Back to index

libindicate  12.10.0
Functions
listen-and-print.c File Reference
#include <glib.h>
#include "libindicate/listener.h"
#include "libindicate-gtk/listener.h"

Go to the source code of this file.

Functions

static void show_property_cb (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gchar *property, const gchar *propertydata, gpointer data)
static void show_property_time_cb (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gchar *property, const GTimeVal *propertydata, gpointer data)
static void show_property_icon_cb (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gchar *property, GdkPixbuf *propertydata, gpointer data)
static void show_property (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gchar *property)
static void get_properties (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator)
static void indicator_added (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gpointer data)
static void indicator_removed (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gpointer data)
static void indicator_modified (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gchar *property, gpointer data)
static void type_cb (IndicateListener *listener, IndicateListenerServer *server, const gchar *value, gpointer data)
static void desktop_cb (IndicateListener *listener, IndicateListenerServer *server, const gchar *value, gpointer data)
static void server_added (IndicateListener *listener, IndicateListenerServer *server, gchar *type, gpointer data)
static void server_removed (IndicateListener *listener, IndicateListenerServer *server, gchar *type, gpointer data)
int main (int argc, char **argv)

Function Documentation

static void desktop_cb ( IndicateListener *  listener,
IndicateListenerServer *  server,
const gchar *  value,
gpointer  data 
) [static]

Definition at line 104 of file listen-and-print.c.

{
       g_debug("Indicator Server Desktop: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), value);
}

Here is the caller graph for this function:

static void get_properties ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator 
) [static]

Definition at line 72 of file listen-and-print.c.

{
       //TODO: Not in API yet.
}

Here is the caller graph for this function:

static void indicator_added ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gpointer  data 
) [static]

Definition at line 78 of file listen-and-print.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void indicator_modified ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gchar *  property,
gpointer  data 
) [static]

Definition at line 91 of file listen-and-print.c.

{
       g_debug("Indicator Modified:       %s %d %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property);
       show_property(listener, server, indicator, property);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void indicator_removed ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gpointer  data 
) [static]

Definition at line 85 of file listen-and-print.c.

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 129 of file listen-and-print.c.

{
       g_type_init();

       IndicateListener * listener = indicate_listener_ref_default();

       g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), NULL);
       g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed), NULL);
       g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, G_CALLBACK(indicator_modified), NULL);
       g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL);
       g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), NULL);

       g_main_loop_run(g_main_loop_new(NULL, FALSE));

       return 0;
}

Here is the call graph for this function:

static void server_added ( IndicateListener *  listener,
IndicateListenerServer *  server,
gchar *  type,
gpointer  data 
) [static]
static void server_removed ( IndicateListener *  listener,
IndicateListenerServer *  server,
gchar *  type,
gpointer  data 
) [static]

Definition at line 123 of file listen-and-print.c.

{
       g_debug("Indicator Server Removed: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type);
}

Here is the caller graph for this function:

static void show_property ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gchar *  property 
) [static]

Definition at line 58 of file listen-and-print.c.

{
       if (!g_strcmp0(property, "icon")) {
              indicate_gtk_listener_get_property_icon(listener, server, indicator, property, show_property_icon_cb, NULL);
       } else if (!g_strcmp0(property, "time")) {
              indicate_listener_get_property_time(listener, server, indicator, property, show_property_time_cb, NULL);
       } else {
              indicate_listener_get_property(listener, server, indicator, property, show_property_cb, NULL);
       }

       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void show_property_cb ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gchar *  property,
const gchar *  propertydata,
gpointer  data 
) [static]

Definition at line 27 of file listen-and-print.c.

{
       g_debug("Indicator Property:       %s %d %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property, propertydata);
       return;
}

Here is the caller graph for this function:

static void show_property_icon_cb ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gchar *  property,
GdkPixbuf *  propertydata,
gpointer  data 
) [static]

Definition at line 50 of file listen-and-print.c.

{
       g_debug("Indicator Property:       %s %d %s %dx%d", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property, gdk_pixbuf_get_width(propertydata), gdk_pixbuf_get_height(propertydata));
       g_object_unref(G_OBJECT(propertydata));
       return;
}

Here is the caller graph for this function:

static void show_property_time_cb ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gchar *  property,
const GTimeVal *  propertydata,
gpointer  data 
) [static]

Definition at line 34 of file listen-and-print.c.

{
       time_t timet;
       struct tm * structtm;

       timet = propertydata->tv_sec;
       structtm = localtime(&timet);

       gchar timestring[80];
       strftime(timestring, 80, "%I:%M", structtm);

       g_debug("Indicator Property:       %s %d %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property, timestring);
       return;
}

Here is the caller graph for this function:

static void type_cb ( IndicateListener *  listener,
IndicateListenerServer *  server,
const gchar *  value,
gpointer  data 
) [static]

Definition at line 98 of file listen-and-print.c.

{
       g_debug("Indicator Server Type:    %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), value);
}

Here is the caller graph for this function: