Commit Graph

108 Commits

Author SHA1 Message Date
Emmanuele Bassi
ccf49466a6 Add GtkActionClass::get_submenu() vfunc: actions providing a menu item or
2007-03-15  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkaction.[ch]: Add GtkActionClass::get_submenu() vfunc:
	actions providing a menu item or a menu tool button with already
	a submenu should return the GtkMenu widget.

	* gtk/gtkuimanager.c (update_node): If an action provides its
	own submenu, use it instead of adding an empty one

	* gtk/gtkrecentaction.[ch]: Add GtkRecentAction, an action
	implementing the GtkRecentChooser interface for displaying the
	list of recently used files into menus and toolbars generated
	using GtkUIManager. (#338843)

	* gtk/Makefile.am:
	* gtk/gtk.h:
	* gtk/gtk.symbols: Add GtkRecentAction API to the build.

	* tests/testactions.c: Exercise the GtkRecentAction API.

svn path=/trunk/; revision=17524
2007-03-15 19:33:57 +00:00
Matthias Clasen
a6fe55fdc3 Don't crash if menu or toolbar positions can't be found. (#396161, Hans
2007-01-13  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkuimanager.c: Don't crash if menu or toolbar
        positions can't be found.  (#396161, Hans Breuer)



svn path=/trunk/; revision=17147
2007-01-14 05:31:46 +00:00
Matthias Clasen
785bffff68 Only use the results of find_menu/toolbar_position() if they succeed. May
2006-12-28  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkuimanager.c (update_node): Only use the results
        of find_menu/toolbar_position() if they succeed. May fix
        bug #388041.
2006-12-28 21:23:17 +00:00
Matthias Clasen
1bb873464c If a required action is missing, don't recurse over the children.
2006-12-27  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkuimanager.c (update_node): If a required action
        is missing, don't recurse over the children.  (#349119,
        Chris Moller)
2006-12-27 06:37:18 +00:00
Matthias Clasen
721c3bc101 Replace a lot of idle and timeout calls by the new gdk_threads api.
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * *.c: Replace a lot of idle and timeout calls by
        the new gdk_threads api.
2006-12-22 19:10:43 +00:00
Matthias Clasen
c6a50a8194 Don't leak the list of children (#357454, Paolo Borelli)
2006-09-25  Matthias Clasen  <mclasen@redhat.com>
        * gtk/gtkuimanager.c (_gtk_menu_is_empty): Don't leak
        the list of children (#357454, Paolo Borelli)
2006-09-25 13:36:00 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
8ade92495d Fix tooltips.
2006-05-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Fix tooltips.
2006-05-08 16:21:02 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Matthias Clasen
5977f7f027 Make find_menu_position and find_toolbar_position void. (#338100)
2006-04-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c: Make find_menu_position and
	find_toolbar_position void.  (#338100)
2006-04-12 13:32:47 +00:00
Matthias Clasen
e0e24d0313 Don't pass a negative value as string length to get_child_node().
2006-04-12  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkuimanager.c (start_element_handler): Don't pass
        a negative value as string length to get_child_node().  (Coverity)
2006-04-12 04:49:18 +00:00
Matthias Clasen
8de7c8b761 Fix a warning.
* gtk/gtktextlayout.c: Fix a warning.

	* gtk/gtktextsegment.h:
	* gtk/gtktextsegment.c:
	* gtk/gtktextchild.c:
	* gtk/gtktextbtree.c:
	* gtk/gtktextmark.c:
	* gtk/gtktexttypes.h: Make the segment class pointers const.

	* gtk/gtktextbufferserialize.c: Make parser struct const.

	* gtk/gtkuimanager.c: Make parser struct const.
2006-04-03 15:50:30 +00:00
Matthias Clasen
58fb752214 Avoid relocations.
2006-04-03  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c: Avoid relocations.
2006-04-03 05:19:42 +00:00
Matthias Clasen
a22bcd66c4 Fix a leak 2006-03-26 06:10:15 +00:00
Matthias Clasen
36d81d4085 Fix actiongroup-action interaction that relied on actions connecting to
2006-01-07  Matthias Clasen  <mclasen@redhat.com>

	Fix actiongroup-action interaction that relied on
	actions connecting to notify on themselves:

	* gtk/gtkaction.[hc]: Factor out the code updating the
	visibility/sensitivity of proxies into _gtk_action_sync_visible()
	and _gtk_action_sync_sensible().

	* gtk/gtkactiongroup.c: Call the new functions when the
	group visibility/sensitivity changes.
2006-01-07 06:08:07 +00:00
Matthias Clasen
b43a41e77a Don't return a list of NULLs. (#325723, Steve Chaplin)
2006-01-04  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_get_toplevels): Don't return
	a list of NULLs.  (#325723, Steve Chaplin)
2006-01-04 15:32:05 +00:00
Matthias Clasen
04eceaf621 Use the slice allocator for many small allocations.
2006-01-04  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkaccelmap.c:
	* gtk/gtkactiongroup.c:
	* gtk/gtkdialog.c:
	* gtk/gtkfilesystemunix.c:
	* gtk/gtkgc.c:
	* gtk/gtkkeyhash.c:
	* gtk/gtkplug.c:
	* gtk/gtktextiter.c:
	* gtk/gtktextlayout.c:
	* gtk/gtkuimanager.c:
	* gtk/gtkwidget.c:
	* gtk/gtkwindow.c:
	* gtk/gtkxembed.c: Use the slice allocator for many small
	allocations.

	* gtk/gtkcolorsel.c:
	* gtk/gtktreeview.c: Use IPN.

	* gtk/gtkwidget.c: Remove an unused field from the AccelPath
	struct.
2006-01-04 07:06:12 +00:00
Matthias Clasen
7dc70fba99 Use g_slice instead of mem chunks.
2005-12-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkwidget.c:
	* gtk/gtkuimanager.c:
	* gtk/gtktreedatalist.c:
	* gtk/gtktext.c:
	* gtk/gtkmain.c:
	* gtk/gtkitemfactory.c:
	* gtk/gtkseparator.[hc]:
	* gtk/gtkclist.[hc]:
	* gtk/gtkctree.c:
	* gtk/gtkgc.c: Use g_slice instead of mem chunks.
2005-12-05 21:28:32 +00:00
Tim Janik
fbb2e3f4f5 deprecated floating/sink API and implemented it in terms of the GObject
Wed Nov 23 18:55:47 2005  Tim Janik  <timj@imendio.com>

        * gtk/gtkobject.[hc]: deprecated floating/sink API and implemented it
        in terms of the GObject floating/sink API.

        * gtk/gtkaboutdialog.c:
        * gtk/gtkaction.c:
        * gtk/gtkcellview.c:
        * gtk/gtkclist.c:
        * gtk/gtkcolorsel.c:
        * gtk/gtkcombobox.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkiconview.c:
        * gtk/gtkinvisible.c:
        * gtk/gtkitemfactory.c:
        * gtk/gtklayout.c:
        * gtk/gtkmenu.c:
        * gtk/gtkmenutoolbutton.c:
        * gtk/gtknotebook.c:
        * gtk/gtkprogress.c:
        * gtk/gtkrange.c:
        * gtk/gtkspinbutton.c:
        * gtk/gtkstatusicon.c:
        * gtk/gtktext.c:
        * gtk/gtktextview.c:
        * gtk/gtktoolbar.c:
        * gtk/gtktoolbutton.c:
        * gtk/gtktoolitem.c:
        * gtk/gtktreeitem.c:
        * gtk/gtktreeview.c:
        * gtk/gtktreeviewcolumn.c:
        * gtk/gtkuimanager.c:
        * gtk/gtkviewport.c:
        * gtk/gtkwidget.c:
        * gtk/gtkwindow.c:
        ported to use GObject's g_object_ref_sink().

        * gtk/gtkcolorsel.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkaboutdialog.c:
        fixed compiler warnings.
2005-11-23 18:06:58 +00:00
Matthias Clasen
463aab93dd Various cleanups. (#315360, Kjartan Maraas)
2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c: Various cleanups.  (#315360, Kjartan Maraas)
2005-09-13 19:57:42 +00:00
Matthias Clasen
94eec04267 Intern some more strings.
2005-09-01  Matthias Clasen  <mclasen@redhat.com>

        * gdk/*.c: Intern some more strings.
        * gtk/gtkintl.h:
        * gtk/*.c: Define an I_() macro and use it instead of the
        bulky g_intern_static_string().
2005-09-01 05:11:46 +00:00
Matthias Clasen
f4bbe8f0de Also intern static strings passed to g_object_set_data() 2005-08-31 17:58:55 +00:00
Matthias Clasen
c09cc89317 Intern type names in code generated by glib-mkenums, too.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* gdk/Makefile.am:
	* gtk/Makefile.am: Intern type names in code generated by
	glib-mkenums, too.

	* gtk/*.c:
	* gdk/x11/*.c:
	* gdk/*.c: Intern type names before registering the type to avoid
	unnecessary copies.
2005-08-31 16:53:43 +00:00
Matthias Clasen
4a481c6d87 Another fix for the default value of the "ui" property.
2005-08-30  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_class_init): Another
	fix for the default value of the "ui" property.
2005-08-30 14:11:50 +00:00
Matthias Clasen
293e7fbe1d Fix the default value of the ui property. (#314532, Yong Wang)
Fix the default
	value of the ui property. (#314532, Yong Wang)
2005-08-27 04:34:00 +00:00
Matthias Clasen
b9abf2e40e Update tooltips when reconnecting toolitems. (#312173, Alex Graveley)
2005-08-01  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Update tooltips when
	reconnecting toolitems.  (#312173, Alex Graveley)
2005-08-01 16:24:30 +00:00
Matthias Clasen
a2ea759334 Fix a warning 2005-06-19 04:44:44 +00:00
Matthias Clasen
e109b31b0a Make this work for inserting before/after an existing menuitem or
2005-06-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Make this
	work for inserting before/after an existing menuitem or
	toolitem.  (#155946, Christian Persch)

	* tests/testmerge.c (delayed_toggle_dynamic): Test the
	"insert after" functionality of gtk_ui_manager_add_ui.
2005-06-19 03:55:12 +00:00
Matthias Clasen
64bfd86b5b Allow to construct menu tool buttons.
2005-06-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c: Allow to construct menu tool buttons.

	* demos/gtk-demo/appwindow.c: Demonstrate menu tool buttons
	constructed with GtkUIManager.
2005-06-19 03:20:07 +00:00
Matthias Clasen
e4ac9938d3 Use g_object_notify() instead of triggering a ::notify by re-setting the
2005-04-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Use g_object_notify() instead
	of triggering a ::notify by re-setting the property.  (#300982,
	Sven Neumann)

	* gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip().
2005-04-29 16:31:49 +00:00
Matthias Clasen
4c28ce0877 Use canonical names for g_object_notify() as well.
2005-03-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c:
	* gdk/gdkdisplaymanager.c:
	Use canonical names for g_object_notify() as well.
2005-03-26 05:49:15 +00:00
Matthias Clasen
269d89c79c Define macros GTK_PARAM_READABLE, GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE
2005-03-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkprivate.h: Define macros GTK_PARAM_READABLE,
	GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE which are like
	their G_ counterparts, but also mark the name, nick
	and blurb as static.

	* gtk/*.c: Mark param spec strings as static, using
	the new macros.
2005-03-22 02:14:55 +00:00
Matthias Clasen
cca8dd6347 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-20  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdkalias.h:

	* gtk/grk.symbols: Group symbols by header and source file.
	* gtk/makegtkalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegtkalias.pl -def
	* gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate
	this file.
	* gtk/*.c: Include gtkalias.h after the other headers,
	include gtkaliasdef.c at the bottom.
	* gtk/*.h: Small cleanups.
2005-03-20 07:01:23 +00:00
Matthias Clasen
52711c24e8 More canonical property names. 2005-03-09 06:15:13 +00:00
Matthias Clasen
6da29b43a6 gdk/gdkkeyuni.c gdk/gdkpixbuf-drawable.c gdk/gdkrgb.c gdk/x11/gdkdnd-x11.c
2005-03-01  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkkeyuni.c
	* gdk/gdkpixbuf-drawable.c
	* gdk/gdkrgb.c
	* gdk/x11/gdkdnd-x11.c
	* gdk/x11/gdkevents-x11.c
	* gdk/x11/gdkproperty-x11.c
	* gdk/x11/gdkvisual-x11.c
	* gdk-pixbuf/gdk-pixbuf.c
	* gtk/gtkaction.c
	* gtk/gtkbindings.c
	* gtk/gtkcolorbutton.c
	* gtk/gtkcombo.c
	* gtk/gtkcontainer.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilesel.c
	* gtk/gtkgamma.c
	* gtk/gtkiconview.c
	* gtk/gtkinputdialog.c
	* gtk/gtkitemfactory.c
	* gtk/gtkmenu.c
	* gtk/gtktextview.c
	* gtk/gtktooltips.c
	* gtk/gtktreedatalist.c
	* gtk/gtkuimanager.c
	* gtk/tree_minus.xpm
	* gtk/tree_plus.xpm
	* gtk/xdgmime/xdgmime.c
	* gtk/xdgmime/xdgmime.h:
	Move constant data to .rodata.
2005-03-01 06:25:55 +00:00
Manish Singh
6a19b7b894 make sure expand is initialized, cast to GTK_SEPARATOR_TOOL_ITEM.
Thu Feb 17 14:58:16 2005  Manish Singh  <yosh@gimp.org>

        * gtk/gtkuimanager.c (start_element_handler): make sure expand
        is initialized, cast to GTK_SEPARATOR_TOOL_ITEM.
2005-02-17 22:59:47 +00:00
Matthias Clasen
da920e08f8 Accept the "expand" attribute and set a flag in the node if it is set to
2005-02-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (start_element_handler): Accept
	the "expand" attribute and set a flag in the node if it
	is set to "true".
	(update_node): If the expand flag is set, make separator
	toolitems non-drawn and expanding.  (#166489, Christian Persch)
2005-02-08 15:54:09 +00:00
Matthias Clasen
9236322963 Add hints about the lifecycle of widgets. (#159503, Christian Persch)
2005-01-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Add hints about
	the lifecycle of widgets.  (#159503, Christian Persch)
2005-01-13 19:25:29 +00:00
Matthias Clasen
5191e341b4 Don't let the empty menu filler affect visibility of separators. (#160500,
2004-12-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_smart_separators): Don't let the
	empty menu filler affect visibility of separators.  (#160500,
	Christian Persch)
2004-12-13 05:35:17 +00:00
Tor Lillqvist
f3da170539 gtk/gtkaccelmap.[ch] gtk/gtkfilechooser.[ch] gtk/gtkfilesel.c
2004-12-12  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkaccelmap.[ch]
	* gtk/gtkfilechooser.[ch]
	* gtk/gtkfilesel.c
	* gtk/gtkfilesystemwin32.c
	* gtk/gtkiconfactory.[ch]
	* gtk/gtkicontheme.[ch]
	* gtk/gtkimage.[ch]
	* gtk/gtkimmodule.c
	* gtk/gtkmodules.c
	* gtk/gtkrc.[ch]
	* gtk/gtkuimanager.[ch]
	* gtk/gtkwindow.[ch]
	* gtk/updateiconcache.c
	* gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert
	environment variables referring to pathnames from locale encoding
	to UTF-8. As in GLib, in order to preserve Windows DLL ABI
	stability, add binary compatibility versions of functions that
	take file names as arguments, or return file names. Add a _utf8
	suffix to the "real" such functions on Windows. The ABI
	compatibility versions keep the old name.

	* gtk/Makefile.am: Strip PRIVATE symbols from the GNU import
	library.

	* gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement
	file mapping on Win32.

	* gtk/updateiconcache.c: Don't crash if invoked without
	argument. Use binary mode when opening file.

	* modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install
	gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.
2004-12-12 21:09:13 +00:00
Michael Natterer
3bd8c449f4 added virtual functions GtkUIManager::get_widget() and ::get_action().
2004-12-01  Michael Natterer  <mitch@gimp.org>

	* gtk/gtkuimanager.[ch]: added virtual functions
	GtkUIManager::get_widget() and ::get_action(). Moved the code from
	gtk_ui_manager_get_widget() and get_action() to the default
	implementations. Fixes bug #160096.

	(gtk_ui_manager_get_toplevels): added missing precondition check
	for GTK_IS_UI_MANAGER(self).
2004-12-01 16:04:28 +00:00
Manish Singh
60b30ff513 gdk/linux-fb/gdkgc-fb.c gdk/win32/gdkgc-win32.c
Fri Nov 19 14:54:09 2004  Manish Singh  <yosh@gimp.org>

        * gdk/linux-fb/gdkgc-fb.c
        * gdk/win32/gdkgc-win32.c
        * gdk/win32/gdkwindow-win32.c
        * gtk/gtkaboutdialog.c
        * gtk/gtkaction.c
        * gtk/gtkactiongroup.c
        * gtk/gtkcellrendererprogress.c
        * gtk/gtkcellview.c
        * gtk/gtkcolorbutton.c
        * gtk/gtkcombobox.c
        * gtk/gtkcomboboxentry.c
        * gtk/gtkentrycompletion.c
        * gtk/gtkfilechooserbutton.c
        * gtk/gtkmenutoolbutton.c
        * gtk/gtkrc.c
        * gtk/gtksettings.c
        * gtk/gtkstyle.c
        * gtk/gtktoggletoolbutton.c
        * gtk/gtktoolbutton.c
        * gtk/gtktoolitem.c
        * gtk/gtktreemodelfilter.c
        * gtk/gtktreeselection.c
        * gtk/gtktreeviewcolumn.c
        * gtk/gtkuimanager.c: get rid of unnecessary casts.

        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
        cast away the const for g_value_set_enum. This is after the g_warning,
        so this is a hack to begin with.

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_set_property):
        add a cast to GTK_FILE_CHOOSER for impl here.
2004-11-19 23:18:38 +00:00
Matthias Clasen
d1a02aaa34 Fix some C99isms.
2004-11-11  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Fix some C99isms.
2004-11-11 21:18:18 +00:00
Matthias Clasen
75eb3f9d2f Remove two more places where we were unconditionally setting "visible",
2004-11-11  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Remove two more places
	where we were unconditionally setting "visible", causing
	unnecessary notifications.

	* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
	(gtk_clipboard_get): Clarify the docs.  (#156638, Torsten
	Schoenfeld)
	(gtk_clipboard_finalize): Warn if the clipboard is still in
	its displays clipboard list.
2004-11-11 19:57:41 +00:00
Matthias Clasen
41628edebb Considerably speed up GtkUIManager, by changing the semantics of the dirty
2004-11-11  Matthias Clasen  <mclasen@redhat.com>

	Considerably speed up GtkUIManager, by changing the semantics
	of the dirty flag. It is now propagated up the tree, and
	update_node() doesn't descend into clean subtrees.  (#143668,
	Dave Neary, Michael Natterer, Sven Neumann, fix proposed
	by Soeren Sandmann)

	* gtk/gtkuimanager.c (node_prepend_ui_reference): Only prepend
	a new node reference if the merge_id is different. Take a GNode,
	so we can walk up the tree, adjust all callers.
	(node_remove_ui_reference): Only mark a node dirty if the first
	ui reference is removed. Take a GNode here as well for
	consistency.
	(update_node): Don't descend into clean subtrees.
	(mark_node_dirty): New function to mark a node and its
	predecessors dirty.
2004-11-11 18:13:19 +00:00
Matthias Clasen
d5f92150d4 Fix many sparse warnings. 2004-10-28 15:00:05 +00:00
Matthias Clasen
f64d8567ed Also update smart separators if the visibility of a menuitem with a
2004-10-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Also update smart separators
	if the visibility of a  menuitem with a submenu changes.  (#153791,
	Christian Persch)
2004-10-08 05:00:34 +00:00
Matthias Clasen
63f3fc79c6 Set action_name. (#154526, John Finlay)
2004-10-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Set
	action_name.  (#154526, John Finlay)
2004-10-05 14:12:24 +00:00
Matthias Clasen
923a2ebde7 Use the proper node type for placeholders in toolbars. (#151963, Olivier
2004-09-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_add_ui): Use the proper node type
	for placeholders in toolbars.  (#151963, Olivier Andrieu)
2004-09-07 17:33:07 +00:00