]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtknotebook.c
GtkWindow: Add gtk_window_has_group()
[~andy/gtk] / gtk / gtknotebook.c
index db873ce4e71d89c7d79e85f11616e41149ef47c7..bb528fdf070cc68952746a5e4de1b37d72ca0472 100644 (file)
@@ -105,14 +105,9 @@ enum {
   PROP_SHOW_TABS,
   PROP_SHOW_BORDER,
   PROP_SCROLLABLE,
-  PROP_TAB_BORDER,
-  PROP_TAB_HBORDER,
-  PROP_TAB_VBORDER,
   PROP_PAGE,
   PROP_ENABLE_POPUP,
-  PROP_GROUP_ID,
   PROP_GROUP,
-  PROP_HOMOGENEOUS
 };
 
 enum {
@@ -417,15 +412,6 @@ static void gtk_notebook_menu_detacher       (GtkWidget        *widget,
                                              GtkMenu          *menu);
 
 /*** GtkNotebook Private Setters ***/
-static void gtk_notebook_set_homogeneous_tabs_internal (GtkNotebook *notebook,
-                                                       gboolean     homogeneous);
-static void gtk_notebook_set_tab_border_internal       (GtkNotebook *notebook,
-                                                       guint        border_width);
-static void gtk_notebook_set_tab_hborder_internal      (GtkNotebook *notebook,
-                                                       guint        tab_hborder);
-static void gtk_notebook_set_tab_vborder_internal      (GtkNotebook *notebook,
-                                                       guint        tab_vborder);
-
 static void gtk_notebook_update_tab_states             (GtkNotebook *notebook);
 static gboolean gtk_notebook_mnemonic_activate_switch_page (GtkWidget *child,
                                                            gboolean overload,
@@ -596,33 +582,6 @@ gtk_notebook_class_init (GtkNotebookClass *class)
                                                      GTK_TYPE_POSITION_TYPE,
                                                      GTK_POS_TOP,
                                                      GTK_PARAM_READWRITE));
