A CxObject has to be inserted into the Commodities network before it can
process any CxMessages. AttachCxObj() adds a CxObject to the personal
list of another CxObject. The HotKey.c example uses it to attach its
filter to a broker.
void AttachCxObj ( CxObj *headobj, CxObj *co);
void InsertCxObj ( CxObj *headobj, CxObj *co, CxObj *co_pred );
void EnqueueCxObj( CxObj *headobj, CxObj *co );
void SetCxObjPri ( CxObj *co, long pri );
void RemoveCxObj ( CxObj *co );
AttachCxObj() adds the CxObject to the end of headobj's personal list.
The ordering of a CxObject list determines which object gets CxMessages
first. InsertCxObj() also inserts a CxObject, but it inserts it after
another CxObject already in the personal list (co_pred in the prototype
above).
Brokers aren't the only CxObjects with a priority. All CxObjects have a
priority associated with them. To change the priority of any CxObject,
use the SetCxObjPri() function. A commodity can use the priority to keep
CxObjects in a personal list sorted by their priority. The
commodities.library function EnqueueCxObj() inserts a CxObject into
another CxObject's personal list based on priority.
Like its name implies, the RemoveCxObj() function removes a CxObject from
a personal list. Note that it is not necessary to remove a CxObject from
a list in order to delete it.
HotKey.c
[Back to Amiga Developer Docs]