Commit 720bdb8d authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Use gssize for length, not gsize.

2003-08-26  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui_from_string): Use gssize
	for length, not gsize.

	* gtk/gtkuimanager.c: Refactor the XML format a bit: rename <Root> to
	<ui> and make it optional in strings. Rename verb to action, <dockitem>
	to <toolbar>, <menu> to <menubar>, <submenu> to <menu>.

	* demos/gtk-demo/appwindow.c:
	* tests/testactions.c:
	* tests/testmerge.c:
	* tests/merge-1.ui:
	* tests/merge-2.ui:
	* tests/merge-3.ui: Adjust to the new XML format.
parent 2be259b2
2003-08-26 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui_from_string): Use gssize
for length, not gsize.
* gtk/gtkuimanager.c: Refactor the XML format a bit: rename <Root> to
<ui> and make it optional in strings. Rename verb to action, <dockitem>
to <toolbar>, <menu> to <menubar>, <submenu> to <menu>.
* demos/gtk-demo/appwindow.c:
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-1.ui:
* tests/merge-2.ui:
* tests/merge-3.ui: Adjust to the new XML format.
Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_layout_width):
......@@ -21,10 +37,12 @@ Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h:
* tests/testmerge.c:
* tests/testactions.c:
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by GtkUIManager.
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by
GtkUIManager.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating: add comments to
entries array, remove newlines from ui definition. Don't use the ::add_widget signal.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating:
add comments to entries array, remove newlines from ui definition. Don't
use the ::add_widget signal.
Mon Aug 25 17:28:04 2003 Owen Taylor <otaylor@redhat.com>
......
2003-08-26 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui_from_string): Use gssize
for length, not gsize.
* gtk/gtkuimanager.c: Refactor the XML format a bit: rename <Root> to
<ui> and make it optional in strings. Rename verb to action, <dockitem>
to <toolbar>, <menu> to <menubar>, <submenu> to <menu>.
* demos/gtk-demo/appwindow.c:
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-1.ui:
* tests/merge-2.ui:
* tests/merge-3.ui: Adjust to the new XML format.
Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_layout_width):
......@@ -21,10 +37,12 @@ Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h:
* tests/testmerge.c:
* tests/testactions.c:
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by GtkUIManager.
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by
GtkUIManager.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating: add comments to
entries array, remove newlines from ui definition. Don't use the ::add_widget signal.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating:
add comments to entries array, remove newlines from ui definition. Don't
use the ::add_widget signal.
Mon Aug 25 17:28:04 2003 Owen Taylor <otaylor@redhat.com>
......
2003-08-26 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui_from_string): Use gssize
for length, not gsize.
* gtk/gtkuimanager.c: Refactor the XML format a bit: rename <Root> to
<ui> and make it optional in strings. Rename verb to action, <dockitem>
to <toolbar>, <menu> to <menubar>, <submenu> to <menu>.
* demos/gtk-demo/appwindow.c:
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-1.ui:
* tests/merge-2.ui:
* tests/merge-3.ui: Adjust to the new XML format.
Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_layout_width):
......@@ -21,10 +37,12 @@ Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h:
* tests/testmerge.c:
* tests/testactions.c:
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by GtkUIManager.
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by
GtkUIManager.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating: add comments to
entries array, remove newlines from ui definition. Don't use the ::add_widget signal.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating:
add comments to entries array, remove newlines from ui definition. Don't
use the ::add_widget signal.
Mon Aug 25 17:28:04 2003 Owen Taylor <otaylor@redhat.com>
......
2003-08-26 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui_from_string): Use gssize
for length, not gsize.
* gtk/gtkuimanager.c: Refactor the XML format a bit: rename <Root> to
<ui> and make it optional in strings. Rename verb to action, <dockitem>
to <toolbar>, <menu> to <menubar>, <submenu> to <menu>.
* demos/gtk-demo/appwindow.c:
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-1.ui:
* tests/merge-2.ui:
* tests/merge-3.ui: Adjust to the new XML format.
Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_layout_width):
......@@ -21,10 +37,12 @@ Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h:
* tests/testmerge.c:
* tests/testactions.c:
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by GtkUIManager.
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by
GtkUIManager.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating: add comments to
entries array, remove newlines from ui definition. Don't use the ::add_widget signal.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating:
add comments to entries array, remove newlines from ui definition. Don't
use the ::add_widget signal.
Mon Aug 25 17:28:04 2003 Owen Taylor <otaylor@redhat.com>
......
2003-08-26 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui_from_string): Use gssize
for length, not gsize.
* gtk/gtkuimanager.c: Refactor the XML format a bit: rename <Root> to
<ui> and make it optional in strings. Rename verb to action, <dockitem>
to <toolbar>, <menu> to <menubar>, <submenu> to <menu>.
* demos/gtk-demo/appwindow.c:
* tests/testactions.c:
* tests/testmerge.c:
* tests/merge-1.ui:
* tests/merge-2.ui:
* tests/merge-3.ui: Adjust to the new XML format.
Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_update_layout_width):
......@@ -21,10 +37,12 @@ Mon Aug 25 19:55:55 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h:
* tests/testmerge.c:
* tests/testactions.c:
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by GtkUIManager.
* demos/gtk-demo/appwindow.c: Replace all uses of GtkMenuMerge by
GtkUIManager.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating: add comments to
entries array, remove newlines from ui definition. Don't use the ::add_widget signal.
* demos/gtk-demo/appwindow.c: Make GtkMenuMerge demo less intimidating:
add comments to entries array, remove newlines from ui definition. Don't
use the ::add_widget signal.
Mon Aug 25 17:28:04 2003 Owen Taylor <otaylor@redhat.com>
......
......@@ -101,39 +101,39 @@ static GtkActionGroupEntry entries[] = {
static guint n_entries = G_N_ELEMENTS (entries);
static const gchar *ui_info =
"<Root>"
" <menu name='MenuBar'>"
" <submenu name='FileMenu'>"
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='FileMenu'>"
" <menuitem name='New'/>"
" <menuitem name='Open'/>"
" <menuitem name='Save'/>"
" <menuitem name='SaveAs'/>"
" <separator name='Sep1'/>"
" <menuitem name='Quit'/>"
" </submenu>"
" <submenu name='PreferencesMenu'>"
" <submenu name='ColorMenu'>"
" </menu>"
" <menu name='PreferencesMenu'>"
" <menu name='ColorMenu'>"
" <menuitem name='Red'/>"
" <menuitem name='Green'/>"
" <menuitem name='Blue'/>"
" </submenu>"
" <submenu name='ShapeMenu'>"
" </menu>"
" <menu name='ShapeMenu'>"
" <menuitem name='Square'/>"
" <menuitem name='Rectangle'/>"
" <menuitem name='Oval'/>"
" </submenu>"
" </submenu>"
" <submenu name='HelpMenu'>"
" </menu>"
" </menu>"
" <menu name='HelpMenu'>"
" <menuitem name='About'/>"
" </submenu>"
" </menu>"
" <dockitem name='ToolBar'>"
" </menu>"
" </menubar>"
" <toolbar name='ToolBar'>"
" <toolitem name='Open'/>"
" <toolitem name='Quit'/>"
" <separator name='Sep1'/>"
" <toolitem name='Logo'/>"
" </dockitem>"
"</Root>";
" </toolbar>"
"</ui>";
......
......@@ -428,7 +428,7 @@ gtk_action_sync_property (GtkAction *action,
property = g_param_spec_get_name (pspec);
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_object_get_property (G_OBJECT (action), property, &value);
g_object_set_property (G_OBJECT (proxy), property, &value);
......
......@@ -212,7 +212,7 @@ gtk_ui_manager_init (GtkUIManager *self)
merge_id = gtk_ui_manager_next_merge_id (self);
node = get_child_node (self, NULL, "Root", 4,
node = get_child_node (self, NULL, "ui", 4,
GTK_UI_MANAGER_ROOT, TRUE, FALSE);
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (node), merge_id, 0);
node = get_child_node (self, self->private_data->root_node, "popups", 6,
......@@ -567,7 +567,7 @@ start_element_handler (GMarkupParseContext *context,
gint i;
const gchar *node_name;
GQuark verb_quark;
GQuark action_quark;
gboolean top;
gboolean raise_error = TRUE;
......@@ -576,7 +576,7 @@ start_element_handler (GMarkupParseContext *context,
/* work out a name for this node. Either the name attribute, or
* element name */
node_name = element_name;
verb_quark = 0;
action_quark = 0;
top = FALSE;
for (i = 0; attribute_names[i] != NULL; i++)
{
......@@ -584,34 +584,34 @@ start_element_handler (GMarkupParseContext *context,
{
node_name = attribute_values[i];
}
else if (!strcmp (attribute_names[i], "verb"))
else if (!strcmp (attribute_names[i], "action"))
{
verb_quark = g_quark_from_string (attribute_values[i]);
action_quark = g_quark_from_string (attribute_values[i]);
}
else if (!strcmp (attribute_names[i], "pos"))
{
top = !strcmp (attribute_values[i], "top");
}
}
/* if no verb, then set it to the node's name */
if (verb_quark == 0)
verb_quark = g_quark_from_string (node_name);
/* if no action, then set it to the node's name */
if (action_quark == 0)
action_quark = g_quark_from_string (node_name);
switch (element_name[0])
{
case 'R':
if (ctx->state == STATE_START && !strcmp (element_name, "Root"))
case 'u':
if (ctx->state == STATE_START && !strcmp (element_name, "ui"))
{
ctx->state = STATE_ROOT;
ctx->current = self->private_data->root_node;
raise_error = FALSE;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
}
break;
case 'm':
if (ctx->state == STATE_ROOT && !strcmp (element_name, "menu"))
if (ctx->state == STATE_ROOT && !strcmp (element_name, "menubar"))
{
ctx->state = STATE_MENU;
ctx->current = get_child_node (self, ctx->current,
......@@ -619,12 +619,28 @@ start_element_handler (GMarkupParseContext *context,
GTK_UI_MANAGER_MENUBAR,
TRUE, FALSE);
if (NODE_INFO (ctx->current)->action_name == 0)
NODE_INFO (ctx->current)->action_name = verb_quark;
NODE_INFO (ctx->current)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
}
else if (ctx->state == STATE_MENU && !strcmp (element_name, "menu"))
{
ctx->state = STATE_MENU;
ctx->current = get_child_node (self, ctx->current,
node_name, strlen (node_name),
GTK_UI_MANAGER_MENU,
TRUE, top);
if (NODE_INFO (ctx->current)->action_name == 0)
NODE_INFO (ctx->current)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, action_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
}
else if (ctx->state == STATE_MENU && !strcmp (element_name, "menuitem"))
......@@ -637,30 +653,12 @@ start_element_handler (GMarkupParseContext *context,
GTK_UI_MANAGER_MENUITEM,
TRUE, top);
if (NODE_INFO (node)->action_name == 0)
NODE_INFO (node)->action_name = verb_quark;
NODE_INFO (node)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (node),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (node)->dirty = TRUE;
raise_error = FALSE;
}
break;
case 'd':
if (ctx->state == STATE_ROOT && !strcmp (element_name, "dockitem"))
{
ctx->state = STATE_TOOLBAR;
ctx->current = get_child_node (self, ctx->current,
node_name, strlen (node_name),
GTK_UI_MANAGER_TOOLBAR,
TRUE, FALSE);
if (NODE_INFO (ctx->current)->action_name == 0)
NODE_INFO (ctx->current)->action_name = verb_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
}
break;
......@@ -674,7 +672,7 @@ start_element_handler (GMarkupParseContext *context,
TRUE, FALSE);
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
......@@ -687,10 +685,10 @@ start_element_handler (GMarkupParseContext *context,
GTK_UI_MANAGER_MENU,
TRUE, FALSE);
if (NODE_INFO (ctx->current)->action_name == 0)
NODE_INFO (ctx->current)->action_name = verb_quark;
NODE_INFO (ctx->current)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
......@@ -710,30 +708,14 @@ start_element_handler (GMarkupParseContext *context,
TRUE, top);
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
}
break;
case 's':
if (ctx->state == STATE_MENU && !strcmp (element_name, "submenu"))
{
ctx->state = STATE_MENU;
ctx->current = get_child_node (self, ctx->current,
node_name, strlen (node_name),
GTK_UI_MANAGER_MENU,
TRUE, top);
if (NODE_INFO (ctx->current)->action_name == 0)
NODE_INFO (ctx->current)->action_name = verb_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, verb_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
}
else if ((ctx->state == STATE_MENU || ctx->state == STATE_TOOLBAR) &&
if ((ctx->state == STATE_MENU || ctx->state == STATE_TOOLBAR) &&
!strcmp (element_name, "separator"))
{
GNode *node;
......@@ -747,17 +729,33 @@ start_element_handler (GMarkupParseContext *context,
GTK_UI_MANAGER_SEPARATOR,
TRUE, top);
if (NODE_INFO (node)->action_name == 0)
NODE_INFO (node)->action_name = verb_quark;
NODE_INFO (node)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (node),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (node)->dirty = TRUE;
raise_error = FALSE;
}
break;
case 't':
if (ctx->state == STATE_TOOLBAR && !strcmp (element_name, "toolitem"))
if (ctx->state == STATE_ROOT && !strcmp (element_name, "toolbar"))
{
ctx->state = STATE_TOOLBAR;
ctx->current = get_child_node (self, ctx->current,
node_name, strlen (node_name),
GTK_UI_MANAGER_TOOLBAR,
TRUE, FALSE);
if (NODE_INFO (ctx->current)->action_name == 0)
NODE_INFO (ctx->current)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (ctx->current),
ctx->merge_id, action_quark);
NODE_INFO (ctx->current)->dirty = TRUE;
raise_error = FALSE;
}
else if (ctx->state == STATE_TOOLBAR && !strcmp (element_name, "toolitem"))
{
GNode *node;
......@@ -767,10 +765,10 @@ start_element_handler (GMarkupParseContext *context,
GTK_UI_MANAGER_TOOLITEM,
TRUE, top);
if (NODE_INFO (node)->action_name == 0)
NODE_INFO (node)->action_name = verb_quark;
NODE_INFO (node)->action_name = action_quark;
gtk_ui_manager_node_prepend_ui_reference (NODE_INFO (node),
ctx->merge_id, verb_quark);
ctx->merge_id, action_quark);
NODE_INFO (node)->dirty = TRUE;
raise_error = FALSE;
......@@ -880,6 +878,56 @@ static GMarkupParser ui_parser = {
};
static gboolean
xml_isspace (char c)
{
return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}
static guint
add_ui_from_string (GtkUIManager *self,
const gchar *buffer,
gssize length,
gboolean needs_root,
GError **error)
{
ParseContext ctx = { 0 };
GMarkupParseContext *context;
ctx.state = STATE_START;
ctx.self = self;
ctx.current = NULL;
ctx.merge_id = gtk_ui_manager_next_merge_id (self);
context = g_markup_parse_context_new (&ui_parser, 0, &ctx, NULL);
if (needs_root)
if (!g_markup_parse_context_parse (context, "<ui>", -1, error))
goto error;
if (!g_markup_parse_context_parse (context, buffer, length, error))
goto error;
if (needs_root)
if (!g_markup_parse_context_parse (context, "</ui>", -1, error))
goto error;
if (!g_markup_parse_context_end_parse (context, error))
goto error;
g_markup_parse_context_free (context);
gtk_ui_manager_queue_update (self);
return ctx.merge_id;
error:
g_markup_parse_context_free (context);
return 0;
}
/**
* gtk_ui_manager_add_ui_from_string:
* @self: a #GtkUIManager object
......@@ -899,41 +947,28 @@ static GMarkupParser ui_parser = {
guint
gtk_ui_manager_add_ui_from_string (GtkUIManager *self,
const gchar *buffer,
gsize length,
gssize length,
GError **error)
{
ParseContext ctx = { 0 };
GMarkupParseContext *context;
gboolean res = TRUE;
gboolean needs_root = TRUE;
const gchar *p;
const gchar *end;
g_return_val_if_fail (GTK_IS_UI_MANAGER (self), FALSE);
g_return_val_if_fail (buffer != NULL, FALSE);
ctx.state = STATE_START;
ctx.self = self;
ctx.current = NULL;
ctx.merge_id = gtk_ui_manager_next_merge_id (self);
context = g_markup_parse_context_new (&ui_parser, 0, &ctx, NULL);
if (length < 0)
length = strlen (buffer);
if (g_markup_parse_context_parse (context, buffer, length, error))
{
if (!g_markup_parse_context_end_parse (context, error))
res = FALSE;
}
else
res = FALSE;
p = buffer;
end = buffer + length;
while (p != end && xml_isspace (*p))
++p;
g_markup_parse_context_free (context);
gtk_ui_manager_queue_update (self);
if (res)
return ctx.merge_id;
return 0;
if (end - p >= 4 && strncmp (p, "<ui>", 4) == 0)
needs_root = FALSE;
return add_ui_from_string (self, buffer, length, needs_root, error);
}
/**
......@@ -963,7 +998,7 @@ gtk_ui_manager_add_ui_from_file (GtkUIManager *self,
if (!g_file_get_contents (filename, &buffer, &length, error))
return 0;
res = gtk_ui_manager_add_ui_from_string (self, buffer, length, error);
res = add_ui_from_string (self, buffer, length, FALSE, error);
g_free (buffer);
return res;
......@@ -1572,25 +1607,25 @@ gtk_ui_manager_dirty_all (GtkUIManager *self)
static const gchar *open_tag_format[] = {
"%*s<UNDECIDED>\n",
"%*s<Root>\n",
"%*s<menu name=\"%s\">\n",
"%*s<submenu name=\"%s\" verb=\"%s\">\n",
"%*s<dockitem name=\"%s\">\n",
"%*s<ui>\n",
"%*s<menubar name=\"%s\">\n",
"%*s<menu name=\"%s\" action=\"%s\">\n",
"%*s<toolbar name=\"%s\">\n",
"%*s<placeholder name=\"%s\">\n",
"%*s<placeholder name=\"%s\">\n",
"%*s<popups>\n",
"%*s<menuitem name=\"%s\" verb=\"%s\"/>\n",
"%*s<toolitem name=\"%s\" verb=\"%s\"/>\n",
"%*s<menuitem name=\"%s\" action=\"%s\"/>\n",
"%*s<toolitem name=\"%s\" action=\"%s\"/>\n",
"%*s<separator/>\n",
"%*s<popup name=\"%s\">\n"
};
static const gchar *close_tag_format[] = {
"%*s</UNDECIDED>\n",
"%*s</Root>\n",
"%*s</ui>\n",
"%*s</menubar>\n",
"%*s</menu>\n",
"%*s</submenu>\n",
"%*s</dockitem>\n",
"%*s</toolbar>\n",
"%*s</placeholder>\n",
"%*s</placeholder>\n",
"%*s</popups>\n",
......
......@@ -95,7 +95,7 @@ GtkWidget *gtk_ui_manager_get_widget (GtkUIManager *self,
* interface */
guint gtk_ui_manager_add_ui_from_string (GtkUIManager *self,
const gchar *buffer,
gsize length,
gssize length,
GError **error);
guint gtk_ui_manager_add_ui_from_file (GtkUIManager *self,
const gchar *filename,
......
<!--*- xml -*-->
<Root>
<menu>
<submenu name="FileMenu" verb="StockFileMenuAction">
<menuitem name="Open" verb="OpenAction" />
</submenu>
<submenu name="EditMenu" verb="StockEditMenuAction">
<menuitem name="Cut" verb="CutAction" />
</submenu>
<ui>
<menubar>
<menu name="FileMenu" action="StockFileMenuAction">
<menuitem name="Open" action="OpenAction" />
</menu>
<menu name="EditMenu" action="StockEditMenuAction">
<menuitem name="Cut" action="CutAction" />
</menu>
<placeholder name="TestPlaceholder" />
</menu>
<dockitem name="toolbar1">
<placeholder name="ToolbarPlaceholder" />
<toolitem name="NewButton" verb="NewAction" />
<toolitem name="CutButton" verb="CutAction" />
<toolitem name="CopyButton" verb="CopyAction" />
<toolitem name="PasteButton" verb="PasteAction" />
</menubar>
<toolbar name="toolbar1">
<placeholder name="ToolbarPlaceholder">
<toolitem name="nb2" action="NewAction" />
</placeholder>
<toolitem name="NewButton" action="NewAction" />
<toolitem name="CutButton" action="CutAction" />
<toolitem name="CopyButton" action="CopyAction" />
<toolitem name="PasteButton" action="PasteAction" />
<placeholder name="JustifyToolItems"/>
</dockitem>
</Root>
</toolbar>
</ui>
<!--*- xml -*-->
<Root>
<menu>
<submenu name="FileMenu" verb="StockFileMenuAction">
<menuitem name="New" verb="NewAction" pos="top" />
<ui>
<menubar>
<menu name="FileMenu" action="StockFileMenuAction">
<menuitem name="New" action="NewAction" pos="top" />
<separator />
<menuitem name="Quit" verb="QuitAction" />
</submenu>
<submenu name="HelpMenu" verb="StockHelpMenuAction">