summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorManish Singh <yosh@gimp.org>2002-11-20 01:07:33 +0000
committerManish Singh <yosh@src.gnome.org>2002-11-20 01:07:33 +0000
commitbc035915e9406896c83a7cd6a132eb722229a876 (patch)
tree2c1562383639d15f86bd64d5dedc7a0055ab11d4 /gtk/gtknotebook.c
parent3e8866a488844f8c2ded0a7cdb26cab3af2c2390 (diff)
downloadgdk-pixbuf-bc035915e9406896c83a7cd6a132eb722229a876.tar.gz
add -DGTK_DISABLE_DEPRECATED. #undef it at the top of gtktypebuiltins.c.
Tue Nov 19 17:05:51 2002 Manish Singh <yosh@gimp.org> * gtk/Makefile.am: add -DGTK_DISABLE_DEPRECATED. #undef it at the top of gtktypebuiltins.c. * gtk/gtkclist.c * gtk/gtkcombo.c * gtk/gtkctree.c * gtk/gtklist.c * gtk/gtklistitem.c * gtk/gtkoldeditable.c * gtk/gtkpixmap.c * gtk/gtkpreview.c * gtk/gtksignal.c * gtk/gtktext.c * gtk/gtktipsquery.c * gtk/gtktree.c * gtk/gtktreeitem.c * gtk/gtktypeutils.c: #undef GTK_DISABLE_DEPRECATED, deprecated widgets and compat code. * gtk/gtkcolorsel.c: move gtk_color_selection_set_color implementation to set_color_internal, and use that. The deprecated function now merely wraps it. * gtk/gtkfontsel.c: same as above, except with gtk_font_selection_get_font. * gtk/gtknotebook.c: same as above, except with gtk_notebook_set_homogeneous, and gtk_notebook_set_tab_{border, hborder,vborder}. * gtk/gtkprogressbar.c: same as above, except with gtk_progress_bar_set_{bar_stype,discrete_blocks,activity_step, activity_blocks}. * gtk/gtkstyle.c: same as above, except with gtk_style_get_font. * gtk/gtkwidget.c: same as above, except with gtk_widget_set_usize. * gtk/gtkitemfactory.h: declare compatibility functions for deprecated GtkMenuFactory stuff if GTK_COMPILATION, since they are used internally by the compat code. * gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove use of deprecated gtk_check_menu_item_set_show_toggle (it is a noop now). * gtk/gtkmain.c: replaced deprecated GTK_TYPE_* with G_TYPE_*. * gtk/gtkobject.c: replaced various deprecated functions. In set and get_property, use g_object_{set,get}_data with "user_data" instead of gtk_object_{set,get}_user_data. * gtk/gtkprogress.h: API declared if GTK_COMPILATION * gtk/gtkprogress.c: port get_type to GObject API. * gtk/gtktypeutils.h: declare GtkArg stuff and gtk_type_init, if GTK_COMPILATION. * gtk/gtkwidget.c: define gtk_widget_queue_clear in terms of gtk_widget_queue_draw instead of the other way around. * tests/Makefile.am: define -DGTK_DISABLE_DEPRECATED * tests/testgtk.c * tests/testselection.c * tests/testsocket.c: #undef GTK_DISABLE_DEPRECATED, makes use of deprecated stuff.
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c132
1 files changed, 92 insertions, 40 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 21e4b430a..51d3dd963 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -248,6 +248,16 @@ static void gtk_notebook_menu_label_unparent (GtkWidget *widget,
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 gboolean focus_tabs_in (GtkNotebook *notebook);
static gboolean focus_child_in (GtkNotebook *notebook,
GtkDirectionType direction);
@@ -773,7 +783,7 @@ gtk_notebook_set_property (GObject *object,
gtk_notebook_popup_disable (notebook);
break;
case PROP_HOMOGENEOUS:
- gtk_notebook_set_homogeneous_tabs (notebook, g_value_get_boolean (value));
+ 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));
@@ -782,13 +792,13 @@ gtk_notebook_set_property (GObject *object,
gtk_notebook_set_tab_pos (notebook, g_value_get_enum (value));
break;
case PROP_TAB_BORDER:
- gtk_notebook_set_tab_border (notebook, g_value_get_uint (value));
+ gtk_notebook_set_tab_border_internal (notebook, g_value_get_uint (value));
break;
case PROP_TAB_HBORDER:
- gtk_notebook_set_tab_hborder (notebook, g_value_get_uint (value));
+ gtk_notebook_set_tab_hborder_internal (notebook, g_value_get_uint (value));
break;
case PROP_TAB_VBORDER:
- gtk_notebook_set_tab_vborder (notebook, g_value_get_uint (value));
+ gtk_notebook_set_tab_vborder_internal (notebook, g_value_get_uint (value));
break;
default:
break;
@@ -3723,6 +3733,80 @@ 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)
+{
+ g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+ 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)
+{
+ g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+ 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)
+{
+ g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+ 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)
+{
+ g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+ 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
@@ -4415,13 +4499,7 @@ gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
{
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- if (homogeneous == notebook->homogeneous)
- return;
-
- notebook->homogeneous = homogeneous;
- gtk_widget_queue_resize (GTK_WIDGET (notebook));
-
- g_object_notify (G_OBJECT (notebook), "homogeneous");
+ gtk_notebook_set_homogeneous_tabs_internal (notebook, homogeneous);
}
/**
@@ -4440,17 +4518,7 @@ gtk_notebook_set_tab_border (GtkNotebook *notebook,
{
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- 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));
-
+ gtk_notebook_set_tab_border_internal (notebook, border_width);
}
/**
@@ -4466,15 +4534,7 @@ gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
{
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- 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");
+ gtk_notebook_set_tab_hborder_internal (notebook, tab_hborder);
}
/**
@@ -4490,15 +4550,7 @@ gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
{
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- 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");
+ gtk_notebook_set_tab_vborder_internal (notebook, tab_vborder);
}
/**