• Aucun résultat trouvé

Message wild cards

Dans le document PenPofnt GO (Page 37-43)

Used to define a class wild card and as a table wild card.

tdefine objWildCard -1 Wild card for clsObject.

tdefine clsObjWildCard Wild card for clsClass.

tdefine clsClsWildCard

MakeMsg(clsObject, objWildCard)

MakeMsg(clsClass, objWildCard)

Functions

ObjectCall

Maps the message to the object's method (MsgHandler) and calls it with pArgs.

Returns STATUS.

Fttndkm Prototype STATUS EXPORTED ObjectCall ( MESSAGE msg,

OBJECT object, P ARGS pArgs

) ;

stsBadObject Object was invalid.

stsScopeViolation Object owned by a different task and does not have objCapCall set.

ObjectCallAncestorCtx

Calls the next ancestor in the class chain.

Returns STATUS.

Fl.mdion Prototype STATUS EXPORTED ObjectCallAncestorCtx (

Return Value

CONTEXT ctx

) ;

Developers usually can avoid calling this expliCitly by specifying objCallAncestorBefore or (for a few messages) objCallAncestorAfter in the method table. Occasionally, you need to call your ancestor in the middle of things, and this is the call you do it with.

ObjectCallAncestor

stsBadContext if ctx parameter is bad.

ObjectCallAncestor

Calls the ancestor with the parameters supplied.

Returns STATUS.

Function Prototype STATUS EXPORTED ObjectCallAncestor (

Comments Return Value

MESSAGE msg, OBJECT self, P_ARGS pArgs, CONTEXT ctx

) ;

In general you should use ObjectCallAncestorCtxO.

stsBadContext if ctx parameter is bad.

ObjectSend

Generalized version of ObjectCallO that works across tasks boundaries.

Returns STATUS.

CLSMGR.H Functions

27

Fundio!'! Prototype STATUS EXPORTED ObjectSend (

Return Value

MESSAGE msg, OBJECT object,

P ARGS pArgs, II In only: Not updated SIZEOF lenArgs

) ;

The pArgs block is copied into the address space of the task that owns the object and an ObjectCallO is executed in that task's context. IflenArgs equals 0, pArgs block is not copied and the pointer is passed directly. In this case, pArgs must point to global storage.

While the current task is waiting for ObjectSendO to return, the task will continue to dispatch messages sent to objects owned by the task. This allows sending to an object in another task, which in turns sends to an object owned by the current task, without deadlock.

stsProtection Violation objCapSend is disabled.

stsSendTasldnvalid Object's owning task is invalid.

stsTaskTerminated While waiting for a reply the object's task died.

ObjectSendUpdate

Same as ObjectSendO, additionally the pArgs block is copied back to the current task.

Returns STATUS.

function Prototype STATUS EXPORTED ObjectSendUpdate ( MESSAGE msg,

OBJECT object,

P ARGS pArgs, I I In/Out: Updated SIZEOF lenArgs

) ;

ObjectSendU32

Same as ObjectSendO without the length arg, lenArgs = 0.

Returns STATUS.

Function Prototype STATUS EXPORTED ObjectSendU32 ( MESSAGE msg,

OBJECT object,

P ARGS pArgs II In only: Not updated

) ;

ObjectSendTask

Same as ObjectSendO except the task is specified explicitly.

Returns STATUS.

function Prototype STATUS EXPORTED ObjectSendTask ( MESSAGE msg,

OBJECT object,

P ARGS pArgs, II In only: Not updated SIZEOF lenArgs,

OS TASK ID task

) ;

28 PEN POINT API REFERENCE Part 1 / Class Manager

