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
=== modified file 'examples/rectangle-mover/Makefile.am'
--- examples/rectangle-mover/Makefile.am 2011-06-14 17:39:10 +0000
+++ examples/rectangle-mover/Makefile.am 2011-10-19 18:09:23 +0000
@@ -12,4 +12,4 @@
12 $(GTK_CFLAGS) \12 $(GTK_CFLAGS) \
13 $(MAINTAINER_CFLAGS)13 $(MAINTAINER_CFLAGS)
1414
15grip_test_LDADD = $(top_builddir)/src/libgrip.la $(GTK_LIBS)15grip_test_LDADD = $(top_builddir)/src/libgrip.la $(GTK_LIBS) -lm
1616
=== modified file 'examples/rectangle-mover/gesture.c'
--- examples/rectangle-mover/gesture.c 2011-08-04 01:09:42 +0000
+++ examples/rectangle-mover/gesture.c 2011-10-19 18:09:23 +0000
@@ -74,13 +74,15 @@
74 GripEventGesturePinch *e = (GripEventGesturePinch *)event;74 GripEventGesturePinch *e = (GripEventGesturePinch *)event;
75 GtkWindow *toplevel = (GtkWindow *)gtk_widget_get_toplevel (widget);75 GtkWindow *toplevel = (GtkWindow *)gtk_widget_get_toplevel (widget);
76 gint window_width, window_height;76 gint window_width, window_height;
77 AxisExtents *x = grip_input_device_get_x_extents (e->input_device);77 const GripAxisExtents *x;
78 AxisExtents *y = grip_input_device_get_y_extents (e->input_device);78 const GripAxisExtents *y;
79 gfloat width = 0;79 gfloat width = 0;
80 gfloat height = 0;80 gfloat height = 0;
81 gfloat factor = 0;81 gfloat factor = 0;
8282
83 gtk_window_get_size (toplevel, &window_width, &window_height);83 gtk_window_get_size (toplevel, &window_width, &window_height);
84 x = grip_input_device_get_x_extents (e->input_device);
85 y = grip_input_device_get_y_extents (e->input_device);
84 width = window_width / (x->maximum - x->minimum);86 width = window_width / (x->maximum - x->minimum);
85 height = window_height / (y->maximum - y->minimum);87 height = window_height / (y->maximum - y->minimum);
86 factor = sqrtf (width * width + height * height) / 5.2723;88 factor = sqrtf (width * width + height * height) / 5.2723;
8789
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2011-08-04 01:04:47 +0000
+++ src/Makefile.am 2011-10-19 18:09:23 +0000
@@ -40,16 +40,17 @@
4040
41irscanner_headers = $(patsubst %,$(srcdir)/%,$(sources_h))41irscanner_headers = $(patsubst %,$(srcdir)/%,$(sources_h))
42Grip.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am42Grip.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
43 $(INTROSPECTION_SCANNER) \43 $(INTROSPECTION_SCANNER) \
44 -v --namespace Grip \44 -v --namespace Grip \
45 --nsversion=0.2 \45 --nsversion=0.2 \
46 --warn-all \46 --warn-all --warn-error \
47 --libtool=$(top_builddir)/libtool \47 -DG_IR_IGNORE \
48 --add-include-path=$(srcdir) $(GTK_CFLAGS) \48 --libtool=$(top_builddir)/libtool \
49 --include=GObject-2.0 \49 --add-include-path=$(srcdir) $(GTK_CFLAGS) \
50 --include=GLib-2.0 \50 --include=GObject-2.0 \
51 --include=Gtk-3.0 \51 --include=GLib-2.0 \
52 --library=grip \52 --include=Gtk-3.0 \
53 --library=grip \
53 --output Grip.gir $(irscanner_headers) \54 --output Grip.gir $(irscanner_headers) \
54 $(addprefix --c-include=src/, $(grip_headers))55 $(addprefix --c-include=src/, $(grip_headers))
5556
@@ -59,8 +60,8 @@
59gir_DATA = $(BUILT_GIRSOURCES)60gir_DATA = $(BUILT_GIRSOURCES)
6061
61typelibsdir = $(libdir)/girepository-1.062typelibsdir = $(libdir)/girepository-1.0
62typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)63typelibs_DATA = $(BUILT_GIRSOURCES:.gir=-1.0.typelib)
63%.typelib: %.gir $(INTROSPECTION_COMPILER)64%-1.0.typelib: %.gir $(INTROSPECTION_COMPILER)
64 $(INTROSPECTION_COMPILER) \65 $(INTROSPECTION_COMPILER) \
65 --includedir=$(srcdir) \66 --includedir=$(srcdir) \
66 --includedir=. \67 --includedir=. \
6768
=== modified file 'src/gripinputdevice.c'
--- src/gripinputdevice.c 2011-08-09 08:35:09 +0000
+++ src/gripinputdevice.c 2011-10-19 18:09:23 +0000
@@ -37,8 +37,8 @@
37 gint touches;37 gint touches;
38 gboolean is_direct;38 gboolean is_direct;
39 gboolean is_independent;39 gboolean is_independent;
40 AxisExtents x_extents;40 GripAxisExtents x_extents;
41 AxisExtents y_extents;41 GripAxisExtents y_extents;
42};42};
4343
4444
@@ -250,7 +250,7 @@
250 *250 *
251 * Returns: the X-axis extents of the device.251 * Returns: the X-axis extents of the device.
252 */252 */
253AxisExtents *253const GripAxisExtents *
254grip_input_device_get_x_extents(GripInputDevice *input_device)254grip_input_device_get_x_extents(GripInputDevice *input_device)
255{255{
256 return &input_device->priv->x_extents;256 return &input_device->priv->x_extents;
@@ -263,7 +263,7 @@
263 *263 *
264 * Returns: the Y-axis extents of the device.264 * Returns: the Y-axis extents of the device.
265 */265 */
266AxisExtents *266const GripAxisExtents *
267grip_input_device_get_y_extents(GripInputDevice *input_device)267grip_input_device_get_y_extents(GripInputDevice *input_device)
268{268{
269 return &input_device->priv->y_extents;269 return &input_device->priv->y_extents;
270270
=== modified file 'src/gripinputdevice.h'
--- src/gripinputdevice.h 2011-08-09 08:35:09 +0000
+++ src/gripinputdevice.h 2011-10-19 18:09:23 +0000
@@ -47,13 +47,21 @@
47 * recognition stack.47 * recognition stack.
48 */48 */
4949
50typedef struct AxisExtents50typedef struct GripAxisExtents
51{51{
52 gfloat minimum;52 gfloat minimum;
53 gfloat maximum;53 gfloat maximum;
54 gfloat resolution;54 gfloat resolution;
55} AxisExtents;55} GripAxisExtents;
5656
57#ifndef G_IR_IGNORE
58/**
59 * AxisExtents: (skip)
60 *
61 * A deprecated name for GripAxisExtents.
62 */
63typedef GripAxisExtents AxisExtents __attribute__((deprecated));
64#endif
5765
58GType grip_input_device_get_type (void) G_GNUC_CONST;66GType grip_input_device_get_type (void) G_GNUC_CONST;
5967
@@ -107,10 +115,10 @@
107gboolean115gboolean
108grip_input_device_is_independent(GripInputDevice *input_device);116grip_input_device_is_independent(GripInputDevice *input_device);
109117
110AxisExtents *118const GripAxisExtents *
111grip_input_device_get_x_extents(GripInputDevice *input_device);119grip_input_device_get_x_extents(GripInputDevice *input_device);
112120
113AxisExtents *121const GripAxisExtents *
114grip_input_device_get_y_extents(GripInputDevice *input_device);122grip_input_device_get_y_extents(GripInputDevice *input_device);
115123
116124

Subscribers

People subscribed via source and target branches