-  g_object_class_install_property (gobject_class,
-                                  PROP_TAB_BORDER,
-                                  g_param_spec_uint ("tab-border",
-                                                     P_("Tab Border"),
-                                                     P_("Width of the border around the tab labels"),
-                                                     0,
-                                                     G_MAXUINT,
-                                                     2,
-                                                     GTK_PARAM_WRITABLE));
-  g_object_class_install_property (gobject_class,
-                                  PROP_TAB_HBORDER,
-                                  g_param_spec_uint ("tab-hborder",
-                                                     P_("Horizontal Tab Border"),
-                                                     P_("Width of the horizontal border of tab labels"),
-                                                     0,
-                                                     G_MAXUINT,
-                                                     2,
-                                                     GTK_PARAM_READWRITE));
-  g_object_class_install_property (gobject_class,
-                                  PROP_TAB_VBORDER,
-                                  g_param_spec_uint ("tab-vborder",
-                                                     P_("Vertical Tab Border"),
-                                                     P_("Width of the vertical border of tab labels"),
-                                                     0,
-                                                     G_MAXUINT,
-                                                     2,
-                                                     GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_SHOW_TABS,
                                   g_param_spec_boolean ("show-tabs",
@@ -651,22 +610,6 @@ gtk_notebook_class_init (GtkNotebookClass *class)
                                                         P_("If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page"),
                                                         FALSE,
                                                         GTK_PARAM_READWRITE));
-  g_object_class_install_property (gobject_class,
-                                  PROP_HOMOGENEOUS,
-                                  g_param_spec_boolean ("homogeneous",
-                                                        P_("Homogeneous"),
-                                                        P_("Whether tabs should have homogeneous sizes"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE));
-  g_object_class_install_property (gobject_class,
-                                  PROP_GROUP_ID,
-                                  g_param_spec_int ("group-id",
-                                                    P_("Group ID"),
-                                                    P_("Group ID for tabs drag and drop"),
-                                                    -1,
-                                                    G_MAXINT,
-                                                    -1,
-                                                    GTK_PARAM_READWRITE));
 
   /**
    * GtkNotebook:group:
@@ -1071,8 +1014,8 @@ gtk_notebook_init (GtkNotebook *notebook)
 {
   GtkNotebookPrivate *priv;
 
-  GTK_WIDGET_SET_FLAGS (notebook, GTK_CAN_FOCUS);
-  GTK_WIDGET_SET_FLAGS (notebook, GTK_NO_WINDOW);
+  gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
+  gtk_widget_set_has_window (GTK_WIDGET (notebook), FALSE);
 
   priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
 
@@ -1530,27 +1473,12 @@ gtk_notebook_set_property (GObject         *object,
       else
        gtk_notebook_popup_disable (notebook);
       break;
-    case PROP_HOMOGENEOUS:
-      gtk_notebook_set_homogeneous_tabs_internal (notebook, g_value_get_boolean (value));
-      break;  
     case PROP_PAGE:
       gtk_notebook_set_current_page (notebook, g_value_get_int (value));
       break;
     case PROP_TAB_POS:
       gtk_notebook_set_tab_pos (notebook, g_value_get_enum (value));
       break;
-    case PROP_TAB_BORDER:
-      gtk_notebook_set_tab_border_internal (notebook, g_value_get_uint (value));
-      break;
-    case PROP_TAB_HBORDER:
-      gtk_notebook_set_tab_hborder_internal (notebook, g_value_get_uint (value));
-      break;
-    case PROP_TAB_VBORDER:
-      gtk_notebook_set_tab_vborder_internal (notebook, g_value_get_uint (value));
-      break;
-    case PROP_GROUP_ID:
-      gtk_notebook_set_group_id (notebook, g_value_get_int (value));
-      break;
     case PROP_GROUP:
       gtk_notebook_set_group (notebook, g_value_get_pointer (value));
       break;
@@ -1586,24 +1514,12 @@ gtk_notebook_get_property (GObject         *object,
     case PROP_ENABLE_POPUP:
       g_value_set_boolean (value, notebook->menu != NULL);
       break;
-    case PROP_HOMOGENEOUS:
-      g_value_set_boolean (value, notebook->homogeneous);
-      break;
     case PROP_PAGE:
       g_value_set_int (value, gtk_notebook_get_current_page (notebook));
       break;
     case PROP_TAB_POS:
       g_value_set_enum (value, notebook->tab_pos);
       break;
-    case PROP_TAB_HBORDER:
-      g_value_set_uint (value, notebook->tab_hborder);
-      break;
-    case PROP_TAB_VBORDER:
-      g_value_set_uint (value, notebook->tab_vborder);
-      break;
-    case PROP_GROUP_ID:
-      g_value_set_int (value, gtk_notebook_get_group_id (notebook));
-      break;
     case PROP_GROUP:
       g_value_set_pointer (value, priv->group);
       break;
@@ -1655,7 +1571,7 @@ gtk_notebook_get_event_window_position (GtkNotebook  *notebook,
   for (tmp_list = notebook->children; tmp_list; tmp_list = tmp_list->next)
     {
       GtkNotebookPage *page = tmp_list->data;
-      if (GTK_WIDGET_VISIBLE (page->child))
+      if (gtk_widget_get_visible (page->child))
        {
          visible_page = page;
          break;
@@ -1682,7 +1598,7 @@ gtk_notebook_get_event_window_position (GtkNotebook  *notebook,
               for (i = 0; i < N_ACTION_WIDGETS; i++)
                 {
                   if (priv->action_widget[i] &&
-                      GTK_WIDGET_VISIBLE (priv->action_widget[i]))
+                      gtk_widget_get_visible (priv->action_widget[i]))
                     {
                       rectangle->width -= priv->action_widget[i]->allocation.width;
                       if ((!is_rtl && i == ACTION_WIDGET_START) ||
@@ -1701,7 +1617,7 @@ gtk_notebook_get_event_window_position (GtkNotebook  *notebook,
               for (i = 0; i < N_ACTION_WIDGETS; i++)
                 {
                   if (priv->action_widget[i] &&
-                      GTK_WIDGET_VISIBLE (priv->action_widget[i]))
+                      gtk_widget_get_visible (priv->action_widget[i]))
                     {
                       rectangle->height -= priv->action_widget[i]->allocation.height;
 
@@ -1736,22 +1652,22 @@ gtk_notebook_map (GtkWidget *widget)
   GList *children;
   gint i;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, TRUE);
 
   notebook = GTK_NOTEBOOK (widget);
   priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
 
   if (notebook->cur_page &&
-      GTK_WIDGET_VISIBLE (notebook->cur_page->child) &&
-      !GTK_WIDGET_MAPPED (notebook->cur_page->child))
+      gtk_widget_get_visible (notebook->cur_page->child) &&
+      !gtk_widget_get_mapped (notebook->cur_page->child))
     gtk_widget_map (notebook->cur_page->child);
 
   for (i = 0; i < N_ACTION_WIDGETS; i++)
     {
       if (priv->action_widget[i] &&
-          GTK_WIDGET_VISIBLE (priv->action_widget[i]) &&
+          gtk_widget_get_visible (priv->action_widget[i]) &&
           GTK_WIDGET_CHILD_VISIBLE (priv->action_widget[i]) &&
-          !GTK_WIDGET_MAPPED (priv->action_widget[i]))
+          !gtk_widget_get_mapped (priv->action_widget[i]))
         gtk_widget_map (priv->action_widget[i]);
     }
 
@@ -1767,8 +1683,8 @@ gtk_notebook_map (GtkWidget *widget)
          children = children->next;
 
          if (page->tab_label &&
-             GTK_WIDGET_VISIBLE (page->tab_label) &&
-             !GTK_WIDGET_MAPPED (page->tab_label))
+             gtk_widget_get_visible (page->tab_label) &&
+             !gtk_widget_get_mapped (page->tab_label))
            gtk_widget_map (page->tab_label);
        }
     }
@@ -1782,7 +1698,7 @@ gtk_notebook_unmap (GtkWidget *widget)
 {
   stop_scrolling (GTK_NOTEBOOK (widget));
   
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+  gtk_widget_set_mapped (widget, FALSE);
 
   gdk_window_hide (GTK_NOTEBOOK (widget)->event_window);
 
@@ -1798,7 +1714,8 @@ gtk_notebook_realize (GtkWidget *widget)
   GdkRectangle event_window_pos;
 
   notebook = GTK_NOTEBOOK (widget);
-  GTK_WIDGET_SET_FLAGS (notebook, GTK_REALIZED);
+
+  gtk_widget_set_realized (widget, TRUE);
 
   gtk_notebook_get_event_window_position (notebook, &event_window_pos);
   
@@ -1884,7 +1801,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
     {
       page = children->data;
 
-      if (GTK_WIDGET_VISIBLE (page->child))
+      if (gtk_widget_get_visible (page->child))
        {
          vis_pages++;
          gtk_widget_size_request (page->child, &child_requisition);
@@ -1895,7 +1812,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
                                            child_requisition.height);
 
          if (notebook->menu && page->menu_label->parent &&
-             !GTK_WIDGET_VISIBLE (page->menu_label->parent))
+             !gtk_widget_get_visible (page->menu_label->parent))
            gtk_widget_show (page->menu_label->parent);
        }
       else
@@ -1903,7 +1820,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
          if (page == notebook->cur_page)
            switch_page = TRUE;
          if (notebook->menu && page->menu_label->parent &&
-             GTK_WIDGET_VISIBLE (page->menu_label->parent))
+             gtk_widget_get_visible (page->menu_label->parent))
            gtk_widget_hide (page->menu_label->parent);
        }
     }
@@ -1928,9 +1845,9 @@ gtk_notebook_size_request (GtkWidget      *widget,
            {
              page = children->data;
              
-             if (GTK_WIDGET_VISIBLE (page->child))
+             if (gtk_widget_get_visible (page->child))
                {
-                 if (!GTK_WIDGET_VISIBLE (page->tab_label))
+                 if (!gtk_widget_get_visible (page->tab_label))
                    gtk_widget_show (page->tab_label);
 
                  gtk_widget_size_request (page->tab_label,
@@ -1961,7 +1878,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
                      break;
                    }
                }
-             else if (GTK_WIDGET_VISIBLE (page->tab_label))
+             else if (gtk_widget_get_visible (page->tab_label))
                gtk_widget_hide (page->tab_label);
            }
 
@@ -2001,7 +1918,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
                      page = children->data;
                      children = children->next;
                  
-                     if (!GTK_WIDGET_VISIBLE (page->child))
+                     if (!gtk_widget_get_visible (page->child))
                        continue;
 
                      if (notebook->homogeneous)
@@ -2051,7 +1968,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
                      page = children->data;
                      children = children->next;
 
-                     if (!GTK_WIDGET_VISIBLE (page->child))
+                     if (!gtk_widget_get_visible (page->child))
                        continue;
 
                      page->requisition.width = tab_width;
@@ -2097,7 +2014,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
            {
              page = children->data;
              
-             if (page->tab_label && GTK_WIDGET_VISIBLE (page->tab_label))
+             if (page->tab_label && gtk_widget_get_visible (page->tab_label))
                gtk_widget_hide (page->tab_label);
            }
        }
@@ -2114,14 +2031,14 @@ gtk_notebook_size_request (GtkWidget      *widget,
               children = children->next)
            {
              page = children->data;
-             if (GTK_WIDGET_VISIBLE (page->child))
+             if (gtk_widget_get_visible (page->child))
                {
                  gtk_notebook_switch_page (notebook, page);
                  break;
                }
            }
        }
-      else if (GTK_WIDGET_VISIBLE (widget))
+      else if (gtk_widget_get_visible (widget))
        {
          widget->requisition.width = GTK_CONTAINER (widget)->border_width * 2;
          widget->requisition.height= GTK_CONTAINER (widget)->border_width * 2;
@@ -2151,7 +2068,7 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
   gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
   
   widget->allocation = *allocation;
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtk_widget_get_realized (widget))
     {
       GdkRectangle position;
 
@@ -2160,7 +2077,7 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
          gdk_window_move_resize (notebook->event_window,
                                  position.x, position.y,
                                  position.width, position.height);
-         if (GTK_WIDGET_MAPPED (notebook))
+         if (gtk_widget_get_mapped (GTK_WIDGET (notebook)))
            gdk_window_show_unraised (notebook->event_window);
        }
       else
@@ -2266,7 +2183,7 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
          page = children->data;
          children = children->next;
          
-         if (GTK_WIDGET_VISIBLE (page->child))
+         if (gtk_widget_get_visible (page->child))
            gtk_widget_size_allocate (page->child, &child_allocation);
        }
 
@@ -2508,7 +2425,7 @@ gtk_notebook_arrow_button_press (GtkNotebook      *notebook,
   gboolean left = (ARROW_IS_LEFT (arrow) && !is_rtl) || 
                   (!ARROW_IS_LEFT (arrow) && is_rtl);
 
-  if (!GTK_WIDGET_HAS_FOCUS (widget))
+  if (!gtk_widget_has_focus (widget))
     gtk_widget_grab_focus (widget);
   
   notebook->button = button;
@@ -2618,8 +2535,8 @@ get_tab_at_pos (GtkNotebook *notebook, gint x, gint y)
     {
       page = children->data;
       
-      if (GTK_WIDGET_VISIBLE (page->child) &&
-         page->tab_label && GTK_WIDGET_MAPPED (page->tab_label) &&
+      if (gtk_widget_get_visible (page->child) &&
+         page->tab_label && gtk_widget_get_mapped (page->tab_label) &&
          (x >= page->allocation.x) &&
          (y >= page->allocation.y) &&
          (x <= (page->allocation.x + page->allocation.width)) &&
@@ -2790,9 +2707,9 @@ get_drop_position (GtkNotebook *notebook,
       page = children->data;
 
       if ((priv->operation != DRAG_OPERATION_REORDER || page != notebook->cur_page) &&
-         GTK_WIDGET_VISIBLE (page->child) &&
+         gtk_widget_get_visible (page->child) &&
          page->tab_label &&
-         GTK_WIDGET_MAPPED (page->tab_label) &&
+         gtk_widget_get_mapped (page->tab_label) &&
          page->pack == pack)
        {
          switch (notebook->tab_pos)
@@ -2834,7 +2751,8 @@ get_drop_position (GtkNotebook *notebook,
 static void
 show_drag_window (GtkNotebook        *notebook,
                  GtkNotebookPrivate *priv,
-                 GtkNotebookPage    *page)
+                 GtkNotebookPage    *page,
+                  GdkDevice          *device)
 {
   GtkWidget *widget = GTK_WIDGET (notebook);
 
@@ -2869,10 +2787,10 @@ show_drag_window (GtkNotebook        *notebook,
   gdk_window_show (priv->drag_window);
 
   /* the grab will dissapear when the window is hidden */
-  gdk_pointer_grab (priv->drag_window,
-                   FALSE,
-                   GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
-                   NULL, NULL, GDK_CURRENT_TIME);
+  gdk_device_grab (device, priv->drag_window,
+                   GDK_OWNERSHIP_WINDOW, FALSE,
+                   GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+                   NULL, GDK_CURRENT_TIME);
 }
 
 /* This function undoes the reparenting that happens both when drag_window
@@ -3212,7 +3130,7 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
          if (priv->operation != DRAG_OPERATION_REORDER)
            {
              priv->operation = DRAG_OPERATION_REORDER;
-             show_drag_window (notebook, priv, page);
+             show_drag_window (notebook, priv, page, event->device);
            }
 
          gtk_notebook_pages_allocate (notebook);
@@ -3272,7 +3190,7 @@ gtk_notebook_draw_focus (GtkWidget      *widget,
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
 
-  if (GTK_WIDGET_HAS_FOCUS (widget) && gtk_widget_is_drawable (widget) &&
+  if (gtk_widget_has_focus (widget) && gtk_widget_is_drawable (widget) &&
       notebook->show_tabs && notebook->cur_page &&
       notebook->cur_page->tab_label->window == event->window)
     {
@@ -3293,7 +3211,7 @@ gtk_notebook_draw_focus (GtkWidget      *widget,
           area.height = page->tab_label->allocation.height + 2 * focus_width;
 
          gtk_paint_focus (widget->style, event->window, 
-                           GTK_WIDGET_STATE (widget), NULL, widget, "tab",
+                           gtk_widget_get_state (widget), NULL, widget, "tab",
                           area.x, area.y, area.width, area.height);
         }
     }
@@ -3832,7 +3750,7 @@ gtk_notebook_get_child_property (GtkContainer    *container,
       label = gtk_notebook_get_tab_label (notebook, child);
 
       if (GTK_IS_LABEL (label))
-       g_value_set_string (value, GTK_LABEL (label)->label);
+       g_value_set_string (value, gtk_label_get_label (GTK_LABEL (label)));
       else
        g_value_set_string (value, NULL);
       break;
@@ -3840,7 +3758,7 @@ gtk_notebook_get_child_property (GtkContainer    *container,
       label = gtk_notebook_get_menu_label (notebook, child);
 
       if (GTK_IS_LABEL (label))
-       g_value_set_string (value, GTK_LABEL (label)->label);
+       g_value_set_string (value, gtk_label_get_label (GTK_LABEL (label)));
       else
        g_value_set_string (value, NULL);
       break;
@@ -3988,7 +3906,7 @@ focus_action_in (GtkNotebook      *notebook,
   GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
 
   if (priv->action_widget[action] &&
-      GTK_WIDGET_VISIBLE (priv->action_widget[action]))
+      gtk_widget_get_visible (priv->action_widget[action]))
     return gtk_widget_child_focus (priv->action_widget[action], direction);
   else
     return FALSE;
@@ -4299,7 +4217,7 @@ page_visible_cb (GtkWidget  *page,
 
   if (notebook->cur_page &&
       notebook->cur_page->child == page &&
-      !GTK_WIDGET_VISIBLE (page))
+      !gtk_widget_get_visible (page))
     {
       list = g_list_find (notebook->children, notebook->cur_page);
       if (list)
@@ -4371,7 +4289,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
 
   if (tab_label)
     {
-      if (notebook->show_tabs && GTK_WIDGET_VISIBLE (child))
+      if (notebook->show_tabs && gtk_widget_get_visible (child))
        gtk_widget_show (tab_label);
       else
        gtk_widget_hide (tab_label);
@@ -4439,7 +4357,7 @@ gtk_notebook_redraw_tabs (GtkNotebook *notebook)
   widget = GTK_WIDGET (notebook);
   border = GTK_CONTAINER (notebook)->border_width;
 
-  if (!GTK_WIDGET_MAPPED (notebook) || !notebook->first_tab)
+  if (!gtk_widget_get_mapped (widget) || !notebook->first_tab)
     return;
 
   page = notebook->first_tab->data;
@@ -4488,7 +4406,8 @@ gtk_notebook_redraw_tabs (GtkNotebook *notebook)
 static void
 gtk_notebook_redraw_arrows (GtkNotebook *notebook)
 {
-  if (GTK_WIDGET_MAPPED (notebook) && gtk_notebook_show_arrows (notebook))
+  if (gtk_widget_get_mapped (GTK_WIDGET (notebook)) &&
+      gtk_notebook_show_arrows (notebook))
     {
       GdkRectangle rect;
       gint i;
@@ -4640,7 +4559,8 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
   
   g_signal_handler_disconnect (page->child, page->notify_visible_handler); 
 
-  if (GTK_WIDGET_VISIBLE (page->child) && GTK_WIDGET_VISIBLE (notebook))
+  if (gtk_widget_get_visible (page->child) &&
+      gtk_widget_get_visible (GTK_WIDGET (notebook)))
     need_resize = TRUE;
 
   gtk_widget_unparent (page->child);
@@ -4653,17 +4573,20 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
       if (destroying)
         gtk_widget_destroy (tab_label);
       g_object_unref (tab_label);
-    } 
+    }
 
   if (notebook->menu)
     {
-      gtk_container_remove (GTK_CONTAINER (notebook->menu), 
-                           page->menu_label->parent);
+      GtkWidget *parent = page->menu_label->parent;
+
+      gtk_notebook_menu_label_unparent (parent, NULL);
+      gtk_container_remove (GTK_CONTAINER (notebook->menu), parent);
+
       gtk_widget_queue_resize (notebook->menu);
     }
   if (!page->default_menu)
     g_object_unref (page->menu_label);
-  
+
   g_list_free (list);
 
   if (page->last_focus_child)
@@ -4710,18 +4633,18 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
                gtk_label_set_text (GTK_LABEL (page->tab_label), string);
            }
 
-         if (GTK_WIDGET_VISIBLE (page->child) &&
-             !GTK_WIDGET_VISIBLE (page->tab_label))
+         if (gtk_widget_get_visible (page->child) &&
+             !gtk_widget_get_visible (page->tab_label))
            gtk_widget_show (page->tab_label);
-         else if (!GTK_WIDGET_VISIBLE (page->child) &&
-                  GTK_WIDGET_VISIBLE (page->tab_label))
+         else if (!gtk_widget_get_visible (page->child) &&
+                  gtk_widget_get_visible (page->tab_label))
            gtk_widget_hide (page->tab_label);
        }
       if (notebook->menu && page->default_menu)
        {
          if (GTK_IS_LABEL (page->tab_label))
            gtk_label_set_text (GTK_LABEL (page->menu_label),
-                                GTK_LABEL (page->tab_label)->label);
+                                gtk_label_get_label (GTK_LABEL (page->tab_label)));
          else
            gtk_label_set_text (GTK_LABEL (page->menu_label), string);
        }
@@ -4788,7 +4711,7 @@ gtk_notebook_search_page (GtkNotebook *notebook,
          page = list->data;
          if (page->pack == flag &&
              (!find_visible ||
-              (GTK_WIDGET_VISIBLE (page->child) &&
+              (gtk_widget_get_visible (page->child) &&
                (!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
            return list;
          old_list = list;
@@ -4806,7 +4729,7 @@ gtk_notebook_search_page (GtkNotebook *notebook,
       page = list->data;
       if (page->pack != flag &&
          (!find_visible ||
-          (GTK_WIDGET_VISIBLE (page->child) &&
+          (gtk_widget_get_visible (page->child) &&
            (!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
        return list;
       old_list = list;
@@ -4846,7 +4769,7 @@ gtk_notebook_paint (GtkWidget    *widget,
   tab_pos = get_effective_tab_pos (notebook);
 
   if ((!notebook->show_tabs && !notebook->show_border) ||
-      !notebook->cur_page || !GTK_WIDGET_VISIBLE (notebook->cur_page->child))
+      !notebook->cur_page || !gtk_widget_get_visible (notebook->cur_page->child))
     return;
 
   x = widget->allocation.x + border_width;
@@ -4866,7 +4789,7 @@ gtk_notebook_paint (GtkWidget    *widget,
   if (!notebook->first_tab)
     notebook->first_tab = notebook->children;
 
-  if (!GTK_WIDGET_MAPPED (notebook->cur_page->tab_label))
+  if (!gtk_widget_get_mapped (notebook->cur_page->tab_label))
     page = GTK_NOTEBOOK_PAGE (notebook->first_tab);
   else
     page = notebook->cur_page;
@@ -4888,7 +4811,7 @@ gtk_notebook_paint (GtkWidget    *widget,
     }
 
   if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, notebook->cur_page) ||
-      !GTK_WIDGET_MAPPED (notebook->cur_page->tab_label))
+      !gtk_widget_get_mapped (notebook->cur_page->tab_label))
     {
       gap_x = 0;
       gap_width = 0;
@@ -4932,9 +4855,9 @@ gtk_notebook_paint (GtkWidget    *widget,
       page = children->data;
       children = gtk_notebook_search_page (notebook, children,
                                           step, TRUE);
-      if (!GTK_WIDGET_VISIBLE (page->child))
+      if (!gtk_widget_get_visible (page->child))
        continue;
-      if (!GTK_WIDGET_MAPPED (page->tab_label))
+      if (!gtk_widget_get_mapped (page->tab_label))
        showarrow = TRUE;
       else if (page != notebook->cur_page)
        gtk_notebook_draw_tab (notebook, page, area);
@@ -4968,7 +4891,7 @@ gtk_notebook_draw_tab (GtkNotebook     *notebook,
   GtkWidget *widget;
   
   if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) ||
-      !GTK_WIDGET_MAPPED (page->tab_label) ||
+      !gtk_widget_get_mapped (page->tab_label) ||
       (page->allocation.width == 0) || (page->allocation.height == 0))
     return;
 
@@ -5041,7 +4964,7 @@ gtk_notebook_draw_arrow (GtkNotebook      *notebook,
             state_type = GTK_STATE_PRELIGHT;
         }
       else
-        state_type = GTK_WIDGET_STATE (widget);
+        state_type = gtk_widget_get_state (widget);
 
       if (notebook->click_child == nbarrow)
         shadow_type = GTK_SHADOW_IN;
@@ -5140,7 +5063,7 @@ gtk_notebook_tab_space (GtkNotebook *notebook,
          children = children->next;
 
          if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
-             GTK_WIDGET_VISIBLE (page->child))
+             gtk_widget_get_visible (page->child))
            *tab_space += page->requisition.width;
        }
       break;
@@ -5168,7 +5091,7 @@ gtk_notebook_tab_space (GtkNotebook *notebook,
          children = children->next;
 
          if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
-             GTK_WIDGET_VISIBLE (page->child))
+             gtk_widget_get_visible (page->child))
            *tab_space += page->requisition.height;
        }
       break;
@@ -5268,7 +5191,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
       *remaining_space = tab_space;
 
       if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, notebook->cur_page) &&
-         GTK_WIDGET_VISIBLE (notebook->cur_page->child))
+         gtk_widget_get_visible (notebook->cur_page->child))
        {
          gtk_notebook_calc_tabs (notebook,
                                  notebook->focus_tab,
@@ -5295,7 +5218,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
              /* Is first_tab really predecessor of focus_tab? */
              page = notebook->first_tab->data;
              if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
-                 GTK_WIDGET_VISIBLE (page->child))
+                 gtk_widget_get_visible (page->child))
                for (children = notebook->focus_tab;
                     children && children != notebook->first_tab;
                     children = gtk_notebook_search_page (notebook,
@@ -5428,7 +5351,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
          children = children->next;
 
          if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) ||
-             !GTK_WIDGET_VISIBLE (page->child))
+             !gtk_widget_get_visible (page->child))
            continue;
 
          c++;
