ZeitgeistMonitor

ZeitgeistMonitor — Listens for updates to the Zeitgeist event log

Functions

Properties

GPtrArray * event-templates Read / Write / Construct Only
ZeitgeistTimeRange * time-range Read / Write / Construct Only

Signals

void events-deleted Run Last
void events-inserted Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── ZeitgeistMonitor

Includes

#include <zeitgeist.h>

Description

A ZeitgeistMonitor listens for updates to the Zeitgeist event log matching a given set of templates and with timestamps in some predefined time range.

A monitor must be installed into the running Zeitgeist daemon by calling zeitgeist_log_install_monitor(). The monitor will not emit any of the ::events-added or ::events-deleted signals before this.

Functions

zeitgeist_monitor_new ()

ZeitgeistMonitor *
zeitgeist_monitor_new (ZeitgeistTimeRange *time_range,
                       GPtrArray *event_templates);

Create a new monitor. Before you can receive signals from the monitor you need to install it in the running Zeitgeist daemon by calling zeitgeist_log_install_monitor().

Parameters

time_range

The monitor will only listen for events with timestamps within this time range. Note that it is legal for applications to insert events that are "in the past".

 

event_templates

A GPtrArray of ZeitgeistEvents. Only listen for events that match any of these templates. The monitor will assume ownership of the events and the pointer array. If you want to keep a reference for yourself you must do a g_ptr_array_ref() on event_templates as well as reffing the events held by it before calling this method.

 

Returns

A reference to a newly allocated monitor.


zeitgeist_monitor_get_time_range ()

ZeitgeistTimeRange *
zeitgeist_monitor_get_time_range (ZeitgeistMonitor *self);

zeitgeist_monitor_get_templates ()

GPtrArray *
zeitgeist_monitor_get_templates (ZeitgeistMonitor *self);

zeitgeist_monitor_get_path ()

const gchar *
zeitgeist_monitor_get_path (ZeitgeistMonitor *self);

Types and Values

struct ZeitgeistMonitor

struct ZeitgeistMonitor;

struct ZeitgeistMonitorClass

struct ZeitgeistMonitorClass {
  GObjectClass parent_class;

  /*< signals >*/
  void (*events_inserted)  (ZeitgeistMonitor   *self,
                            ZeitgeistTimeRange *time_range,
                            GPtrArray          *events);

  void (*events_deleted)  (ZeitgeistMonitor   *self,
                           ZeitgeistTimeRange *time_range,
                           GArray             *event_ids);
};

Property Details

The “event-templates” property

  “event-templates”          GPtrArray *

Events must match at least one these templates in order to trigger the monitor

Owner: ZeitgeistMonitor

Flags: Read / Write / Construct Only


The “time-range” property

  “time-range”               ZeitgeistTimeRange *

Events must have timestamps within this timerange in order to trigger the monitor.

Owner: ZeitgeistMonitor

Flags: Read / Write / Construct Only

Signal Details

The “events-deleted” signal

void
user_function (ZeitgeistMonitor   *time_range,
               ZeitgeistTimeRange *event_ids,
               GArray             *arg2,
               gpointer            user_data)

Emitted when events with timestamps within the time range of this monitor has been deleted from the log. Note that the deleted events may not match the event templates for the monitor.

Parameters

time_range

A ZeitgeistTimeRange that specifies the minimum and maximum timestamps of the deleted events

 

event_ids

A GArray of guint32s holding the ids of the deleted events

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “events-inserted” signal

void
user_function (ZeitgeistMonitor   *time_range,
               ZeitgeistTimeRange *events,
               ZeitgeistResultSet *arg2,
               gpointer            user_data)

Emitted when events matching the event templates and with timestamps within the time range of the monitor has been inserted into the log.

Parameters

time_range

A ZeitgeistTimeRange that specifies the minimum and maximum of the timestamps in events

 

events

A ZeitgeistResultSet holding the ZeitgeistEvents that have been inserted into the log

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last