InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
C9PointProxyEH Class Referenceabstract

#include <C9PointProxyEH.h>

Inheritance diagram for C9PointProxyEH:
DVControlEventHandlerDVHostedWidgetEHIEventHandlerIPMUnknown

Public Types

enum  {
  kMainDiamondHeight = 24, kCornerDiamondHeight = 8, kMainSquareHeight = 19, kCornerSquareHeight = 7,
  kLineSquareHeight = 7
}
 

Public Member Functions

 C9PointProxyEH (IPMUnknown *boss)
 
virtual bool16 CanHaveKeyFocus () const =0
 
virtual bool16 KeyDown (IEvent *e)
 
virtual bool16 LButtonDn (IEvent *e)
 
- Public Member Functions inherited from DVControlEventHandler
 DVControlEventHandler (IPMUnknown *boss)
 
virtual const char * class_name ()
 
- Public Member Functions inherited from DVHostedWidgetEH
 DVHostedWidgetEH (IPMUnknown *boss)
 
virtual bool16 Activate (IEvent *)
 
virtual bool16 Deactivate (IEvent *)
 
virtual bool16 Suspend (IEvent *)
 
virtual bool16 Resume (IEvent *)
 
virtual bool16 MouseMove (IEvent *)
 
virtual bool16 MouseExit (IEvent *)
 
virtual bool16 MouseDrag (IEvent *)
 
virtual bool16 RButtonDn (IEvent *)
 
virtual bool16 MButtonDn (IEvent *)
 
virtual bool16 LButtonUp (IEvent *)
 
virtual bool16 RButtonUp (IEvent *)
 
virtual bool16 MButtonUp (IEvent *)
 
virtual bool16 ButtonDblClk (IEvent *)
 
virtual bool16 ButtonTrplClk (IEvent *)
 
virtual bool16 ButtonQuadClk (IEvent *)
 
virtual bool16 ButtonQuintClk (IEvent *)
 
virtual bool16 MouseWheel (IEvent *)
 
virtual bool16 TabletEvent (IEvent *)
 
virtual bool16 GestureEvent (IEvent *)
 
virtual bool16 MultiTouchEvent (IEvent *)
 
virtual bool16 BaseHandlePointerEvent (IEvent *)
 
virtual bool16 KeyCmd (IEvent *)
 
virtual bool16 KeyUp (IEvent *)
 
virtual bool16 BaseHandleKeyboardEvent (IEvent *)
 
virtual void PreGetKeyFocus ()
 
virtual void PreGiveUpKeyFocus ()
 
virtual bool16 WillingToGiveUpKeyFocus ()
 
virtual bool16 SuspendKeyFocus ()
 
virtual bool16 ResumeKeyFocus ()
 
virtual bool16 WantsTabKeyFocus () const
 
virtual bool16 ControlCmd (IEvent *)
 
virtual bool16 Update (IEvent *)
 
virtual bool16 PlatformEvent (IEvent *)
 
virtual bool16 CallSysEventHandler (IEvent *)
 
virtual void SetView (IControlView *)
 

Static Public Member Functions

static
IReferencePointData::ReferencePointPosition 
TransformPosition (const IReferencePointData::ReferencePointPosition &position, const PMReal &xScale, const PMReal &yScale, const PMReal &cwAngle, bool16 invert)
 
static void TransformPoint (PMPoint &point, const PMReal &xScale, const PMReal &yScale, const PMReal &cwAngle, const PMPoint &referencePoint, bool16 invert)
 
static
IReferencePointData::ReferencePointPosition 
GetFirstPosition (const PMLine &line)
 
static
IReferencePointData::ReferencePointPosition 
GetLastPosition (const PMLine &line)
 
static PMPoint GetCornerPoint (const IReferencePointData::ReferencePointPosition &position, const PMRect &mainSquare)
 
static PMRect GetCornerRect (const IReferencePointData::ReferencePointPosition &position, const PMRect &mainSquare, const PMReal &cornerHeight)
 
static PMPolygon4 GetCornerDiamond (const IReferencePointData::ReferencePointPosition &position, const PMPolygon4 &mainDiamond, const PMReal &cornerHeight)
 
static bool16 Contains (const PMPolygon4 &poly4, const PMPoint &point)
 
static void MakeDiamond (PMPolygon4 &poly4, const PMPoint &center, const PMReal &height)
 
static void Poly4Inset (PMPolygon4 &poly4, const PMReal &inset)
 
static short Octant (const PMReal &angle)
 
static PMPoint PositionToPoint (const IReferencePointData::ReferencePointPosition &position)
 
static
IReferencePointData::ReferencePointPosition 
PointToPosition (const PMPoint &point)
 

