implement the GtkOrientable interface and deprecate

2008-11-11  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktoolbar.[ch]: implement the GtkOrientable interface
	and deprecate gtk_toolbar_get,set_orientation().

	* gtk/gtk.symbols: changed accordingly.


svn path=/trunk/; revision=21777
This commit is contained in:
Michael Natterer
2008-11-11 15:28:07 +00:00
committed by Michael Natterer
parent 4e29d5da8d
commit 8004fcbfc1
4 changed files with 66 additions and 44 deletions

View File

@ -1,3 +1,10 @@
2008-11-11 Michael Natterer <mitch@imendio.com>
* gtk/gtktoolbar.[ch]: implement the GtkOrientable interface
and deprecate gtk_toolbar_get,set_orientation().
* gtk/gtk.symbols: changed accordingly.
2008-11-10 Marek Kasik <mkasik@redhat.com> 2008-11-10 Marek Kasik <mkasik@redhat.com>
Bug 560135 - Print when the user double clicks a printer Bug 560135 - Print when the user double clicks a printer

View File

@ -4158,7 +4158,9 @@ gtk_toolbar_get_icon_size
gtk_toolbar_get_item_index gtk_toolbar_get_item_index
gtk_toolbar_get_n_items gtk_toolbar_get_n_items
gtk_toolbar_get_nth_item gtk_toolbar_get_nth_item
#ifndef GTK_DISABLE_DEPRECATED
gtk_toolbar_get_orientation gtk_toolbar_get_orientation
#endif
gtk_toolbar_get_relief_style gtk_toolbar_get_relief_style
gtk_toolbar_get_show_arrow gtk_toolbar_get_show_arrow
gtk_toolbar_get_style gtk_toolbar_get_style
@ -4169,7 +4171,9 @@ gtk_toolbar_get_type G_GNUC_CONST
gtk_toolbar_insert gtk_toolbar_insert
gtk_toolbar_new gtk_toolbar_new
gtk_toolbar_set_drop_highlight_item gtk_toolbar_set_drop_highlight_item
#ifndef GTK_DISABLE_DEPRECATED
gtk_toolbar_set_orientation gtk_toolbar_set_orientation
#endif
gtk_toolbar_set_show_arrow gtk_toolbar_set_show_arrow
gtk_toolbar_set_style gtk_toolbar_set_style
#ifndef GTK_DISABLE_DEPRECATED #ifndef GTK_DISABLE_DEPRECATED

View File

