[gnome-initial-setup] gis-assistant-gd: Use the new slide transitions in libgd



commit 26f5dee4906b1453b1d720eac73577c6380d5d4f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 26 18:25:08 2013 -0500

    gis-assistant-gd: Use the new slide transitions in libgd

 gnome-initial-setup/gis-assistant-gd.c  |   20 ++++++++++++++++++--
 gnome-initial-setup/gis-assistant-gtk.c |    5 +++--
 gnome-initial-setup/gis-assistant.c     |   10 ++++++----
 gnome-initial-setup/gis-assistant.h     |    7 ++++++-
 libgd                                   |    2 +-
 5 files changed, 34 insertions(+), 10 deletions(-)
---
diff --git a/gnome-initial-setup/gis-assistant-gd.c b/gnome-initial-setup/gis-assistant-gd.c
index e32b1af..368605b 100644
--- a/gnome-initial-setup/gis-assistant-gd.c
+++ b/gnome-initial-setup/gis-assistant-gd.c
@@ -51,10 +51,26 @@ current_page_changed (GObject    *gobject,
 }
 
 static void
-gis_assistant_gd_switch_to (GisAssistant *assistant,
-                            GisPage      *page)
+gis_assistant_gd_switch_to (GisAssistant          *assistant,
+                            GisAssistantDirection  direction,
+                            GisPage               *page)
 {
   GisAssistantGdPrivate *priv = GIS_ASSISTANT_GD (assistant)->priv;
+  GdStackTransitionType transition_type;
+
+  switch (direction) {
+  case GIS_ASSISTANT_NEXT:
+    transition_type = GD_STACK_TRANSITION_TYPE_SLIDE_LEFT;
+    break;
+  case GIS_ASSISTANT_PREV:
+    transition_type = GD_STACK_TRANSITION_TYPE_SLIDE_RIGHT;
+    break;
+  default:
+    g_assert_not_reached ();
+  }
+
+  gd_stack_set_transition_type (GD_STACK (priv->stack), transition_type);
+
   gd_stack_set_visible_child (GD_STACK (priv->stack),
                               GTK_WIDGET (page));
 }
diff --git a/gnome-initial-setup/gis-assistant-gtk.c b/gnome-initial-setup/gis-assistant-gtk.c
index 2d9af59..aac3f99 100644
--- a/gnome-initial-setup/gis-assistant-gtk.c
+++ b/gnome-initial-setup/gis-assistant-gtk.c
@@ -49,8 +49,9 @@ current_page_changed (GtkNotebook  *notebook,
 }
 
 static void
-gis_assistant_gtk_switch_to (GisAssistant *assistant,
-                             GisPage      *page)
+gis_assistant_gtk_switch_to (GisAssistant          *assistant,
+                             GisAssistantDirection  direction,
+                             GisPage               *page)
 {
   GisAssistantGtkPrivate *priv = GIS_ASSISTANT_GTK (assistant)->priv;
   gint page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook),
diff --git a/gnome-initial-setup/gis-assistant.c b/gnome-initial-setup/gis-assistant.c
index a6ab465..a7726ea 100644
--- a/gnome-initial-setup/gis-assistant.c
+++ b/gnome-initial-setup/gis-assistant.c
@@ -84,9 +84,11 @@ widget_destroyed (GtkWidget    *widget,
 }
 
 static void
-gis_assistant_switch_to (GisAssistant *assistant, GisPage *page)
+gis_assistant_switch_to (GisAssistant          *assistant,
+                         GisAssistantDirection  direction,
+                         GisPage               *page)
 {
-  GIS_ASSISTANT_GET_CLASS (assistant)->switch_to (assistant, page);
+  GIS_ASSISTANT_GET_CLASS (assistant)->switch_to (assistant, direction, page);
 }
 
 void
@@ -117,7 +119,7 @@ static void
 gis_assistant_real_next_page (GisAssistant *assistant,
                               GisPage      *page)
 {
-  gis_assistant_switch_to (assistant, find_next_page (page));
+  gis_assistant_switch_to (assistant, GIS_ASSISTANT_NEXT, find_next_page (page));
 }
 
 static GisPage *
@@ -135,7 +137,7 @@ gis_assistant_previous_page (GisAssistant *assistant)
 {
   GisAssistantPrivate *priv = assistant->priv;
   g_return_if_fail (priv->current_page != NULL);
-  gis_assistant_switch_to (assistant, find_prev_page (priv->current_page));
+  gis_assistant_switch_to (assistant, GIS_ASSISTANT_PREV, find_prev_page (priv->current_page));
 }
 
 static void
diff --git a/gnome-initial-setup/gis-assistant.h b/gnome-initial-setup/gis-assistant.h
index 8e28d3c..4d8589c 100644
--- a/gnome-initial-setup/gis-assistant.h
+++ b/gnome-initial-setup/gis-assistant.h
@@ -39,6 +39,11 @@ typedef struct _GisAssistant        GisAssistant;
 typedef struct _GisAssistantClass   GisAssistantClass;
 typedef struct _GisAssistantPrivate GisAssistantPrivate;
 
+typedef enum {
+  GIS_ASSISTANT_PREV,
+  GIS_ASSISTANT_NEXT,
+} GisAssistantDirection;
+
 struct _GisAssistant
 {
   GtkBox parent;
@@ -53,7 +58,7 @@ struct _GisAssistantClass
   void (* prepare) (GisAssistant *assistant, GisPage *page);
   void (* next_page) (GisAssistant *assistant, GisPage *page);
 
-  void (* switch_to) (GisAssistant *assistant, GisPage *page);
+  void (* switch_to) (GisAssistant *assistant, GisAssistantDirection direction, GisPage *page);
   void (* add_page) (GisAssistant *assistant, GisPage *page);
 };
 
diff --git a/libgd b/libgd
index 0d817b0..d7ab27d 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit 0d817b002d6c782cb6d0db8ca6a69312cf1293eb
+Subproject commit d7ab27d2b05a4455c8be0c6cd6e24b10ca1277c2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]