+
+/* GTK+ internal methods */
+
+gint
+_gtk_toolbar_get_default_space_size (void)
+{
+ return DEFAULT_SPACE_SIZE;
+}
+
+void
+_gtk_toolbar_paint_space_line (GtkWidget *widget,
+ GtkToolbar *toolbar,
+ GdkRectangle *area,
+ GtkAllocation *allocation)
+{
+ const double start_fraction = (SPACE_LINE_START / SPACE_LINE_DIVISION);
+ const double end_fraction = (SPACE_LINE_END / SPACE_LINE_DIVISION);
+
+ GtkOrientation orientation;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ orientation = toolbar? toolbar->orientation : GTK_ORIENTATION_HORIZONTAL;
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ gboolean wide_separators;
+ gint separator_width;
+
+ gtk_widget_style_get (widget,
+ "wide-separators", &wide_separators,
+ "separator-width", &separator_width,
+ NULL);
+
+ if (wide_separators)
+ gtk_paint_box (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget), GTK_SHADOW_ETCHED_OUT,
+ area, widget, "vseparator",
+ allocation->x + (allocation->width - separator_width) / 2,
+ allocation->y + allocation->height * start_fraction,
+ separator_width,
+ allocation->height * (end_fraction - start_fraction));
+ else
+ gtk_paint_vline (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget), area, widget,
+ "toolbar",
+ allocation->y + allocation->height * start_fraction,
+ allocation->y + allocation->height * end_fraction,
+ allocation->x + (allocation->width - widget->style->xthickness) / 2);
+ }
+ else
+ {
+ gboolean wide_separators;
+ gint separator_height;
+
+ gtk_widget_style_get (widget,
+ "wide-separators", &wide_separators,
+ "separator-height", &separator_height,
+ NULL);
+
+ if (wide_separators)
+ gtk_paint_box (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget), GTK_SHADOW_ETCHED_OUT,
+ area, widget, "hseparator",
+ allocation->x + allocation->width * start_fraction,
+ allocation->y + (allocation->height - separator_height) / 2,
+ allocation->width * (end_fraction - start_fraction),
+ separator_height);
+ else
+ gtk_paint_hline (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget), area, widget,
+ "toolbar",
+ allocation->x + allocation->width * start_fraction,
+ allocation->x + allocation->width * end_fraction,
+ allocation->y + (allocation->height - widget->style->ythickness) / 2);
+ }
+}
+
+gchar *
+_gtk_toolbar_elide_underscores (const gchar *original)
+{
+ gchar *q, *result;
+ const gchar *p, *end;
+ gsize len;
+ gboolean last_underscore;
+
+ if (!original)
+ return NULL;
+
+ len = strlen (original);
+ q = result = g_malloc (len + 1);
+ last_underscore = FALSE;
+
+ end = original + len;
+ for (p = original; p < end; p++)
+ {
+ if (!last_underscore && *p == '_')
+ last_underscore = TRUE;
+ else
+ {
+ last_underscore = FALSE;
+ if (original + 2 <= p && p + 1 <= end &&
+ p[-2] == '(' && p[-1] == '_' && p[0] != '_' && p[1] == ')')
+ {
+ q--;
+ *q = '\0';
+ p++;
+ }
+ else
+ *q++ = *p;
+ }
+ }
+
+ if (last_underscore)
+ *q++ = '_';
+
+ *q = '\0';
+
+ return result;
+}
+
+static GtkIconSize
+toolbar_get_icon_size (GtkToolShell *shell)
+{
+ return GTK_TOOLBAR (shell)->icon_size;
+}
+
+static GtkOrientation
+toolbar_get_orientation (GtkToolShell *shell)
+{
+ return GTK_TOOLBAR (shell)->orientation;
+}
+
+static GtkToolbarStyle
+toolbar_get_style (GtkToolShell *shell)
+{
+ return GTK_TOOLBAR (shell)->style;
+}
+
+static GtkReliefStyle
+toolbar_get_relief_style (GtkToolShell *shell)
+{
+ return get_button_relief (GTK_TOOLBAR (shell));
+}
+
+static void
+toolbar_rebuild_menu (GtkToolShell *shell)
+{
+ GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (shell);
+ GList *list;
+
+ priv->need_rebuild = TRUE;
+
+ for (list = priv->content; list != NULL; list = list->next)
+ {
+ ToolbarContent *content = list->data;
+
+ toolbar_content_set_unknown_menu_status (content);
+ }
+
+ gtk_widget_queue_resize (GTK_WIDGET (shell));
+}
+
+#define __GTK_TOOLBAR_C__
+#include "gtkaliasdef.c"