Protected Member Functions

virtual void PostGetKeyFocus ()
 
virtual void PostGiveUpKeyFocus ()
 
IReferencePointData::ReferencePointPosition HitTestSquares (const PMPoint &point)
 
IReferencePointData::ReferencePointPosition HitTestDiamonds (const PMPoint &point)
 
IReferencePointData::ReferencePointPosition HitTestLine (const PMPoint &point)
 
IReferencePointData::ReferencePointPosition ComputeNewReferencePosition (const PMPoint &localPoint)
 
virtual void ChangeReferencePosition (IReferencePointData::ReferencePointPosition newPosition)=0
 
void HandleKeyEvent (VirtualKey &key)
 

Detailed Description

Helper class providing partial implementation of IEventHandler for a proxy widget (e.g. control strip or transform panel).

See Also
IEventHandler.h
IProxyWidgetAttributes.h

Member Enumeration Documentation

anonymous enum

Constants for the appearance of the proxy.

Member Function Documentation

virtual bool16 C9PointProxyEH::CanHaveKeyFocus () const
pure virtual

Client must override this function.

Parameters
none
Returns
kTrue if you want the proxy to be a tab stop (and keyboard drivable), kFalse otherwise.

Reimplemented from DVHostedWidgetEH.

virtual void C9PointProxyEH::ChangeReferencePosition (IReferencePointData::ReferencePointPosition newPosition)
protectedpure virtual

Change the reference position

Parameters
newPositionthe new reference point position
IReferencePointData::ReferencePointPosition C9PointProxyEH::ComputeNewReferencePosition (const PMPointlocalPoint)
protected

High level routine: Given a point, hit test the proxy points and return the hit position. Calls either HitTestSquares, HitTestDiamonds, or HitTestLine to do its work.

Parameters
localPointthe point to use for hittesting.
Returns
IReferencePointData::ReferencePointPosition the new reference position after doing the hittest.
static bool16 C9PointProxyEH::Contains (const PMPolygon4poly4,
const PMPointpoint 
)
static

Test if the given polygon contains a point

Parameters
poly4the polygon to use
pointthe point to test
Returns
static bool16 return kTrue if point is in the polygon
static PMPolygon4 C9PointProxyEH::GetCornerDiamond (const IReferencePointData::ReferencePointPositionposition,
const PMPolygon4mainDiamond,
const PMRealcornerHeight 
)
static

Given the size of the main proxy widget and a reference position and a size, return a rect that is the size of one of the points of the proxy. Used when proxy is rotated.

Parameters
positionthe reference position to draw
mainDiamondthe size of the main proxy in rotated mode
cornerHeightthe size of each proxy point
Returns
static PMPolygon4 a polygon the size of the proxy
static PMPoint C9PointProxyEH::GetCornerPoint (const IReferencePointData::ReferencePointPositionposition,
const PMRectmainSquare 
)
static

Given the size of the main proxy widget and a reference position, return a point location of one of the points of the proxy.

Parameters
positionthe reference position to draw
mainSquarethe size of the main proxy
Returns
static PMPoint the returned point corresponding to the given position
static PMRect C9PointProxyEH::GetCornerRect (const IReferencePointData::ReferencePointPositionposition,
const PMRectmainSquare,
const PMRealcornerHeight 
)
static

Given the size of the main proxy widget and a reference position and a size, return a rect that is the size of one of the points of the proxy.

Parameters
positionthe reference position to draw
mainSquarethe size of the main proxy
cornerHeightthe size of each proxy point
Returns
static PMRect the rect size of the proxy (centered on GetCornerPoint)
static IReferencePointData::ReferencePointPosition C9PointProxyEH::GetFirstPosition (const PMLineline)
static

Return the first position of the proxy to draw. Used when drawing the line appearance.

Parameters
linethe line to draw the proxy with
Returns
static IReferencePointData::ReferencePointPosition
static IReferencePointData::ReferencePointPosition C9PointProxyEH::GetLastPosition (const PMLineline)
static

Return the last position of the proxy to draw. Used when drawing the line appearance.

Parameters
linethe line to draw the proxy with
Returns
static IReferencePointData::ReferencePointPosition
void C9PointProxyEH::HandleKeyEvent (VirtualKeykey)
protected

Handle a key event when the proxy widget has focus. Currently handles numbers and arrow keys

Parameters
keythe virtual key to handle and move the proxy point
IReferencePointData::ReferencePointPosition C9PointProxyEH::HitTestDiamonds (const PMPointpoint)
protected

Given a point, hit test the 9 squares of the proxy (when in rotated IReferencePointData::kNinePoint appearance) and return the nearest reference position.

