Top |
char * | actor | Read / Write |
guint | id | Read / Write |
char * | interpretation | Read / Write |
char * | manifestation | Read / Write |
char * | origin | Read / Write |
GByteArray * | payload | Read / Write |
GPtrArray * | subjects | Read / Write |
gint64 | timestamp | Read / Write |
#define | ZEITGEIST_TYPE_EVENT |
#define | ZEITGEIST_EVENT_SIGNATURE |
struct | ZeitgeistEvent |
struct | ZeitgeistEventClass |
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.
ZeitgeistSubject * zeitgeist_event_get_subject (ZeitgeistEvent *self
,gint index
);
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
);
gboolean zeitgeist_event_matches_template (ZeitgeistEvent *self
,ZeitgeistEvent *template_event
);
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
);
event_variant |
|
|
error |
location to store the error occurring, or |
[error-domains ZeitgeistDataModelError] |
guint32
zeitgeist_event_get_id (ZeitgeistEvent *self
);
Get and return the current value of the "id" property.
void zeitgeist_event_set_id (ZeitgeistEvent *self
,guint32 value
);
Set the value of the "id" property to value
.
gint64
zeitgeist_event_get_timestamp (ZeitgeistEvent *self
);
Get and return the current value of the "timestamp" property.
void zeitgeist_event_set_timestamp (ZeitgeistEvent *self
,gint64 value
);
Set the value of the "timestamp" property to value
.
self |
the ZeitgeistEvent instance to modify |
|
value |
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.
void zeitgeist_event_set_origin (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "origin" property to value
.
const gchar *
zeitgeist_event_get_actor (ZeitgeistEvent *self
);
Get and return the current value of the "actor" property.
void zeitgeist_event_set_actor (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "actor" property to value
.
const gchar *
zeitgeist_event_get_interpretation (ZeitgeistEvent *self
);
Get and return the current value of the "interpretation" property.
void zeitgeist_event_set_interpretation (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "interpretation" property to value
.
self |
the ZeitgeistEvent instance to modify |
|
value |
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.
void zeitgeist_event_set_manifestation (ZeitgeistEvent *self
,const gchar *value
);
Set the value of the "manifestation" property to value
.
self |
the ZeitgeistEvent instance to modify |
|
value |
the new value of the "manifestation" property |
GPtrArray *
zeitgeist_event_get_subjects (ZeitgeistEvent *self
);
Get and return the current value of the "subjects" property.
void zeitgeist_event_set_subjects (ZeitgeistEvent *self
,GPtrArray *value
);
Set the value of the "subjects" property to value
.
self |
the ZeitgeistEvent instance to modify |
|
value |
the new value of the "subjects" property |
GByteArray *
zeitgeist_event_get_payload (ZeitgeistEvent *self
);
Get and return the current value of the "payload" property.
void zeitgeist_event_set_payload (ZeitgeistEvent *self
,GByteArray *value
);
Set the value of the "payload" property to value
.
GPtrArray * zeitgeist_events_from_variant (GVariant *vevents
,GError **error
);
self |
the (null) instance |
|
vevents |
|
|
error |
location to store the error occurring, or |
[error-domains ZeitgeistDataModelError] |
#define ZEITGEIST_TYPE_EVENT (zeitgeist_event_get_type ())
The type for ZeitgeistEvent.
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.
“actor”
property “actor” char *
actor.
Owner: ZeitgeistEvent
Flags: Read / Write
Default value: NULL
“interpretation”
property “interpretation” char *
interpretation.
Owner: ZeitgeistEvent
Flags: Read / Write
Default value: NULL
“manifestation”
property “manifestation” char *
manifestation.
Owner: ZeitgeistEvent
Flags: Read / Write
Default value: NULL
“origin”
property “origin” char *
origin.
Owner: ZeitgeistEvent
Flags: Read / Write
Default value: NULL
“timestamp”
property“timestamp” gint64
timestamp.
Owner: ZeitgeistEvent
Flags: Read / Write
Default value: 0