diff options
author | Ted Gould <ted@canonical.com> | 2009-01-12 16:17:25 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-01-12 16:17:25 -0600 |
commit | 3d55f9063f2ee1a1a472f5a7b0b4bfa4a798b1f9 (patch) | |
tree | a878282484487ac32b9cf6af56e27588fbacfed9 | |
parent | b687b3aefb3b7a231d18dea06ca511b990049487 (diff) | |
download | libayatana-indicator-3d55f9063f2ee1a1a472f5a7b0b4bfa4a798b1f9.tar.gz libayatana-indicator-3d55f9063f2ee1a1a472f5a7b0b4bfa4a798b1f9.tar.bz2 libayatana-indicator-3d55f9063f2ee1a1a472f5a7b0b4bfa4a798b1f9.zip |
Basic show hide support in the indicator
-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); |