diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2012-02-14 22:29:50 +0100 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2012-02-14 22:29:50 +0100 |
commit | f8e24aeac440743247ede915a6d255b36197a9f4 (patch) | |
tree | ae0374f9fbafd4bffd511da5070dadf5e0526658 /tests/dummy-indicator-signaler.c | |
parent | e81d0ecfe1899acc60fb50a5fbc03823a132139d (diff) | |
parent | ee6a7f0fbc9598f791f217d47b9e2c678a106e61 (diff) | |
download | libayatana-indicator-f8e24aeac440743247ede915a6d255b36197a9f4.tar.gz libayatana-indicator-f8e24aeac440743247ede915a6d255b36197a9f4.tar.bz2 libayatana-indicator-f8e24aeac440743247ede915a6d255b36197a9f4.zip |
Import upstream version 0.4.91
Diffstat (limited to 'tests/dummy-indicator-signaler.c')
-rw-r--r-- | tests/dummy-indicator-signaler.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/dummy-indicator-signaler.c b/tests/dummy-indicator-signaler.c index c7a5c1f..a4206d0 100644 --- a/tests/dummy-indicator-signaler.c +++ b/tests/dummy-indicator-signaler.c @@ -42,6 +42,7 @@ struct _DummyIndicatorSignalerClass { struct _DummyIndicatorSignaler { IndicatorObject parent; + IndicatorObjectEntry *entries; }; GType dummy_indicator_signaler_get_type (void); @@ -110,9 +111,19 @@ idle_signal (gpointer data) { DummyIndicatorSignaler * self = DUMMY_INDICATOR_SIGNALER(data); - g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED_ID, 0, GUINT_TO_POINTER(5), TRUE); - g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID, 0, GUINT_TO_POINTER(5), TRUE); - g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED_ID, 0, GUINT_TO_POINTER(5), 0, 1, TRUE); + 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 */ } @@ -120,6 +131,7 @@ idle_signal (gpointer data) static void dummy_indicator_signaler_init (DummyIndicatorSignaler *self) { + self->entries = g_new0(IndicatorObjectEntry, 3); g_idle_add(idle_signal, self); return; } @@ -135,7 +147,8 @@ dummy_indicator_signaler_dispose (GObject *object) static void dummy_indicator_signaler_finalize (GObject *object) { - + DummyIndicatorSignaler * self = DUMMY_INDICATOR_SIGNALER(object); + g_free (self->entries); G_OBJECT_CLASS (dummy_indicator_signaler_parent_class)->finalize (object); return; } |