Back to index

libindicator  12.10.0
Classes | Defines | Typedefs | Functions
dummy-indicator-signaler.c File Reference
#include <glib.h>
#include <glib-object.h>
#include "libindicator/indicator.h"
#include "libindicator/indicator-object.h"

Go to the source code of this file.

Classes

struct  _DummyIndicatorSignalerClass
struct  _DummyIndicatorSignaler

Defines

#define DUMMY_INDICATOR_SIGNALER_TYPE   (dummy_indicator_signaler_get_type ())
#define DUMMY_INDICATOR_SIGNALER(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), DUMMY_INDICATOR_SIGNALER_TYPE, DummyIndicatorSignaler))
#define DUMMY_INDICATOR_SIGNALER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), DUMMY_INDICATOR_SIGNALER_TYPE, DummyIndicatorSignalerClass))
#define IS_DUMMY_INDICATOR_SIGNALER(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DUMMY_INDICATOR_SIGNALER_TYPE))
#define IS_DUMMY_INDICATOR_SIGNALER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), DUMMY_INDICATOR_SIGNALER_TYPE))
#define DUMMY_INDICATOR_SIGNALER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), DUMMY_INDICATOR_SIGNALER_TYPE, DummyIndicatorSignalerClass))

Typedefs

typedef struct _DummyIndicatorSignaler
typedef struct _DummyIndicatorSignalerClass

Functions

GType dummy_indicator_signaler_get_type (void)
INDICATOR_SET_VERSION GtkLabel * get_label (IndicatorObject *io)
GtkImage * get_icon (IndicatorObject *io)
GtkMenu * get_menu (IndicatorObject *io)
const gchar * get_accessible_desc (IndicatorObject *io)
static void dummy_indicator_signaler_class_init (DummyIndicatorSignalerClass *klass)
static void dummy_indicator_signaler_init (DummyIndicatorSignaler *self)
static void dummy_indicator_signaler_dispose (GObject *object)
static void dummy_indicator_signaler_finalize (GObject *object)
 G_DEFINE_TYPE (DummyIndicatorSignaler, dummy_indicator_signaler, INDICATOR_OBJECT_TYPE)
static gboolean idle_signal (gpointer data)

Class Documentation

struct _DummyIndicatorSignalerClass

Definition at line 39 of file dummy-indicator-signaler.c.

Class Members
IndicatorObjectClass parent_class
struct _DummyIndicatorSignaler

Definition at line 43 of file dummy-indicator-signaler.c.

Class Members
IndicatorObjectEntry * entries
IndicatorObject parent

Define Documentation

#define DUMMY_INDICATOR_SIGNALER (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), DUMMY_INDICATOR_SIGNALER_TYPE, DummyIndicatorSignaler))

Definition at line 30 of file dummy-indicator-signaler.c.

#define DUMMY_INDICATOR_SIGNALER_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), DUMMY_INDICATOR_SIGNALER_TYPE, DummyIndicatorSignalerClass))

Definition at line 31 of file dummy-indicator-signaler.c.

#define DUMMY_INDICATOR_SIGNALER_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), DUMMY_INDICATOR_SIGNALER_TYPE, DummyIndicatorSignalerClass))

Definition at line 34 of file dummy-indicator-signaler.c.

Definition at line 29 of file dummy-indicator-signaler.c.

#define IS_DUMMY_INDICATOR_SIGNALER (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DUMMY_INDICATOR_SIGNALER_TYPE))

Definition at line 32 of file dummy-indicator-signaler.c.

#define IS_DUMMY_INDICATOR_SIGNALER_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), DUMMY_INDICATOR_SIGNALER_TYPE))

Definition at line 33 of file dummy-indicator-signaler.c.


Typedef Documentation

typedef struct _DummyIndicatorSignaler

Definition at line 36 of file dummy-indicator-signaler.c.

Definition at line 37 of file dummy-indicator-signaler.c.


Function Documentation

static void dummy_indicator_signaler_class_init ( DummyIndicatorSignalerClass *  klass) [static]

Definition at line 90 of file dummy-indicator-signaler.c.

{
       GObjectClass *object_class = G_OBJECT_CLASS (klass);

       object_class->dispose = dummy_indicator_signaler_dispose;
       object_class->finalize = dummy_indicator_signaler_finalize;

       IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass);

       io_class->get_label = get_label;
       io_class->get_image = get_icon;
       io_class->get_menu = get_menu;
       io_class->get_accessible_desc = get_accessible_desc;
       io_class->entry_being_removed  = NULL;
       io_class->entry_was_added  = NULL;

       return;
}

Here is the call graph for this function:

static void dummy_indicator_signaler_dispose ( GObject *  object) [static]

Definition at line 140 of file dummy-indicator-signaler.c.

{

       G_OBJECT_CLASS (dummy_indicator_signaler_parent_class)->dispose (object);
       return;
}

Here is the caller graph for this function:

static void dummy_indicator_signaler_finalize ( GObject *  object) [static]

Definition at line 148 of file dummy-indicator-signaler.c.

{
       DummyIndicatorSignaler * self = DUMMY_INDICATOR_SIGNALER(object);
       g_free (self->entries);
       G_OBJECT_CLASS (dummy_indicator_signaler_parent_class)->finalize (object);
       return;
}

Here is the caller graph for this function:

static void dummy_indicator_signaler_init ( DummyIndicatorSignaler *  self) [static]

Definition at line 132 of file dummy-indicator-signaler.c.

{
       self->entries = g_new0(IndicatorObjectEntry, 3);
       g_idle_add(idle_signal, self);
       return;
}

Here is the call graph for this function:

G_DEFINE_TYPE ( DummyIndicatorSignaler  ,
dummy_indicator_signaler  ,
INDICATOR_OBJECT_TYPE   
)
const gchar* get_accessible_desc ( IndicatorObject *  io)

Definition at line 77 of file dummy-indicator-signaler.c.

{
       return "Signaler Item";
}
GtkImage* get_icon ( IndicatorObject *  io)

Definition at line 60 of file dummy-indicator-signaler.c.

{
       return GTK_IMAGE(gtk_image_new());
}
INDICATOR_SET_VERSION GtkLabel* get_label ( IndicatorObject *  io)

Definition at line 54 of file dummy-indicator-signaler.c.

{
       return GTK_LABEL(gtk_label_new("Signaler Item"));
}
GtkMenu* get_menu ( IndicatorObject *  io)

Definition at line 66 of file dummy-indicator-signaler.c.

{
       GtkMenu * main_menu = GTK_MENU(gtk_menu_new());
       GtkWidget * loading_item = gtk_menu_item_new_with_label("Loading...");
       gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), loading_item);
       gtk_widget_show(GTK_WIDGET(loading_item));

       return main_menu;
}
static gboolean idle_signal ( gpointer  data) [static]

Definition at line 110 of file dummy-indicator-signaler.c.

{
       DummyIndicatorSignaler * self = DUMMY_INDICATOR_SIGNALER(data);

       IndicatorObjectEntry *added_entry, *removed_entry, *moved_entry;

       added_entry = &self->entries[0];
       moved_entry = &self->entries[1];
       removed_entry = &self->entries[2];

       added_entry->name_hint = "added";
       moved_entry->name_hint = "moved";
       removed_entry->name_hint = "removed";

       g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED_ID, 0, added_entry);
       g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED_ID, 0, moved_entry, 0, 1);
       g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID, 0, removed_entry);

       return FALSE; /* Don't queue again */
}

Here is the caller graph for this function: