]> www.fi.muni.cz Git - evince.git/commitdiff
Use GtkScrollType instead of EvScrollType.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 7 Sep 2008 17:20:27 +0000 (17:20 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 7 Sep 2008 17:20:27 +0000 (17:20 +0000)
2008-09-07  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-view-private.h:
* shell/ev-view.[ch]: (add_scroll_binding_keypad),
(ev_view_scroll), (ev_view_class_init):
* shell/ev-view-accessible.c:
(ev_view_accessible_action_do_action):
* shell/ev-window.c: (ev_window_cmd_scroll_forward),
(ev_window_cmd_scroll_backward):

Use GtkScrollType instead of EvScrollType.

svn path=/trunk/; revision=3162

ChangeLog
shell/ev-view-accessible.c
shell/ev-view-private.h
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c

index 9c16b3ee9b7d2d16ac7ad00e3589369d3a1d087f..4949510c50bd94532f9111ce49afba79571d25c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-09-07  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-view-private.h:
+       * shell/ev-view.[ch]: (add_scroll_binding_keypad),
+       (ev_view_scroll), (ev_view_class_init):
+       * shell/ev-view-accessible.c:
+       (ev_view_accessible_action_do_action):
+       * shell/ev-window.c: (ev_window_cmd_scroll_forward),
+       (ev_window_cmd_scroll_backward):
+
+       Use GtkScrollType instead of EvScrollType.
+       
 2008-09-07  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-page-cache.c (ev_page_cache_set_page_label):
index 25a3ac2ba28a035ae89c4b684d2e7e98d5767967..3bf28d9b9c8c291b7ab3cb03d6e955b338ce50e0 100644 (file)
@@ -54,7 +54,7 @@ typedef struct {
        /* Action */
        gchar *action_descriptions[LAST_ACTION];
        guint action_idle_handler;  
-       EvScrollType idle_scroll;        
+       GtkScrollType idle_scroll;       
 } EvViewAccessiblePriv;
 
 typedef GtkAccessibleClass EvViewAccessibleClass;
@@ -390,10 +390,10 @@ ev_view_accessible_action_do_action (AtkAction *action,
        
        switch (i) {
                case ACTION_SCROLL_UP:
-                       priv->idle_scroll = EV_SCROLL_PAGE_BACKWARD;
+                       priv->idle_scroll = GTK_SCROLL_PAGE_BACKWARD;
                        break;
                case ACTION_SCROLL_DOWN:
-                       priv->idle_scroll = EV_SCROLL_PAGE_FORWARD;
+                       priv->idle_scroll = GTK_SCROLL_PAGE_FORWARD;
                        break;
                default:
                        return FALSE;
index 547d1654111af32554edb2bffaa7e8c09067da77..0643fa876a26a981c6f4f09a869b02d709b21189 100644 (file)
@@ -186,7 +186,7 @@ struct _EvViewClass {
        GtkLayoutClass parent_class;
 
        void    (*binding_activated)      (EvView         *view,
-                                          EvScrollType   scroll,
+                                          GtkScrollType   scroll,
                                           gboolean        horizontal);
        void    (*zoom_invalid)           (EvView         *view);
        void    (*handle_link)            (EvView         *view,
index da895804da8da4bfbc5bbdaea4354a0463c11a79..1685aee823eb8c8070111dcda836083913ed187e 100644 (file)
@@ -124,7 +124,7 @@ static void       set_scroll_adjustment                      (EvView
 static void       add_scroll_binding_keypad                  (GtkBindingSet      *binding_set,
                                                              guint               keyval,
                                                              GdkModifierType modifiers,
-                                                             EvScrollType       scroll,
+                                                             GtkScrollType       scroll,
                                                              gboolean            horizontal);
 static void       ensure_rectangle_is_visible                (EvView             *view,
                                                              GdkRectangle       *rect);
@@ -574,25 +574,25 @@ static void
 add_scroll_binding_keypad (GtkBindingSet  *binding_set,
                           guint           keyval,
                           GdkModifierType modifiers,
-                          EvScrollType    scroll,
+                          GtkScrollType   scroll,
                           gboolean        horizontal)
 {
   guint keypad_keyval = keyval - GDK_Left + GDK_KP_Left;
 
   gtk_binding_entry_add_signal (binding_set, keyval, modifiers,
                                 "binding_activated", 2,
-                                EV_TYPE_SCROLL_TYPE, scroll,
+                                GTK_TYPE_SCROLL_TYPE, scroll,
                                G_TYPE_BOOLEAN, horizontal);
   gtk_binding_entry_add_signal (binding_set, keypad_keyval, modifiers,
                                 "binding_activated", 2,
-                                EV_TYPE_SCROLL_TYPE, scroll,
+                                GTK_TYPE_SCROLL_TYPE, scroll,
                                G_TYPE_BOOLEAN, horizontal);
 }
 
 void
 ev_view_scroll (EvView        *view,
-               EvScrollType   scroll,
-               gboolean horizontal)
+               GtkScrollType  scroll,
+               gboolean       horizontal)
 {
        GtkAdjustment *adjustment;
        double value, increment;
@@ -603,12 +603,12 @@ ev_view_scroll (EvView        *view,
 
        if (view->presentation || view->sizing_mode == EV_SIZING_BEST_FIT) {
                switch (scroll) {
-                       case EV_SCROLL_PAGE_BACKWARD:
-                       case EV_SCROLL_STEP_BACKWARD:
+                       case GTK_SCROLL_PAGE_BACKWARD:
+                       case GTK_SCROLL_STEP_BACKWARD:
                                ev_view_previous_page (view);
                                break;
-                       case EV_SCROLL_PAGE_FORWARD:
-                       case EV_SCROLL_STEP_FORWARD:
+                       case GTK_SCROLL_PAGE_FORWARD:
+                       case GTK_SCROLL_STEP_FORWARD:
                                ev_view_next_page (view);
                                break;
                        default:
@@ -629,7 +629,7 @@ ev_view_scroll (EvView        *view,
                last_page = TRUE;
 
        switch (scroll) {
-               case EV_SCROLL_PAGE_BACKWARD:
+               case GTK_SCROLL_PAGE_BACKWARD:
                        /* Do not jump backwards if at the first page */
                        if (value == (adjustment->lower) && first_page) {
                                /* Do nothing */
@@ -642,7 +642,7 @@ ev_view_scroll (EvView        *view,
                                value = MAX (value - increment, adjustment->lower);
                        }
                        break;
-               case EV_SCROLL_PAGE_FORWARD:
+               case GTK_SCROLL_PAGE_FORWARD:
                        /* Do not jump forward if at the last page */
                        if (value == (adjustment->upper - adjustment->page_size) && last_page) {
                                /* Do nothing */
@@ -655,16 +655,16 @@ ev_view_scroll (EvView        *view,
                                value = MIN (value + increment, adjustment->upper - adjustment->page_size);
                        }
                        break;
-               case EV_SCROLL_STEP_BACKWARD:
+               case GTK_SCROLL_STEP_BACKWARD:
                        value -= adjustment->step_increment;
                        break;
-               case EV_SCROLL_STEP_FORWARD:
+               case GTK_SCROLL_STEP_FORWARD:
                        value += adjustment->step_increment;
                        break;
-               case EV_SCROLL_STEP_DOWN:
+               case GTK_SCROLL_STEP_DOWN:
                        value -= adjustment->step_increment / 10;
                        break;
-               case EV_SCROLL_STEP_UP:
+               case GTK_SCROLL_STEP_UP:
                        value += adjustment->step_increment / 10;
                        break;
                default:
@@ -4152,22 +4152,22 @@ ev_view_class_init (EvViewClass *class)
 
        binding_set = gtk_binding_set_by_class (class);
 
-       add_scroll_binding_keypad (binding_set, GDK_Left,  0, EV_SCROLL_STEP_BACKWARD, TRUE);
-       add_scroll_binding_keypad (binding_set, GDK_Right, 0, EV_SCROLL_STEP_FORWARD,  TRUE);
-       add_scroll_binding_keypad (binding_set, GDK_Left,  GDK_MOD1_MASK, EV_SCROLL_STEP_DOWN, TRUE);
-       add_scroll_binding_keypad (binding_set, GDK_Right, GDK_MOD1_MASK, EV_SCROLL_STEP_UP,  TRUE);
-       add_scroll_binding_keypad (binding_set, GDK_Up,    0, EV_SCROLL_STEP_BACKWARD, FALSE);
-       add_scroll_binding_keypad (binding_set, GDK_Down,  0, EV_SCROLL_STEP_FORWARD,  FALSE);
-       add_scroll_binding_keypad (binding_set, GDK_Up,    GDK_MOD1_MASK, EV_SCROLL_STEP_DOWN, FALSE);
-       add_scroll_binding_keypad (binding_set, GDK_Down,  GDK_MOD1_MASK, EV_SCROLL_STEP_UP,  FALSE);
-       gtk_binding_entry_add_signal (binding_set, GDK_H, 0, "binding_activated", 2, EV_TYPE_SCROLL_TYPE,
-                                     EV_SCROLL_STEP_BACKWARD, G_TYPE_BOOLEAN, TRUE);
-       gtk_binding_entry_add_signal (binding_set, GDK_J, 0, "binding_activated", 2, EV_TYPE_SCROLL_TYPE,
-                                     EV_SCROLL_STEP_FORWARD, G_TYPE_BOOLEAN, FALSE);
-       gtk_binding_entry_add_signal (binding_set, GDK_K, 0, "binding_activated", 2, EV_TYPE_SCROLL_TYPE,
-                                     EV_SCROLL_STEP_BACKWARD, G_TYPE_BOOLEAN, FALSE);
-       gtk_binding_entry_add_signal (binding_set, GDK_L, 0, "binding_activated", 2, EV_TYPE_SCROLL_TYPE,
-                                     EV_SCROLL_STEP_FORWARD, G_TYPE_BOOLEAN, TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Left,  0, GTK_SCROLL_STEP_BACKWARD, TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Right, 0, GTK_SCROLL_STEP_FORWARD,  TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Left,  GDK_MOD1_MASK, GTK_SCROLL_STEP_DOWN, TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Right, GDK_MOD1_MASK, GTK_SCROLL_STEP_UP,  TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Up,    0, GTK_SCROLL_STEP_BACKWARD, FALSE);
+       add_scroll_binding_keypad (binding_set, GDK_Down,  0, GTK_SCROLL_STEP_FORWARD,  FALSE);
+       add_scroll_binding_keypad (binding_set, GDK_Up,    GDK_MOD1_MASK, GTK_SCROLL_STEP_DOWN, FALSE);
+       add_scroll_binding_keypad (binding_set, GDK_Down,  GDK_MOD1_MASK, GTK_SCROLL_STEP_UP,  FALSE);
+       gtk_binding_entry_add_signal (binding_set, GDK_H, 0, "binding_activated", 2, GTK_TYPE_SCROLL_TYPE,
+                                     GTK_SCROLL_STEP_BACKWARD, G_TYPE_BOOLEAN, TRUE);
+       gtk_binding_entry_add_signal (binding_set, GDK_J, 0, "binding_activated", 2, GTK_TYPE_SCROLL_TYPE,
+                                     GTK_SCROLL_STEP_FORWARD, G_TYPE_BOOLEAN, FALSE);
+       gtk_binding_entry_add_signal (binding_set, GDK_K, 0, "binding_activated", 2, GTK_TYPE_SCROLL_TYPE,
+                                     GTK_SCROLL_STEP_BACKWARD, G_TYPE_BOOLEAN, FALSE);
+       gtk_binding_entry_add_signal (binding_set, GDK_L, 0, "binding_activated", 2, GTK_TYPE_SCROLL_TYPE,
+                                     GTK_SCROLL_STEP_FORWARD, G_TYPE_BOOLEAN, TRUE);
        
 }
 
@@ -5917,25 +5917,6 @@ ev_sizing_mode_get_type (void)
   return etype;
 }
 
-GType
-ev_scroll_type_get_type (void)
-{
-  static GType etype = 0;
-  if (etype == 0) {
-    static const GEnumValue values[] = {
-      { EV_SCROLL_PAGE_FORWARD, "EV_SCROLL_PAGE_FORWARD", "scroll-page-forward" },
-      { EV_SCROLL_PAGE_BACKWARD, "EV_SCROLL_PAGE_BACKWARD", "scroll-page-backward" },
-      { EV_SCROLL_STEP_FORWARD, "EV_SCROLL_STEP_FORWARD", "scroll-step-forward" },
-      { EV_SCROLL_STEP_FORWARD, "EV_SCROLL_STEP_FORWARD", "scroll-step-forward" },
-      { EV_SCROLL_STEP_UP, "EV_SCROLL_STEP_UP", "scroll-step-up" },
-      { EV_SCROLL_STEP_DOWN, "EV_SCROLL_STEP_DOWN", "scroll-step-down" },
-      { 0, NULL, NULL }
-    };
-    etype = g_enum_register_static ("EvScrollType", values);
-  }
-  return etype;
-}
-
 void
 ev_view_update_view_size (EvView *view, GtkScrolledWindow * scrolled_window)
 {
index b6e5e8201d8fe762bbcf884199ea26febddc7877..424cecc95b04a6fd0727ed34a872b1cbe31b2635 100644 (file)
@@ -35,9 +35,6 @@ G_BEGIN_DECLS
 #define EV_TYPE_SIZING_MODE     (ev_sizing_mode_get_type())
 #define EV_SIZING_MODE_CLASS    (g_type_class_peek (EV_TYPE_SIZING_MODE))
 
-#define EV_TYPE_SCROLL_TYPE     (ev_scroll_type_get_type())
-#define EV_SCROLL_TYPE_CLASS    (g_type_class_peek (EV_TYPE_SCROLL_TYPE))
-
 typedef struct _EvView       EvView;
 typedef struct _EvViewClass  EvViewClass;
 
@@ -53,18 +50,8 @@ typedef enum {
        EV_VIEW_SELECTION_RECTANGLE,
 } EvViewSelectionMode;
 
-typedef enum {
-       EV_SCROLL_PAGE_FORWARD,
-       EV_SCROLL_PAGE_BACKWARD,
-       EV_SCROLL_STEP_BACKWARD,
-       EV_SCROLL_STEP_FORWARD,
-       EV_SCROLL_STEP_DOWN,
-       EV_SCROLL_STEP_UP,
-} EvScrollType;
-
 GType          ev_view_get_type          (void) G_GNUC_CONST;
 GType           ev_sizing_mode_get_type   (void) G_GNUC_CONST;
-GType           ev_scroll_type_get_type   (void) G_GNUC_CONST;
 
 GtkWidget*     ev_view_new               (void);
 void           ev_view_set_document      (EvView         *view,
@@ -133,7 +120,7 @@ void           ev_view_show_cursor        (EvView         *view);
 
 /* Navigation */
 void          ev_view_scroll             (EvView         *view,
-                                          EvScrollType    scroll,
+                                          GtkScrollType   scroll,
                                           gboolean        horizontal);
 void          ev_view_handle_link        (EvView         *view,
                                           EvLink         *link);
@@ -141,7 +128,8 @@ gboolean       ev_view_next_page      (EvView         *view);
 gboolean       ev_view_previous_page     (EvView         *view);
 gchar*         ev_view_page_label_from_dest (EvView *view, EvLinkDest *dest);
 
-void           ev_view_update_view_size (EvView *view, GtkScrolledWindow *scrolled_window);
+void           ev_view_update_view_size   (EvView            *view,
+                                          GtkScrolledWindow *scrolled_window);
 
 void          ev_view_autoscroll_start   (EvView *view);
 void           ev_view_autoscroll_stop    (EvView *view);
index df3c17cefd54c002a8ddba6756769bcb87668c71..9f27479c7f6c496228344c2538b4fcbe194eac66 100644 (file)
@@ -2624,13 +2624,13 @@ ev_window_cmd_focus_page_selector (GtkAction *act, EvWindow *window)
 static void
 ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window)
 {
-       ev_view_scroll (EV_VIEW (window->priv->view), EV_SCROLL_PAGE_FORWARD, FALSE);
+       ev_view_scroll (EV_VIEW (window->priv->view), GTK_SCROLL_PAGE_FORWARD, FALSE);
 }
 
 static void
 ev_window_cmd_scroll_backward (GtkAction *action, EvWindow *window)
 {
-       ev_view_scroll (EV_VIEW (window->priv->view), EV_SCROLL_PAGE_BACKWARD, FALSE);
+       ev_view_scroll (EV_VIEW (window->priv->view), GTK_SCROLL_PAGE_BACKWARD, FALSE);
 }
 
 static void
@@ -4143,7 +4143,9 @@ find_bar_visibility_changed_cb (EggFindBar *find_bar,
 }
 
 static void
-find_bar_scroll(EggFindBar *find_bar, GtkScrollType scroll, EvWindow* ev_window)
+find_bar_scroll (EggFindBar   *find_bar,
+                GtkScrollType scroll,
+                EvWindow     *ev_window)
 {
        ev_view_scroll (EV_VIEW (ev_window->priv->view), scroll, FALSE);
 }