@@ -5554,7 +5477,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
        {
          *children = (*children)->next;
 
-          if (page->pack != GTK_PACK_END || !GTK_WIDGET_VISIBLE (page->child))
+          if (page->pack != GTK_PACK_END || !gtk_widget_get_visible (page->child))
            continue;
        }
 
@@ -5867,7 +5790,7 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
   gboolean was_visible = page->tab_allocated_visible;
 
   if (!page->tab_label ||
-      !GTK_WIDGET_VISIBLE (page->tab_label) ||
+      !gtk_widget_get_visible (page->tab_label) ||
       !gtk_widget_get_child_visible (page->tab_label))
     {
       page->tab_allocated_visible = FALSE;
@@ -5988,7 +5911,7 @@ gtk_notebook_calc_tabs (GtkNotebook  *notebook,
            {
              page = children->data;
              if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
-                 GTK_WIDGET_VISIBLE (page->child))
+                 gtk_widget_get_visible (page->child))
                {
                  if (page->pack == pack)
                    {
@@ -6024,7 +5947,7 @@ gtk_notebook_calc_tabs (GtkNotebook  *notebook,
            {
              page = children->data;
              if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
-                 GTK_WIDGET_VISIBLE (page->child))
+                 gtk_widget_get_visible (page->child))
                {
                  if (page->pack == pack)
                    {
@@ -6093,7 +6016,7 @@ gtk_notebook_real_switch_page (GtkNotebook     *notebook,
 {
   gboolean child_has_focus;
 
-  if (notebook->cur_page == page || !GTK_WIDGET_VISIBLE (page->child))
+  if (notebook->cur_page == page || !gtk_widget_get_visible (page->child))
     return;
 
   /* save the value here, changing visibility changes focus */
@@ -6213,7 +6136,7 @@ gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
     return;
 
   page = notebook->focus_tab->data;
-  if (GTK_WIDGET_MAPPED (page->tab_label))
+  if (gtk_widget_get_mapped (page->tab_label))
     gtk_notebook_redraw_tabs (notebook);
   else
     gtk_notebook_pages_allocate (notebook);
@@ -6267,7 +6190,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook,
   if (page->default_menu)
     {
       if (GTK_IS_LABEL (page->tab_label))
-       page->menu_label = gtk_label_new (GTK_LABEL (page->tab_label)->label);
+       page->menu_label = gtk_label_new (gtk_label_get_label (GTK_LABEL (page->tab_label)));
       else
        page->menu_label = gtk_label_new ("");
       gtk_misc_set_alignment (GTK_MISC (page->menu_label), 0.0, 0.5);
@@ -6280,7 +6203,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook,
                         gtk_notebook_real_page_position (notebook, list));
   g_signal_connect (menu_item, "activate",
                    G_CALLBACK (gtk_notebook_menu_switch_page), page);
-  if (GTK_WIDGET_VISIBLE (page->child))
+  if (gtk_widget_get_visible (page->child))
     gtk_widget_show (menu_item);
 }
 
@@ -6304,72 +6227,6 @@ gtk_notebook_menu_detacher (GtkWidget *widget,
   notebook->menu = NULL;
 }
 
-/* Private GtkNotebook Setter Functions:
- *
- * gtk_notebook_set_homogeneous_tabs_internal
- * gtk_notebook_set_tab_border_internal
- * gtk_notebook_set_tab_hborder_internal
- * gtk_notebook_set_tab_vborder_internal
- */
-static void
-gtk_notebook_set_homogeneous_tabs_internal (GtkNotebook *notebook,
-                                           gboolean     homogeneous)
-{
-  if (homogeneous == notebook->homogeneous)
-    return;
-
-  notebook->homogeneous = homogeneous;
-  gtk_widget_queue_resize (GTK_WIDGET (notebook));
-
-  g_object_notify (G_OBJECT (notebook), "homogeneous");
-}
-
-static void
-gtk_notebook_set_tab_border_internal (GtkNotebook *notebook,
-                                     guint        border_width)
-{
-  notebook->tab_hborder = border_width;
-  notebook->tab_vborder = border_width;
-
-  if (GTK_WIDGET_VISIBLE (notebook) && notebook->show_tabs)
-    gtk_widget_queue_resize (GTK_WIDGET (notebook));
-
-  g_object_freeze_notify (G_OBJECT (notebook));
-  g_object_notify (G_OBJECT (notebook), "tab-hborder");
-  g_object_notify (G_OBJECT (notebook), "tab-vborder");
-  g_object_thaw_notify (G_OBJECT (notebook));
-}
-
-static void
-gtk_notebook_set_tab_hborder_internal (GtkNotebook *notebook,
-                                      guint        tab_hborder)
-{
-  if (notebook->tab_hborder == tab_hborder)
-    return;
-
-  notebook->tab_hborder = tab_hborder;
-
-  if (GTK_WIDGET_VISIBLE (notebook) && notebook->show_tabs)
-    gtk_widget_queue_resize (GTK_WIDGET (notebook));
-
-  g_object_notify (G_OBJECT (notebook), "tab-hborder");
-}
-
-static void
-gtk_notebook_set_tab_vborder_internal (GtkNotebook *notebook,
-                                      guint        tab_vborder)
-{
-  if (notebook->tab_vborder == tab_vborder)
-    return;
-
-  notebook->tab_vborder = tab_vborder;
-
-  if (GTK_WIDGET_VISIBLE (notebook) && notebook->show_tabs)
-    gtk_widget_queue_resize (GTK_WIDGET (notebook));
-
-  g_object_notify (G_OBJECT (notebook), "tab-vborder");
-}
-
 /* Public GtkNotebook Page Insert/Remove Methods :
  *
  * gtk_notebook_append_page
@@ -6846,7 +6703,7 @@ gtk_notebook_set_show_border (GtkNotebook *notebook,
     {
       notebook->show_border = show_border;
 
-      if (GTK_WIDGET_VISIBLE (notebook))
+      if (gtk_widget_get_visible (GTK_WIDGET (notebook)))
        gtk_widget_queue_resize (GTK_WIDGET (notebook));
       
       g_object_notify (G_OBJECT (notebook), "show-border");
@@ -6900,7 +6757,7 @@ gtk_notebook_set_show_tabs (GtkNotebook *notebook,
 
   if (!show_tabs)
     {
-      GTK_WIDGET_UNSET_FLAGS (notebook, GTK_CAN_FOCUS);
+      gtk_widget_set_can_focus (GTK_WIDGET (notebook), FALSE);
 
       while (children)
        {
@@ -6917,7 +6774,7 @@ gtk_notebook_set_show_tabs (GtkNotebook *notebook,
     }
   else
     {
-      GTK_WIDGET_SET_FLAGS (notebook, GTK_CAN_FOCUS);
+      gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
       gtk_notebook_update_labels (notebook);
     }
 
@@ -6966,7 +6823,7 @@ gtk_notebook_set_tab_pos (GtkNotebook     *notebook,
   if (notebook->tab_pos != pos)
     {
       notebook->tab_pos = pos;
-      if (GTK_WIDGET_VISIBLE (notebook))
+      if (gtk_widget_get_visible (GTK_WIDGET (notebook)))
        gtk_widget_queue_resize (GTK_WIDGET (notebook));
     }
 
@@ -6990,73 +6847,6 @@ gtk_notebook_get_tab_pos (GtkNotebook *notebook)
   return notebook->tab_pos;
 }
 
-/**
- * gtk_notebook_set_homogeneous_tabs:
- * @notebook: a #GtkNotebook
- * @homogeneous: %TRUE if all tabs should be the same size.
- * 
- * Sets whether the tabs must have all the same size or not.
- **/
-void
-gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
-                                  gboolean     homogeneous)
-{
-  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
-
-  gtk_notebook_set_homogeneous_tabs_internal (notebook, homogeneous);
-}
-
-/**
- * gtk_notebook_set_tab_border:
- * @notebook: a #GtkNotebook
- * @border_width: width of the border around the tab labels.
- * 
- * Sets the width the border around the tab labels
- * in a notebook. This is equivalent to calling
- * gtk_notebook_set_tab_hborder (@notebook, @border_width) followed
- * by gtk_notebook_set_tab_vborder (@notebook, @border_width).
- **/
-void
-gtk_notebook_set_tab_border (GtkNotebook *notebook,
-                            guint        border_width)
-{
-  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
-
-  gtk_notebook_set_tab_border_internal (notebook, border_width);
-}
-
-/**
- * gtk_notebook_set_tab_hborder:
- * @notebook: a #GtkNotebook
- * @tab_hborder: width of the horizontal border of tab labels.
- * 
- * Sets the width of the horizontal border of tab labels.
- **/
-void
-gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
-                             guint        tab_hborder)
-{
-  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
-
-  gtk_notebook_set_tab_hborder_internal (notebook, tab_hborder);
-}
-
-/**
- * gtk_notebook_set_tab_vborder:
- * @notebook: a #GtkNotebook
- * @tab_vborder: width of the vertical border of tab labels.
- * 
- * Sets the width of the vertical border of tab labels.
- **/
-void
-gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
-                             guint        tab_vborder)
-{
-  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
-
-  gtk_notebook_set_tab_vborder_internal (notebook, tab_vborder);
-}
-
 /**
  * gtk_notebook_set_scrollable:
  * @notebook: a #GtkNotebook
@@ -7077,7 +6867,7 @@ gtk_notebook_set_scrollable (GtkNotebook *notebook,
     {
       notebook->scrollable = scrollable;
 
-      if (GTK_WIDGET_VISIBLE (notebook))
+      if (gtk_widget_get_visible (GTK_WIDGET (notebook)))
        gtk_widget_queue_resize (GTK_WIDGET (notebook));
 
       g_object_notify (G_OBJECT (notebook), "scrollable");
@@ -7113,7 +6903,7 @@ gtk_notebook_get_scrollable (GtkNotebook *notebook)
  * @notebook: a #GtkNotebook
  * 
  * Enables the popup menu: if the user clicks with the right mouse button on
- * the bookmarks, a menu with all the pages will be popped up.
+ * the tab labels, a menu with all the pages will be popped up.
  **/
 void
 gtk_notebook_popup_enable (GtkNotebook *notebook)
@@ -7271,7 +7061,7 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook,
                        G_CALLBACK (gtk_notebook_mnemonic_activate_switch_page),
                        notebook);
 
-  if (notebook->show_tabs && GTK_WIDGET_VISIBLE (child))
+  if (notebook->show_tabs && gtk_widget_get_visible (child))
     {
       gtk_widget_show (page->tab_label);
       gtk_widget_queue_resize (GTK_WIDGET (notebook));
@@ -7494,9 +7284,9 @@ gtk_notebook_child_reordered (GtkNotebook     *notebook,
  * gtk_notebook_set_tab_label_packing:
  * @notebook: a #GtkNotebook
  * @child: the child widget
- * @expand: whether to expand the bookmark or not
- * @fill: whether the bookmark should fill the allocated area or not
- * @pack_type: the position of the bookmark
+ * @expand: whether to expand the tab label or not
+ * @fill: whether the tab label should fill the allocated area or not
+ * @pack_type: the position of the tab label
  *
  * Sets the packing parameters for the tab label of the page
  * containing @child. See gtk_box_pack_start() for the exact meaning
@@ -7504,6 +7294,8 @@ gtk_notebook_child_reordered (GtkNotebook     *notebook,
  *
  * Deprecated: 2.20: Modify the #GtkNotebook:tab-expand and
  *   #GtkNotebook:tab-fill child properties instead.
+ *   Modifying the packing of the tab label is a deprecated feature and
+ *   shouldn't be done anymore.
  **/
 void
 gtk_notebook_set_tab_label_packing (GtkNotebook *notebook,
@@ -7675,32 +7467,6 @@ gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc  func,
   window_creation_hook_destroy = destroy;
 }
 
-/**
- * gtk_notebook_set_group_id:
- * @notebook: a #GtkNotebook
- * @group_id: a group identificator, or -1 to unset it
- *
- * Sets an group identificator for @notebook, notebooks sharing
- * the same group identificator will be able to exchange tabs
- * via drag and drop. A notebook with group identificator -1 will
- * not be able to exchange tabs with any other notebook.
- * 
- * Since: 2.10
- * Deprecated: 2.12: use gtk_notebook_set_group() instead.
- */
-void
-gtk_notebook_set_group_id (GtkNotebook *notebook,
-                          gint         group_id)
-{
-  gpointer group;
-
-  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
-
-  /* add 1 to get rid of the -1/NULL difference */
-  group = GINT_TO_POINTER (group_id + 1);
-  gtk_notebook_set_group (notebook, group);
-}
-
 /**
  * gtk_notebook_set_group:
  * @notebook: a #GtkNotebook
@@ -7731,30 +7497,6 @@ gtk_notebook_set_group (GtkNotebook *notebook,
     }
 }
 
-/**
- * gtk_notebook_get_group_id:
- * @notebook: a #GtkNotebook
- * 
- * Gets the current group identificator for @notebook.
- * 
- * Return Value: the group identificator, or -1 if none is set.
- *
- * Since: 2.10
- * Deprecated: 2.12: use gtk_notebook_get_group() instead.
- */
-gint
-gtk_notebook_get_group_id (GtkNotebook *notebook)
-{
-  GtkNotebookPrivate *priv;
-
-  g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
-
-  priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
-
-  /* substract 1 to get rid of the -1/NULL difference */
-  return GPOINTER_TO_INT (priv->group) - 1;
-}
-
 /**
  * gtk_notebook_get_group:
  * @notebook: a #GtkNotebook