Boolean ObjCompProcessChildren(
optr obj, /* parent's optr */
optr firstChild, /* optr of first child to process */
ObjCompCallType stdCallback, /* standard callback type */
void * cbData, /* data passed to callback */
word masterOffset, /* offset to master part */
word compOffset, /* offset to comp field */
word linkOffset); /* offset to link field */
Boolean _pascal (*callback) (optr parent, optr child, void *cbData));
This routine performs a specific set of actions on all or some of an object's children. It is very rare that you will use this routine; typically, you should send a message to all of the parent's children. If, however, you use this routine, you must also write a callback routine that will be executed once for each affected child.
ObjCompProcessChildren()
returns
true
(nonzero) only if it was stopped before all children had been processed. The only two ways this could be returned is if an error occurs or if your callback returns
true
when called.
The parameters for this routine are
obj
firstChild
ObjCompFindChildByNumber()
--to process all children.
stdCallback
ObjCompCallType
indicating how the data in the buffer pointed to by
cbData
will be passed to your callback routine. These values are detailed below.
cbData
masterOffset
Class_masterOffset
field in its
ClassStruct
structure.)
compOffset
linkOffset
callbackThe callback routine takes three parameters and returns a boolean value. It must be declared _pascal. The three parameters to the callback are listed below:
parent
child
cbData
ObjCompProcessChildren()
. What is actually in this buffer may depend on the value in the original
sdtCallback
parameter; if the buffer is not saved and restored by
ObjCompProcessChildren()
between children, each child may receive data altered by the previous child.
The callback routine can access and alter the buffer pointed to by
cbData
, or it can query the child or do anything else with the exception of destroying the child. It should return a Boolean value:
true
if
ObjCompProcessChildren()
should be aborted,
false
if it should not.
The values you can pass to
ObjCompProcessChildren()
in
stdCallback
are of type
ObjCompCallType
. You can use one of the following values to specify how the buffer in
cbData
will be passed on to the next child's callback routine:
cbData
before calling each child; abort the routine if the callback returns
true
.
cbData
before calling each child; do not check the return value of the callback before proceeding to the next child.
cbData
, and abort if the callback routine returns
true
.
cbData
, and do not check the callback routine's return value.Include: metaC.goh
See Also: @send,
@call,
MSG_META_SEND_CLASSED_EVENT.
void ObjCompRemoveChild(
optr obj, /* parent's optr */
optr objToRemove /* optr of child to be removed */
word flags, /* CompChildFlags */
word masterOffset, /* offset to master part */
word compOffset, /* offset to comp field in master part */
word linkOffset); /* offset to link field in master part */
This routine removes the given child from the specified parent composite. The child will be removed entirely from the object tree, but it will not be detached or freed. The parameters of this routine are listed below:
obj
objToRemove
flags
CompChildFlags
indicating whether the parent and child should be marked dirty after the operation.
masterOffset
Class_masterOffset
field in its
ClassStruct
structure.)
compOffset
linkOffset
Include: metaC.goh
void ObjDecInteractibleCount(
MemHandle mh); /* subject object block */
This routine decrements the given object block's interactable count. Do not decrement the interactable count without first incrementing it with
ObjIncInteractibleCount()
. Visible objects automatically decrement the interactable count in their
MSG_VIS_CLOSE
handlers.
Include: object.h
See Also: ObjIncInteractibleCount(),
MSG_VIS_CLOSE,
ObjLMemBlockHeader.
void ObjDecInUseCount(
MemHandle mh); /* subject object block */
This routine decrements the given object block's in-use count. When the in-use count reaches zero, the block may safely be freed. You should not decrement the in-use count of a block without first incrementing it at some point with
ObjIncInUseCount()
.
Warnings: Do not decrement the in-use count without incrementing it first. An error will result.
Include: object.h
See Also: ObjIncInUseCount(),
ObjDecInteractibleCount(),
ObjLMemBlockHeader.
GEOS SDK TechDocs
|
|
ObjCompFindChildByOptr() ...
|
ObjDeref() ...