From 69221d8f85a2e1b5f3638e7dfc988b772f74737e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 14 Sep 2010 09:55:16 -0500 Subject: Adding in the signal for the menu showing --- libindicator/indicator-object.c | 53 ++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 511a407..a5fd740 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -57,7 +57,8 @@ enum { ENTRY_ADDED, ENTRY_REMOVED, ENTRY_MOVED, - SCROLL, + SCROLL, + MENU_SHOW, LAST_SIGNAL }; @@ -145,22 +146,40 @@ indicator_object_class_init (IndicatorObjectClass *klass) G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_NONE); - /** - IndicatorObject::scroll: - @arg0: The #IndicatorObject object - @arg1: The delta of the scroll event - @arg2: The orientation of the scroll event. - - When the indicator receives a mouse scroll wheel event - from the user, this signal is emitted. - */ - signals[SCROLL] = g_signal_new (INDICATOR_OBJECT_SIGNAL_SCROLL, - G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicatorObjectClass, scroll), - NULL, NULL, - _indicator_object_marshal_VOID__UINT_ENUM, - G_TYPE_NONE, 2, G_TYPE_UINT, INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION); + /** + IndicatorObject::scroll: + @arg0: The #IndicatorObject object + @arg1: The delta of the scroll event + @arg2: The orientation of the scroll event. + + When the indicator receives a mouse scroll wheel event + from the user, this signal is emitted. + */ + signals[SCROLL] = g_signal_new (INDICATOR_OBJECT_SIGNAL_SCROLL, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicatorObjectClass, scroll), + NULL, NULL, + _indicator_object_marshal_VOID__UINT_ENUM, + G_TYPE_NONE, 2, G_TYPE_UINT, INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION); + + /** + IndicatorObject::menu-show: + @arg0: The #IndicatorObject object + @arg1: A pointer to the #IndicatorObjectEntry that + is being shown. + @arg2: The timestamp of the event + + Used when the indicator wants to signal up the stack + that the menu should be shown. + */ + signals[MENU_SHOW] = g_signal_new (INDICATOR_OBJECT_SIGNAL_MENU_SHOW, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicatorObjectClass, menu_show), + NULL, NULL, + _indicator_object_marshal_VOID__POINTER_UINT, + G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT); return; -- cgit v1.2.3 From 90b4c191ef8eb28244ea405669a3671f0e5060c5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 15:56:50 -0500 Subject: Adding a function to push activate back down. --- libindicator/indicator-object.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index a5fd740..63eed05 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -432,3 +432,22 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr return 0; } + +/** + indicator_object_entry_activate: + @io: #IndicatorObject to query + @entry: The #IndicatorObjectEntry whose entry was shown + + Used to signal to the indicator that the menu on an entry has + been clicked on. This can either be an activate or a showing + of the menu. Note, this does not actually show the menu that's + left up to the reader. +*/ +void +indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry) +{ + + + + return; +} -- cgit v1.2.3 From 64db4d0d0dd0eb801b0dd2214d7723ba10f4ba81 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 16:06:41 -0500 Subject: Breaking the ABI and adding a subclassable function. --- libindicator/indicator-object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 63eed05..ecd0966 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -437,6 +437,7 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr indicator_object_entry_activate: @io: #IndicatorObject to query @entry: The #IndicatorObjectEntry whose entry was shown + @timestamp: The X11 timestamp of the event Used to signal to the indicator that the menu on an entry has been clicked on. This can either be an activate or a showing @@ -444,7 +445,7 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr left up to the reader. */ void -indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry) +indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp) { -- cgit v1.2.3 From daffbe647964a04f1f8da94f12cfd9746ad7483b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 16:09:26 -0500 Subject: Fleshing out the entry activate function --- libindicator/indicator-object.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index ecd0966..41484a6 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -447,8 +447,13 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp) { + g_return_if_fail(INDICATOR_IS_OBJECT(io)); + IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); - + if (class->entry_activate != NULL) { + return class->entry_activate(io, entry, timestamp); + } return; } + -- cgit v1.2.3