(omments For experts only: Use this routine with care, the task of the object is ignored. ObjectSendTaskO allows sending to well-known process-globals from outside the process, such as, theProcess. You might use this to communicate with theUndoManager in an embedded application.

ObjectSendUpdateTask

Same as ObjectSendfaskO, additionally the pArgs are updated.

Returns STATUS.

Fwrg';tion F'rototype STATUS EXPORTED ObjectSendUpdateTask ( MESSAGE msg,

OBJECT object,

P ARGS pArgs, II In/Out: Updated SIZEOF lenArgs,

OS TASK ID task

) i

Comments Experts only, use this routine with care.

ObjectPost

Posts a message to the object via the system input queue.

Returns STATUS.

Fundion Prototype STATUS EXPORTED ObjectPost ( MESSAGE msg,

OBJECT object, P ARGS pArgs, SIZEOF lenArgs

) i

ObjectPostO is similar to ObjectSendO but the message delivery is deferred and the current task continues to run. Because the current task does not wait, it is not possible to return a status value or pArgs.

The most common use of ObjectPostO is to delay the effect of a msgDestroy. For example, if a button sends you a message when it is pressed, and you want to destroy the button at that point, you cannot use ObjectCallO to send msgDestroy to it until after you have returned from processing the message the button sent. If you ObjectPostO the msgDestroy, this guarantees the button won't receive it until you have returned.

ObjectPostO is synchronized with respect to the input system. A posted message is placed in the system input queue. When the message reaches the head of the queue it is sent to the object in the context of the task that owns the object. A posted message is typically dispatched by a task's top-level dispatch loop.

If the task is already processing a message or waiting for a reply to a sent message the posted message is queued. The one exception is when the input system is running system modal, in this case the posted messages are delivered to any dispatch loop. Dispatch loops are created whenever an ObjectSendO is waiting for a reply. The side effect is that any task that is running concurrently may receive a posted message at any time.

ObjectPostU32

Same as ObjectPostO without the length arg, lenArgs = O.

Returns STATUS.

Function Prototype STATUS EXPORTED ObjectPostU32 ( MESSAGE msg,

OBJECT object, P ARGS pArgs ) ;

ObjectPostTask

Same as ObjectPostO except the task is specified explicitly.

Returns STATUS.

Fundion Prototype STATUS EXPORTED ObjectPostTask ( MESSAGE msg,

OBJECT object, P ARGS pArgs, SIZEOF lenArgs, OS TASK 1D task ) ;

CLSMGR.H Functions

Comments For experts only: Use this routine with care, the owning task of the object is ignored. ObjectPostTaskO allows posting to WKN process-globals from outside the process, such as, theProcess.

ObjectPostAsync

Similar to ObjectPostO but not synchronized with the input system.

Returns STATUS.

Function Prototype STATUS EXPORTED ObjectPostAsync ( MESSAGE msg,

OBJECT object, P ARGS pArgs, SIZEOF lenArgs ) ;

Comments This call causes concurrency and all the difficulties associated with it.

29

One of these difficulties, described in detail under ObjectPost, is the handling of posted messages when the input system is running system modal.

ObjectPostAsyncTask

Same as ObjectPostAsyncO except the task is specified explicitly.

Returns STATUS.

fundion Prototype STATUS EXPORTED ObjectPostAsyncTask ( MESSAGE msg,

OBJECT object, P ARGS pArgs, SIZEOF lenArgs, OS TASK 1D task ) ;

Comments This call causes concurrency and all the difficulties associated with it.

30 PEN POINT API REFERENCE Part 1 / Class Manager

For experts only: Use this routine with care, the owning task of the object is ignored.

ObjectPostAsyncTaskO allows posting to WKN process-globals from outside the process, such as, theProcess.

ObjectPostDirect

Similar to ObjectPostAsyncO but can be dispatched by any dispatch loop.

Returns STATUS.

riJl1d!@!'1 Pr@h$type STATUS EXPORTED ObjectPostDirect ( MESSAGE msg,

OBJECT object, P ARGS pArgs, SIZEOF lenArgs

) ;

This call causes concurrency and all the difficulties associated with it.

One of these difficulties, described in detail under ObjectPost, is the handling of posted messages when the input system is running system modal.

ObjectPostDirectTask

Same as ObjectPostDirectO except the task is specified explicitly.

Returns STATUS.

Fundi@t1 Pr©t©type STATUS EXPORTED ObjectPostDirectTask ( MESSAGE msg,

OBJECT object, P ARGS pArgs, SIZEOF lenArgs, OS TASK ID task

) ;

This call causes concurrency and all the difficulties associated with it.

For experts only: Use this routine with care, the owning task of the object is ignored.

ObjectPostDirect TaskO allows posting to WKN process-globals from outside the process, such as, theProcess.

ObjectWrite

Writes the instance data for self in a protected area.

Returns STATUS.

rund!@rt Pmf@fype STATUS EXPORTEDO ObjectWrite (

) ;

OBJECT self, CONTEXT

P UNKNOWN ctx, pData

stsBadContext Invalid context.

Fundion Prototype

Return Volue

ObjectWritePartial

Updates part of the instance data for self in a protected area.

Returns STATUS.

STATUS EXPORTEDO OBJECT stsBadContext Invalid context.

ObjectRead

Copies the instance data from protected storage into pBuf.

Returns STATUS.

Fundion Prototype STATUS EXPORTED ObjectRead ( OBJECT self,

Cemments The pData pointer passed into the MsgHandler is a faster way to read the protected data.

Comments

ObjectPoke

Writes the object's instance data.

Returns STATUS.

STATUS EXPORTEDO OBJECT

Copies pBuf into the instance data block for the class specified.

stsBadAncestor ClassMsgTable did not correspond to an ancestor.

stsProtection Violation Key does not open the object.

ObjectPeek

Reads the object's instance data.

Returns STATUS.

Fundioi1 Prei'otype STATUS EXPORTED ObjectPeek (

Comments

OBJECT object,

P~MSG classMsgTable, OBJ KEY key,

P_uNKNOWN pBuf

) ;

Copies the instance data block for the class specified into pBuf.

stsBadAncestor ClassMsgTable did not correspond to an ancestor.

stsProtection Violation Key does not open the object.

31

32 PENPOINT API REFERENCE Part 1 I Class Manager

ObjectOwner

Returns the object's owner.

Returns SfATUS.

Function Prototype OS_TASK _ ID EXPORTED Ob jectOwner ( OBJECT object

) ;

ObjectVaiid

Returns stsO K if the object is validate, otherwise an error is returned.

Returns SfATUS.

Fundion Prototype STATUS EXPORTED Object Valid ( OBJECT object ) ;

Dans le document PenPofnt GO (Page 37-43)