diff options
author | Jason Conti <jason.conti@gmail.com> | 2011-05-13 14:10:30 -0400 |
---|---|---|
committer | Jason Conti <jason.conti@gmail.com> | 2011-05-13 14:10:30 -0400 |
commit | e195cbcc888eb7ba61ef0ded56c4b5756442ffb9 (patch) | |
tree | d5657401dcb384f7f3463d85f70b028810c9880e /src/dbus-spy.h | |
parent | deb48f9400d853178d1cea51a92b598080151b5e (diff) | |
download | ayatana-indicator-notifications-e195cbcc888eb7ba61ef0ded56c4b5756442ffb9.tar.gz ayatana-indicator-notifications-e195cbcc888eb7ba61ef0ded56c4b5756442ffb9.tar.bz2 ayatana-indicator-notifications-e195cbcc888eb7ba61ef0ded56c4b5756442ffb9.zip |
Importing dbus-spy and notification dbus objects to watch dbus for org.freedesktop.Notification.Notify messages (from test project).
Diffstat (limited to 'src/dbus-spy.h')
-rw-r--r-- | src/dbus-spy.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/dbus-spy.h b/src/dbus-spy.h new file mode 100644 index 0000000..1f9f79e --- /dev/null +++ b/src/dbus-spy.h @@ -0,0 +1,53 @@ +/* + * dbus-spy.h - A gobject subclass to watch dbus for org.freedesktop.Notification.Notify messages. + */ + +#ifndef __DBUS_SPY_H__ +#define __DBUS_SPY_H__ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> + +#include "notification.h" + +G_BEGIN_DECLS + +#define DBUS_SPY_TYPE (dbus_spy_get_type ()) +#define DBUS_SPY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DBUS_SPY_TYPE, DBusSpy)) +#define DBUS_SPY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_SPY_TYPE, DBusSpyClass)) +#define IS_DBUS_SPY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DBUS_SPY_TYPE)) +#define IS_DBUS_SPY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_SPY_TYPE)) + +typedef struct _DBusSpy DBusSpy; +typedef struct _DBusSpyClass DBusSpyClass; +typedef struct _DBusSpyPrivate DBusSpyPrivate; + +struct _DBusSpy +{ + GObject parent; + DBusSpyPrivate *priv; +}; + +struct _DBusSpyClass +{ + GObjectClass parent_class; + + void (* message_received) (DBusSpy *spy, + Notification *note); +}; + +struct _DBusSpyPrivate { + GDBusConnection *connection; + GCancellable *connection_cancel; +}; + +#define DBUS_SPY_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUS_SPY_TYPE, DBusSpyPrivate)) + +GType dbus_spy_get_type(void); +DBusSpy* dbus_spy_new(void); + +G_END_DECLS + +#endif /* __DBUS_SPY_H__ */ |