From 3d55f9063f2ee1a1a472f5a7b0b4bfa4a798b1f9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 12 Jan 2009 16:17:25 -0600 Subject: Basic show hide support in the indicator --- libindicate/indicator.c | 22 +++++++++++++++++++--- libindicate/indicator.h | 2 ++ libindicate/tests/indicate-and-crash.c | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'libindicate') diff --git a/libindicate/indicator.c b/libindicate/indicator.c index 3e168c9..43eac55 100644 --- a/libindicate/indicator.c +++ b/libindicate/indicator.c @@ -33,6 +33,20 @@ indicate_indicator_class_init (IndicateIndicatorClass * class) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals[HIDE] = g_signal_new(INDICATE_INDICATOR_SIGNAL_HIDE, + G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(IndicateIndicatorClass, hide), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + signals[SHOW] = g_signal_new(INDICATE_INDICATOR_SIGNAL_SHOW, + G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(IndicateIndicatorClass, show), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); return; } @@ -70,14 +84,16 @@ indicate_indicator_new (void) void indicate_indicator_show (IndicateIndicator * indicator) { + if (indicator->server) { + indicate_server_show(indicator->server); + } - + g_signal_emit(indicator, signals[SHOW], NULL, G_TYPE_NONE); } void indicate_indicator_hide (IndicateIndicator * indicator) { - - + g_signal_emit(indicator, signals[HIDE], NULL, G_TYPE_NONE); } diff --git a/libindicate/indicator.h b/libindicate/indicator.h index 976e4b6..cfa93aa 100644 --- a/libindicate/indicator.h +++ b/libindicate/indicator.h @@ -16,6 +16,8 @@ /* This is a signal that signals to the indicator that the user * has done an action where they'd like this indicator to be * displayed. */ +#define INDICATE_INDICATOR_SIGNAL_HIDE "hide" +#define INDICATE_INDICATOR_SIGNAL_SHOW "show" #define INDICATE_INDICATOR_SIGNAL_DISPLAY "user-display" typedef struct _IndicateIndicator IndicateIndicator; diff --git a/libindicate/tests/indicate-and-crash.c b/libindicate/tests/indicate-and-crash.c index fbc32b0..3cf3968 100644 --- a/libindicate/tests/indicate-and-crash.c +++ b/libindicate/tests/indicate-and-crash.c @@ -10,7 +10,7 @@ main (int argc, char ** argv) g_type_init(); IndicateIndicator * indicator = indicate_indicator_new(); - indicator_show(indicator->server); + indicate_indicator_show(indicator->server); //g_timeout_add_seconds(15, crashfunc, NULL); -- cgit v1.2.3