diff options
-rw-r--r-- | libindicate/indicator.c | 22 | ||||
-rw-r--r-- | libindicate/indicator.h | 2 | ||||
-rw-r--r-- | libindicate/tests/indicate-and-crash.c | 2 |
3 files changed, 22 insertions, 4 deletions
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); |