![]() |
![]() |
![]() |
Zeitgeist Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#define ZEITGEIST_TYPE_EVENT ZeitgeistSubject * zeitgeist_event_get_subject (ZeitgeistEvent *self
,gint index
); gint zeitgeist_event_num_subjects (ZeitgeistEvent *self
); void zeitgeist_event_add_subject (ZeitgeistEvent *self
,ZeitgeistSubject *subject
); void zeitgeist_event_take_subject (ZeitgeistEvent *self
,ZeitgeistSubject *subject
); void zeitgeist_event_set_actor_from_app_info (ZeitgeistEvent *self
,GAppInfo *info
); GVariant * zeitgeist_event_to_variant (ZeitgeistEvent *self
); void zeitgeist_event_debug_print (ZeitgeistEvent *self
); gboolean zeitgeist_event_matches_template (ZeitgeistEvent *self
,ZeitgeistEvent *template_event
); #define ZEITGEIST_EVENT_SIGNATURE ZeitgeistEvent * zeitgeist_event_new_full (const gchar *interpretation
,const gchar *manifestation
,const gchar *actor
,const gchar *origin
,...
); ZeitgeistEvent * zeitgeist_event_new_from_variant (GVariant *event_variant
,GError **error
); ZeitgeistEvent * zeitgeist_event_new (void
); guint32 zeitgeist_event_get_id (ZeitgeistEvent *self
); void zeitgeist_event_set_id (ZeitgeistEvent *self
,guint32 value
); gint64 zeitgeist_event_get_timestamp (ZeitgeistEvent *self
); void zeitgeist_event_set_timestamp (ZeitgeistEvent *self
,gint64 value
); const gchar * zeitgeist_event_get_origin (ZeitgeistEvent *self
); void zeitgeist_event_set_origin (ZeitgeistEvent *self
,const gchar *value
); const gchar * zeitgeist_event_get_actor (ZeitgeistEvent *self
); void zeitgeist_event_set_actor (ZeitgeistEvent *self
,const gchar *value
); const gchar * zeitgeist_event_get_interpretation (ZeitgeistEvent *self
); void zeitgeist_event_set_interpretation (ZeitgeistEvent *self
,const gchar *value
); const gchar * zeitgeist_event_get_manifestation (ZeitgeistEvent *self
); void zeitgeist_event_set_manifestation (ZeitgeistEvent *self
,const gchar *value
); GPtrArray * zeitgeist_event_get_subjects (ZeitgeistEvent *self
); void zeitgeist_event_set_subjects (ZeitgeistEvent *self
,GPtrArray *value
); GByteArray * zeitgeist_event_get_payload (ZeitgeistEvent *self
); void zeitgeist_event_set_payload (ZeitgeistEvent *self
,GByteArray *value
); struct ZeitgeistEvent; struct ZeitgeistEventClass; GPtrArray * zeitgeist_events_from_variant (GVariant *vevents
,GError **error
); GVariant * zeitgeist_events_to_variant (GPtrArray *events
); GVariant * zeitgeist_events_to_variant_with_limit (GPtrArray *events
,gsize limit
,GError **error
);
"actor" gchar* : Read / Write "id" guint : Read / Write "interpretation" gchar* : Read / Write "manifestation" gchar* : Read / Write "origin" gchar* : Read / Write "payload" GByteArray* : Read / Write "subjects" GPtrArray* : Read / Write "timestamp" gint64 : Read / Write
The Event class is one of the primary elements for communicating with the Zeitgeist daemon. Events serve two purposes Unsurprisingly, they represent events that have happened, but they can also act as templates. See also ZeitgeistSubject.
An event in the Zeitgeist world is characterized by two main properties. "What happened", also called the interpretation, and "How did it happen", also called the manifestation. Besides these properties, an event also has an actor which identifies the party responsible for triggering the event which in most cases will be an application. Lastly there is an event timestamp and an event ID. The timestamp is calculated as the number of milliseconds since the Unix epoch and the event ID is a number assigned to the event by the Zeitgeist engine when it's logged. These five properties are collectively known as the event metadata.
An event must also describe what it happened to. For this we have event subjects. Most events have one subject, but they may also have more. The metadata of the subjects are recorded at the time of logging, and are encapsulated by the Subject class. It's important to understand that it's just the subject metadata at the time of logging, not necessarily the subject metadata as it exists right now.
In addition to the listed properties, events may also carry a free form binary payload. The usage of this is application specific and is generally useless unless you have some contextual information to figure out what's in it.
A large part of the Zeitgeist query and monitoring API revolves around a concept of template matching. A query is simply a list of event templates that you want to look for in the log. An unset property on an event template indicates that anything is allowed in that field. If the property is set it indicates that the property must be an exact match, unless a special operator is used.
#define ZEITGEIST_TYPE_EVENT (zeitgeist_event_get_type ())
The type for ZeitgeistEvent.
ZeitgeistSubject * zeitgeist_event_get_subject (ZeitgeistEvent *self
,gint index
);
|
the ZeitgeistEvent instance |
|
gint zeitgeist_event_num_subjects (ZeitgeistEvent *self
);
|
the ZeitgeistEvent instance |
void zeitgeist_event_add_subject (ZeitgeistEvent *self
,ZeitgeistSubject *subject
);
|
the ZeitgeistEvent instance |
|
void zeitgeist_event_take_subject (ZeitgeistEvent *self
,ZeitgeistSubject *subject
);
|
the ZeitgeistEvent instance |
|
void zeitgeist_event_set_actor_from_app_info (ZeitgeistEvent *self
,GAppInfo *info
);
|
the ZeitgeistEvent instance |
|
GVariant * zeitgeist_event_to_variant (ZeitgeistEvent *self
);
|
the ZeitgeistEvent instance |
void zeitgeist_event_debug_print (ZeitgeistEvent *self
);
|
the ZeitgeistEvent instance |
gboolean zeitgeist_event_matches_template (ZeitgeistEvent *self
,ZeitgeistEvent *template_event
);
|
the ZeitgeistEvent instance |
|
ZeitgeistEvent * zeitgeist_event_new_full (const gchar *interpretation
,const gchar *manifestation
,const gchar *actor
,const gchar *origin
,...
);
|
|
|
|
|
|
|
|
|
ZeitgeistEvent * zeitgeist_event_new_from_variant (GVariant *event_variant
,GError **error
);
|
|
|
location to store the error occuring, or NULL to ignore. [error-domains ZeitgeistDataModelError]
|
guint32 zeitgeist_event_get_id (ZeitgeistEvent *self
);
Get and return the current value of the "id" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "id" property |
void zeitgeist_event_set_id (ZeitgeistEvent *self
,guint32 value
);
Set the value of the "id" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "id" property |
gint64 zeitgeist_event_get_timestamp (ZeitgeistEvent *self
);
Get and return the current value of the "timestamp" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "timestamp" property |
void zeitgeist_event_set_timestamp (ZeitgeistEvent *self
,gint64 value
);
Set the value of the "timestamp" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "timestamp" property |
const gchar * zeitgeist_event_get_origin (ZeitgeistEvent *self
);
Get and return the current value of the "origin" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "origin" property |
void zeitgeist_event_set_origin (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "origin" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "origin" property |
const gchar * zeitgeist_event_get_actor (ZeitgeistEvent *self
);
Get and return the current value of the "actor" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "actor" property |
void zeitgeist_event_set_actor (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "actor" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "actor" property |
const gchar * zeitgeist_event_get_interpretation (ZeitgeistEvent *self
);
Get and return the current value of the "interpretation" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "interpretation" property |
void zeitgeist_event_set_interpretation (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "interpretation" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "interpretation" property |
const gchar * zeitgeist_event_get_manifestation (ZeitgeistEvent *self
);
Get and return the current value of the "manifestation" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "manifestation" property |
void zeitgeist_event_set_manifestation (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "manifestation" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "manifestation" property |
GPtrArray * zeitgeist_event_get_subjects (ZeitgeistEvent *self
);
Get and return the current value of the "subjects" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "subjects" property |
void zeitgeist_event_set_subjects (ZeitgeistEvent *self
,GPtrArray *value
);
Set the value of the "subjects" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "subjects" property |
GByteArray * zeitgeist_event_get_payload (ZeitgeistEvent *self
);
Get and return the current value of the "payload" property.
|
the ZeitgeistEvent instance to query |
Returns : |
the value of the "payload" property |
void zeitgeist_event_set_payload (ZeitgeistEvent *self
,GByteArray *value
);
Set the value of the "payload" property to value
.
|
the ZeitgeistEvent instance to modify |
|
the new value of the "payload" property |
struct ZeitgeistEvent;
Event objects abstract Zeitgeist events
The Event class is one of the primary elements for communicating with the Zeitgeist daemon. Events serve two purposes Unsurprisingly, they represent events that have happened, but they can also act as templates. See also ZeitgeistSubject.
An event in the Zeitgeist world is characterized by two main properties. "What happened", also called the interpretation, and "How did it happen", also called the manifestation. Besides these properties, an event also has an actor which identifies the party responsible for triggering the event which in most cases will be an application. Lastly there is an event timestamp and an event ID. The timestamp is calculated as the number of milliseconds since the Unix epoch and the event ID is a number assigned to the event by the Zeitgeist engine when it's logged. These five properties are collectively known as the event metadata.
An event must also describe what it happened to. For this we have event subjects. Most events have one subject, but they may also have more. The metadata of the subjects are recorded at the time of logging, and are encapsulated by the Subject class. It's important to understand that it's just the subject metadata at the time of logging, not necessarily the subject metadata as it exists right now.
In addition to the listed properties, events may also carry a free form binary payload. The usage of this is application specific and is generally useless unless you have some contextual information to figure out what's in it.
A large part of the Zeitgeist query and monitoring API revolves around a concept of template matching. A query is simply a list of event templates that you want to look for in the log. An unset property on an event template indicates that anything is allowed in that field. If the property is set it indicates that the property must be an exact match, unless a special operator is used.
struct ZeitgeistEventClass { GObjectClass parent_class; };
The class structure for ZEITGEIST_TYPE_EVENT
. All the fields in this structure are private and should never be accessed directly.
GObjectClass |
the parent class structure |
GPtrArray * zeitgeist_events_from_variant (GVariant *vevents
,GError **error
);
|
the (null) instance |
|
|
|
location to store the error occuring, or NULL to ignore. [error-domains ZeitgeistDataModelError]
|
GVariant * zeitgeist_events_to_variant (GPtrArray *events
);
|
the (null) instance |
|