[gtk+] Rename GtkSidebar to GtkStackSidebar
- From: Lars Uebernickel <larsu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Rename GtkSidebar to GtkStackSidebar
- Date: Fri, 13 Feb 2015 17:02:11 +0000 (UTC)
commit f3110e4103207e31d932f9bcdd5ca295e17f41de
Author: Lars Uebernickel <lars uebernickel canonical com>
Date: Thu Feb 12 18:09:13 2015 +0100
Rename GtkSidebar to GtkStackSidebar
GtkSidebar is too generic and doesn't fully convey what the widget does.
https://bugzilla.gnome.org/show_bug.cgi?id=744094
NEWS | 2 +
demos/gtk-demo/sidebar.c | 18 ++--
demos/widget-factory/widget-factory.ui | 2 +-
docs/reference/gtk/gtk-docs.sgml | 2 +-
docs/reference/gtk/gtk3-sections.txt | 22 ++--
docs/reference/gtk/gtk3.types.in | 2 +-
docs/reference/gtk/visual_index.xml | 2 +-
docs/tools/widgets.c | 4 +-
gtk/Makefile.am | 4 +-
gtk/gtk-autocleanups.h | 2 +-
gtk/gtk.h | 2 +-
gtk/{gtksidebar.c => gtkstacksidebar.c} | 197 ++++++++++++++++---------------
gtk/{gtksidebar.h => gtkstacksidebar.h} | 38 +++---
gtk/inspector/window.ui | 2 +-
gtk/makefile.msc.in | 4 +-
po-properties/POTFILES.in | 2 +-
po/POTFILES.in | 2 +-
tests/teststack.c | 4 +-
18 files changed, 157 insertions(+), 154 deletions(-)
---
diff --git a/NEWS b/NEWS
index ed53482..61643b3 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,8 @@ Overview of Changes in GTK+ 3.15.5
* GtkScrolledWindow has gained a new ::edge-reached signal, which
triggers when the edge of the scrollable area is reached.
+* GtkSidebar was renamed to GtkStackSidebar to better convey what it does
+
* CSS:
- Performance improvements
diff --git a/demos/gtk-demo/sidebar.c b/demos/gtk-demo/sidebar.c
index f135794..1422d10 100644
--- a/demos/gtk-demo/sidebar.c
+++ b/demos/gtk-demo/sidebar.c
@@ -1,9 +1,9 @@
-/* Sidebar
+/* Stack Sidebar
*
- * GtkSidebar provides an automatic sidebar widget to control navigation
- * of a GtkStack object. This widget automatically updates it content
- * based on what is presently available in the GtkStack object, and
- * using the "title" child property to set the display labels.
+ * GtkStackSidebar provides an automatic sidebar widget to control
+ * navigation of a GtkStack object. This widget automatically updates it
+ * content based on what is presently available in the GtkStack object,
+ * and using the "title" child property to set the display labels.
*/
#include <glib/gi18n.h>
@@ -21,7 +21,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *header;
const gchar* pages[] = {
"Welcome to GTK+",
- "GtkSidebar Widget",
+ "GtkStackSidebar Widget",
"Automatic navigation",
"Consistent appearance",
"Scrolling",
@@ -43,18 +43,18 @@ do_sidebar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW(window), header);
- gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo");
+ gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar demo");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- sidebar = gtk_sidebar_new ();
+ sidebar = gtk_stack_sidebar_new ();
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
- gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
+ gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
/* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index aac64b9..c6ef6e6 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -3400,7 +3400,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
- <object class="GtkSidebar">
+ <object class="GtkStackSidebar">
<property name="visible">True</property>
<property name="stack">sidebar_stack</property>
</object>
diff --git a/docs/reference/gtk/gtk-docs.sgml b/docs/reference/gtk/gtk-docs.sgml
index e6712a3..9e69992 100644
--- a/docs/reference/gtk/gtk-docs.sgml
+++ b/docs/reference/gtk/gtk-docs.sgml
@@ -76,7 +76,7 @@
<xi:include href="xml/gtkflowbox.xml" />
<xi:include href="xml/gtkstack.xml" />
<xi:include href="xml/gtkstackswitcher.xml" />
- <xi:include href="xml/gtksidebar.xml" />
+ <xi:include href="xml/gtkstacksidebar.xml" />
<xi:include href="xml/gtkactionbar.xml" />
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 7db2ee3..1d76872 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -8214,24 +8214,24 @@ gtk_gesture_zoom_get_type
</SECTION>
<SECTION>
-<FILE>gtksidebar</FILE>
-GtkSidebar
-GtkSidebarClass
-gtk_sidebar_new
-gtk_sidebar_set_stack
-gtk_sidebar_get_stack
+<FILE>gtkstacksidebar</FILE>
+GtkStackSidebar
+GtkStackSidebarClass
+gtk_stack_sidebar_new
+gtk_stack_sidebar_set_stack
+gtk_stack_sidebar_get_stack
<SUBSECTION Standard>
GTK_TYPE_SIDEBAR
-GTK_SIDEBAR
-GTK_SIDEBAR_CLASS
+GTK_STACK_SIDEBAR
+GTK_STACK_SIDEBAR_CLASS
GTK_IS_SIDEBAR
GTK_IS_SIDEBAR_CLASS
-GTK_SIDEBAR_GET_CLASS
+GTK_STACK_SIDEBAR_GET_CLASS
<SUBSECTION Private>
-GtkSidebarPrivate
-gtk_sidebar_get_type
+GtkStackSidebarPrivate
+gtk_stack_sidebar_get_type
</SECTION>
<SECTION>
diff --git a/docs/reference/gtk/gtk3.types.in b/docs/reference/gtk/gtk3.types.in
index 0bc2c6a..4b20622 100644
--- a/docs/reference/gtk/gtk3.types.in
+++ b/docs/reference/gtk/gtk3.types.in
@@ -173,7 +173,7 @@ gtk_separator_get_type
gtk_separator_menu_item_get_type
gtk_separator_tool_item_get_type
gtk_settings_get_type
-gtk_sidebar_get_type
+gtk_stack_sidebar_get_type
gtk_size_group_get_type
@ENABLE_ON_X11 gtk_socket_get_type
gtk_spin_button_get_type
diff --git a/docs/reference/gtk/visual_index.xml b/docs/reference/gtk/visual_index.xml
index 6e58e53..c3f3776 100644
--- a/docs/reference/gtk/visual_index.xml
+++ b/docs/reference/gtk/visual_index.xml
@@ -144,7 +144,7 @@
<link linkend="GtkStackSwitcher">
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
</link>
- <link linkend="GtkSidebar">
+ <link linkend="GtkStackSidebar">
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkTreeView">
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index c6d1afb..932daf1 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1407,8 +1407,8 @@ create_sidebar (void)
gtk_widget_show (view);
gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
- sidebar = gtk_sidebar_new ();
- gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
+ sidebar = gtk_stack_sidebar_new ();
+ gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
frame = gtk_frame_new (NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index ed87475..721a76d 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -269,7 +269,7 @@ gtk_public_h_sources = \
gtkseparatortoolitem.h \
gtksettings.h \
gtkshow.h \
- gtksidebar.h \
+ gtkstacksidebar.h \
gtksizegroup.h \
gtksizerequest.h \
gtksocket.h \
@@ -787,7 +787,7 @@ gtk_base_c_sources = \
gtksizerequest.c \
gtksizerequestcache.c \
gtkshow.c \
- gtksidebar.c \
+ gtkstacksidebar.c \
gtkspinbutton.c \
gtkspinner.c \
gtkstack.c \
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h
index c846f89..5361872 100644
--- a/gtk/gtk-autocleanups.h
+++ b/gtk/gtk-autocleanups.h
@@ -165,7 +165,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparator, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorMenuItem, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorToolItem, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSettings, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSidebar, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStackSidebar, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSizeGroup, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSpinButton, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSpinner, g_object_unref)
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 1d174c7..3cbd13f 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -184,7 +184,7 @@
#include <gtk/gtkseparatortoolitem.h>
#include <gtk/gtksettings.h>
#include <gtk/gtkshow.h>
-#include <gtk/gtksidebar.h>
+#include <gtk/gtkstacksidebar.h>
#include <gtk/gtksizegroup.h>
#include <gtk/gtksizerequest.h>
#include <gtk/gtkspinbutton.h>
diff --git a/gtk/gtksidebar.c b/gtk/gtkstacksidebar.c
similarity index 65%
rename from gtk/gtksidebar.c
rename to gtk/gtkstacksidebar.c
index 39c3321..cedc104 100644
--- a/gtk/gtksidebar.c
+++ b/gtk/gtkstacksidebar.c
@@ -21,7 +21,7 @@
#include "config.h"
-#include "gtksidebar.h"
+#include "gtkstacksidebar.h"
#include "gtklabel.h"
#include "gtklistbox.h"
@@ -32,21 +32,22 @@
#include "gtkintl.h"
/**
- * SECTION:gtksidebar
- * @Title: GtkSidebar
+ * SECTION:gtkstacksidebar
+ * @Title: GtkStackSidebar
* @Short_description: An automatic sidebar widget
*
- * A GtkSidebar enables you to quickly and easily provide a consistent
- * "sidebar" object for your user interface.
+ * A GtkStackSidebar enables you to quickly and easily provide a
+ * consistent "sidebar" object for your user interface.
*
- * In order to use a GtkSidebar, you simply use a GtkStack to organize
- * your UI flow, and add the sidebar to your sidebar area. You can use
- * gtk_sidebar_set_stack() to connect the #GtkSidebar to the #GtkStack.
+ * In order to use a GtkStackSidebar, you simply use a GtkStack to
+ * organize your UI flow, and add the sidebar to your sidebar area. You
+ * can use gtk_stack_sidebar_set_stack() to connect the #GtkStackSidebar
+ * to the #GtkStack.
*
* Since: 3.16
*/
-struct _GtkSidebarPrivate
+struct _GtkStackSidebarPrivate
{
GtkListBox *list;
GtkStack *stack;
@@ -54,7 +55,7 @@ struct _GtkSidebarPrivate
gboolean in_child_changed;
};
-G_DEFINE_TYPE_WITH_PRIVATE (GtkSidebar, gtk_sidebar, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkStackSidebar, gtk_stack_sidebar, GTK_TYPE_BIN)
enum
{
@@ -65,15 +66,15 @@ enum
static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
static void
-gtk_sidebar_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+gtk_stack_sidebar_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_STACK:
- gtk_sidebar_set_stack (GTK_SIDEBAR (object), g_value_get_object (value));
+ gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (object), g_value_get_object (value));
break;
default:
@@ -83,12 +84,12 @@ gtk_sidebar_set_property (GObject *object,
}
static void
-gtk_sidebar_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+gtk_stack_sidebar_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (GTK_SIDEBAR (object));
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (GTK_STACK_SIDEBAR (object));
switch (prop_id)
{
@@ -121,8 +122,8 @@ sort_list (GtkListBoxRow *row1,
GtkListBoxRow *row2,
gpointer userdata)
{
- GtkSidebar *sidebar = GTK_SIDEBAR (userdata);
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebar *sidebar = GTK_STACK_SIDEBAR (userdata);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *item;
GtkWidget *widget;
gint left = 0; gint right = 0;
@@ -156,12 +157,12 @@ sort_list (GtkListBoxRow *row1,
}
static void
-gtk_sidebar_row_selected (GtkListBox *box,
- GtkListBoxRow *row,
- gpointer userdata)
+gtk_stack_sidebar_row_selected (GtkListBox *box,
+ GtkListBoxRow *row,
+ gpointer userdata)
{
- GtkSidebar *sidebar = GTK_SIDEBAR (userdata);
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebar *sidebar = GTK_STACK_SIDEBAR (userdata);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *item;
GtkWidget *widget;
@@ -177,13 +178,13 @@ gtk_sidebar_row_selected (GtkListBox *box,
}
static void
-gtk_sidebar_init (GtkSidebar *sidebar)
+gtk_stack_sidebar_init (GtkStackSidebar *sidebar)
{
GtkStyleContext *style;
- GtkSidebarPrivate *priv;
+ GtkStackSidebarPrivate *priv;
GtkWidget *sw;
- priv = gtk_sidebar_get_instance_private (sidebar);
+ priv = gtk_stack_sidebar_get_instance_private (sidebar);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (sw);
@@ -203,7 +204,7 @@ gtk_sidebar_init (GtkSidebar *sidebar)
gtk_list_box_set_sort_func (priv->list, sort_list, sidebar, NULL);
g_signal_connect (priv->list, "row-selected",
- G_CALLBACK (gtk_sidebar_row_selected), sidebar);
+ G_CALLBACK (gtk_stack_sidebar_row_selected), sidebar);
style = gtk_widget_get_style_context (GTK_WIDGET (sidebar));
gtk_style_context_add_class (style, "sidebar");
@@ -212,11 +213,11 @@ gtk_sidebar_init (GtkSidebar *sidebar)
}
static void
-update_row (GtkSidebar *sidebar,
- GtkWidget *widget,
- GtkWidget *row)
+update_row (GtkStackSidebar *sidebar,
+ GtkWidget *widget,
+ GtkWidget *row)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *item;
gchar *title;
gboolean needs_attention;
@@ -242,21 +243,21 @@ update_row (GtkSidebar *sidebar,
}
static void
-on_position_updated (GtkWidget *widget,
- GParamSpec *pspec,
- GtkSidebar *sidebar)
+on_position_updated (GtkWidget *widget,
+ GParamSpec *pspec,
+ GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
gtk_list_box_invalidate_sort (priv->list);
}
static void
-on_child_updated (GtkWidget *widget,
- GParamSpec *pspec,
- GtkSidebar *sidebar)
+on_child_updated (GtkWidget *widget,
+ GParamSpec *pspec,
+ GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *row;
row = g_hash_table_lookup (priv->rows, widget);
@@ -264,10 +265,10 @@ on_child_updated (GtkWidget *widget,
}
static void
-add_child (GtkWidget *widget,
- GtkSidebar *sidebar)
+add_child (GtkWidget *widget,
+ GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkStyleContext *style;
GtkWidget *item;
GtkWidget *row;
@@ -306,10 +307,10 @@ add_child (GtkWidget *widget,
}
static void
-remove_child (GtkWidget *widget,
- GtkSidebar *sidebar)
+remove_child (GtkWidget *widget,
+ GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *row;
row = g_hash_table_lookup (priv->rows, widget);
@@ -324,9 +325,9 @@ remove_child (GtkWidget *widget,
}
static void
-populate_sidebar (GtkSidebar *sidebar)
+populate_sidebar (GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *widget, *row;
gtk_container_foreach (GTK_CONTAINER (priv->stack), (GtkCallback)add_child, sidebar);
@@ -340,19 +341,19 @@ populate_sidebar (GtkSidebar *sidebar)
}
static void
-clear_sidebar (GtkSidebar *sidebar)
+clear_sidebar (GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
gtk_container_foreach (GTK_CONTAINER (priv->stack), (GtkCallback)remove_child, sidebar);
}
static void
-on_child_changed (GtkWidget *widget,
- GParamSpec *pspec,
- GtkSidebar *sidebar)
+on_child_changed (GtkWidget *widget,
+ GParamSpec *pspec,
+ GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
GtkWidget *child;
GtkWidget *row;
@@ -367,25 +368,25 @@ on_child_changed (GtkWidget *widget,
}
static void
-on_stack_child_added (GtkContainer *container,
- GtkWidget *widget,
- GtkSidebar *sidebar)
+on_stack_child_added (GtkContainer *container,
+ GtkWidget *widget,
+ GtkStackSidebar *sidebar)
{
add_child (widget, sidebar);
}
static void
-on_stack_child_removed (GtkContainer *container,
- GtkWidget *widget,
- GtkSidebar *sidebar)
+on_stack_child_removed (GtkContainer *container,
+ GtkWidget *widget,
+ GtkStackSidebar *sidebar)
{
remove_child (widget, sidebar);
}
static void
-disconnect_stack_signals (GtkSidebar *sidebar)
+disconnect_stack_signals (GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
g_signal_handlers_disconnect_by_func (priv->stack, on_stack_child_added, sidebar);
g_signal_handlers_disconnect_by_func (priv->stack, on_stack_child_removed, sidebar);
@@ -394,9 +395,9 @@ disconnect_stack_signals (GtkSidebar *sidebar)
}
static void
-connect_stack_signals (GtkSidebar *sidebar)
+connect_stack_signals (GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
g_signal_connect_after (priv->stack, "add",
G_CALLBACK (on_stack_child_added), sidebar);
@@ -409,39 +410,39 @@ connect_stack_signals (GtkSidebar *sidebar)
}
static void
-gtk_sidebar_dispose (GObject *object)
+gtk_stack_sidebar_dispose (GObject *object)
{
- GtkSidebar *sidebar = GTK_SIDEBAR (object);
+ GtkStackSidebar *sidebar = GTK_STACK_SIDEBAR (object);
- gtk_sidebar_set_stack (sidebar, NULL);
+ gtk_stack_sidebar_set_stack (sidebar, NULL);
- G_OBJECT_CLASS (gtk_sidebar_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gtk_stack_sidebar_parent_class)->dispose (object);
}
static void
-gtk_sidebar_finalize (GObject *object)
+gtk_stack_sidebar_finalize (GObject *object)
{
- GtkSidebar *sidebar = GTK_SIDEBAR (object);
- GtkSidebarPrivate *priv = gtk_sidebar_get_instance_private (sidebar);
+ GtkStackSidebar *sidebar = GTK_STACK_SIDEBAR (object);
+ GtkStackSidebarPrivate *priv = gtk_stack_sidebar_get_instance_private (sidebar);
g_hash_table_destroy (priv->rows);
- G_OBJECT_CLASS (gtk_sidebar_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gtk_stack_sidebar_parent_class)->finalize (object);
}
static void
-gtk_sidebar_class_init (GtkSidebarClass *klass)
+gtk_stack_sidebar_class_init (GtkStackSidebarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = gtk_sidebar_dispose;
- object_class->finalize = gtk_sidebar_finalize;
- object_class->set_property = gtk_sidebar_set_property;
- object_class->get_property = gtk_sidebar_get_property;
+ object_class->dispose = gtk_stack_sidebar_dispose;
+ object_class->finalize = gtk_stack_sidebar_finalize;
+ object_class->set_property = gtk_stack_sidebar_set_property;
+ object_class->get_property = gtk_stack_sidebar_get_property;
obj_properties[PROP_STACK] =
g_param_spec_object (I_("stack"), P_("Stack"),
- P_("Associated stack for this GtkSidebar"),
+ P_("Associated stack for this GtkStackSidebar"),
GTK_TYPE_STACK,
G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
@@ -449,26 +450,26 @@ gtk_sidebar_class_init (GtkSidebarClass *klass)
}
/**
- * gtk_sidebar_new:
+ * gtk_stack_sidebar_new:
*
* Creates a new sidebar.
*
- * Returns: the new #GtkSidebar
+ * Returns: the new #GtkStackSidebar
*
* Since: 3.16
*/
GtkWidget *
-gtk_sidebar_new (void)
+gtk_stack_sidebar_new (void)
{
- return GTK_WIDGET (g_object_new (GTK_TYPE_SIDEBAR, NULL));
+ return GTK_WIDGET (g_object_new (GTK_TYPE_STACK_SIDEBAR, NULL));
}
/**
- * gtk_sidebar_set_stack:
- * @sidebar: a #GtkSidebar
+ * gtk_stack_sidebar_set_stack:
+ * @sidebar: a #GtkStackSidebar
* @stack: a #GtkStack
*
- * Set the #GtkStack associated with this #GtkSidebar.
+ * Set the #GtkStack associated with this #GtkStackSidebar.
*
* The sidebar widget will automatically update according to the order
* (packing) and items within the given #GtkStack.
@@ -476,15 +477,15 @@ gtk_sidebar_new (void)
* Since: 3.16
*/
void
-gtk_sidebar_set_stack (GtkSidebar *sidebar,
- GtkStack *stack)
+gtk_stack_sidebar_set_stack (GtkStackSidebar *sidebar,
+ GtkStack *stack)
{
- GtkSidebarPrivate *priv;
+ GtkStackSidebarPrivate *priv;
g_return_if_fail (GTK_IS_SIDEBAR (sidebar));
g_return_if_fail (GTK_IS_STACK (stack) || stack == NULL);
- priv = gtk_sidebar_get_instance_private (sidebar);
+ priv = gtk_stack_sidebar_get_instance_private (sidebar);
if (priv->stack == stack)
return;
@@ -508,11 +509,11 @@ gtk_sidebar_set_stack (GtkSidebar *sidebar,
}
/**
- * gtk_sidebar_get_stack:
- * @sidebar: a #GtkSidebar
+ * gtk_stack_sidebar_get_stack:
+ * @sidebar: a #GtkStackSidebar
*
* Retrieves the stack.
- * See gtk_sidebar_set_stack().
+ * See gtk_stack_sidebar_set_stack().
*
* Returns: (transfer full): the associated #GtkStack or
* %NULL if none has been set explicitly
@@ -520,13 +521,13 @@ gtk_sidebar_set_stack (GtkSidebar *sidebar,
* Since: 3.16
*/
GtkStack *
-gtk_sidebar_get_stack (GtkSidebar *sidebar)
+gtk_stack_sidebar_get_stack (GtkStackSidebar *sidebar)
{
- GtkSidebarPrivate *priv;
+ GtkStackSidebarPrivate *priv;
g_return_val_if_fail (GTK_IS_SIDEBAR (sidebar), NULL);
- priv = gtk_sidebar_get_instance_private (sidebar);
+ priv = gtk_stack_sidebar_get_instance_private (sidebar);
return GTK_STACK (priv->stack);
}
diff --git a/gtk/gtksidebar.h b/gtk/gtkstacksidebar.h
similarity index 56%
rename from gtk/gtksidebar.h
rename to gtk/gtkstacksidebar.h
index a2c4d8c..70af353 100644
--- a/gtk/gtksidebar.h
+++ b/gtk/gtkstacksidebar.h
@@ -19,8 +19,8 @@
* Ikey Doherty <michael i doherty intel com>
*/
-#ifndef __GTK_SIDEBAR_H__
-#define __GTK_SIDEBAR_H__
+#ifndef __GTK_STACK_SIDEBAR_H__
+#define __GTK_STACK_SIDEBAR_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
@@ -31,23 +31,23 @@
G_BEGIN_DECLS
-#define GTK_TYPE_SIDEBAR (gtk_sidebar_get_type ())
-#define GTK_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SIDEBAR, GtkSidebar))
-#define GTK_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SIDEBAR))
-#define GTK_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SIDEBAR,
GtkSidebarClass))
-#define GTK_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SIDEBAR))
-#define GTK_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SIDEBAR,
GtkSidebarClass))
+#define GTK_TYPE_STACK_SIDEBAR (gtk_stack_sidebar_get_type ())
+#define GTK_STACK_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_STACK_SIDEBAR,
GtkStackSidebar))
+#define GTK_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_STACK_SIDEBAR))
+#define GTK_STACK_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STACK_SIDEBAR,
GtkStackSidebarClass))
+#define GTK_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STACK_SIDEBAR))
+#define GTK_STACK_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STACK_SIDEBAR,
GtkStackSidebarClass))
-typedef struct _GtkSidebar GtkSidebar;
-typedef struct _GtkSidebarPrivate GtkSidebarPrivate;
-typedef struct _GtkSidebarClass GtkSidebarClass;
+typedef struct _GtkStackSidebar GtkStackSidebar;
+typedef struct _GtkStackSidebarPrivate GtkStackSidebarPrivate;
+typedef struct _GtkStackSidebarClass GtkStackSidebarClass;
-struct _GtkSidebar
+struct _GtkStackSidebar
{
GtkBin parent;
};
-struct _GtkSidebarClass
+struct _GtkStackSidebarClass
{
GtkBinClass parent_class;
@@ -59,15 +59,15 @@ struct _GtkSidebarClass
};
GDK_AVAILABLE_IN_3_16
-GType gtk_sidebar_get_type (void) G_GNUC_CONST;
+GType gtk_stack_sidebar_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_16
-GtkWidget * gtk_sidebar_new (void);
+GtkWidget * gtk_stack_sidebar_new (void);
GDK_AVAILABLE_IN_3_16
-void gtk_sidebar_set_stack (GtkSidebar *sidebar,
- GtkStack *stack);
+void gtk_stack_sidebar_set_stack (GtkStackSidebar *sidebar,
+ GtkStack *stack);
GDK_AVAILABLE_IN_3_16
-GtkStack * gtk_sidebar_get_stack (GtkSidebar *sidebar);
+GtkStack * gtk_stack_sidebar_get_stack (GtkStackSidebar *sidebar);
G_END_DECLS
-#endif /* __GTK_SIDEBAR_H__ */
+#endif /* __GTK_STACK_SIDEBAR_H__ */
diff --git a/gtk/inspector/window.ui b/gtk/inspector/window.ui
index 6046618..272959c 100644
--- a/gtk/inspector/window.ui
+++ b/gtk/inspector/window.ui
@@ -233,7 +233,7 @@
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
- <object class="GtkSidebar">
+ <object class="GtkStackSidebar">
<property name="visible">True</property>
<property name="stack">object_details</property>
</object>
diff --git a/gtk/makefile.msc.in b/gtk/makefile.msc.in
index 3ee1baa..78a5244 100644
--- a/gtk/makefile.msc.in
+++ b/gtk/makefile.msc.in
@@ -283,7 +283,7 @@ gtk_OBJECTS = \
gtkseparatortoolitem.obj \
gtksettings.obj \
gtkshow.obj \
- gtksidebar.obj \
+ gtkstacksidebar.obj \
gtksizegroup.obj \
gtksizerequest.obj \
gtkspinbutton.obj \
@@ -476,7 +476,7 @@ gtk_public_h_sources = \
gtkseparatortoolitem.h \
gtksettings.h \
gtkshow.h \
- gtksidebar.h \
+ gtkstacksidebar.h \
gtksizegroup.h \
gtksizerequest.h \
gtksocket.h \
diff --git a/po-properties/POTFILES.in b/po-properties/POTFILES.in
index a9c8297..8f58885 100644
--- a/po-properties/POTFILES.in
+++ b/po-properties/POTFILES.in
@@ -230,7 +230,7 @@ gtk/gtkselection.c
gtk/gtkseparator.c
gtk/gtkseparatortoolitem.c
gtk/gtksettings.c
-gtk/gtksidebar.c
+gtk/gtkstacksidebar.c
gtk/gtksizegroup.c
gtk/gtksocket.c
gtk/gtkspinbutton.c
diff --git a/po/POTFILES.in b/po/POTFILES.in
index afa435a..5c11dbf 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -231,7 +231,7 @@ gtk/gtkselection.c
gtk/gtkseparator.c
gtk/gtkseparatortoolitem.c
gtk/gtksettings.c
-gtk/gtksidebar.c
+gtk/gtkstacksidebar.c
gtk/gtksizegroup.c
gtk/gtksizerequest.c
gtk/gtksocket.c
diff --git a/tests/teststack.c b/tests/teststack.c
index c74c7a2..4cf6c07 100644
--- a/tests/teststack.c
+++ b/tests/teststack.c
@@ -137,8 +137,8 @@ main (gint argc,
gtk_widget_set_halign (stack, GTK_ALIGN_START);
/* Add sidebar before stack */
- sidebar = gtk_sidebar_new ();
- gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
+ sidebar = gtk_stack_sidebar_new ();
+ gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (layout), sidebar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (layout), stack, TRUE, TRUE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]