@ -32,29 +32,33 @@
#undef GTK_DISABLE_DEPRECATED #undef GTK_DISABLE_DEPRECATED
#include "config.h" #include "config.h"
#include <math.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include "gtkarrow.h" #include "gtkarrow.h"
#include "gtkbindings.h"
#include "gtkhbox.h"
#include "gtkimage.h"
#include "gtklabel.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmenu.h"
#include "gtkorientable.h"
#include "gtkradiobutton.h"
#include "gtkradiotoolbutton.h"
#include "gtkseparatormenuitem.h"
#include "gtkseparatortoolitem.h"
#include "gtkstock.h"
#include "gtktoolbar.h"
#include "gtktoolbar.h" #include "gtktoolbar.h"
#include "gtktoolshell.h" #include "gtktoolshell.h"
#include "gtkradiotoolbutton.h" #include "gtkvbox.h"
#include "gtkseparatortoolitem.h"
#include "gtkmenu.h"
#include "gtkradiobutton.h"
#include "gtktoolbar.h"
#include "gtkbindings.h"
#include <gdk/gdkkeysyms.h>
#include "gtkmarshalers.h"
#include "gtkmain.h"
#include "gtkstock.h"
#include "gtklabel.h"
#include "gtkprivate.h" #include "gtkprivate.h"
#include "gtkintl.h" #include "gtkintl.h"
#include <string.h>
#include "gtkhbox.h"
#include "gtkvbox.h"
#include "gtkimage.h"
#include "gtkseparatormenuitem.h"
#include "gtkalias.h" #include "gtkalias.h"
#include <math.h>
typedef struct _ToolbarContent ToolbarContent; typedef struct _ToolbarContent ToolbarContent;
@ -310,10 +314,15 @@ static void toolbar_rebuild_menu (GtkToolShell
#define GTK_TOOLBAR_GET_PRIVATE(o) \ #define GTK_TOOLBAR_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_TOOLBAR, GtkToolbarPrivate)) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_TOOLBAR, GtkToolbarPrivate))
static guint toolbar_signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkToolbar, gtk_toolbar, GTK_TYPE_CONTAINER, G_DEFINE_TYPE_WITH_CODE (GtkToolbar, gtk_toolbar, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TOOL_SHELL, toolbar_tool_shell_iface_init)) G_IMPLEMENT_INTERFACE (GTK_TYPE_TOOL_SHELL,
toolbar_tool_shell_iface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
NULL))
static guint toolbar_signals[LAST_SIGNAL] = { 0 };
static void static void
add_arrow_bindings (GtkBindingSet *binding_set, add_arrow_bindings (GtkBindingSet *binding_set,
@ -345,16 +354,6 @@ add_ctrl_tab_bindings (GtkBindingSet *binding_set,
GTK_TYPE_DIRECTION_TYPE, direction); GTK_TYPE_DIRECTION_TYPE, direction);
} }
static void
toolbar_tool_shell_iface_init (GtkToolShellIface *iface)
{
iface->get_icon_size = toolbar_get_icon_size;
iface->get_orientation = toolbar_get_orientation;
iface->get_style = toolbar_get_style;
iface->get_relief_style = toolbar_get_relief_style;
iface->rebuild_menu = toolbar_rebuild_menu;
}
static void static void
gtk_toolbar_class_init (GtkToolbarClass *klass) gtk_toolbar_class_init (GtkToolbarClass *klass)
{ {
@ -486,14 +485,9 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
G_TYPE_BOOLEAN); G_TYPE_BOOLEAN);
/* properties */ /* properties */
g_object_class_install_property (gobject_class, g_object_class_override_property (gobject_class,
PROP_ORIENTATION, PROP_ORIENTATION,
g_param_spec_enum ("orientation", "orientation");
P_("Orientation"),
P_("The orientation of the toolbar"),
GTK_TYPE_ORIENTATION,
GTK_ORIENTATION_HORIZONTAL,
GTK_PARAM_READWRITE));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_TOOLBAR_STYLE, PROP_TOOLBAR_STYLE,
@ -673,6 +667,16 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
g_type_class_add_private (gobject_class, sizeof (GtkToolbarPrivate)); g_type_class_add_private (gobject_class, sizeof (GtkToolbarPrivate));
} }
static void
toolbar_tool_shell_iface_init (GtkToolShellIface *iface)
{
iface->get_icon_size = toolbar_get_icon_size;
iface->get_orientation = toolbar_get_orientation;
iface->get_style = toolbar_get_style;
iface->get_relief_style = toolbar_get_relief_style;
iface->rebuild_menu = toolbar_rebuild_menu;
}
static void static void
gtk_toolbar_init (GtkToolbar *toolbar) gtk_toolbar_init (GtkToolbar *toolbar)
{ {
@ -730,7 +734,8 @@ gtk_toolbar_set_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
case PROP_ORIENTATION: case PROP_ORIENTATION:
gtk_toolbar_set_orientation (toolbar, g_value_get_enum (value)); g_signal_emit (toolbar, toolbar_signals[ORIENTATION_CHANGED], 0,
g_value_get_enum (value));
break; break;
case PROP_TOOLBAR_STYLE: case PROP_TOOLBAR_STYLE:
gtk_toolbar_set_style (toolbar, g_value_get_enum (value)); gtk_toolbar_set_style (toolbar, g_value_get_enum (value));
@ -2832,6 +2837,8 @@ gtk_toolbar_get_item_index (GtkToolbar *toolbar,
* @orientation: a new #GtkOrientation. * @orientation: a new #GtkOrientation.
* *
* Sets whether a toolbar should appear horizontally or vertically. * Sets whether a toolbar should appear horizontally or vertically.
*
* Deprecated: 2.16: Use gtk_orientable_set_orientation() instead.
**/ **/
void void
gtk_toolbar_set_orientation (GtkToolbar *toolbar, gtk_toolbar_set_orientation (GtkToolbar *toolbar,
@ -2850,6 +2857,8 @@ gtk_toolbar_set_orientation (GtkToolbar *toolbar,
* gtk_toolbar_set_orientation(). * gtk_toolbar_set_orientation().
* *
* Return value: the orientation * Return value: the orientation
*
* Deprecated: 2.16: Use gtk_orientable_get_orientation() instead.
**/ **/
GtkOrientation GtkOrientation
gtk_toolbar_get_orientation (GtkToolbar *toolbar) gtk_toolbar_get_orientation (GtkToolbar *toolbar)

View File

@ -151,14 +151,16 @@ GtkToolItem * gtk_toolbar_get_nth_item (GtkToolbar *toolbar,
gboolean gtk_toolbar_get_show_arrow (GtkToolbar *toolbar); gboolean gtk_toolbar_get_show_arrow (GtkToolbar *toolbar);
void gtk_toolbar_set_show_arrow (GtkToolbar *toolbar, void gtk_toolbar_set_show_arrow (GtkToolbar *toolbar,
gboolean show_arrow); gboolean show_arrow);
#ifndef GTK_DISABLE_DEPRECATED
GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar); GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar);
void gtk_toolbar_set_orientation (GtkToolbar *toolbar, void gtk_toolbar_set_orientation (GtkToolbar *toolbar,
GtkOrientation orientation); GtkOrientation orientation);
#ifndef GTK_DISABLE_DEPRECATED
gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar); gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar);
void gtk_toolbar_set_tooltips (GtkToolbar *toolbar, void gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
gboolean enable); gboolean enable);
#endif /* GTK_DISABLE_DEPRECATED */ #endif /* GTK_DISABLE_DEPRECATED */
GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar); GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
void gtk_toolbar_set_style (GtkToolbar *toolbar, void gtk_toolbar_set_style (GtkToolbar *toolbar,
GtkToolbarStyle style); GtkToolbarStyle style);