[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

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