Parameters
pointthe point to use for hittesting
Returns
IReferencePointData::ReferencePointPosition the nearest position
IReferencePointData::ReferencePointPosition C9PointProxyEH::HitTestLine (const PMPointpoint)
protected

Given a point, hit test the 3 squares of the proxy (when in IReferencePointData::kLine appearance) and return the nearest reference position.

Parameters
pointthe point to use for hittesting
Returns
IReferencePointData::ReferencePointPosition the nearest position
IReferencePointData::ReferencePointPosition C9PointProxyEH::HitTestSquares (const PMPointpoint)
protected

Given a point, hit test the 9 squares of the proxy (when in IReferencePointData::kNinePoint appearance) and return the nearest reference position.

Parameters
pointthe point to use for hittesting
Returns
IReferencePointData::ReferencePointPosition the nearest position
virtual bool16 C9PointProxyEH::KeyDown (IEvente)
virtual

Override if you want non-standard keyboard handling when proxy widget has focus. Default implementation responds to number pad numbers, regular numbers, arrows (all to move proxy point around), and return/enter/escape (to lose focus).

Parameters
ethe event
Returns
kTrue if event was handled, kFalse otherwise.

Reimplemented from DVHostedWidgetEH.

virtual bool16 C9PointProxyEH::LButtonDn (IEvente)
virtual

Override if you want to provide special event handling. Default implementation changes the current layout window's reference point in response to clicked on point.

Parameters
ethe event
Returns
bool16 kTrue if event was handled, kFalse otherwise.

Reimplemented from DVHostedWidgetEH.

static void C9PointProxyEH::MakeDiamond (PMPolygon4poly4,
const PMPointcenter,
const PMRealheight 
)
static

Given a height and a center, return a polygon describing the size of the diamond appearance of the proxy.

Parameters
poly4OUT the returned polygon
centerthe center of the widget
heightthe height to make the polygon
static short C9PointProxyEH::Octant (const PMRealangle)
static

Given an angle, return the octant of the proxy. Used for diamond appearance. 1 means 45 degrees, 2 90, etc. So octant value is the number of 45 degree rotations of the proxy.

Parameters
anglethe angle to test
Returns
static short the octant value. 0 if regular rect appearance, non-zero odd value for diamond appearance
static IReferencePointData::ReferencePointPosition C9PointProxyEH::PointToPosition (const PMPointpoint)
static

Map a point into a reference position on the proxy

Parameters
pointthe given point
Returns
static IReferencePointData::ReferencePointPosition the returned reference position
static void C9PointProxyEH::Poly4Inset (PMPolygon4poly4,
const PMRealinset 
)
static

Inset the given polygon by an amount

Parameters
poly4IN/OUT the polygon to alter
insetthe amount to inset
static PMPoint C9PointProxyEH::PositionToPoint (const IReferencePointData::ReferencePointPositionposition)
static

Map a reference position into a point on the proxy

Parameters
positionthe given ref position
Returns
static PMPoint the returned point
virtual void C9PointProxyEH::PostGetKeyFocus ()
protectedvirtual

Called after the proxy widget acquires keyboard focus.

Parameters
eevent of interest
Returns
kTrue if event has been handled and should not be further dispatched, kFalse otherwise (pass event to next handler)

Reimplemented from DVHostedWidgetEH.

virtual void C9PointProxyEH::PostGiveUpKeyFocus ()
protectedvirtual

Called after the proxy widget loses keyboard focus.

Parameters
eevent of interest
Returns
kTrue if event has been handled and should not be further dispatched, kFalse otherwise (pass event to next handler)

Reimplemented from DVHostedWidgetEH.

static void C9PointProxyEH::TransformPoint (PMPointpoint,
const PMRealxScale,
const PMRealyScale,
const PMRealcwAngle,
const PMPointreferencePoint,
bool16 invert 
)
static

Transform the given point into a reference position

Parameters
positionIN/OUT the position to transform
xScaleIN the x scale to use in the transform
yScaleIN the y scale to use in the transform
cwAngleIN the angle to use in the transform
referencePointIN the reference point to use during the transform of the point
invertIN whether to invert the scale/rotate matrix
static IReferencePointData::ReferencePointPosition C9PointProxyEH::TransformPosition (const IReferencePointData::ReferencePointPositionposition,
const PMRealxScale,
const PMRealyScale,
const PMRealcwAngle,
bool16 invert 
)
static

Transform the current reference position by the given scale and angle

Parameters
positionthe position to transform
xScalethe x scale to use in the transform
yScalethe y scale to use in the transform
cwAnglethe angle to use in the transform
invertwhether to invert (kTrue) or not (kFalse) the reference position
Returns
static IReferencePointData::ReferencePointPosition the original position transformed by the given values