Commit f3110e41 authored by Lars Uebernickel's avatar Lars Uebernickel

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
parent ac497c6e
......@@ -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
......
/* 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);
......
......@@ -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>
......
......@@ -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" />
......
......@@ -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>
......
......@@ -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
......
......@@ -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">
......
......@@ -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);
......
......@@ -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 \
......
......@@ -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)
......
......@@ -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>
......
......@@ -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);
}
......@@ -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__ */
......@@ -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>
......
......@@ -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 \
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment