summaryrefslogtreecommitdiff
path: root/gtk/gtktoolitem.c
diff options
context:
space:
mode:
authorMathias Hasselmann <hasselmm@src.gnome.org>2007-12-14 10:57:46 +0000
committerMathias Hasselmann <hasselmm@src.gnome.org>2007-12-14 10:57:46 +0000
commit95adf7ee26a5c113ef63805842578254789c06e9 (patch)
treefbec6dfbe1662b816a7164009766332b4446f963 /gtk/gtktoolitem.c
parentea8074a4077ac7bf90f3873160da35bd491e8079 (diff)
downloadgtk+-95adf7ee26a5c113ef63805842578254789c06e9.tar.gz
Change GtkToolItem to retrieve its properties from GtkToolShell interface,
instead of relying on being child of a GtkToolbar. (#5034079) * gtk/gtk.symbols, docs/reference/gtk/gtk-docs.sgml, docs/reference/gtk/gtk-sections.txt: Add GtkToolShell symbols. * docs/reference/gtk/tmpl/gtktoolitem.sgml: Move section docs inline. * gtk/gtktoolbar.c: Implement GtkToolShellIface. * gtk/gtktoolbar.h: Remove _gtk_toolbar_rebuild_menu. * gtk/gtktoolitem.c: Use GtkToolShell, instead of GtkToolbar. Take section docs from template file and update them for GtkToolShell. * gtk/Makefile.am: Add gtk/gtktoolshell.c and gtk/gtktoolshell.h. * gtk/gtktoolshell.c, gtk/gtktoolshell.h: New GtkToolShellIface. svn path=/trunk/; revision=19177
Diffstat (limited to 'gtk/gtktoolitem.c')
-rw-r--r--gtk/gtktoolitem.c53
1 files changed, 38 insertions, 15 deletions
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 1916af938c..0fcf93e7e1 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -23,7 +23,7 @@
#include <config.h>
#include "gtktoolitem.h"
#include "gtkmarshalers.h"
-#include "gtktoolbar.h"
+#include "gtktoolshell.h"
#include "gtkseparatormenuitem.h"
#include "gtkintl.h"
#include "gtkmain.h"
@@ -32,6 +32,29 @@
#include <string.h>
+/**
+ * SECTION:gtktoolitem
+ * @short_description: The base class of widgets that can be added to #GtkToolShell
+ *
+ * #GtkToolItem<!-- -->s are widgets that can appear on a toolbar. To
+ * create a toolbar item that contain something else than a button, use
+ * gtk_tool_item_new(). Use gtk_container_add() to add a child
+ * widget to the tool item.
+ *
+ * For toolbar items that contain buttons, see the #GtkToolButton,
+ * #GtkToggleToolButton and #GtkRadioToolButton classes.
+ *
+ * See the #GtkToolbar class for a description of the toolbar widget, and
+ * #GtkToolShell for a description of the tool shell interface.
+ */
+
+/**
+ * GtkToolItem:
+ *
+ * The GtkToolItem struct contains only private data.
+ * It should only be accessed through the functions described below.
+ */
+
enum {
CREATE_MENU_PROXY,
TOOLBAR_RECONFIGURED,
@@ -192,10 +215,10 @@ gtk_tool_item_class_init (GtkToolItemClass *klass)
* item is a child of changes. For custom subclasses of #GtkToolItem,
* the default handler of this signal use the functions
* <itemizedlist>
- * <listitem>gtk_toolbar_get_orientation()</listitem>
- * <listitem>gtk_toolbar_get_style()</listitem>
- * <listitem>gtk_toolbar_get_icon_size()</listitem>
- * <listitem>gtk_toolbar_get_relief_style()</listitem>
+ * <listitem>gtk_tool_shell_get_orientation()</listitem>
+ * <listitem>gtk_tool_shell_get_style()</listitem>
+ * <listitem>gtk_tool_shell_get_icon_size()</listitem>
+ * <listitem>gtk_tool_shell_get_relief_style()</listitem>
* </itemizedlist>
* to find out what the toolbar should look like and change
* themselves accordingly.
@@ -518,10 +541,10 @@ gtk_tool_item_get_icon_size (GtkToolItem *tool_item)
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ICON_SIZE_LARGE_TOOLBAR);
parent = GTK_WIDGET (tool_item)->parent;
- if (!parent || !GTK_IS_TOOLBAR (parent))
+ if (!parent || !GTK_IS_TOOL_SHELL (parent))
return GTK_ICON_SIZE_LARGE_TOOLBAR;
- return gtk_toolbar_get_icon_size (GTK_TOOLBAR (parent));
+ return gtk_tool_shell_get_icon_size (GTK_TOOL_SHELL (parent));
}
/**
@@ -545,10 +568,10 @@ gtk_tool_item_get_orientation (GtkToolItem *tool_item)
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ORIENTATION_HORIZONTAL);
parent = GTK_WIDGET (tool_item)->parent;
- if (!parent || !GTK_IS_TOOLBAR (parent))
+ if (!parent || !GTK_IS_TOOL_SHELL (parent))
return GTK_ORIENTATION_HORIZONTAL;
- return gtk_toolbar_get_orientation (GTK_TOOLBAR (parent));
+ return gtk_tool_shell_get_orientation (GTK_TOOL_SHELL (parent));
}
/**
@@ -588,10 +611,10 @@ gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item)
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_TOOLBAR_ICONS);
parent = GTK_WIDGET (tool_item)->parent;
- if (!parent || !GTK_IS_TOOLBAR (parent))
+ if (!parent || !GTK_IS_TOOL_SHELL (parent))
return GTK_TOOLBAR_ICONS;
- return gtk_toolbar_get_style (GTK_TOOLBAR (parent));
+ return gtk_tool_shell_get_style (GTK_TOOL_SHELL (parent));
}
/**
@@ -616,10 +639,10 @@ gtk_tool_item_get_relief_style (GtkToolItem *tool_item)
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_RELIEF_NONE);
parent = GTK_WIDGET (tool_item)->parent;
- if (!parent || !GTK_IS_TOOLBAR (parent))
+ if (!parent || !GTK_IS_TOOL_SHELL (parent))
return GTK_RELIEF_NONE;
- return gtk_toolbar_get_relief_style (GTK_TOOLBAR (parent));
+ return gtk_tool_shell_get_relief_style (GTK_TOOL_SHELL (parent));
}
/**
@@ -1095,8 +1118,8 @@ gtk_tool_item_rebuild_menu (GtkToolItem *tool_item)
widget = GTK_WIDGET (tool_item);
- if (widget->parent && GTK_IS_TOOLBAR (widget->parent))
- _gtk_toolbar_rebuild_menu (GTK_TOOLBAR (widget->parent));
+ if (widget->parent && GTK_IS_TOOL_SHELL (widget->parent))
+ gtk_tool_shell_rebuild_menu (GTK_TOOL_SHELL (widget->parent));
}
/**