libswami Reference Manual | ||||
---|---|---|---|---|
Top | Description |
SwamiControlEvent; #define SWAMI_TYPE_CONTROL_EVENT #define SWAMI_CONTROL_EVENT_VALUE (event) GType swami_control_event_get_type (void
); SwamiControlEvent * swami_control_event_new (gboolean stamp
); void swami_control_event_free (SwamiControlEvent *event
); SwamiControlEvent * swami_control_event_duplicate (const SwamiControlEvent *event
); SwamiControlEvent * swami_control_event_transform (SwamiControlEvent *event
,GType valtype
,SwamiValueTransform trans
,gpointer data
); void swami_control_event_stamp (SwamiControlEvent *event
); void swami_control_event_set_origin (SwamiControlEvent *event
,SwamiControlEvent *origin
); SwamiControlEvent * swami_control_event_ref (SwamiControlEvent *event
); void swami_control_event_unref (SwamiControlEvent *event
); void swami_control_event_active_ref (SwamiControlEvent *event
); void swami_control_event_active_unref (SwamiControlEvent *event
);
typedef struct { struct timeval tick; /* tick time */ SwamiControlEvent *origin; /* origin event or %NULL if is origin */ GValue value; /* value for this event */ int active; /* active propagation count */ int refcount; /* reference count */ } SwamiControlEvent;
SwamiControlEvent * swami_control_event_new (gboolean stamp
);
Create a new control event structure.
|
TRUE to time stamp the new event (can be done later with
swami_control_event_stamp() .
|
Returns : |
New control event with a refcount of 1 which the caller owns.
Keep in mind that a SwamiControlEvent is not a GObject, so it does its
own refcounting with swami_control_event_ref() and
swami_control_event_unref() .
|
void swami_control_event_free (SwamiControlEvent *event
);
Frees a Swami control event structure. Normally this function should
not be used, swami_control_event_unref()
should be used instead to allow
for multiple users of a SwamiControlEvent. Calling this function bypasses
reference counting, so make sure you know what you are doing if you use
this.
|
Swami control event structure to free |
SwamiControlEvent * swami_control_event_duplicate (const SwamiControlEvent *event
);
Duplicate a control event. The refcount and active count are not duplicated, but the tick, origin and value are.
|
Swami control event structure |
Returns : |
New duplicate control event |
SwamiControlEvent * swami_control_event_transform (SwamiControlEvent *event
,GType valtype
,SwamiValueTransform trans
,gpointer data
);
Like swami_control_event_duplicate()
but transforms the event's value
using the trans
function to the type indicated by valtype
.
|
Swami control event structure |
|
The type for the new value (or 0 to use the event value type)
|
|
Value transform function |
|
User data passed to transform function |
Returns : |
New transformed control event (caller owns creator's reference) |
void swami_control_event_stamp (SwamiControlEvent *event
);
Stamps an event with the current tick count.
|
Event to stamp |
void swami_control_event_set_origin (SwamiControlEvent *event
,SwamiControlEvent *origin
);
Set the origin of an event. Should only be set once since its not multi-thread locked.
|
Event structure |
|
Origin event or NULL if event is its own origin
|
SwamiControlEvent * swami_control_event_ref (SwamiControlEvent *event
);
Increment the reference count of an event.
|
Event structure |
Returns : |
The same referenced event as a convenience.
|
void swami_control_event_unref (SwamiControlEvent *event
);
Decrement the reference count of an event. If the reference count reaches 0 the event will be freed.
|
Event structure |
void swami_control_event_active_ref (SwamiControlEvent *event
);
Increment the active propagation reference count.
|
Event structure |
void swami_control_event_active_unref (SwamiControlEvent *event
);
Decrement the active propagation reference count.
|
Event object |