Merge lp:~bregma/evince/ubuntu-natty into lp:~ubuntu-desktop/evince/ubuntu
- ubuntu-natty
- Merge into ubuntu
Proposed by
Stephen M. Webb
Status: | Rejected |
---|---|
Rejected by: | Sebastien Bacher |
Proposed branch: | lp:~bregma/evince/ubuntu-natty |
Merge into: | lp:~ubuntu-desktop/evince/ubuntu |
Diff against target: |
678 lines (+636/-0) 5 files modified
debian/changelog (+6/-0) debian/control.in (+1/-0) debian/patches/07_utouch-gestures.patch (+627/-0) debian/patches/series (+1/-0) debian/rules (+1/-0) |
To merge this branch: | bzr merge lp:~bregma/evince/ubuntu-natty |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Desktop | Pending | ||
Review via email: mp+54568@code.launchpad.net |
Commit message
Description of the change
Adds uTouch multi-touch gesture handling via libgrip.
This is targetted at natty release.
To post a comment you must log in.
lp:~bregma/evince/ubuntu-natty
updated
- 116. By Stephen M. Webb
-
Added multi-touch gesture support through libgrip.
Unmerged revisions
- 116. By Stephen M. Webb
-
Added multi-touch gesture support through libgrip.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2011-03-22 18:38:58 +0000 |
3 | +++ debian/changelog 2011-03-23 21:23:34 +0000 |
4 | @@ -1,3 +1,9 @@ |
5 | +evince (2.32.0-0ubuntu13) UNRELEASED; urgency=low |
6 | + |
7 | + * Added multi-touch gesture support through libgrip (LP: #741242). |
8 | + |
9 | + -- Stephen M. Webb <stephen.webb@canonical.com> Mon, 21 Mar 2011 17:28:15 -0400 |
10 | + |
11 | evince (2.32.0-0ubuntu12) natty; urgency=low |
12 | |
13 | * debian/rules: update the translation template in the correct directory |
14 | |
15 | === modified file 'debian/control.in' |
16 | --- debian/control.in 2011-01-07 16:38:17 +0000 |
17 | +++ debian/control.in 2011-03-23 21:23:34 +0000 |
18 | @@ -17,6 +17,7 @@ |
19 | libcairo2-dev (>= 1.9.10), |
20 | libgtk2.0-dev (>= 2.21.5), |
21 | libglib2.0-dev (>= 2.25.11), |
22 | + libgrip-0.1-dev (>= 0.1.1), |
23 | libgail-dev (>= 2.21.5), |
24 | libgnome-keyring-dev (>= 2.22.0), |
25 | gnome-icon-theme (>= 2.17.1), |
26 | |
27 | === added file 'debian/patches/07_utouch-gestures.patch' |
28 | --- debian/patches/07_utouch-gestures.patch 1970-01-01 00:00:00 +0000 |
29 | +++ debian/patches/07_utouch-gestures.patch 2011-03-23 21:23:34 +0000 |
30 | @@ -0,0 +1,627 @@ |
31 | +--- a/configure.ac |
32 | ++++ b/configure.ac |
33 | +@@ -335,6 +335,17 @@ |
34 | + AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],false) |
35 | + fi |
36 | + |
37 | ++# **************** |
38 | ++# uTouch (optional) |
39 | ++# **************** |
40 | ++GRIP_REQUIRED=0.1.0 |
41 | ++ |
42 | ++AC_ARG_WITH([libgrip], AC_HELP_STRING([--with-libgrip], [enable libgrip support])) |
43 | ++AS_IF([test "x$with_libgrip" = "xyes"],[ |
44 | ++ PKG_CHECK_MODULES([LIBGRIP], [libgrip-0.1 >= $GRIP_REQUIRED], |
45 | ++ [AC_DEFINE(HAVE_LIBGRIP, 1, [libgrip support])]) |
46 | ++]) |
47 | ++ |
48 | + dnl Debug mode |
49 | + |
50 | + AC_ARG_ENABLE([debug], |
51 | +@@ -359,8 +370,8 @@ |
52 | + AC_SUBST(LIBDOCUMENT_CFLAGS) |
53 | + AC_SUBST(LIBDOCUMENT_LIBS) |
54 | + |
55 | +-LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS" |
56 | +-LIBVIEW_LIBS="$LIBVIEW_LIBS $GTKUNIXPRINT_LIBS -lm" |
57 | ++LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $GTKUNIXPRINT_CFLAGS $LIBGRIP_CFLAGS $DEBUG_FLAGS" |
58 | ++LIBVIEW_LIBS="$LIBVIEW_LIBS $GTKUNIXPRINT_LIBS $LIBGRIP_LIBS -lm" |
59 | + AC_SUBST(LIBVIEW_CFLAGS) |
60 | + AC_SUBST(LIBVIEW_LIBS) |
61 | + |
62 | +--- a/libview/ev-view-private.h |
63 | ++++ b/libview/ev-view-private.h |
64 | +@@ -193,6 +193,16 @@ |
65 | + |
66 | + /* Accessibility */ |
67 | + gboolean a11y_enabled; |
68 | ++ |
69 | ++#ifdef HAVE_LIBGRIP |
70 | ++ /* Gesture state */ |
71 | ++ gboolean enable_gestures; |
72 | ++ gdouble drag_start_x; |
73 | ++ gdouble drag_start_y; |
74 | ++ gdouble pinch_start_x; |
75 | ++ gdouble pinch_start_y; |
76 | ++ gdouble pinch_start_radius; |
77 | ++#endif |
78 | + }; |
79 | + |
80 | + struct _EvViewClass { |
81 | +--- a/libview/ev-view.c |
82 | ++++ b/libview/ev-view.c |
83 | +@@ -28,6 +28,10 @@ |
84 | + #include <gtk/gtk.h> |
85 | + #include <gdk/gdkkeysyms.h> |
86 | + |
87 | ++#ifdef HAVE_LIBGRIP |
88 | ++#include <libgrip/gripgesturemanager.h> |
89 | ++#endif |
90 | ++ |
91 | + #include "ev-mapping-list.h" |
92 | + #include "ev-document-forms.h" |
93 | + #include "ev-document-images.h" |
94 | +@@ -48,6 +52,13 @@ |
95 | + #define EV_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_VIEW)) |
96 | + #define EV_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_VIEW, EvViewClass)) |
97 | + |
98 | ++#ifdef HAVE_LIBGRIP |
99 | ++enum { |
100 | ++ PROP_0, |
101 | ++ PROP_ENABLE_GESTURES |
102 | ++}; |
103 | ++#endif |
104 | ++ |
105 | + enum { |
106 | + SIGNAL_BINDING_ACTIVATED, |
107 | + SIGNAL_HANDLE_LINK, |
108 | +@@ -75,6 +86,11 @@ |
109 | + #define ZOOM_IN_FACTOR 1.2 |
110 | + #define ZOOM_OUT_FACTOR (1.0/ZOOM_IN_FACTOR) |
111 | + |
112 | ++#ifdef HAVE_LIBGRIP |
113 | ++#define GESTURE_DRAG_VELOCITY 1.0 |
114 | ++#define GESTURE_ROTATE_ANGLE 1.0 |
115 | ++#endif |
116 | ++ |
117 | + #define SCROLL_TIME 150 |
118 | + |
119 | + /*** Scrolling ***/ |
120 | +@@ -140,6 +156,16 @@ |
121 | + static void hide_annotation_windows (EvView *view, |
122 | + gint page); |
123 | + /*** GtkWidget implementation ***/ |
124 | ++#ifdef HAVE_LIBGRIP |
125 | ++static void ev_view_get_property (GObject *object, |
126 | ++ guint prop_id, |
127 | ++ GValue *value, |
128 | ++ GParamSpec *param_spec); |
129 | ++static void ev_view_set_property (GObject *object, |
130 | ++ guint prop_id, |
131 | ++ const GValue *value, |
132 | ++ GParamSpec *param_spec); |
133 | ++#endif |
134 | + static void ev_view_size_request_continuous_dual_page (EvView *view, |
135 | + GtkRequisition *requisition); |
136 | + static void ev_view_size_request_continuous (EvView *view, |
137 | +@@ -277,6 +303,14 @@ |
138 | + gpointer data); |
139 | + static void ev_view_update_primary_selection (EvView *ev_view); |
140 | + |
141 | ++/*** Gestures ***/ |
142 | ++#ifdef HAVE_LIBGRIP |
143 | ++static void ev_gesture_callback (GtkWidget *widget, |
144 | ++ GripTimeType time_type, |
145 | ++ GripGestureEvent *event, |
146 | ++ gpointer user_data); |
147 | ++#endif |
148 | ++ |
149 | + G_DEFINE_TYPE (EvView, ev_view, GTK_TYPE_LAYOUT) |
150 | + |
151 | + /* HeightToPage cache */ |
152 | +@@ -2942,6 +2976,116 @@ |
153 | + return FALSE; |
154 | + } |
155 | + |
156 | ++#ifdef HAVE_LIBGRIP |
157 | ++/*** Gesture implementation ***/ |
158 | ++static void |
159 | ++ev_gesture_callback (GtkWidget *widget, |
160 | ++ GripTimeType time_type, |
161 | ++ GripGestureEvent *event, |
162 | ++ gpointer user_data) |
163 | ++{ |
164 | ++ EvView *view = EV_VIEW (widget); |
165 | ++ |
166 | ++ if (time_type == GRIP_TIME_START) { |
167 | ++ switch (event->type) { |
168 | ++ case GRIP_GESTURE_DRAG: { |
169 | ++ GripEventGestureDrag *drag = (GripEventGestureDrag *)event; |
170 | ++ |
171 | ++ view->drag_start_x = drag->position_x; |
172 | ++ view->drag_start_y = drag->position_y; |
173 | ++ |
174 | ++ break; |
175 | ++ } |
176 | ++ |
177 | ++ case GRIP_GESTURE_PINCH: { |
178 | ++ GripEventGesturePinch *pinch = (GripEventGesturePinch *)event; |
179 | ++ |
180 | ++ view->pinch_start_x = pinch->focus_x; |
181 | ++ view->pinch_start_y = pinch->focus_y; |
182 | ++ view->pinch_start_radius = pinch->radius; |
183 | ++ break; |
184 | ++ } |
185 | ++ |
186 | ++ default: |
187 | ++ break; |
188 | ++ } |
189 | ++ } else if (time_type == GRIP_TIME_END) { |
190 | ++ switch (event->type) { |
191 | ++ case GRIP_GESTURE_DRAG: { |
192 | ++ GripEventGestureDrag *drag = (GripEventGestureDrag *)event; |
193 | ++ |
194 | ++ if (drag->velocity_y >= GESTURE_DRAG_VELOCITY && |
195 | ++ drag->position_y > view->drag_start_y) { |
196 | ++ ev_view_previous_page (view); |
197 | ++ } else if (drag->velocity_y <= -GESTURE_DRAG_VELOCITY && |
198 | ++ drag->position_y < view->drag_start_y) { |
199 | ++ ev_view_next_page (view); |
200 | ++ } else if (drag->velocity_x >= GESTURE_DRAG_VELOCITY && |
201 | ++ drag->position_x > view->drag_start_x) { |
202 | ++ ev_view_previous_page (view); |
203 | ++ } else if (drag->velocity_x <= -GESTURE_DRAG_VELOCITY && |
204 | ++ drag->position_x < view->drag_start_x) { |
205 | ++ ev_view_next_page (view); |
206 | ++ } |
207 | ++ |
208 | ++ break; |
209 | ++ } |
210 | ++ |
211 | ++ case GRIP_GESTURE_ROTATE: { |
212 | ++ GripEventGestureRotate *rotate = (GripEventGestureRotate *)event; |
213 | ++ gint rotation = ev_document_model_get_rotation (view->model); |
214 | ++ |
215 | ++ if (rotate->angle >= GESTURE_ROTATE_ANGLE) { |
216 | ++ ev_document_model_set_rotation (view->model, |
217 | ++ rotation + 90); |
218 | ++ } else if (rotate->angle <= -GESTURE_ROTATE_ANGLE) { |
219 | ++ ev_document_model_set_rotation (view->model, |
220 | ++ rotation - 90); |
221 | ++ } |
222 | ++ |
223 | ++ break; |
224 | ++ } |
225 | ++ |
226 | ++ default: |
227 | ++ break; |
228 | ++ } |
229 | ++ } else { |
230 | ++ switch (event->type) { |
231 | ++ case GRIP_GESTURE_PINCH: { |
232 | ++ GripEventGesturePinch *pinch = (GripEventGesturePinch *)event; |
233 | ++ gdouble increment = pinch->radius_delta * 0.01; |
234 | ++ |
235 | ++ if (increment < 0.0) increment = -increment; |
236 | ++ increment += 1.0; |
237 | ++ |
238 | ++ if (pinch->radius_delta < 0.0) { |
239 | ++ ev_document_model_set_sizing_mode (view->model, EV_SIZING_FREE); |
240 | ++ ev_view_zoom_out_smooth (view, (1.0 / increment)); |
241 | ++ } else if (pinch->radius_delta > 0.0) { |
242 | ++ ev_document_model_set_sizing_mode (view->model, EV_SIZING_FREE); |
243 | ++ ev_view_zoom_in_smooth (view, increment); |
244 | ++ } |
245 | ++ |
246 | ++ break; |
247 | ++ } |
248 | ++ |
249 | ++ case GRIP_GESTURE_DRAG: { |
250 | ++ GripEventGestureDrag *drag = (GripEventGestureDrag *)event; |
251 | ++ |
252 | ++ if (drag->fingers == 1) { |
253 | ++ ev_view_drag (view, |
254 | ++ (gdouble)-drag->delta_x, |
255 | ++ (gdouble)-drag->delta_y); |
256 | ++ } |
257 | ++ } |
258 | ++ |
259 | ++ default: |
260 | ++ break; |
261 | ++ } |
262 | ++ } |
263 | ++} |
264 | ++#endif |
265 | ++ |
266 | + /*** GtkWidget implementation ***/ |
267 | + |
268 | + static void |
269 | +@@ -4586,6 +4730,82 @@ |
270 | + return GTK_WIDGET_CLASS (ev_view_parent_class)->get_accessible (widget); |
271 | + } |
272 | + |
273 | ++#ifdef HAVE_LIBGRIP |
274 | ++static void |
275 | ++ev_view_get_property (GObject *object, |
276 | ++ guint prop_id, |
277 | ++ GValue *value, |
278 | ++ GParamSpec *param_spec) |
279 | ++{ |
280 | ++ EvView *view = EV_VIEW (object); |
281 | ++ |
282 | ++ switch (prop_id) { |
283 | ++ case PROP_ENABLE_GESTURES: |
284 | ++ g_value_set_boolean (value, view->enable_gestures); |
285 | ++ break; |
286 | ++ |
287 | ++ default: |
288 | ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, |
289 | ++ prop_id, |
290 | ++ param_spec); |
291 | ++ } |
292 | ++} |
293 | ++ |
294 | ++static void |
295 | ++ev_view_set_property (GObject *object, |
296 | ++ guint prop_id, |
297 | ++ const GValue *value, |
298 | ++ GParamSpec *param_spec) |
299 | ++{ |
300 | ++ EvView *view = EV_VIEW (object); |
301 | ++ GtkWidget *widget; |
302 | ++ GripGestureManager *manager; |
303 | ++ |
304 | ++ switch (prop_id) { |
305 | ++ case PROP_ENABLE_GESTURES: |
306 | ++ view->enable_gestures = g_value_get_boolean (value); |
307 | ++ |
308 | ++ widget = GTK_WIDGET (view); |
309 | ++ manager = grip_gesture_manager_get (); |
310 | ++ |
311 | ++ grip_gesture_manager_register_window (manager, |
312 | ++ widget, |
313 | ++ GRIP_GESTURE_PINCH, |
314 | ++ 2, |
315 | ++ ev_gesture_callback, |
316 | ++ NULL, NULL); |
317 | ++ |
318 | ++ grip_gesture_manager_register_window (manager, |
319 | ++ widget, |
320 | ++ GRIP_GESTURE_DRAG, |
321 | ++ 2, |
322 | ++ ev_gesture_callback, |
323 | ++ NULL, NULL); |
324 | ++ |
325 | ++ grip_gesture_manager_register_window (manager, |
326 | ++ widget, |
327 | ++ GRIP_GESTURE_DRAG, |
328 | ++ 1, |
329 | ++ ev_gesture_callback, |
330 | ++ NULL, NULL); |
331 | ++ |
332 | ++ grip_gesture_manager_register_window (manager, |
333 | ++ widget, |
334 | ++ GRIP_GESTURE_ROTATE, |
335 | ++ 2, |
336 | ++ ev_gesture_callback, |
337 | ++ NULL, NULL); |
338 | ++ |
339 | ++ break; |
340 | ++ |
341 | ++ default: |
342 | ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, |
343 | ++ prop_id, |
344 | ++ param_spec); |
345 | ++ } |
346 | ++} |
347 | ++#endif |
348 | ++ |
349 | + static void |
350 | + ev_view_class_init (EvViewClass *class) |
351 | + { |
352 | +@@ -4596,6 +4816,10 @@ |
353 | + GtkBindingSet *binding_set; |
354 | + |
355 | + object_class->finalize = ev_view_finalize; |
356 | ++#ifdef HAVE_LIBGRIP |
357 | ++ object_class->get_property = ev_view_get_property; |
358 | ++ object_class->set_property = ev_view_set_property; |
359 | ++#endif |
360 | + |
361 | + widget_class->expose_event = ev_view_expose_event; |
362 | + widget_class->button_press_event = ev_view_button_press_event; |
363 | +@@ -4681,6 +4905,17 @@ |
364 | + G_TYPE_NONE, 1, |
365 | + EV_TYPE_ANNOTATION); |
366 | + |
367 | ++#ifdef HAVE_LIBGRIP |
368 | ++ g_object_class_install_property (object_class, |
369 | ++ PROP_ENABLE_GESTURES, |
370 | ++ g_param_spec_boolean ("enable-gestures", |
371 | ++ "Enable gestures", |
372 | ++ "Whether to enable gestures", |
373 | ++ FALSE, |
374 | ++ G_PARAM_WRITABLE | |
375 | ++ G_PARAM_CONSTRUCT_ONLY)); |
376 | ++#endif |
377 | ++ |
378 | + binding_set = gtk_binding_set_by_class (class); |
379 | + |
380 | + add_scroll_binding_keypad (binding_set, GDK_Left, 0, GTK_SCROLL_STEP_BACKWARD, TRUE); |
381 | +@@ -4732,6 +4967,7 @@ |
382 | + gtk_layout_set_vadjustment (GTK_LAYOUT (view), NULL); |
383 | + } |
384 | + |
385 | ++ |
386 | + /*** Callbacks ***/ |
387 | + |
388 | + static void |
389 | +@@ -4867,8 +5103,21 @@ |
390 | + view_update_range_and_current_page (view); |
391 | + } |
392 | + |
393 | ++#ifdef HAVE_LIBGRIP |
394 | ++GtkWidget* |
395 | ++ev_view_new (gboolean enable_gestures) |
396 | ++{ |
397 | ++ GtkWidget *view; |
398 | ++ |
399 | ++ view = g_object_new (EV_TYPE_VIEW, |
400 | ++ "enable-gestures", enable_gestures, |
401 | ++ NULL); |
402 | ++ |
403 | ++ return view; |
404 | ++} |
405 | ++#else |
406 | + GtkWidget* |
407 | +-ev_view_new (void) |
408 | ++ev_view_new () |
409 | + { |
410 | + GtkWidget *view; |
411 | + |
412 | +@@ -4876,6 +5125,7 @@ |
413 | + |
414 | + return view; |
415 | + } |
416 | ++#endif |
417 | + |
418 | + static void |
419 | + setup_caches (EvView *view) |
420 | +@@ -5022,6 +5272,26 @@ |
421 | + ev_view_handle_cursor_over_xy (view, x, y); |
422 | + } |
423 | + |
424 | ++#ifdef HAVE_LIBGRIP |
425 | ++void |
426 | ++ev_view_drag (EvView *view, |
427 | ++ gdouble x, |
428 | ++ gdouble y) |
429 | ++{ |
430 | ++ gdouble value; |
431 | ++ |
432 | ++ value = gtk_adjustment_get_value (view->vadjustment); |
433 | ++ value = CLAMP (value + y, 0, |
434 | ++ gtk_adjustment_get_upper (view->vadjustment) - gtk_adjustment_get_page_size (view->vadjustment)); |
435 | ++ gtk_adjustment_set_value (view->vadjustment, value); |
436 | ++ |
437 | ++ value = gtk_adjustment_get_value (view->hadjustment); |
438 | ++ value = CLAMP (value + x, 0, |
439 | ++ gtk_adjustment_get_upper (view->hadjustment) - gtk_adjustment_get_page_size (view->hadjustment)); |
440 | ++ gtk_adjustment_set_value (view->hadjustment, value); |
441 | ++} |
442 | ++#endif |
443 | ++ |
444 | + static void |
445 | + ev_view_document_changed_cb (EvDocumentModel *model, |
446 | + GParamSpec *pspec, |
447 | +@@ -5253,14 +5523,51 @@ |
448 | + return view->scale * ZOOM_OUT_FACTOR >= ev_document_model_get_min_scale (view->model); |
449 | + } |
450 | + |
451 | ++#ifdef HAVE_LIBGRIP |
452 | ++void |
453 | ++ev_view_zoom_in_smooth (EvView *view, float factor) |
454 | ++{ |
455 | ++ gdouble scale; |
456 | ++ |
457 | ++ g_return_if_fail (view->sizing_mode == EV_SIZING_FREE); |
458 | ++ |
459 | ++ view->pending_scroll = SCROLL_TO_CENTER; |
460 | ++ scale = ev_document_model_get_scale (view->model) * factor; |
461 | ++ ev_document_model_set_scale (view->model, scale); |
462 | ++} |
463 | ++ |
464 | + void |
465 | + ev_view_zoom_in (EvView *view) |
466 | + { |
467 | ++ ev_view_zoom_in_smooth (view, ZOOM_IN_FACTOR); |
468 | ++} |
469 | ++ |
470 | ++void |
471 | ++ev_view_zoom_out_smooth (EvView *view, float factor) |
472 | ++{ |
473 | + gdouble scale; |
474 | + |
475 | + g_return_if_fail (view->sizing_mode == EV_SIZING_FREE); |
476 | + |
477 | + view->pending_scroll = SCROLL_TO_CENTER; |
478 | ++ scale = ev_document_model_get_scale (view->model) * factor; |
479 | ++ ev_document_model_set_scale (view->model, scale); |
480 | ++} |
481 | ++ |
482 | ++void |
483 | ++ev_view_zoom_out (EvView *view) |
484 | ++{ |
485 | ++ ev_view_zoom_out_smooth (view, ZOOM_OUT_FACTOR); |
486 | ++} |
487 | ++#else |
488 | ++void |
489 | ++ev_view_zoom_in (EvView *view) |
490 | ++{ |
491 | ++ gdouble scale; |
492 | ++ |
493 | ++ g_return_if_fail (view->sizing_mode == EV_SIZING_FREE); |
494 | ++ |
495 | ++ view->pending_scroll = SCROLL_TO_CENTER; |
496 | + scale = ev_document_model_get_scale (view->model) * ZOOM_IN_FACTOR; |
497 | + ev_document_model_set_scale (view->model, scale); |
498 | + } |
499 | +@@ -5276,6 +5583,7 @@ |
500 | + scale = ev_document_model_get_scale (view->model) * ZOOM_OUT_FACTOR; |
501 | + ev_document_model_set_scale (view->model, scale); |
502 | + } |
503 | ++#endif |
504 | + |
505 | + static double |
506 | + zoom_for_size_fit_width (gdouble doc_width, |
507 | +--- a/libview/ev-view.h |
508 | ++++ b/libview/ev-view.h |
509 | +@@ -46,7 +46,11 @@ |
510 | + |
511 | + GType ev_view_get_type (void) G_GNUC_CONST; |
512 | + |
513 | ++#ifdef HAVE_LIBGRIP |
514 | ++GtkWidget* ev_view_new (gboolean enable_gestures); |
515 | ++#else |
516 | + GtkWidget* ev_view_new (void); |
517 | ++#endif |
518 | + void ev_view_set_model (EvView *view, |
519 | + EvDocumentModel *model); |
520 | + void ev_view_set_loading (EvView *view, |
521 | +@@ -65,8 +69,14 @@ |
522 | + /* Page size */ |
523 | + gboolean ev_view_can_zoom_in (EvView *view); |
524 | + void ev_view_zoom_in (EvView *view); |
525 | ++#ifdef HAVE_LIBGRIP |
526 | ++void ev_view_zoom_in_smooth (EvView *view, float factor); |
527 | ++#endif |
528 | + gboolean ev_view_can_zoom_out (EvView *view); |
529 | + void ev_view_zoom_out (EvView *view); |
530 | ++#ifdef HAVE_LIBGRIP |
531 | ++void ev_view_zoom_out_smooth (EvView *view, float factor); |
532 | ++#endif |
533 | + |
534 | + /* Find */ |
535 | + void ev_view_find_next (EvView *view); |
536 | +@@ -103,6 +113,13 @@ |
537 | + gint page, |
538 | + GdkRectangle *page_area, |
539 | + GtkBorder *border); |
540 | ++ |
541 | ++#ifdef HAVE_LIBGRIP |
542 | ++void ev_view_drag (EvView *view, |
543 | ++ gdouble x, |
544 | ++ gdouble y); |
545 | ++#endif |
546 | ++ |
547 | + /* Annotations */ |
548 | + void ev_view_focus_annotation (EvView *view, |
549 | + EvMapping *annot_mapping); |
550 | +--- a/previewer/ev-previewer-window.c |
551 | ++++ b/previewer/ev-previewer-window.c |
552 | +@@ -607,7 +607,11 @@ |
553 | + GTK_POLICY_AUTOMATIC, |
554 | + GTK_POLICY_AUTOMATIC); |
555 | + |
556 | ++#ifdef HAVE_LIBGRIP |
557 | ++ window->view = EV_VIEW (ev_view_new (FALSE)); |
558 | ++#else |
559 | + window->view = EV_VIEW (ev_view_new ()); |
560 | ++#endif |
561 | + g_signal_connect_object (window->view, "focus_in_event", |
562 | + G_CALLBACK (view_focus_changed), |
563 | + window, 0); |
564 | +--- a/shell/ev-application.c |
565 | ++++ b/shell/ev-application.c |
566 | +@@ -72,6 +72,10 @@ |
567 | + |
568 | + gchar *filechooser_open_uri; |
569 | + gchar *filechooser_save_uri; |
570 | ++ |
571 | ++#ifdef HAVE_LIBGRIP |
572 | ++ gboolean gestures_enabled; |
573 | ++#endif |
574 | + }; |
575 | + |
576 | + struct _EvApplicationClass { |
577 | +@@ -126,6 +130,20 @@ |
578 | + return instance; |
579 | + } |
580 | + |
581 | ++#ifdef HAVE_LIBGRIP |
582 | ++gboolean |
583 | ++ev_application_get_gestures_enabled (EvApplication *application) |
584 | ++{ |
585 | ++ return application->gestures_enabled; |
586 | ++} |
587 | ++ |
588 | ++void |
589 | ++ev_application_set_gestures_enabled (EvApplication *application, gboolean enabled) |
590 | ++{ |
591 | ++ application->gestures_enabled = enabled; |
592 | ++} |
593 | ++#endif |
594 | ++ |
595 | + /* Session */ |
596 | + gboolean |
597 | + ev_application_load_session (EvApplication *application) |
598 | +--- a/shell/ev-application.h |
599 | ++++ b/shell/ev-application.h |
600 | +@@ -81,6 +81,10 @@ |
601 | + const gchar *ev_application_get_dot_dir (EvApplication *application, |
602 | + gboolean create); |
603 | + const gchar *ev_application_get_data_dir (EvApplication *application); |
604 | ++#ifdef HAVE_LIBGRIP |
605 | ++gboolean ev_application_get_gestures_enabled (EvApplication *application); |
606 | ++void ev_application_set_gestures_enabled (EvApplication *application, gboolean enabled); |
607 | ++#endif |
608 | + |
609 | + G_END_DECLS |
610 | + |
611 | +--- a/shell/ev-window.c |
612 | ++++ b/shell/ev-window.c |
613 | +@@ -6950,7 +6950,11 @@ |
614 | + ev_window->priv->view_box); |
615 | + gtk_widget_show (ev_window->priv->view_box); |
616 | + |
617 | ++#ifdef HAVE_LIBGRIP |
618 | ++ ev_window->priv->view = ev_view_new (ev_application_get_gestures_enabled (EV_APP)); |
619 | ++#else |
620 | + ev_window->priv->view = ev_view_new (); |
621 | ++#endif |
622 | + ev_view_set_page_cache_size (EV_VIEW (ev_window->priv->view), PAGE_CACHE_SIZE); |
623 | + ev_view_set_model (EV_VIEW (ev_window->priv->view), ev_window->priv->model); |
624 | + |
625 | +--- a/shell/main.c |
626 | ++++ b/shell/main.c |
627 | +@@ -58,7 +58,9 @@ |
628 | + static gboolean unlink_temp_file = FALSE; |
629 | + static gchar *print_settings; |
630 | + static const char **file_arguments = NULL; |
631 | +- |
632 | ++#ifdef HAVE_LIBGRIP |
633 | ++static gboolean disable_gestures = FALSE; |
634 | ++#endif |
635 | + |
636 | + static gboolean |
637 | + option_version_cb (const gchar *option_name, |
638 | +@@ -82,6 +84,9 @@ |
639 | + { "find", 'l', 0, G_OPTION_ARG_STRING, &ev_find_string, N_("The word or phrase to find in the document"), N_("STRING")}, |
640 | + { "unlink-tempfile", 'u', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unlink_temp_file, NULL, NULL }, |
641 | + { "print-settings", 't', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &print_settings, NULL, NULL }, |
642 | ++#ifdef HAVE_LIBGRIP |
643 | ++ { "disable-gestures", 'g', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &disable_gestures, NULL, NULL }, |
644 | ++#endif |
645 | + { "version", 0, G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL }, |
646 | + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file_arguments, NULL, N_("[FILEā¦]") }, |
647 | + { NULL } |
648 | +@@ -312,6 +317,9 @@ |
649 | + #endif /* WITH_SMCLIENT && GDK_WINDOWING_X11 */ |
650 | + |
651 | + ev_application_load_session (EV_APP); |
652 | ++#ifdef HAVE_LIBGRIP |
653 | ++ ev_application_set_gestures_enabled (EV_APP, !disable_gestures); |
654 | ++#endif |
655 | + load_files (file_arguments); |
656 | + |
657 | + /* Change directory so we don't prevent unmounting in case the initial cwd |
658 | |
659 | === modified file 'debian/patches/series' |
660 | --- debian/patches/series 2011-02-04 17:14:42 +0000 |
661 | +++ debian/patches/series 2011-03-23 21:23:34 +0000 |
662 | @@ -4,3 +4,4 @@ |
663 | 04_gold.patch |
664 | 05_library-path.patch |
665 | 06_new_poppler_api_update.patch |
666 | +07_utouch-gestures.patch |
667 | |
668 | === modified file 'debian/rules' |
669 | --- debian/rules 2011-03-22 18:38:58 +0000 |
670 | +++ debian/rules 2011-03-23 21:23:34 +0000 |
671 | @@ -24,6 +24,7 @@ |
672 | --enable-pixbuf \ |
673 | --enable-comics \ |
674 | --enable-impress \ |
675 | + --with-libgrip \ |
676 | --enable-introspection=yes |
677 | |
678 | DEB_DH_MAKESHLIBS_ARGS += --exclude=libevince-properties-page.so |