Merge lp:~bratsche/oif/eog-rotate-gesture-2 into lp:~oif-team/oif/eog-gestures-trunk

Proposed by Cody Russell
Status: Merged
Merged at revision: 117
Proposed branch: lp:~bratsche/oif/eog-rotate-gesture-2
Merge into: lp:~oif-team/oif/eog-gestures-trunk
Diff against target: 93 lines (+43/-1)
2 files modified
debian/control (+1/-1)
src/eog-window.c (+42/-0)
To merge this branch: bzr merge lp:~bratsche/oif/eog-rotate-gesture-2
Reviewer Review Type Date Requested Status
Henrik Rydberg (community) Needs Fixing
Stephen M. Webb (community) Approve
Review via email: mp+45433@code.launchpad.net

Description of the change

Aha, it was trying to merge into the wrong branch. That's what was causing these ridiculous diffs. Sorry. :)

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

I would suggest using a constant instead of hard-coded 1.0 in "rotate->angle >= 1.0" and "rotate->angle <= -1.0" so they can be tweaked a little easier when we figure out better threshold values, and so they can be a little more self-documenting.

Other than that, this change looks clean.

review: Approve
Revision history for this message
Henrik Rydberg (rydberg) wrote :

I agree with Stephens comments, but would rather put that as needs fixing.

review: Needs Fixing
117. By Cody Russell

Add #define for the angles.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2011-01-05 16:12:48 +0000
+++ debian/control 2011-01-07 15:29:26 +0000
@@ -20,7 +20,7 @@
20 gnome-doc-utils,20 gnome-doc-utils,
21 libgtk2.0-dev (>= 2.18),21 libgtk2.0-dev (>= 2.18),
22 libglib2.0-dev (>= 2.25.9),22 libglib2.0-dev (>= 2.25.9),
23 libgrip-0.1-0-dev (>= 0.1.1),23 libgrip-0.1-dev (>= 0.1.1),
24 librsvg2-dev,24 librsvg2-dev,
25 libgnome-desktop-dev (>= 2.25.1),25 libgnome-desktop-dev (>= 2.25.1),
26 libgconf2-dev (>= 2.6.1-2),26 libgconf2-dev (>= 2.6.1-2),
2727
=== modified file 'src/eog-window.c'
--- src/eog-window.c 2010-09-20 13:04:27 +0000
+++ src/eog-window.c 2011-01-07 15:29:26 +0000
@@ -67,6 +67,7 @@
67#include <gio/gdesktopappinfo.h>67#include <gio/gdesktopappinfo.h>
68#include <gtk/gtk.h>68#include <gtk/gtk.h>
69#include <gconf/gconf-client.h>69#include <gconf/gconf-client.h>
70#include <libgrip/gripgesturemanager.h>
70#include <launchpad-integration.h>71#include <launchpad-integration.h>
7172
72#if HAVE_LCMS73#if HAVE_LCMS
@@ -98,6 +99,9 @@
9899
99#define EOG_WALLPAPER_FILENAME "eog-wallpaper"100#define EOG_WALLPAPER_FILENAME "eog-wallpaper"
100101
102#define EOG_GESTURE_ROTATE_CW_ANGLE 1.0
103#define EOG_GESTURE_ROTATE_CCW_ANGLE -1.0
104
101#define is_rtl (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)105#define is_rtl (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
102106
103typedef enum {107typedef enum {
@@ -4504,6 +4508,34 @@
4504}4508}
45054509
4506static void4510static void
4511eog_window_gesture_event (GtkWidget *widget,
4512 GripTimeType time_type,
4513 GripGestureEvent *event,
4514 gpointer user_data)
4515{
4516 if (time_type == GRIP_TIME_END) {
4517 switch (event->type) {
4518 case GRIP_GESTURE_ROTATE: {
4519 GripEventGestureRotate *rotate = (GripEventGestureRotate *)event;
4520
4521 if (rotate->angle >= EOG_GESTURE_ROTATE_CW_ANGLE) {
4522 apply_transformation (EOG_WINDOW (user_data),
4523 eog_transform_rotate_new (90));
4524 } else if (rotate->angle <= EOG_GESTURE_ROTATE_CCW_ANGLE) {
4525 apply_transformation (EOG_WINDOW (user_data),
4526 eog_transform_rotate_new (270));
4527 }
4528
4529 break;
4530 }
4531
4532 default:
4533 break;
4534 }
4535 }
4536}
4537
4538static void
4507eog_window_construct_ui (EogWindow *window)4539eog_window_construct_ui (EogWindow *window)
4508{4540{
4509 EogWindowPrivate *priv;4541 EogWindowPrivate *priv;
@@ -4518,6 +4550,8 @@
45184550
4519 GConfEntry *entry;4551 GConfEntry *entry;
45204552
4553 GripGestureManager *manager;
4554
4521 g_return_if_fail (EOG_IS_WINDOW (window));4555 g_return_if_fail (EOG_IS_WINDOW (window));
45224556
4523 priv = window->priv;4557 priv = window->priv;
@@ -4710,6 +4744,14 @@
4710 G_CALLBACK (view_zoom_changed_cb),4744 G_CALLBACK (view_zoom_changed_cb),
4711 window);4745 window);
47124746
4747 manager = grip_gesture_manager_get ();
4748 grip_gesture_manager_register_window (manager,
4749 priv->view,
4750 GRIP_GESTURE_ROTATE,
4751 2,
4752 eog_window_gesture_event,
4753 window, NULL);
4754
4713 view_popup = gtk_ui_manager_get_widget (priv->ui_mgr, "/ViewPopup");4755 view_popup = gtk_ui_manager_get_widget (priv->ui_mgr, "/ViewPopup");
4714 eog_scroll_view_set_popup (EOG_SCROLL_VIEW (priv->view),4756 eog_scroll_view_set_popup (EOG_SCROLL_VIEW (priv->view),
4715 GTK_MENU (view_popup));4757 GTK_MENU (view_popup));

Subscribers

People subscribed via source and target branches