Merge lp:~bregma/libgrip/lp-861596 into lp:libgrip

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 64
Proposed branch: lp:~bregma/libgrip/lp-861596
Merge into: lp:libgrip
Diff against target: 146 lines (+34/-23)
5 files modified
examples/rectangle-mover/Makefile.am (+1/-1)
examples/rectangle-mover/gesture.c (+4/-2)
src/Makefile.am (+13/-12)
src/gripinputdevice.c (+4/-4)
src/gripinputdevice.h (+12/-4)
To merge this branch: bzr merge lp:~bregma/libgrip/lp-861596
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+79824@code.launchpad.net

Description of the change

(1) Made the generated introspection library have a name that conforms to the GObject introspection runtime requirements (fixes lp:861596).

(2) Renamed the typedef AxisExtents to GripAxisExtents to fix the GObject introspection runtime build failure (this is an API breakage but not an ABI breakage). The API change does not affect eog or evince but may affect unknown third-paty usage.

(3) Turned all g-ir-scanner warnings into errors so the build will break instead of silently producing non-working software.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Added another commit to reintroduce the AxisExtents symbol, marked it as deprecated, and reverted the API change. Good to go.

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good now that we don't break the API. I assume you meant to name the macro G_IR_IGNORE instead of G_IR_IGNIORE though. I'm approving with that changed to proper english :).

review: Approve
lp:~bregma/libgrip/lp-861596 updated
66. By Stephen M. Webb

Re-added AxisExtents symbol, marked it as deprecated, and forced g-ir-scanner to ignore that particular symbol.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/rectangle-mover/Makefile.am'
2--- examples/rectangle-mover/Makefile.am 2011-06-14 17:39:10 +0000
3+++ examples/rectangle-mover/Makefile.am 2011-10-19 18:09:23 +0000
4@@ -12,4 +12,4 @@
5 $(GTK_CFLAGS) \
6 $(MAINTAINER_CFLAGS)
7
8-grip_test_LDADD = $(top_builddir)/src/libgrip.la $(GTK_LIBS)
9+grip_test_LDADD = $(top_builddir)/src/libgrip.la $(GTK_LIBS) -lm
10
11=== modified file 'examples/rectangle-mover/gesture.c'
12--- examples/rectangle-mover/gesture.c 2011-08-04 01:09:42 +0000
13+++ examples/rectangle-mover/gesture.c 2011-10-19 18:09:23 +0000
14@@ -74,13 +74,15 @@
15 GripEventGesturePinch *e = (GripEventGesturePinch *)event;
16 GtkWindow *toplevel = (GtkWindow *)gtk_widget_get_toplevel (widget);
17 gint window_width, window_height;
18- AxisExtents *x = grip_input_device_get_x_extents (e->input_device);
19- AxisExtents *y = grip_input_device_get_y_extents (e->input_device);
20+ const GripAxisExtents *x;
21+ const GripAxisExtents *y;
22 gfloat width = 0;
23 gfloat height = 0;
24 gfloat factor = 0;
25
26 gtk_window_get_size (toplevel, &window_width, &window_height);
27+ x = grip_input_device_get_x_extents (e->input_device);
28+ y = grip_input_device_get_y_extents (e->input_device);
29 width = window_width / (x->maximum - x->minimum);
30 height = window_height / (y->maximum - y->minimum);
31 factor = sqrtf (width * width + height * height) / 5.2723;
32
33=== modified file 'src/Makefile.am'
34--- src/Makefile.am 2011-08-04 01:04:47 +0000
35+++ src/Makefile.am 2011-10-19 18:09:23 +0000
36@@ -40,16 +40,17 @@
37
38 irscanner_headers = $(patsubst %,$(srcdir)/%,$(sources_h))
39 Grip.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
40- $(INTROSPECTION_SCANNER) \
41- -v --namespace Grip \
42- --nsversion=0.2 \
43- --warn-all \
44- --libtool=$(top_builddir)/libtool \
45- --add-include-path=$(srcdir) $(GTK_CFLAGS) \
46- --include=GObject-2.0 \
47- --include=GLib-2.0 \
48- --include=Gtk-3.0 \
49- --library=grip \
50+ $(INTROSPECTION_SCANNER) \
51+ -v --namespace Grip \
52+ --nsversion=0.2 \
53+ --warn-all --warn-error \
54+ -DG_IR_IGNORE \
55+ --libtool=$(top_builddir)/libtool \
56+ --add-include-path=$(srcdir) $(GTK_CFLAGS) \
57+ --include=GObject-2.0 \
58+ --include=GLib-2.0 \
59+ --include=Gtk-3.0 \
60+ --library=grip \
61 --output Grip.gir $(irscanner_headers) \
62 $(addprefix --c-include=src/, $(grip_headers))
63
64@@ -59,8 +60,8 @@
65 gir_DATA = $(BUILT_GIRSOURCES)
66
67 typelibsdir = $(libdir)/girepository-1.0
68-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
69-%.typelib: %.gir $(INTROSPECTION_COMPILER)
70+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=-1.0.typelib)
71+%-1.0.typelib: %.gir $(INTROSPECTION_COMPILER)
72 $(INTROSPECTION_COMPILER) \
73 --includedir=$(srcdir) \
74 --includedir=. \
75
76=== modified file 'src/gripinputdevice.c'
77--- src/gripinputdevice.c 2011-08-09 08:35:09 +0000
78+++ src/gripinputdevice.c 2011-10-19 18:09:23 +0000
79@@ -37,8 +37,8 @@
80 gint touches;
81 gboolean is_direct;
82 gboolean is_independent;
83- AxisExtents x_extents;
84- AxisExtents y_extents;
85+ GripAxisExtents x_extents;
86+ GripAxisExtents y_extents;
87 };
88
89
90@@ -250,7 +250,7 @@
91 *
92 * Returns: the X-axis extents of the device.
93 */
94-AxisExtents *
95+const GripAxisExtents *
96 grip_input_device_get_x_extents(GripInputDevice *input_device)
97 {
98 return &input_device->priv->x_extents;
99@@ -263,7 +263,7 @@
100 *
101 * Returns: the Y-axis extents of the device.
102 */
103-AxisExtents *
104+const GripAxisExtents *
105 grip_input_device_get_y_extents(GripInputDevice *input_device)
106 {
107 return &input_device->priv->y_extents;
108
109=== modified file 'src/gripinputdevice.h'
110--- src/gripinputdevice.h 2011-08-09 08:35:09 +0000
111+++ src/gripinputdevice.h 2011-10-19 18:09:23 +0000
112@@ -47,13 +47,21 @@
113 * recognition stack.
114 */
115
116-typedef struct AxisExtents
117+typedef struct GripAxisExtents
118 {
119 gfloat minimum;
120 gfloat maximum;
121 gfloat resolution;
122-} AxisExtents;
123+} GripAxisExtents;
124
125+#ifndef G_IR_IGNORE
126+/**
127+ * AxisExtents: (skip)
128+ *
129+ * A deprecated name for GripAxisExtents.
130+ */
131+typedef GripAxisExtents AxisExtents __attribute__((deprecated));
132+#endif
133
134 GType grip_input_device_get_type (void) G_GNUC_CONST;
135
136@@ -107,10 +115,10 @@
137 gboolean
138 grip_input_device_is_independent(GripInputDevice *input_device);
139
140-AxisExtents *
141+const GripAxisExtents *
142 grip_input_device_get_x_extents(GripInputDevice *input_device);
143
144-AxisExtents *
145+const GripAxisExtents *
146 grip_input_device_get_y_extents(GripInputDevice *input_device);
147
148

Subscribers

People subscribed via source and target branches