Merge lp:~3v1n0/libindicator/scroll-event-support into lp:libindicator/0.4

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 395
Proposed branch: lp:~3v1n0/libindicator/scroll-event-support
Merge into: lp:libindicator/0.4
Diff against target: 89 lines (+28/-4)
3 files modified
libindicator/indicator-object-marshal.list (+2/-1)
libindicator/indicator-object.c (+23/-2)
libindicator/indicator-object.h (+3/-1)
To merge this branch: bzr merge lp:~3v1n0/libindicator/scroll-event-support
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+47608@code.launchpad.net

Description of the change

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...

This is part of the Indicators "scroll-event" support patch, see bug #708180

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

69 -#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED "entry-added"
70 +#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED SCROLL "entry-added"

I'm not sure what the SCROLL here is for. Otherwise it looks good.

review: Needs Information
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> 69 -#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED "entry-added"
> 70 +#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED SCROLL "entry-added"
>
> I'm not sure what the SCROLL here is for. Otherwise it looks good.

Ops, it was a typo (or bad paste :P)... I'm fixing it, sorry.

396. By Marco Trevisan (Treviño)

Removed typo in code.

Pasted a more SCROLL value :P

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ah, let me know if you'd prefer to replace the old "scroll" signal with the new one, instead of adding one more (so using an extra slot of the struct for the very same reason); the current implementation could be considered not optimized and containing a duplicate.

In this case, indicator-sound (the only depending on this, right now) should be updated too, to use the scroll_entry signal instead of the scroll one.

Revision history for this message
Ted Gould (ted) wrote :

On Thu, 2011-01-27 at 11:37 +0000, Treviño (Marco Trevisan) wrote:
> Ah, let me know if you'd prefer to replace the old "scroll" signal with the new one, instead of adding one more (so using an extra slot of the struct for the very same reason); the current implementation could be considered not optimized and containing a duplicate.
>
> In this case, indicator-sound (the only depending on this, right now) should be updated too, to use the scroll_entry signal instead of the scroll one.

Yeah, from a coding perspective it's not a big deal. But every time we
break API we kinda mess with the distro folks in a bad way. So it's
worth not doing that if we don't need to. Next time we break ABI I'll
reclaim the reserved.

Thanks for fixing the typo!

  review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicator/indicator-object-marshal.list'
2--- libindicator/indicator-object-marshal.list 2011-01-04 21:56:53 +0000
3+++ libindicator/indicator-object-marshal.list 2011-01-27 11:27:12 +0000
4@@ -1,4 +1,5 @@
5 VOID: POINTER, UINT, UINT
6-VOID: UINT,ENUM
7+VOID: UINT, ENUM
8+VOID: POINTER, UINT, ENUM
9 VOID: POINTER, UINT
10 VOID: POINTER, BOOLEAN
11
12=== modified file 'libindicator/indicator-object.c'
13--- libindicator/indicator-object.c 2011-01-10 16:19:52 +0000
14+++ libindicator/indicator-object.c 2011-01-27 11:27:12 +0000
15@@ -58,6 +58,7 @@
16 ENTRY_REMOVED,
17 ENTRY_MOVED,
18 SCROLL,
19+ SCROLL_ENTRY,
20 MENU_SHOW,
21 SHOW_NOW_CHANGED,
22 LAST_SIGNAL
23@@ -146,7 +147,6 @@
24 _indicator_object_marshal_VOID__POINTER_UINT_UINT,
25 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_NONE);
26
27-
28 /**
29 IndicatorObject::scroll:
30 @arg0: The #IndicatorObject object
31@@ -162,7 +162,28 @@
32 G_STRUCT_OFFSET (IndicatorObjectClass, scroll),
33 NULL, NULL,
34 _indicator_object_marshal_VOID__UINT_ENUM,
35- G_TYPE_NONE, 2, G_TYPE_UINT, INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION);
36+ G_TYPE_NONE, 2, G_TYPE_UINT,
37+ INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION);
38+
39+/**
40+ IndicatorObject::scroll-entry:
41+ @arg0: The #IndicatorObject object
42+ @arg1: A pointer to the #IndicatorObjectEntry that
43+ receives the scroll event.
44+ @arg2: The delta of the scroll event
45+ @arg3: The orientation of the scroll event.
46+
47+ When the indicator receives a mouse scroll wheel event
48+ from the user, this signal is emitted.
49+ */
50+ signals[SCROLL_ENTRY] = g_signal_new (INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY,
51+ G_TYPE_FROM_CLASS(klass),
52+ G_SIGNAL_RUN_LAST,
53+ G_STRUCT_OFFSET (IndicatorObjectClass, scroll_entry),
54+ NULL, NULL,
55+ _indicator_object_marshal_VOID__POINTER_UINT_ENUM,
56+ G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT,
57+ INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION);
58
59 /**
60 IndicatorObject::menu-show:
61
62=== modified file 'libindicator/indicator-object.h'
63--- libindicator/indicator-object.h 2011-01-09 21:44:19 +0000
64+++ libindicator/indicator-object.h 2011-01-27 11:27:12 +0000
65@@ -51,6 +51,8 @@
66 #define INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ENTRY_MOVED, INDICATOR_OBJECT_TYPE))
67 #define INDICATOR_OBJECT_SIGNAL_SCROLL "scroll"
68 #define INDICATOR_OBJECT_SIGNAL_SCROLL_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SCROLL, INDICATOR_OBJECT_TYPE))
69+#define INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY "scroll-entry"
70+#define INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY_ID (g_signal_lookup(#define INDICATOR_OBJECT_SIGNAL_SCROLL_ENTRY, INDICATOR_OBJECT_TYPE))
71 #define INDICATOR_OBJECT_SIGNAL_MENU_SHOW "menu-show"
72 #define INDICATOR_OBJECT_SIGNAL_MENU_SHOW_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_MENU_SHOW, INDICATOR_OBJECT_TYPE))
73 #define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED "show-now-changed"
74@@ -114,6 +116,7 @@
75 void (*scroll) (IndicatorObject * io, gint delta, IndicatorScrollDirection direction);
76 void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
77 void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data);
78+ void (*scroll_entry) (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction);
79
80 /* Reserved */
81 void (*reserved1) (void);
82@@ -121,7 +124,6 @@
83 void (*reserved3) (void);
84 void (*reserved4) (void);
85 void (*reserved5) (void);
86- void (*reserved6) (void);
87 };
88
89 /**

Subscribers

People subscribed via source and target branches