]> Pileus Git - ~andy/gtk/commitdiff
Deprecate GtkNotebookPage as used in switch-page
authorChristian Dywan <christian@twotoasts.de>
Tue, 13 Jul 2010 14:49:53 +0000 (16:49 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 13 Jul 2010 14:49:53 +0000 (16:49 +0200)
Fixes: 618327
gtk/gtknotebook.c
gtk/gtknotebook.h
modules/other/gail/gailnotebookpage.h
tests/testgtk.c

index e9810b5a79166b6e09fcd23963075ad88d9dddc3..bb4650ec9fcfcc78636a0c71878ab6bf3171d37b 100644 (file)
@@ -398,7 +398,7 @@ static void gtk_notebook_calc_tabs           (GtkNotebook      *notebook,
 
 /*** GtkNotebook Page Switch Methods ***/
 static void gtk_notebook_real_switch_page    (GtkNotebook      *notebook,
-                                             GtkNotebookPage  *page,
+                                             GtkNotebookPage  *child,
                                              guint             page_num);
 
 /*** GtkNotebook Page Switch Functions ***/
@@ -6019,12 +6019,14 @@ gtk_notebook_update_tab_states (GtkNotebook *notebook)
  */
 static void
 gtk_notebook_real_switch_page (GtkNotebook     *notebook,
-                              GtkNotebookPage *page,
+                              GtkNotebookPage* child,
                               guint            page_num)
 {
+  GList *list = gtk_notebook_find_child (notebook, GTK_WIDGET (child), NULL);
+  GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (list);
   gboolean child_has_focus;
 
-  if (notebook->cur_page == page || !gtk_widget_get_visible (page->child))
+  if (notebook->cur_page == page || !gtk_widget_get_visible (GTK_WIDGET (child)))
     return;
 
   /* save the value here, changing visibility changes focus */
@@ -6082,7 +6084,7 @@ gtk_notebook_switch_page (GtkNotebook     *notebook,
   g_signal_emit (notebook,
                 notebook_signals[SWITCH_PAGE],
                 0,
-                page,
+                page->child,
                 page_num);
 }
 
index 97128b8467db1317d1327aadcefb2f00f95cc260..0f8dec401d488c5c6034c58e4e1c596fc2ba9ab9 100644 (file)
@@ -54,13 +54,19 @@ typedef enum
 
 typedef struct _GtkNotebook       GtkNotebook;
 typedef struct _GtkNotebookClass  GtkNotebookClass;
+#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
 typedef struct _GtkNotebookPage   GtkNotebookPage;
+#endif
 
 struct _GtkNotebook
 {
   GtkContainer container;
   
+#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
   GtkNotebookPage *GSEAL (cur_page);
+#else
+  gpointer GSEAL (cur_page);
+#endif
   GList *GSEAL (children);
   GList *GSEAL (first_tab);            /* The first tab visible (for scrolling notebooks) */
   GList *GSEAL (focus_tab);
@@ -97,7 +103,11 @@ struct _GtkNotebookClass
   GtkContainerClass parent_class;
 
   void (* switch_page)       (GtkNotebook     *notebook,
+#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
                               GtkNotebookPage *page,
+#else
+                              gpointer         page,
+#endif
                              guint            page_num);
 
   /* Action signals for keybindings */
index 38e2acfb88ecb11d0dac41db9d5d17e802794779..27778ce292afc63362a370c14c9db19042567326 100644 (file)
@@ -40,7 +40,11 @@ struct _GailNotebookPage
   AtkObject parent;
 
   GtkNotebook *notebook;
+#ifndef GTK_DISABLE_DEPRECATED
   GtkNotebookPage *page;
+#else
+  gpointer page;
+#endif
   
   gint index;
   guint notify_child_added_id;
index 0a3161b6b99b2424b6b020ba8ca0b00fd5a258d4..5751632cf1e57a089e6496924e92de14a1e6ceb1 100644 (file)
@@ -6681,7 +6681,7 @@ set_page_image (GtkNotebook *notebook, gint page_num, GdkPixbuf *pixbuf)
 }
 
 static void
-page_switch (GtkWidget *widget, GtkNotebookPage *page, gint page_num)
+page_switch (GtkWidget *widget, gpointer *page, gint page_num)
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
   gint old_page_num = gtk_notebook_get_current_page (notebook);