From 5873fe77cd5961991c4f1d86001cf41f3414a2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 27 Jan 2011 00:12:42 +0100 Subject: Added support for "signal-entry" signal libindicator support the new "scroll-entry" signal (which get called using the target entry as parameter too) I think that maybe we could simply rewrite the "scroll" signal, but I kept it there for compatibility reasons; however, actually just the indicator-sound should be fixed in case of switch... --- libindicator/indicator-object-marshal.list | 3 ++- libindicator/indicator-object.c | 25 +++++++++++++++++++++++-- libindicator/indicator-object.h | 6 ++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/libindicator/indicator-object-marshal.list b/libindicator/indicator-object-marshal.list index 4ea1e8b..73f1fac 100644 --- a/libindicator/indicator-object-marshal.list +++ b/libindicator/indicator-object-marshal.list @@ -1,4 +1,5 @@ VOID: POINTER, UINT, UINT -VOID: UINT,ENUM +VOID: UINT, ENUM +VOID: POINTER, UINT, ENUM VOID: POINTER, UINT VOID: POINTER, BOOLEAN diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 988a8ae..95ab08a 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -58,6 +58,7 @@ enum { ENTRY_REMOVED, ENTRY_MOVED, SCROLL, + SCROLL_ENTRY, MENU_SHOW, SHOW_NOW_CHANGED, LAST_SIGNAL @@ -146,7 +147,6 @@ indicator_object_class_init (IndicatorObjectClass *klass) _indicator_object_marshal_VOID__POINTER_UINT_UINT, G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_NONE); - /** IndicatorObject::scroll: @arg0: The #IndicatorObject object @@ -162,7 +162,28 @@ indicator_object_class_init (IndicatorObjectClass *klass) 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); + G_TYPE_NONE, 2, G_TYPE_UINT, + INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION); + +/** + IndicatorObject::scroll-entry: + @arg0: The #IndicatorObject object + @arg1: A pointer to the #IndicatorObjectEntry that + receives the scroll event. + @arg2: The delta of the scroll event + @arg3: The orientation of the scroll event. + + When the indicator receives a mouse scroll wheel event + from the user, this signal is emitted. + */ + signals[SCROLL_ENTRY] = g_signal_new (INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicatorObjectClass, scroll_entry), + NULL, NULL, + _indicator_object_marshal_VOID__POINTER_UINT_ENUM, + G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, + INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION); /** IndicatorObject::menu-show: diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index 9ad1366..f1669ab 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -43,7 +43,7 @@ typedef enum #define INDICATOR_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_OBJECT_TYPE, IndicatorObjectClass)) -#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED "entry-added" +#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED SCROLL "entry-added" #define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED "entry-removed" #define INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, INDICATOR_OBJECT_TYPE)) @@ -51,6 +51,8 @@ typedef enum #define INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED, INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_SIGNAL_SCROLL "scroll" #define INDICATOR_OBJECT_SIGNAL_SCROLL_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SCROLL, INDICATOR_OBJECT_TYPE)) +#define INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY "scroll-entry" +#define INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY_ID (g_signal_lookup(#define INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY, INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_SIGNAL_MENU_SHOW "menu-show" #define INDICATOR_OBJECT_SIGNAL_MENU_SHOW_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_MENU_SHOW, INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED "show-now-changed" @@ -114,6 +116,7 @@ struct _IndicatorObjectClass { void (*scroll) (IndicatorObject * io, gint delta, IndicatorScrollDirection direction); void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data); void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data); + void (*scroll_entry) (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction); /* Reserved */ void (*reserved1) (void); @@ -121,7 +124,6 @@ struct _IndicatorObjectClass { void (*reserved3) (void); void (*reserved4) (void); void (*reserved5) (void); - void (*reserved6) (void); }; /** -- cgit v1.2.3 From d903523d9f89042b865a3aa6f0dd523d404848f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 27 Jan 2011 12:24:00 +0100 Subject: Removed typo in code. Pasted a more SCROLL value :P --- libindicator/indicator-object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index f1669ab..4b3ce0b 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -43,7 +43,7 @@ typedef enum #define INDICATOR_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_OBJECT_TYPE, IndicatorObjectClass)) -#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED SCROLL "entry-added" +#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED "entry-added" #define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED, INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED "entry-removed" #define INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED, INDICATOR_OBJECT_TYPE)) -- cgit v1.2.3 From 9ac551998017804c2e9024d22d809e22a63987ce Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 27 Jan 2011 15:14:17 -0600 Subject: 0.3.18 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6396bd3..839cff1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(libindicator, 0.3.17, ted@canonical.com) +AC_INIT(libindicator, 0.3.18, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libindicator, 0.3.17) +AM_INIT_AUTOMAKE(libindicator, 0.3.18) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) -- cgit v1.2.3