Merge lp:~jpakkane/libgrip/gtk3-test into lp:libgrip

Proposed by Jussi Pakkanen
Status: Merged
Merged at revision: 41
Proposed branch: lp:~jpakkane/libgrip/gtk3-test
Merge into: lp:libgrip
Diff against target: 196 lines (+21/-26)
4 files modified
configure.ac (+1/-1)
examples/rectangle-mover/gesture.c (+5/-10)
libgrip.pc.in (+1/-1)
src/gripgesturemanager.c (+14/-14)
To merge this branch: bzr merge lp:~jpakkane/libgrip/gtk3-test
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+63818@code.launchpad.net

Description of the change

This branch makes Libgrip work with GTK3. GTK2 does not work. API/ABI version numbers not yet bumped.

If this is merged now, it means that libgrip applications on GTK2 will not get rotate/pinch center locations. If we want them to get that, then we first need to merge that change, do a release, merge this, bump versions and do another release.

The requirement for exposing center locations is a new GEIS release.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good! I'm fine with libgrip for gtk2 not having centroid for pinch and rotate events. After we release libgrip for gtk3 the older libgrip will be deprecated anyway.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2011-03-23 18:13:02 +0000
3+++ configure.ac 2011-06-08 07:33:34 +0000
4@@ -71,7 +71,7 @@
5 AC_FUNC_MMAP
6 AC_CHECK_FUNCS([memset munmap strcasecmp strdup])
7
8-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.19.7)
9+PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0.8)
10 AC_SUBST(GTK_CFLAGS)
11 AC_SUBST(GTK_LIBS)
12
13
14=== modified file 'examples/rectangle-mover/gesture.c'
15--- examples/rectangle-mover/gesture.c 2011-01-13 05:50:41 +0000
16+++ examples/rectangle-mover/gesture.c 2011-06-08 07:33:34 +0000
17@@ -10,16 +10,13 @@
18 static gint in_touch = 0;
19
20 static gboolean
21-expose_event (GtkWidget *widget,
22- GdkEventExpose *event,
23- gpointer data)
24+draw_canvas (GtkWidget *widget,
25+ cairo_t *cr,
26+ gpointer data)
27 {
28- cairo_t *cr;
29 gdouble radians;
30 gint width = (in_touch > 0) ? 10 : 1;
31
32- cr = gdk_cairo_create (widget->window);
33-
34 cairo_set_source_rgb (cr, 0, 0, 0);
35 cairo_set_line_width (cr, width);
36
37@@ -33,8 +30,6 @@
38 cairo_set_source_rgb (cr, 1, 0, 1);
39 cairo_fill (cr);
40
41- cairo_destroy (cr);
42-
43 return FALSE;
44 }
45
46@@ -143,8 +138,8 @@
47
48 gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &white);
49
50- g_signal_connect (da, "expose-event",
51- G_CALLBACK (expose_event), NULL);
52+ g_signal_connect (da, "draw",
53+ G_CALLBACK (draw_canvas), NULL);
54
55 grip_gesture_manager_register_window (manager,
56 da,
57
58=== modified file 'libgrip.pc.in'
59--- libgrip.pc.in 2010-11-22 14:49:44 +0000
60+++ libgrip.pc.in 2011-06-08 07:33:34 +0000
61@@ -8,4 +8,4 @@
62 Version: @VERSION@
63 Libs: -L${libdir} -lgrip-0.1
64 Cflags: -I${includedir}/libgrip-0.1
65-Requires: gtk+-2.0
66+Requires: gtk+-3.0
67
68=== modified file 'src/gripgesturemanager.c'
69--- src/gripgesturemanager.c 2011-03-23 15:17:02 +0000
70+++ src/gripgesturemanager.c 2011-06-08 07:33:34 +0000
71@@ -520,7 +520,7 @@
72 if (drag->fingers == binding->touches)
73 {
74 if (matches_widget (binding->widget,
75- GTK_WIDGET (reg->window)->window,
76+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
77 (gint)drag->focus_x,
78 (gint)drag->focus_y))
79 {
80@@ -544,7 +544,7 @@
81 if (pinch->fingers == binding->touches)
82 {
83 if (matches_widget (binding->widget,
84- GTK_WIDGET (reg->window)->window,
85+ gtk_widget_get_window(GTK_WIDGET(reg->window)),
86 (gint)pinch->focus_x,
87 (gint)pinch->focus_y))
88 {
89@@ -568,7 +568,7 @@
90 if (rotate->fingers == binding->touches)
91 {
92 if (matches_widget (binding->widget,
93- GTK_WIDGET (reg->window)->window,
94+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
95 (gint)rotate->focus_x,
96 (gint)rotate->focus_y))
97 {
98@@ -592,7 +592,7 @@
99 if (tap->fingers == binding->touches)
100 {
101 if (matches_widget (binding->widget,
102- GTK_WIDGET (reg->window)->window,
103+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
104 (gint)tap->focus_x,
105 (gint)tap->focus_y))
106 {
107@@ -640,7 +640,7 @@
108 if (drag->fingers == binding->touches)
109 {
110 if (matches_widget (binding->widget,
111- GTK_WIDGET (reg->window)->window,
112+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
113 (gint)drag->focus_x,
114 (gint)drag->focus_y))
115 {
116@@ -664,7 +664,7 @@
117 if (pinch->fingers == binding->touches)
118 {
119 if (matches_widget (binding->widget,
120- GTK_WIDGET (reg->window)->window,
121+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
122 (gint)pinch->focus_x,
123 (gint)pinch->focus_y))
124 {
125@@ -688,7 +688,7 @@
126 if (rotate->fingers == binding->touches)
127 {
128 if (matches_widget (binding->widget,
129- GTK_WIDGET (reg->window)->window,
130+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
131 (gint)rotate->focus_x,
132 (gint)rotate->focus_y))
133 {
134@@ -712,7 +712,7 @@
135 if (tap->fingers == binding->touches)
136 {
137 if (matches_widget (binding->widget,
138- GTK_WIDGET (reg->window)->window,
139+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
140 (gint)tap->focus_x,
141 (gint)tap->focus_y))
142 {
143@@ -760,7 +760,7 @@
144 if (drag->fingers == binding->touches)
145 {
146 if (matches_widget (binding->widget,
147- GTK_WIDGET (reg->window)->window,
148+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
149 (gint)drag->focus_x,
150 (gint)drag->focus_y))
151 {
152@@ -784,7 +784,7 @@
153 if (pinch->fingers == binding->touches)
154 {
155 if (matches_widget (binding->widget,
156- GTK_WIDGET (reg->window)->window,
157+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
158 (gint)pinch->focus_x,
159 (gint)pinch->focus_y))
160 {
161@@ -808,7 +808,7 @@
162 if (rotate->fingers == binding->touches)
163 {
164 if (matches_widget (binding->widget,
165- GTK_WIDGET (reg->window)->window,
166+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
167 (gint)rotate->focus_x,
168 (gint)rotate->focus_y))
169 {
170@@ -832,7 +832,7 @@
171 if (tap->fingers == binding->touches)
172 {
173 if (matches_widget (binding->widget,
174- GTK_WIDGET (reg->window)->window,
175+ gtk_widget_get_window(GTK_WIDGET (reg->window)),
176 (gint)tap->focus_x,
177 (gint)tap->focus_y))
178 {
179@@ -872,7 +872,7 @@
180 }
181
182 static void
183-window_destroyed_cb (GtkObject *object,
184+window_destroyed_cb (GtkWidget *object,
185 gpointer user_data)
186 {
187 GripGestureManager *manager = (GripGestureManager *)user_data;
188@@ -954,7 +954,7 @@
189 GeisXcbWinInfo xcb_win_info = {
190 .display_name = NULL,
191 .screenp = NULL,
192- .window_id = GDK_DRAWABLE_XID (toplevel->window)
193+ .window_id = GDK_WINDOW_XID (gtk_widget_get_window(toplevel))
194 };
195 GeisWinInfo win_info = {
196 GEIS_XCB_FULL_WINDOW,

Subscribers

People subscribed via source and target branches