• Keine Ergebnisse gefunden

Move/Copy Protocol Messages

Im Dokument PenPofnt GO (Seite 172-177)

msgEmbeddedWinGetStyle

Passes back an embeddedWin's style.

Takes P _EMBEDDED_WIN_STYLE, returns STATUS.

*define msgEmbeddedWinGetStyle MakeMsg(clsEmbeddedWin, 2) See ewnew.h for the definition ofp_EMBEDDED_WIN_STYLE.

msgEmbeddedWinSetStyle

Specifies an embeddedWin's style.

Takes P _EMBEDDED_WIN_STYLE, returns STATUS.

*define msgEmbeddedWinSetStyle MakeMsg(clsEmbeddedWin, 3)

If pArgs->embeddee is true and the embeddedWin's uuid is nil, a uuid is created for the window.

Clients must not alter the value of style.moveCopyMode.

See ewnew.h for the definition of P _EMBEDDED_WIN_STYLE.

Move/Copy Protocol Messages

Meu@ge Arguments

msgEmbeddedWinBeginMove

Places an embeddedWin in move mode.

Takes P _EMBEDDED_ WIN_BEGIN_MOVE_COPY, returns STATUS.

*define msgEmbeddedWinBeginMove MakeMsg(clsEmbeddedWin, 4) typedef struct EMBEDDED_WIN_BEGIN_MOVE_COPY {

XY32 xy;

II

x,y in source to begin move/copy.

RECT32 bounds;

II

Bounding box of area to move/copy.

U32 reserved[4];

II

Reserved.

EMBEDDED_WIN_BEGIN_MOVE_COPY, *P_EMBEDDED_WIN_BEGIN_MOVE_COPY;

An

embeddedWin self sends this message to get itself into move mode. This message is usually self sent by an embeddedWin as part of the response to msgSelBeginMove if style. moveable is set.

clsEmbeddedWin responds by creating a move icon (an instance of clsMoveCopylcon). If

pArgs->bounds is a visible rectangle, the move icon is created with an image of what's displayed in the pArgs->bounds rectangle in the embeddedWin. Otherwise a default move icon is displayed centered at pArgs->xy. The client of the icon is self. Also style.moveCopyMode becomes ewMoveMode.

stsRequestDenied The window is already in either ewMoveMode or ewCopyMode msgSelBeginMove

msgEmbeddedWinBeginCopy

Places an embeddedWin in copy mode.

Takes P _EMBEDDED_ WIN_BEGIN_MOVE_COPY, returns STATUS.

*define msgEmbeddedWinBeginCopy MakeMsg(clsErnbeddedWin, 5) typedef struct EMBEDDED_WIN_BEGIN_MOVE_COPY{

XY32 xy;

II

x,y in source to begin move/copy.

RECT32 bounds;

II

Bounding box of area to move/copy.

U32 reserved[4];

II

Reserved.

EMBEDDED_WIN_BEGIN_MOVE_COPY, *P_EMBEDDED_WIN_BEGIN_MOVE_COPY;

162 PENPOINT API REFERENCE

Part 2 I Pen Point Application Framework

An

embeddedWin self sends this message to get itself into copy mode. This message is usually self sent by an embeddedWin as part of the response to msgSelBeginCopy if style.copyable is set.

clsEmbeddedWin responds by creating a copy icon (an instance of clsMoveCopylcon) .. If

pArgs->bounds is a visible rectangle, the copy icon is created with an image of what's displayed in the pArgs->bounds rectangle in the embeddedWin. Otherwise a default copy icon is displayed centered at pArgs->xy. The client of the icon is self Also style.moveCopyMode becomes ewCopyMode.

stsRequestDenied The window is already in either ewMoveMode or ewCopyMode.

msgSelBeginCopy

msgEmbeddedWinMove

Moves an embeddedWin to the destination.

#define msgEmbeddedWinMove MakeMsg(clsEmbeddedWin, 6) typedef structEMBEDDED_WIN_MOVE_COPY

XY32 xy;

II

x,y location in dest.

OBJECT dest;

II

Destination object.

TAG format;

II

Data transfer format. Must be

II

xferEmbeddedWin.

OBJECT uid;

II

out: moved/copied object.

U32 reserved[2];

II

Reserved.

EMBEDDED_WIN_MOVE_COPY, *P_EMBEDDED_WIN_MOVE_COPY;

A destination embeddedWin sends this message to a source embeddedWin to have the source embeddedWin move itself to the destination.

See the section "Move/Copy Behavior" for more information.

stsEWSelRefusedMove The send of msgEmbeddedWinMoveCopyOK returned FALSE for moveOK.

stsEWMoveTolnvalidLocation window could not be moved to pArgs->dest.

msgEmbeddedWinProvidelcon

Asks an embeddedWin to provide the move/copy icon.

Takes P _EMBEDDED_ WIN_PROVIDE_ICON, returns STATUS.

#define msgEmbeddedWinProvidelcon MakeMsg(clsEmbeddedWin, 23) MESSAGE

XY32 RECT32

msg;

xy;

bounds;

II

msgEmbeddedWinMove or msgEmbeddedWinCopy.

II

x,y in source to begin move/copy.

II

Bounding box of area to move/copy.

OBJECT icon;

II

out: the icon.

U32 reserved[4];

II

Reserved.

EMBEDDED_WIN_PROVIDE_ICON, *P_EMBEDDED_WIN_PROVIDE_ICON;

An

embeddedWin's default response is as follows:

• if pArgs->obounds.size.w and pArgs->bounds.size.h are both greater than zero, then a marquee style icon is created using a "snapshot" of the screen image contained in pArgs->bounds.

• Otherwise, a default move or copy icon is created.

MessCige Arguments

Arguments

EMBEDWIN.H 163 Move/Copy Protocol Messages

msgEmbeddedWinCopy

Copies an embeddedWin to the destination.

Takes P _EMBEDDED_ WIN_MOVE_COPY, returns STATUS.

#define msgErnbeddedWinCopy MakeMsg(clsErnbeddedWin, 7) typedef struct EMBEDDED_WIN_MOVE_COPY

XY32 xy;

II

x,y location in dest.

OBJECT dest;

II

Destination object.

TAG format;

II

Data transfer format. Must be

II

xferErnbeddedWin.

OBJECT uid;

II

out: moved/copied object.

U32 reserved[2];

II

Reserved.

EMBEDDED_WIN_MOVE_COPY, *P_EMBEDDED_WIN_MOVE_COPY;

A destination embeddedWin sends this message to a source embeddedWin to have the source embeddedWin copy itself to the destination.

See the section "Move/Copy Behavior" for more information.

stsEWSelRefusedCopy The. send of msgEmbeddedWinMoveCopyOK returned FALSE for copyOK.

stsEWCopyT oInvaiidLocation window could not be copied to pArgs->dest.

msgEmbeddedWinMoveCopyOK

Asks whether it is OK to move or copy an embeddedWin to a destination.

Takes P _EMBEDDED_ WIN_MOVE_COPY_OK, returns STATUS.

#define msgErnbeddedWinMoveCopyOK MakeMsg(clsEmbeddedWin, 8) typedef struct EMBEDDED WIN MOVE COPY OK {

BOOLEAN - -moveOK;

17

out: true if ok to move.

BOOLEAN copyOK;

II

out: true if ok to copy.

EMBEDDED_WIN_MOVE_COPY target;

II

move/copy struct.

EMBEDDED_WIN_MOVE_COPY_OK, *P_EMBEDDED_WIN_MOVE_COPY_OK;

A source embeddedWin self sends this message to check that it is OK to move or copy itself to the destination. The default response to this message is to fill in pArgs->moveOK with style. moveable and pArgs->copyOK with style.copyable.

See the section "Move/Copy Behavior" for more information.

stsEWUnrecognizedFormat target. format was not xferEmbeddedWin.

stsEWNotEmbeddee embeddedWin is not an embeddee.

msgEmbeddedWinMove

msgEmbeddedWinGetPenOffset

Passes back the pen offset during move or copy.

Takes P _XY32, returns STATUS.

#define msgEmbeddedWinGetPenOffset MakeMsg(clsErnbeddedWin, 9)

This message allows the destination of a move or copy to determine the actual pen position relative to the lower-left hand corner of the move/copy icon.

When the user lifts the pen, msgSelBeginMove passes the x,y position of the icon, not the pen.

164 PENPOINT API REFERENCE

(orrnm:'iors

Mii.'%soSjii.' Awg!Jmii.'ots

Part 2 / PenPoint Application Framework

msgEmbeddedWinGetDest

Get the destination for embeddedWin move or copy.

Takes P _EMBEDDED_ WIN_GET_DEST, returns STATUS.

tdefine msgEmbeddedWinGetDest tdefine ewPropCopyDest

MakeMsg(clsEmbeddedWin, 10)

MakeTag(clsEmbeddedWin, 1)

II

Private.

typedef struct EMBEDDED_WIN_GET_DEST

XY32 xy;

II

x,y location in self.

FS LOCATOR locator;

II

out: Destination parent app.

U16 sequence;

II

out: Sequence in parent.

char path [fsPathBuf Length];

II

Path buffer for locator.

OBJECT source;

II

Object to be moved/copied.

U32 reserved[3];

II

Reserved.

EMBEDDED_WIN_GET_DEST, *P_EMBEDDED_WIN_GET_DEST;

Some source embeddedWins move or copy more than themselves in response to

msgEmbeddedWinMove or msgEmbeddedWinCopy. Some also transfer filed information. (For instance, reference buttons have to move filed information about the destination of the button.) The source sends msgEmbeddedWinGetDest to the destination to get the file system location that the destination wants the source to use for this filed information.

An embeddedWin's default response is to (1) set pArgs->locator to OSThisAppO's locator, (2) set pArgs->sequence to 1, and (3) set pArgs->path to the empty string. Then if style.embedForward is true, msgEmbeddedWinForwardedGetDest is sent to selfs parent window.

Corkboard Windows (clsCorkBoardWin; see cbwin.h) are an example of a class that that has a non-default response to this message. When an embeddedWin is copied to a cork margin, it may represent a ,document, and the source is likely to copy not only the window but also the document files to the destination. The cork margin cannot allow the source to copy these files into the directory of the cork margin's containing application since then the files would look like they're in the parent application -- the wrong place! So in response to msgEmbeddedWinGetDest, a corkboard window appends an extra directory level to is ancestor's response to msgEmbeddedWinGetDest.

msgEmbeddedWinForwardedGetDest

Get the destination for embeddedWin move or copy.

Takes P_EMBEDDED_WIN_GET_DEST, returns STATUS.

tdefine msgEmbeddedWinForwardedGetDest MakeMsg(clsEmbeddedWin, 22) typedef struct EMBEDDED_WIN_GET_DEST

XY32 xy;

II

x,y location in self.

FS LOCATOR locator;

II

out: Destination parent app.

U16 sequence;

II

out: Sequence in parent.

char path [fsPathBuf Length];

II

Path buffer for locator.

OBJECT source;

II

Object to be moved/copied.

U32 reserved[3];

II

Reserved.

EMBEDDED_WIN_GET_DEST, *P_EMBEDDED_WIN_GET_DEST;

If a child embeddedWin's style.embedForward is true, then the child sends

msgEmbeddedWinForwardedGetDest to the parent to allow the parent to override all or part of the child's response to msgEmbeddedWinGetDest.

An embeddedWin's default response to this message is identical to the default response to msgEmbeddedWinGetDest.

Arguments

Comments

Comments

EMBEDWIN.H 165 Move/Copy Protocol Messages

msgEmbeddedWinlnsertChild

Asks an embeddedWin to insert a child window.

Takes P _EMBEDDED_ WIN_INSERT_CHILD, returns STATUS.

*define msgEmbeddedWinInsertChild MakeMsg(clsEmbeddedWin, 11) typedef struct EMBEDDED WIN INSERT CHILD

XY32 XYi //-x,y location in destination.

OBJECT wini // Window to insert/extract/position.

OBJECT sourcei // Requestor.

U32 reserved[4]i // Reserved.

EMBEDDED WIN INSERT CHILD, *p EMBEDDED WIN INSERT CHILD, EMBEDDED=WIN=EXTRACT_CHILD, *P_EMBEDDED_WIN_EXTRACT_CHILD, EMBEDDED_WIN_POSITION_CHILD, *P_EMBEDDED_WIN_POSITION_CHILDi

c1sEmbeddedWin's default response is as follows; this is illustrated in the sample code below.

• send msgEmbeddedWinGetPenOffset to pArgs->source

• offset pArgs->xy by the value passed back by msgEmbeddedWinGetPenOffset

• send msgWinlnsert to pArgs->win with self as the parent.

XY32 XYi

WIN METRICS wmi

ObjSendUpdateRet(msgEmbeddedWinGetPenOffset, pArgs->source, &xy, SizeOf(xY))i

ObjSendUpdateRet(msgWinGetMetrics, pArgs->win, &wm, SizeOf(wm), S)i

wm.bounds.origin.x

=

pArgs->xy.x - xy.Xi wm.bounds.origin.y

=

pArgs->xy.y - XY.Yi

ObjSendRet(msgWinDelta, pArgs->win, &wm, SizeOf(wm), S)i

wm.options = wsPOSTOPi wm.parent

=

selfi

ObjSendRet(msgWinInsert, pArgs->win, &wm, SizeOf(wm), S)i

This message may be sent during a move/copy operation; see the section "Move/Copy Behavior" for more information.

msgEmbeddedWinExtractChild

Asks an embeddedWin to extract a child window.

Takes P _EMBEDDED_ WIN_EXTRACT_CHILD, returns STATUS.

*define msgEmbeddedWinExtractChild MakeMsg(clsEmbeddedWin, 12)

c1sEmbeddedWin's default response is to ObjectSend msgWinExtract to pArgs->win.

This message may be sent during a move/copy operation; see the section "Move/Copy Behavior" for more information.

msgEmbeddedWinPositionChild

Asks an embeddedWin to reposition a child window.

Takes P_EMBEDDED_WIN_POSITION_CHILD, returns STATUS.

*define msgEmbeddedWinPositionChild MakeMsg(clsEmbeddedWin, 13)

c1sEmbeddedWin's default response is as follows; this is illustrated in the sample code below.

• send msgEmbeddedWinGetPenOffset to pArgs->source

• offset pArgs->xy by the value passed back by msgEmbeddedWinGetPenOffset

• self send msgWinDelta.

166 PENPOINT API REFERENCE

Part 2 / Pen Point Application Framework

XY32 xy;

WIN_METRICS wm;

ObjSendUpdateRet(msgEmbeddedWinGetPenOffset, pArgs->source, &xy, SizeOf (xy) , s);

ObjSendUpdateRet(msgWinGetMetrics, pArgs->win, &wm, SizeOf(wm), s);

wm.bounds.origin.x

=

pArgs->xy.x - xy.x;

wm.bounds.origin.y

=

pArgs->xy.y - xy.y;

ObjSendRet(msgWinDelta, pArgs->win, &wm, SizeOf(wm), s);

This message may be sent during a move/copy operation; see the section "Move/Copy Behavior" for more information.

Im Dokument PenPofnt GO (Seite 172-177)