1. 10 Oct, 2003 1 commit
    • Matthias Clasen's avatar
      Fixes for (#124212, Marco Pesenti Gritti): · e8bcc9af
      Matthias Clasen authored
      Fri Oct 10 22:50:05 2003  Matthias Clasen  <maclas@gmx.de>
      
      	Fixes for (#124212, Marco Pesenti Gritti):
      
      	* gtk/gtkuimanager.c (update_smart_separators): Don't spit
      	warnings for popups.
      	(_gtk_menu_is_empty): Return FALSE for non-menus.
      e8bcc9af
  2. 30 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Test handling of empty menus. · 57f13d81
      Matthias Clasen authored
      2003-09-30  Matthias Clasen  <maclas@gmx.de>
      
      	* tests/merge-*.ui:
      	* tests/testmerge.c: Test handling of empty menus.
      
      	* gtk/gtkuimanager.c (_gtk_menu_is_empty): New function to determine
      	whether a menu is empty. Used in gtkaction.c.
      	(update_smart_separators): Also update the visibility of empty menus.
      	(update_node): When creating a new menu proxy, insert an "Empty" menu
      	item which only gets shown if the menu is empty.
      
      	* gtk/gtkaction.c (gtk_action_class_init): Document the meaning of
      	"is_important" for menu proxies.
      	(_gtk_action_sync_menu_visible): New function to sync the visibility
      	of menu proxies. Used in gtkuimanager.c.
      	(gtk_action_sync_visible): New function to sync the visibility of
      	proxies.
      57f13d81
  3. 26 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Demonstrate the use of the connect-proxy signal. · eeed9d18
      Matthias Clasen authored
      2003-09-27  Matthias Clasen  <maclas@gmx.de>
      
      	* tests/testmerge.c: Demonstrate the use of the
      	connect-proxy signal.
      
      	* gtk/gtkaction.c (connect_proxy): Add connect-proxy and
      	disconnect-proxy signals to do small customizations
      	like displaying tooltips in the statusbar without
      	custom actions.  (#122894, Philip Langdale)
      
      	* gtk/gtkuimanager.c (update_node): Don't leak tooltip.
      eeed9d18
  4. 23 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Sync tooltips on toolitems. · a93cee89
      Matthias Clasen authored
      2003-09-24  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkaction.c (connect_proxy): Sync tooltips on toolitems.
      
      	* gtk/gtkuimanager.c (update_node): Don't complain about missing
      	actions on popups. Re-set "tooltip" property on toolitems after
      	adding them to parent to trigger proxy update.
      a93cee89
  5. 21 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Changes to make cross-process merging feasible: · d381967d
      Matthias Clasen authored
      2003-09-21  Matthias Clasen  <maclas@gmx.de>
      
      	Changes to make cross-process merging feasible:
      
      	* gtk/gtkuimanager.[hc]: Add a readonly "ui" property which holds the
      	merged UI definition. Remove the "changed" signal, since its role
      	is now filled by "notify::ui". Instead add a "actions-changed" signal
      	which gets emitted when the set of actions changes.
      
      	* gtk/gtktoggleactionprivate.h:
      	* gtk/gtktoggleaction.[hc] (gtk_toggle_action_[sg]et_draw_as_radio):
      	Add a "draw_as_radio" property to toggle actions so that they can be
      	used as proxies for radio actions much like the "draw_as_radio"
      	property on check menu items enables them to operate as proxies for
      	radio actions.
      
      	Prevent the "show_all" trap for action-based menus (see
      	http://mail.gnome.org/archives/gtk-devel-list/2003-September/
      	msg00260.html):
      
      	* gtk/gtkmenu.c (gtk_menu_{hide,show}_all): Remove g_return_if_fail()
      	calls from static functions.
      
      	* gtk/gtkuimanager.c (update_node):
      	* gtk/gtkaction.c (connect_proxy): Set "no_show_all" on constructed
      	widgets whose visibility is externally controlled.
      
      	* gtk/gtkwidget.[hc] (gtk_widget_[gs]et_no_show_all): Add a boolean
      	"no_show_all" property with setter and getter. When TRUE, it keeps
      	gtk_widget_{hide,show}_all() from modifying the visibility of the
      	widget and its children.
      d381967d
  6. 17 Sep, 2003 3 commits
    • Matthias Clasen's avatar
      Install accelerators on actions, not on proxies, support accelerator-only · 0ceb0db0
      Matthias Clasen authored
      2003-09-18  Matthias Clasen  <maclas@gmx.de>
      
      	Install accelerators on actions, not on proxies, support
      	accelerator-only actions:
      
      	* gtk/gtkmenu.c (get_accel_path): New function to get the accel path
      	and its lock status either via _gtk_widget_get_accel_path() or by
      	looking at the accel_path stored in the menu item itself and determining
      	its lock status by peeking into the contained accel label. This was
      	already (accidentally) committed a week ago.
      
      	* gtk/gtkaction.h (gtk_action_set_accel_group):
      	(gtk_action_[dis]connect_accelerator): New functions.
      
      	* gtk/gtkaction.c (struct _GtkActionPrivate): Add accel_group,
      	accel_closure and accel_count. We must have a reference to the accel_group,
      	since we need it in connect_proxy. The count is necessary to ensure
      	that the accelerator isn't removed before the last proxy requesting
      	it has been unmerged.
      	(connect_proxy): Connect the accelerator to the
      	action now, only set the accel_path on the menuitem.
      	(remove_proxy): Disconnect the accelerator from the action, not from
      	the menuitem.
      	(gtk_action_set_accel_group): Set the accel group.
      	(gtk_action_[dis]connect_accelerator): Count the number of times
      	this functions have been called and install/remove the accelerator if
      	the count leaves/reaches zero.
      
      	* gtk/gtkuimanager.h (GtkUIManagerItemType): Add
      	GTK_UI_MANAGER_ACCELERATOR.
      
      	* gtk/gtkuimanager.c (NodeType): Add NODE_TYPE_ACCELERATOR.
      	(start_element_handler): Create NODE_TYPE_ACCELERATOR nodes from
      	<accelerator> elements.
      	(gtk_ui_manager_add_ui): Create NODE_TYPE_ACCELERATOR nodes when
      	type is GTK_UI_MANAGER_ACCELERATOR.
      	(update_node): Set the accel group on actions before creating their
      	proxies. Don't set the accel group on created menus. For
      	NODE_TYPE_ACCELERATOR nodes, [dis]connect the actions' accelerator.
      	(print_node): Also emit <accelerator> elements.
      
      	* tests/testmerge.c (dump_accels): Add a "Dump Accels" button.
      0ceb0db0
    • Matthias Clasen's avatar
      Robustness improvements. · a7ad2a46
      Matthias Clasen authored
      	* gtk/gtkuimanager.c (update_node): Robustness improvements.
      a7ad2a46
    • Matthias Clasen's avatar
      Report unexpected character data as error from the GMarkup parser, · 3044d0f5
      Matthias Clasen authored
      2003-09-17  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.c (text_handler): Report unexpected character
      	data as error from the GMarkup parser, otherwise things like
      	gtk_ui_manager_add_ui_from_string (ui, "Hi there!", -1, &error)
      	pass unexpectedly.
      3044d0f5
  7. 15 Sep, 2003 2 commits
    • Matthias Clasen's avatar
      Apply egtk-format-protos. Doc tweaks. · 543b020f
      Matthias Clasen authored
      	* gtk/gtkaction.h: Apply egtk-format-protos.
      	* gtk/gtkuimanager.c: Doc tweaks.
      
      	* gtk/tmpl/gtkaction.sgml:
      	* gtk/tmpl/gtkradioaction.sgml:
      	* gtk/tmpl/gtkactiongroup.sgml:
      	* gtk/tmpl/gtkuimanager.sgml: Updates.
      543b020f
    • Matthias Clasen's avatar
      New function which implements "smart" separators by iterating once over · c77b0caa
      Matthias Clasen authored
      	* gtk/gtkuimanager.c (update_smart_separators): New function which
      	implements "smart" separators by iterating once over the entries of a
      	menu, hiding and showing separators as necessary.
      	(update_node): Mark separators used as fences of placeholders as
      	hidden. Explicitly added separators are marked as smart. Call
      	update_smart_separators after updating a menu or toolbar node.
      	Connect update_smart_separators to "notify::visible" signal on menu
      	and tool items.
      
      	* tests/merge-[12].ui: Test smart separators.
      
      	* gtk/tmpl/gtkuimanager.sgml: Add a paragraph about smart separators.
      c77b0caa
  8. 11 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Add table menu tests. · 6f81c10a
      Matthias Clasen authored
      2003-09-11  Matthias Clasen  <maclas@gmx.de>
      
      	* tests/testgtk.c: Add table menu tests.
      
      	* gtk/gtkmenu.c (gtk_menu_free_private): Don't forget to free the
      	GtkMenuPrivate struct itself. Pointed out by valgrind.
      
      	* gtk/gtkuimanager.c (gtk_ui_manager_finalize): Clean up
      	properly.  (#121998)
      6f81c10a
  9. 06 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Fix a C99ism. (#121640, Josh Beam) · e8c93d56
      Matthias Clasen authored
      2003-09-07  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.c (update_node): Fix a C99ism.  (#121640,
      	Josh Beam)
      
      	Fixes for accelerator handling during (un)merging:
      
      	* gtk/gtkuimanager.c (update_node): Move setting info-action
      	after the switch, since the old action is needed in some cases.
      	In cases of proxy type mismatch, disconnect the old proxy from
      	the old action.
      
      	* gtk/gtkaction.c (remove_proxy): Renamed from
      	gtk_action_remove_proxy(). Move unsetting of the accelerator
      	here from disconnect_proxy() in order to catch all cases of
      	removing a proxy.
      	(gtk_action_disconnect_proxy): Fix logic in g_return_if_fail()
      	to fail if proxy isn't a proxy of action.
      e8c93d56
  10. 04 Sep, 2003 4 commits
    • Matthias Clasen's avatar
      Test gtk_ui_manager_add_ui(). · 02a963e1
      Matthias Clasen authored
      2003-09-04  Matthias Clasen  <maclas@gmx.de>
      
      	* tests/testmerge.c (toggle_dynamic): Test gtk_ui_manager_add_ui().
      
      	* gtk/gtkuimanager.h: Add GtkUIManagerItemType enum which is needed for the
      	'type' argument of gtk_ui_manager_add_ui().
      
      	* gtk/gtkuimanager.[hc] (gtk_ui_manager_add_ui): Add 'type' and 'top' arguments
      	to make this function as powerful as the XML methods of adding UI.  (#120647)
      
      	* gtk/gtk-sections.txt: Add GtkUIManagerItemType.
      02a963e1
    • Matthias Clasen's avatar
      Use "position" instead of "pos". · 6c227b5a
      Matthias Clasen authored
      	* tests/merge-2.ui: Use "position" instead of "pos".
      
      	* gtk/gtkuimanager.c (start_element_handler): No need
      	to be terse: Change the name of the "pos" attribute
      	to "position".
      
      	* gtk/tmpl/gtkuimanager.sgml: Change the name of the "pos"
      	attribute to "position".
      6c227b5a
    • Matthias Clasen's avatar
      Un-prefix GtkUIManagerNodeType and GtkUIManagerNode to shorten the names · e4dbc17a
      Matthias Clasen authored
      	* gtk/gtkuimanager.c: Un-prefix GtkUIManagerNodeType and
      	GtkUIManagerNode to shorten the names and to make the
      	GTK_UI_MANAGER_<TYPE> names available for a public enum.
      e4dbc17a
    • Matthias Clasen's avatar
      Various doc tweaks. · e6a8aa11
      Matthias Clasen authored
      2003-09-04  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.c: Various doc tweaks.
      
      	* gtk/gtkuimanager.c (start_element_handler):
      	(end_element_handler): Improve error reporting.
      e6a8aa11
  11. 01 Sep, 2003 1 commit
    • Matthias Clasen's avatar
      Shorten the names of some static functions. · cbbe97ab
      Matthias Clasen authored
      2003-09-02  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.c: Shorten the names of some static
      	functions.
      
      	Support adding and removing merge nodes dynamically (#120647,
      	Anders Carlsson):
      
      	* gtk/gtkuimanager.[ch] (gtk_ui_manager_new_merge_id): Renamed
      	gtk_ui_manager_next_merge_id to gtk_ui_manager_new_merge_id
      	and made it public.
      	(gtk_ui_manager_add_ui): New function to add UI elements
      	without juggling XML fragments, currently restricted to menuitems,
      	toolitems and separators. Actions still come from registered
      	action groups.
      cbbe97ab
  12. 31 Aug, 2003 4 commits
    • Matthias Clasen's avatar
      Make this public again, since it's occasionally useful. (#121128, Marco · 7cddc693
      Matthias Clasen authored
      2003-09-01  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
      	this public again, since it's occasionally useful.  (#121128,
      	Marco Pesenti Gritti)
      
      	* gtk/gtkaction.c: Add an "is_important" property and propagate
      	it to toolitem proxies.  (#121058, Marco Pesenti Gritti)
      7cddc693
    • Matthias Clasen's avatar
      g_return_if_fail() if path is NULL. (gtk_ui_manager_get_node): Avoid a · 4e3936c7
      Matthias Clasen authored
      2003-09-01  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.c (gtk_ui_manager_get_widget)
      	(gtk_ui_manager_get_action): g_return_if_fail() if
      	path is NULL.
      	(gtk_ui_manager_get_node): Avoid a segfault if path is empty.
      	(gtk_ui_manager_finalize): Remove the idle on finalize. (#121125,
      	Marco Pesenti Gritti)
      4e3936c7
    • Matthias Clasen's avatar
      Add gtktoggleactionprivate.h · 2c41fc09
      Matthias Clasen authored
      2003-08-31  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/Makefile.am (IGNORE_HFILES): Add gtktoggleactionprivate.h
      
      	* gtk/tmpl/gtkuimanager.sgml:
      	* gtk/gtk-sections.txt: Replace gtk_ui_manager_activate by
      	gtk_ui_manager_get_action.
      
      	* gtk/gtkuimanager.[ch] (gtk_ui_manager_get_action): New function,
      	replaces gtk_ui_manager_activate().  (#120658)
      
      	* tests/testmerge.c: Use gtk_ui_manager_get_action() instead of
      	gtk_ui_manager_activate().
      2c41fc09
    • Matthias Clasen's avatar
      Additions. · 320bba9f
      Matthias Clasen authored
      2003-08-31  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/tmpl/gtkuimanager.sgml:
      	* gtk/tmpl/gtkactiongroup.sgml:
      	* gtk/tmpl/gtkaction.sgml:
      	* gtk/tmpl/gtktoggleaction.sgml:
      	* gtk/tmpl/gtkradioaction.sgml: Additions.
      
      	* gtk/gtk-sections.txt: Updates.
      
      	* gtk/gtk.types: Add GtkAction, GtkActionGroup, GtkToggleAction,
      	GtkRadioAction and GtkUIManager.
      
      	* gtk/gtkaction.c:
      	* gtk/gtkactiongroup.c: Some doc tweaks.
      
      	* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
      	wasn't emitted anyway. Some doc tweaks.
      320bba9f
  13. 30 Aug, 2003 2 commits
    • Matthias Clasen's avatar
      Add some docs. · 0a49f658
      Matthias Clasen authored
      2003-08-31  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkactiongroup.c: Add some docs.
      
      	* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
      	wasn't emitted anyway.
      0a49f658
    • Matthias Clasen's avatar
      Connect to "destroy" on toolbar, rather than to "remove" on handlebox. · e5eaa52b
      Matthias Clasen authored
      2003-08-30  Matthias Clasen  <maclas@gmx.de>
      
      	* tests/testmerge.c (add_widget): Connect to "destroy" on toolbar,
      	rather than to "remove" on handlebox.
      
      	* gtk/gtkuimanager.[hc] (gtk_ui_manager_activate): New method to
      	activate an action found by following a path.  (#120658)
      
      	* tests/testmerge.c: Add a button to test gtk_ui_manager_activate().
      e5eaa52b
  14. 29 Aug, 2003 2 commits
    • Matthias Clasen's avatar
      Put toolbars in handleboxes. · 5f6d00b4
      Matthias Clasen authored
      2003-08-30  Matthias Clasen  <maclas@gmx.de>
      
      	* tests/testmerge.c (add_widget): Put toolbars in handleboxes.
      
      	* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
      	setter and getter. If it is set, add tearoff menu items to regular
      	menus, but not to popups. Add a signal "changed", which gets emitted
      	when the merged ui has changed.
      
      	* tests/testmerge.c: Add button to test the generation of tearoff
      	menu items.
      5f6d00b4
    • Matthias Clasen's avatar
      Add a boolean property, "add_tearoffs" with setter and getter. If it is · 879880e7
      Matthias Clasen authored
      2003-08-30  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
      	setter and getter. If it is set, add tearoff menu items to regular
      	menus, but not to popups.
      
      	* tests/testmerge.c: Add button to test the generation of tearoff
      	menu items.
      879880e7
  15. 27 Aug, 2003 1 commit
    • Matthias Clasen's avatar
      Change the XML format: <Root> element is replaced by <ui>, <menu> element · cbc20c4d
      Matthias Clasen authored
      2003-08-28  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkuimanager.c: Change the XML format:
      	<Root> element is replaced by <ui>,
      	<menu> element is replaced by <menubar>,
      	<submenu> element is replaced by <menu>,
      	<dockitem> element is replaced by <toolbar>,
      	<popups> element is gone,
      	verb attribute is replaced by action,
      	name defaults to action or the element name.
      
      	* gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry
      	and GtkRadioActionEntry. GtkActionEntry is simplified by removing
      	the user_data, entry_type and extra_data fields, GtkRadioActionEntry is
      	further simplified by removing the callback. The user_data can now be
      	specified as an argument to gtk_action_group_add_actions(). There is
      	a new method gtk_action_group_add_radio_actions(), which is similar
      	to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys
      	and a callback parameter in addition to the user_data. The callback
      	is connected to the ::changed signal of the first group member.
      	There are _full() variants taking a GDestroyNotify of
      	gtk_action_group_add_[radio_]actions().
      
      	* gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted
      	on every member of the radio group when the active member is changed.
      	Add an integer property "value", and a getter for the value of "value"
      	on the currently active group member.
      
      	* tests/testactions.c:
      	* tests/testmerge.c:
      	* tests/merge-[123].ui:
      	* demos/gtk-demo/appwindow.c: Adjust to these changes.
      
      	* gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
      cbc20c4d
  16. 26 Aug, 2003 1 commit
    • Matthias Clasen's avatar
      Use gssize for length, not gsize. · 720bdb8d
      Matthias Clasen authored
      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.
      720bdb8d
  17. 25 Aug, 2003 1 commit
  18. 24 Aug, 2003 2 commits
    • Matthias Clasen's avatar
      Add a few forgotten Since: 2.4 markers. · a6781eb5
      Matthias Clasen authored
      a6781eb5
    • Matthias Clasen's avatar
      A model-view separation for menus and toolbars, using the EggMenu code by · e7e39565
      Matthias Clasen authored
      2003-08-24  Matthias Clasen  <maclas@gmx.de>
      
      	* gtk/gtkaction.[ch]:
      	* gtk/gtktoggleaction.[ch]:
      	* gtk/gtktoggleactionprivate.h:
      	* gtk/gtkradioaction.[ch]:
      	* gtk/gtkactiongroup.[ch]:
      	* gtk/gtkmenumerge.[ch]: A model-view separation for menus and
      	toolbars, using the EggMenu code by James Henstridge.
      
      	* gtk/gtk.h: Include new headers.
      	* gtk/Makefile.am: Add new files.
      
      	* tests/testactions.c: Test for actions.
      	* tests/testmerge.c: Test for menu merging.
      	* tests/merge-[123].ui: Test data for testmerge.
      	* tests/Makefile.am: Add testactions and testmerge.
      
      	* demos/gtk-demo/appwindow.c: Use GtkMenuMerge to construct the
      	menubar and toolbar.
      e7e39565