Commit Graph

406 Commits

Author SHA1 Message Date
Hans Breuer
d3ce448c20 fix 'function' : incompatible types - from 'struct _cairo *' to 'struct
2008-06-21  Hans Breuer  <hans@breuer.org>

	* gtk/gtkprintoperation-win32.c(1713) : fix 'function' : incompatible 
	types - from 'struct _cairo *' to 'struct _cairo_surface *' by
	passing the surface to cairo_surface_show_page(), not the context
	* gtk/gtkprintoperation-win32.c(866) : get rid of warning C4018: 
	'<' : signed/unsigned mismatch by using guint for the loop

	* gtk/gtkmenu.c(gtk_menu_get_property) : property 'menu::active' is 
	an uint, gtk_menu_get_active() returns the widget pointer. Convert
	the latter to the former by calculating the index in menu::children
	Also fix some occurences of g_return_if_fail() where 
	g_return_val_if_fail() was meant


svn path=/trunk/; revision=20662
2008-06-21 09:49:00 +00:00
Johan Dahlin
e46eeab2a9 Add missing Since: gtk-doc markup for newly added GSEAL API. Change all
2008-06-20  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtkaccelgroup.c:
    * gtk/gtkcolorseldialog.c:
    * gtk/gtkcontainer.c:
    * gtk/gtkdialog.c:
    * gtk/gtkentry.c (gtk_entry_class_init):
    * gtk/gtkfontsel.c:
    * gtk/gtkhandlebox.c:
    * gtk/gtklayout.c:
    * gtk/gtkmenu.c (gtk_menu_class_init):
    * gtk/gtkmenuitem.c (gtk_menu_item_class_init):
    * gtk/gtkplug.c (gtk_plug_class_init):
    * gtk/gtkselection.c:
    * gtk/gtksocket.c:
    * gtk/gtktreeselection.c:
    * gtk/gtkwidget.c (gtk_widget_class_init):
    * gtk/gtkwindow.c:
    Add missing Since: gtk-doc markup for newly added GSEAL API.
    Change all Since: GSEAL-branch to Since: 2.14.


svn path=/trunk/; revision=20639
2008-06-20 13:54:31 +00:00
Tim Janik
f61c311176 Seal GtkMenu
svn path=/trunk/; revision=20589
2008-06-20 11:06:52 +00:00
Johan Dahlin
6ef2f57450 Remove an unused variable and cast to gchar to avoid a compiler warning.
2008-06-19  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtkmenu.c (gtk_menu_set_accel_path):
    Remove an unused variable and cast to gchar to avoid a compiler
    warning.


svn path=/trunk/; revision=20467
2008-06-19 13:43:51 +00:00
Johan Dahlin
1a30e12586 Use g_object_new instead of gtk_widget_new
2008-06-19  Johan Dahlin  <jdahlin@async.com.br>

    * demos/testpixbuf.c (new_testrgb_window):
    * gtk/gtkctree.c (gtk_ctree_new_with_titles):
    * gtk/gtkitemfactory.c (gtk_item_factory_construct),
    (gtk_item_factory_create_item):
    * gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
    * gtk/gtkprogressbar.c (gtk_progress_bar_new),
    (gtk_progress_bar_new_with_adjustment):
    * gtk/gtkscrolledwindow.c (gtk_scrolled_window_new):
    * gtk/gtktext.c (gtk_text_new):
    * gtk/gtkviewport.c (gtk_viewport_new):
    * tests/simple.c (main):
    * tests/testgtk.c (create_statusbar), (create_get_image),
    (create_saved_position), (create_tooltips), (create_cursors),
    (create_display_screen), (create_progress_bar), (create_idle_test):
    * tests/testmultidisplay.c (make_selection_dialog), (main):
    * tests/testmultiscreen.c (main):
    * tests/testrgb.c (new_testrgb_window):
    Use g_object_new instead of gtk_widget_new


svn path=/trunk/; revision=20462
2008-06-19 12:25:19 +00:00
Michael Natterer
fe8a946e87 deprecate GtkDestroyNotify.
2008-06-18  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktypeutils.h: deprecate GtkDestroyNotify.

	* gtk/gtkactiongroup.[ch]
	* gtk/gtkcombobox.[ch]
	* gtk/gtkcontainer.[ch]
	* gtk/gtkliststore.[ch]
	* gtk/gtkmain.[ch]
	* gtk/gtkmenu.c
	* gtk/gtkstock.[ch]
	* gtk/gtktreedatalist.[ch]
	* gtk/gtktreemodelfilter.[ch]
	* gtk/gtktreemodelsort.[ch]
	* gtk/gtktreeprivate.h
	* gtk/gtktreeselection.[ch]
	* gtk/gtktreesortable.[ch]
	* gtk/gtktreestore.[ch]
	* gtk/gtktreeview.[ch]
	* gtk/gtktreeviewcolumn.[ch]: s/GtkDestroyNotify/GDestroyNotify/g.


svn path=/trunk/; revision=20448
2008-06-18 09:12:32 +00:00
Christian Persch
dcc9428036 Bug 535608 – do not string-copy accel paths in the menu code
Don't store the accel path as a string in gtkmenu/gtkmenuitem.
The accel path will be interned anyway, so keeping a string copy around
is just a waste of memory.
Improve the documentation to mention this.

svn path=/trunk/; revision=20331
2008-06-07 20:40:20 +00:00
Michael Natterer
bd2b0d30a8 cast attach_info_free() to GDestroyNotify when using it in
2008-05-30  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (get_attach_info): cast attach_info_free() to
	GDestroyNotify when using it in g_object_set_data_full().


svn path=/trunk/; revision=20257
2008-05-30 12:12:19 +00:00
Matthias Clasen
81320ba90b Bug 404571 – Scroll arrow backgrounds should be painted with different
detail

        * gtk/gtkmenu.c (gtk_menu_paint): Use "menu_scroll_arrow_up/down"
        as detail when drawing scroll arrow backgrounds. Proposed by
        Tommi Komulainen.


svn path=/trunk/; revision=20202
2008-05-28 01:30:37 +00:00
Matthias Clasen
b0ea8e9f85 Bug 501730 – use GSlice for small allocs
* gtk/gtkmenuitem.c:
        * gtk/gtkmenu.c: Use the slice allocator for small allocations.
        Patch by Christian Persch.


svn path=/trunk/; revision=20161
2008-05-25 22:33:34 +00:00
Michael Natterer
ac6c371997 gtk/gtkcellview.c gtk/gtklabel.c gtk/gtklayout.c gtk/gtklist.c
2008-02-07  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcellview.c
	* gtk/gtklabel.c
	* gtk/gtklayout.c
	* gtk/gtklist.c
	* gtk/gtkmenu.c
	* gtk/gtkmenushell.c
	* gtk/gtkmisc.c
	* gtk/gtkoptionmenu.c
	* gtk/gtkplug.c
	* gtk/gtkpreview.c
	* gtk/gtkprogress.c
	* gtk/gtkradiomenuitem.c
	* gtk/gtkscale.c
	* gtk/gtkscrolledwindow.c
	* gtk/gtksocket.c: remove g_return_if_fail() from private
	functions and virtual function implementations.


svn path=/trunk/; revision=19492
2008-02-07 16:59:42 +00:00
Michael Natterer
e7355f82c2 gtk/gtkcontainer.c gtk/gtkexpander.c gtk/gtkframe.c gtk/gtklabel.c
2008-02-06  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcontainer.c
	* gtk/gtkexpander.c
	* gtk/gtkframe.c
	* gtk/gtklabel.c
	* gtk/gtkmain.c
	* gtk/gtkmenu.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmenushell.c
	* gtk/gtknotebook.c
	* gtk/gtkseparatortoolitem.c
	* gtk/gtksocket.c
	* gtk/gtktextlayout.c
	* gtk/gtktoggletoolbutton.c
	* gtk/gtktoolbutton.c
	* gtk/gtktoolitem.c
	* gtk/gtktree.c
	* gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply
	"GTK_IS_FOO (foo)".


svn path=/trunk/; revision=19481
2008-02-06 09:53:34 +00:00
Matthias Clasen
81b82a676f More default property value corrections
svn path=/trunk/; revision=19276
2007-12-28 17:10:33 +00:00
Michael Natterer
65ef21dfb3 remove recently added gdk_flush() again, it's not needed after all.
2007-11-14  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_popup): remove recently added
	gdk_flush() again, it's not needed after all.


svn path=/trunk/; revision=18991
2007-11-14 10:09:44 +00:00
Michael Natterer
9b3edbc319 call gdk_flush() after showing the menu so we can definitely grab on it.
2007-11-06  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_popup): call gdk_flush() after showing
	the menu so we can definitely grab on it. Grab failure found by
	Xan Lopez.


svn path=/trunk/; revision=18969
2007-11-06 14:23:56 +00:00
Michael Natterer
7b6c536cc7 Make sure menu_shell->button gets reset to 0 when we bail out early here
2007-09-11  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_button_release): Make sure
	menu_shell->button gets reset to 0 when we bail out early here
	instead of chaining up, so it is in a consistent state for the
	next press/release in GtkMenuShell. Fixes bug #449371.


svn path=/trunk/; revision=18795
2007-09-11 17:38:12 +00:00
Tim Janik
fda0eb309b Clarified activate_time docs.
Fri Aug 17 11:36:29 2007  Tim Janik  <timj@imendio.com>                                                                                                       
                                                                                                                                                              
        * gtk/gtkmenu.c (gtk_menu_popup): Clarified activate_time docs.                                                                                       
                                                                                                                                                              


svn path=/trunk/; revision=18643
2007-08-17 09:36:15 +00:00
Matthias Clasen
55c23d2b22 Restructure the code to make sense, and don't leak an empty accel.
2007-07-24  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenubar.c (window_key_press_handler):
        * gtk/gtkmenu.c (gtk_menu_key_press): Restructure the code
        to make sense, and don't leak an empty accel.  (#459515, Owen Taylor)



svn path=/trunk/; revision=18535
2007-07-24 04:56:47 +00:00
Michael Natterer
c3ee7283cf Merged from maemo-gtk:
2007-06-27  Michael Natterer  <mitch@imendio.com>

	Merged from maemo-gtk:

	* gtk/gtkmenu.c (gtk_menu_handle_scrolling): when updating the
	scroll arrows' state, make sure we don't overwrite the insensitive
	state that might have been set by the first scroll step hitting
	the top/bottom border of the menu.


svn path=/trunk/; revision=18260
2007-06-27 11:43:16 +00:00
Cody Russell
465b7f441b Refactored arrow border size, visible area, and sensitive area calculations
svn path=/trunk/; revision=17808
2007-05-09 15:46:41 +00:00
Michael Natterer
533d3fcc76 Merged heavily modified patch from maemo-gtk which enables opening and
2007-04-27  Michael Natterer  <mitch@imendio.com>

	Merged heavily modified patch from maemo-gtk which enables opening
	and closing submenus on click, and introduces some usability
	changes when gtk-touchscreen-mode is enabled (bug #128968):

	* gtk/gtkmenushell.c (struct GtkMenuShellPrivate): added boolean
	"activated_submenu" to indicate that the current mouse operation
	(click or drag) has opened a submenu.

	(gtk_menu_shell_button_press): pop up submenus without delay
	and record the fact in "activated_submenu".

	(gtk_menu_shell_button_release): if a submenu was explicitely
	opened, or not opened by this release's button_press, or enough
	time has passed since timeout-opening it, close the submenu here.

	(gtk_menu_shell_enter_notify): when entering a menu item with
	any mouse button pressed, open its submenu.

	(gtk_real_menu_shell_move_current): in touchsreen mode, close the
	submenu when moving the focus away from it via keyboard-navigation.

	* gtk/gtkmenuitem.[ch] (_gtk_menu_item_popup_submenu): added
	parameter "gboolean with_delay" so GtkMenuShell can control this
	for the different scenarios of submenu showing.

	(_gtk_menu_item_popdown_submenu): new function. also needed by
	GtkMenuShell for closing submenus on click.

	Renamed internal function gtk_menu_item_select_timeout() to
	gtk_menu_item_popup_timeout().

	(gtk_menu_item_real_popup_submenu): new utility function which
	does the actual popup and records the exact time of the popup when
	the menu was timeout-opened (using g_get_current_time()).

	(gtk_real_menu_item_select): don't add the popup timeout when in
	touchscreen mode.

	* gtk/gtkmenu.c (gtk_menu_popup): in touchscreen mode, select the
	first item of every opened menu.


svn path=/trunk/; revision=17659
2007-04-27 14:49:37 +00:00
Michael Natterer
4a74188834 fix ACTIVE state of scroll buttons (we were setting the state to ACTIVE
2007-04-25  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_handle_scrolling): fix ACTIVE state of
	scroll buttons (we were setting the state to ACTIVE but
	immediately overwriting it with NORMAL or PRELIGHT). Also got rid
	of many separate calls to gdk_window_invalidate_rect() by
	remembering the old button state and only invalidating the area if
	the state has changed (addresses parts of bug #433242, Tommi
	Komulainen).

	(gtk_menu_scroll_to): change the arrow states only if changing
	from or to INSENSITIVE state, so we don't overwrite the ACTIVE
	state set by above function.


svn path=/trunk/; revision=17630
2007-04-25 12:11:08 +00:00
Michael Natterer
edb9f10aad Don't close menus on clicks on their border area (bug #423761). (modified
2007-03-29  Michael Natterer  <mitch@imendio.com>

	Don't close menus on clicks on their border area (bug #423761).
	(modified patch from maemo-gtk).

	* gtk/gtkmenu.c (gtk_menu_button_press)
	(gtk_menu_button_release): bail out early if the click was on the
	menu's border (not on any item and not outside the window).

	(pointer_in_menu_window): new utility function which checks if
	passed root coords are inside the menu_shell or one of its
	parent shells.


svn path=/trunk/; revision=17571
2007-03-29 15:47:49 +00:00
Michael Natterer
bec19a3f73 get rid of local GtkSettings variables by moving gtk_widget_get_settings()
2007-03-29  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c: get rid of local GtkSettings variables by moving
	gtk_widget_get_settings() into the g_object_get() call. Some small
	indentation fixes.


svn path=/trunk/; revision=17570
2007-03-29 08:14:22 +00:00
Michael Natterer
44d79a77ac don't forget to set the state of the synthesized GDK_ENTER_NOTIFY event.
2007-02-14  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_motion_notify): don't forget to set the
	state of the synthesized GDK_ENTER_NOTIFY event. Fix taken from
	maemo-gtk.


svn path=/trunk/; revision=17291
2007-02-14 11:52:27 +00:00
Michael Natterer
1d06562a87 pass &event->area to gtk_paint_box() calls.
2007-02-01  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_paint): pass &event->area to
	gtk_paint_box() calls.


svn path=/trunk/; revision=17248
2007-02-01 19:47:29 +00:00
Michael Natterer
9205bfd82c remove redundant and confusing if (GTK_IS_MENU (widget)) checks because
2007-02-01  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_button_press)
	(gtk_menu_button_release)
	(gtk_menu_button_scroll): remove redundant and confusing
	if (GTK_IS_MENU (widget)) checks because "widget" is always a
	GtkMenu here.


svn path=/trunk/; revision=17247
2007-02-01 13:57:36 +00:00
Michael Natterer
42debff10d gtk/gtkcheckbutton.c gtk/gtkdnd.c gtk/gtkentry.c gtk/gtkmenu.c
2007-01-18  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcheckbutton.c
	* gtk/gtkdnd.c
	* gtk/gtkentry.c
	* gtk/gtkmenu.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c: pass more clip rectangles to gtk_paint_foo()
	functions. Based on a patch from maemo-gtk (bug #398023).


svn path=/trunk/; revision=17183
2007-01-18 17:30:10 +00:00
Matthias Clasen
9ee7338f60 Take the scroll arrow into account when drawing the background. (#393166,
2007-01-05  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_paint): Take the scroll arrow into
        account when drawing the background.  (#393166, Benjamin Berg)



svn path=/trunk/; revision=17084
2007-01-05 18:24:00 +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
Federico Mena Quintero
8387869a5d Merged from gtk-2-10:
2006-12-15  Federico Mena Quintero  <federico@novell.com>

	Merged from gtk-2-10:

	* gtk/gtkmenu.c (gtk_menu_set_title): Don't try to optimize for
	the case where the new title is the same as the old title, to
	preserve the behavior from GTK+ 2.8 (NULL and "" titles are not
	equivalent).  Handle the case where title == priv->title.  This
	was found by the LSB compatibility tests:
	https://bugzilla.novell.com/show_bug.cgi?id=223882

2006-12-15  Dom Lachowicz <domlachowicz@gmail.com>
2006-12-15 20:13:01 +00:00
Michael Natterer
7f374a74ba Add new infrastructure for notifications of failed keyboard navigation and
2006-11-16  Michael Natterer  <mitch@imendio.com>

	Add new infrastructure for notifications of failed keyboard
	navigation and navigation with restricted set of keys.

	The patch handles configurable beeping, navigating the GUI with
	cursor keys only (as in phone environments), and configurable
	wrap-around. Fixes bugs #322640, #70986, #318827, #334726, #334742
	and #309291.

	* gtk/gtksettings.c: added properties gtk-keynav-cursor-only,
	gtk-keynav-wrap-around and gtk-error-bell.

	* gtk/gtkwidget.[ch]: added new signal "keynav-failed" and public
	API to emit it. Added New function gtk_widget_error_bell() which
	looks at the gtk-error-bell setting and calls gdk_window_beep()
	accordingly.

	* gtk/gtk.symbols: add the new widget symbols.

	* gtk/gtkcellrendereraccel.c
	* gtk/gtkimcontextsimple.c
	* gtk/gtkmenu.c
	* gtk/gtknotebook.c: use gtk_widget_error_bell() or look at the
	gtk-error-bell setting instead of calling gdk_display_beep()
	unconditionally.

	* gtk/gtkcombobox.c
	* gtk/gtkentry.c
	* gtk/gtkiconview.c
	* gtk/gtklabel.c
	* gtk/gtkmenushell.c
	* gtk/gtkspinbutton.c
	* gtk/gtktextview.c
	* gtk/gtktreeview.c: call gtk_widget_error_bell() on failed keynav.

	* gtk/gtkentry.c
	* gtk/gtklabel.c
	* gtk/gtkrange.c
	* gtk/gtktextview.c: consult gtk_widget_keynav_failed() on failed
	cursor navigation and leave the widget if it returns FALSE.

	* gtk/gtkmenushell.c
	* gtk/gtknotebook.c: only wrap around if gtk-keynav-wrap-around
	is TRUE.

	* gtk/gtkradiobutton.c: ask gtk_widget_keynav_failed() to decide
	whether to to wrap-around, and don't select active items on cursor
	navigation if gtk-keynav-cursor-only is TRUE. Should look at
	gtk-keynav-wrap-around too, will look into that.
2006-11-16 12:56:30 +00:00
Matthias Clasen
07e7719441 Apply a cleanup patch by Kjartan Maraas (#341812)
2006-10-08  Matthias Clasen  <mclasen@redhat.com>

	* Apply a cleanup patch by Kjartan Maraas  (#341812)
2006-10-08 05:07:55 +00:00
Matthias Clasen
9fef5e76ab Just remove the scroll timeout here, don't access settings. (#348095,
2006-07-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_destroy): Just remove the scroll
	timeout here, don't access settings.  (#348095, Chris Wilson)
2006-07-20 19:07:51 +00:00
Matthias Clasen
8b77374789 Treat "" like NULL when parsing the menu-bar-accel setting. Here too.
2006-07-02  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenubar.c (window_key_press_handler): Treat
        "" like NULL when parsing the menu-bar-accel setting.
        * gtk/gtkmenu.c (gtk_menu_key_press): Here too.
        (#346420, Yevgen Muntyan)
2006-07-03 00:25:06 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Alexander Larsson
d8f1ce735c Better handling of the window group on unsetting transient-for, since the
2006-05-12  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkwindow.c:
	Better handling of the window group on unsetting transient-for, since
	the transient parent might have changed group.

	* gtk/gtkmenu.c:
	Combine the handling of transient for the attach-widget and the
	window group handling by setting transient-to on popup/popdown only.

	See bug #340401

	* gtk/gtkprintunixdialog.c:
	Remove part of old fix no longer needed.
2006-05-12 16:06:53 +00:00
Alexander Larsson
c459feaab1 Fix build errors.
2006-05-12  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkrecentmanager.c:
	Fix build errors.

	* gtk/gtk.symbols:
	* demos/gtk-demo/printing.c:
	* gtk/gtkprintoperation-win32.c:
	* gtk/gtkprintoperation.[ch]:
	* gtk/gtkprintsettings.[ch]:
	* modules/printbackends/cups/gtkprintbackendcups.c:
	* modules/printbackends/lpr/gtkprintbackendlpr.c:
	* modules/printbackends/pdf/gtkprintbackendpdf.c:
	* tests/print-editor.c:
	* tests/testnouiprint.c:
	* tests/testprint.c:
	* tests/testprintfileoperation.c:
	Rename functions from nr_of_pages to n_pages, and num_copies to
	n_copies to match other gtk+ names.

	* gtk/gtkmenu.c: (gtk_menu_popdown):
	Only re-set window group on popdown if we set it on popup (i.e.
	if there is a parent menu shell).
	Fixed part of bug #340401

	* gtk/gtkwindow.c:
	Add (contruct) property "transient-for" to GtkWindow. This
	is needed for the fix to bug #340401.

	* gtk/gtkprintunixdialog.c:
	Use the transient-for property on construction and populate the dialog
	with widgets after that. This fixes bug #340401.
	More n_pages renames.
2006-05-12 09:47:58 +00:00
Tim Janik
4e8e3add5b applied unified patch for configurable scroll arrow sizes from bug #333632
Wed May 10 15:57:53 2006  Tim Janik  <timj@imendio.com>

        * applied unified patch for configurable scroll arrow sizes from
        bug #333632 and bug #325282.

        * gtk/gtkwidget.c (gtk_widget_class_init): added ::scroll-arrow-hlength
        and ::scroll-arrow-vlength style properties. fixed upper limit for
        ::separator-width and ::separator-height to be MAXINT.

        * gtk/gtkmenu.c: use GtkWidget::scroll-arrow-vlength to determine the
        scroll arrow size, instead of using a hard coded constant.

        * gtk/gtknotebook.c: use GtkWidget::scroll-arrow-vlength and
        GtkWidget::scroll-arrow-hlength to determine scroll arrow sizes.
        added GtkNotebook::arrow-spacing style property to configure the
        spacing between scroll arrows.
2006-05-10 14:02:20 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Søren Sandmann
b9d1a03440 Create 'composited' label.
Tue Apr 25 10:25:28 2006  Søren Sandmann  <sandmann@redhat.com>

	* tests/testgtk.c (create_alpha_window): Create 'composited' label.

	* tests/testgtk.c (on_composited_changed): New function, change
	the label to say whether the screen is composited or not.

	* gtk/gtkwindow.c (gtk_window_on_composited_changed): When
	composited status change, invalidate the window and propagate the signal;.

	* gtk/gtkwindow.c (gtk_window_map): Set the appropriate type hint
	if reset_type_hint is TRUE.

	* gtk/gtkwindow.c (gtk_window_set_type_hint): If hint is one of
	the old hints, store a shadow copy in the public window->type_hint
	bitfield, otherwise set this field to normal. Set the private
	field to the type hint.

	* gtk/gtkwindow.c (gtk_window_init): Initialize priv->type_hint.

	* gtk/gtkwindow.c (struct _GtkWindowPrivate): New field
	"reset_type_hint" indicating whether the type hint needs to be
	reset. New field type_hint containing a GdkWindowTypeHint.

	* gtk/gtkwidget.c (propagate_composited_changed): New function to
	propagate changes in composited status.
	(gtk_widget_class_init): Add composited_changed signal.

	* gtk/gtkwidget.h (struct _GtkWidgetClass): New signal composited-changed.

	* gtk/gtkwidget.c (gtk_widget_is_composited): New function.

	* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Set transient for.

	* gtk/gtktooltips.c (gtk_tooltips_force_window): Set the type hint

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Compute whether
	the item belongs to a menubar. Set the type_hint appropriately
	depending on the outcome.

	* gtk/gtkmenu.c (gtk_menu_position): Set the default type hint here.

	* gtk/gtkmenu.c (gtk_menu_attach_to_widget): connect to hierarchy
	changed on the attach widget.

	* gtk/gtkmenu.c (attach_widget_hierarchy_changed): New function to
	set the transient_for property for menus.

	* gtk/gtkdnd.c (set_icon_stock_pixbuf): Set the appropriate type hint.

	* gtk/gtkcombo.c (gtk_combo_popup_list): Make the popup window
	transient for the toplevel.

	* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Set
	transient-for, for the popup window.

	* gdk/x11/gdkwindow-x11.c (gdk_window_get_type_hint): Support for
	new window types.

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_type_hint): Add support
	for new window types.

	* gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_process_owner_change):
	New function called whenever the compositing manager comes and goes.

	* gdk/x11/gdkscreen-x11.c (gdk_screen_is_composited): New function.

	* gdk/x11/gdkscreen-x11.c
	(_gdk_x11_screen_request_cm_notification, make_cm_atom,
	check_is_composited): New functions

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
	_gdk_x11_screen_process_owner_change when an
	XFixesSelectionNotifyEvent is received.

	* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Call
	_gdk_x11_screen_request_cm_notification() on all screens.

	* gdk/quartz/gdkscreen-quartz.c (gdk_screen_is_composited): Dummy
	implementation.

	* gdk/gdkscreen.c (gdk_screen_class_init): New signal,
	'composited-changed'.

	* gdk/gdkwindow.h: Add new EWMH window types.

	* gdk/win32/gdkscreen-win32.c (gdk_screen_is_composited)
2006-04-25 14:27:32 +00:00
Matthias Clasen
0d10969b9f Match parameter names with the headers.
2006-04-24  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkclipboard.h:
	* gtk/gtkprinter.c:
	* gtk/gtkprintsettings.h:
	* gtk/gtkprintsettings.c: Match parameter names with the headers.

	* gtk/gtkprintoperation-unix.c (gtk_print_run_page_setup_dialog):
	Add docs.

	* gtk/gtktextbufferrichtext.c (gtk_text_buffer_deserialize):
	* gtk/gtkstatusicon.c (gtk_status_icon_get_storage_type):
	* gtk/gtktreeview.c (gtk_tree_view_set_search_position_func):
	* gtk/gtktreeview.c (gtk_tree_view_get_headers_clickable):
	* gtk/gtkcellrendererspin.c (gtk_cell_renderer_spin_new):
	* gtk/gtkmenu.c (gtk_menu_get_for_attach_widget): Fix the docs.
2006-04-24 05:42:12 +00:00
Michael Natterer
161b0a5c55 bail out if there is no need for scrolling (more obvious than adding
2006-03-27  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need
	for scrolling (more obvious than adding additional conditions to
	the scroll offset calculation). Fixes bug #335912.
2006-03-27 17:00:01 +00:00
Michael Natterer
3b3b722ccf added boolean property gtk-touchscreen-mode, which essentially means
2006-02-22  Michael Natterer  <mitch@imendio.com>

	* gtk/gtksettings.c: added boolean property gtk-touchscreen-mode,
	which essentially means "there are no motion notify events", so
	widgets can't use the pointer hovering them for anything.

	* gtk/gtkmenu.c: if gtk-touchscreen-mode is TRUE, scroll menus
	when clicking the scroll arrows, since hovering goes undetected.
	Fixes bug #323028.

	Added boolean style property "double-arrows" which always makes
	both scroll arrows visible when the menu is too long.
	For pushed-in popup menus, both arrows are always shown
	(regardless of double-arrows), in order to fix user confusion
	about the blank area. Fixes bug #129463.
2006-02-22 10:10:23 +00:00
Matthias Clasen
dcfac2c69c Make this function public API. (#307099, Todd Berman)
2006-01-09  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtk.symbols:
	* gtk/gtkwindow.h:
	* gtk/gtkwindow.c (gtk_window_get_group): Make this function
	public API.  (#307099, Todd Berman)

	* gtk/gtkmenu.c:
	* gtk/gtkmain.c:
	* gtk/gtkentrycompletion.c:
	* gtk/gtkcombo.c:
	* gtk/gtkcombobox.c: Update all callers.
2006-01-10 04:33:30 +00:00
Matthias Clasen
62c1d36a67 Accept NULL as a detach func. (#323386, Jorn Baayen)
2005-12-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_attach_to_widget): Accept NULL
	as a detach func.  (#323386, Jorn Baayen)
2005-12-06 17:33:46 +00:00
Michael Natterer
b3f1be3b56 applied modified patch from maemo-gtk which adds a "horizontal-padding"
2005-12-02  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c: applied modified patch from maemo-gtk which
	adds a "horizontal-padding" style property. Fixes bug #323036.
2005-12-02 19:49:10 +00:00
Michael Natterer
5e1335376f removed redundant assignment of widget_class->motion_notify_event.
2005-12-01  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_class_init): removed redundant
	assignment of widget_class->motion_notify_event.
2005-12-01 13:03:43 +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
c613c6bef7 Convert GtkMenu to g_type_class_add_private.
2005-11-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c: Convert GtkMenu to g_type_class_add_private.
2005-11-21 16:15:11 +00:00
Matthias Clasen
14c284c37e Fix some compiler warnings. (#321141, Kjartan Maraas)
2005-11-10  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
	Kjartan Maraas)
2005-11-10 14:33:51 +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
9eb5ea7dd3 Only cancel if the menu was active. (#314298, Christian Persch, analysis
2005-08-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_grab_notify): Only cancel if the menu
	was active.  (#314298, Christian Persch, analysis by Mark McLoughlin)
2005-08-29 14:53:45 +00:00
Matthias Clasen
8821161c38 Take window groups into account. (#309473, Diego Gonzalez)
2005-07-05  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window
        groups into account.  (#309473, Diego Gonzalez)

        * gtk/gtkwindow.[hc]: Add a non-exported function to
        get the grab widget of a window group.
2005-07-05 22:34:07 +00:00
Matthias Clasen
ddd27f21a6 Cancel menus when they are grab-shadowed by something thats not a submenu.
2005-06-27  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_grab_notify): Cancel menus when
        they are grab-shadowed by something thats not a
        submenu.  (#145416, Euan MacGregor)
2005-06-27 17:36:34 +00:00
Matthias Clasen
92e3227043 Pay attention to the scroll offset when drawing the box. (#308834, Tom von
2005-06-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
	scroll offset when drawing the box.  (#308834, Tom von
	Schwerdtner)
2005-06-27 02:07:35 +00:00
Matthias Clasen
624a9cdb1f Allow setting background images on menus. (#169532, Benjamin Otte)
2005-04-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_paint): Allow setting background
	images on menus.  (#169532, Benjamin Otte)
2005-04-07 19:56:57 +00:00
Søren Sandmann
44404f2dc8 Translate x, y into widget coordinates instead of root coordinates. Patch
Mon Apr  4 12:14:35 2005  Søren Sandmann  <sandmann@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_handle_scrolling): Translate x, y into
	widget coordinates instead of root coordinates. Patch from Jorn
	Baayen. (#172236)
2005-04-04 16:20:28 +00:00
Michael Natterer
91cb92c018 Allow to pop up menus without grabbing the keyboard. Useful for stuff like
2005-03-31  Michael Natterer  <mitch@gimp.org>

	Allow to pop up menus without grabbing the keyboard. Useful for
	stuff like virtual keyboards. Fixes bug #159890

	* gtk/gtk.symbols
	* gtk/gtkmenushell.[ch]: added boolean property "take-focus"
	and public API gtk_menu_shell_set/get_take_focus().

	* gtk/gtkmenu.c (gtk_menu_popup)
	(popup_grab_on_window): don't grab the keyboard if take_focus
	is FALSE.

	* gtk/gtkmenuitem.c (_gtk_menu_item_popup_submen): propagate the
	parent menu_shell's take_focus property to the submenu which is
	about to be popped up.
2005-03-31 17:02:19 +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
Matthias Clasen
812e0cfdb7 Support vertical menubars (#166632):
2005-02-11  Matthias Clasen  <mclasen@redhat.com>

	Support vertical menubars  (#166632):

	* gtk/gtkenums.h (GtkPackDirection): New enumeration for pack
	directions, with values for left-to-right, right-to-left,
	top-to-bottom and bottom-to-top.

	* gtk/gtk.symbols:
	* gtk/gtkmenubar.h:
	* gtk/gtkmenubar.c: Add two properties, pack-direction and
	child-pack-direction, which specify how children and
	grandchildren of a menubar are packed, with getters and setters.

	* gtk/gtkmenubar.c (gtk_menu_bar_set_property):
	(gtk_menu_bar_get_property): Implement set_property and get_property.

	* gtk/gtkmenubar.c (gtk_menu_bar_size_request):
	(gtk_menu_bar_size_allocate): Take pack direction into account.

	* gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement
	move_current here move all the menubar-specific direction
	tweaking from the generic menushell implementation here.

	* gtk/gtkmenu.c (gtk_menu_move_current): Move  menu-specific
	direction tweaking from the generic menushell implementation here.

	* gtk/gtkmenuitem.c (gtk_menu_item_size_request):
	(gtk_menu_bar_size_allocate): Take pack direction into account.

	* gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request)
	(gtk_image_menu_item_size_allocate):
	(gtk_image_menu_item_toggle_size_request): Take child pack
	direction into account and pack the image vertically if
	necessary.

	* gtk/gtkmenushell.c (gtk_menu_shell_real_select_item):
	Set the submenu direction to left-right for menuitems in
	vertical menubars.
	(gtk_real_menu_shell_move_current): Simplify by moving
	direction tweaking to menu- and menubar-specific
	implementations. Take pack direction into account when
	doing fallbacks.

	* tests/testmenubars.c: Test menubars in various packing
	direction combinations.

	* tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
Matthias Clasen
a03c10fa14 Don't do one roundtrip per motion event. (#166173, pointed out by Chris
2005-02-03  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_handle_scrolling): Don't do
	one roundtrip per motion event.  (#166173, pointed out
	by Chris Lee, patch by Søren Sandmann)
2005-02-03 18:09:41 +00:00
Søren Sandmann
03413577a1 Bug #147497, make menu items activate immediately when you release the
Wed Dec 22 11:35:41 2004  Søren Sandmann  <sandmann@redhat.com>

	Bug #147497, make menu items activate immediately when you release
	the button.

	* gtk/gtkmenu.c (gtk_menu_enter_notify, menu_motion_notify): Make
	items activate immediately.

	* gtk/gtkmenu.c (definitely_within_item): New function
	* gtk/gtkmenu.c (check_threshold): New function
2004-12-22 16:52:23 +00:00
Matthias Clasen
7ffcc59b5a Implement scroll wheel scrolling for menus. (#88532)
2004-12-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_scroll): Implement scroll wheel scrolling
	for menus. (#88532)
2004-12-13 18:40:12 +00:00
Matthias Clasen
b2890f5394 Implement scroll wheel scrolling for menus. (#88532)
2004-12-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_scroll): Implement scroll wheel scrolling
	for menus. (#88532)
2004-12-13 18:22:02 +00:00
Matthias Clasen
1be34ede80 Remove some warnings.
2004-11-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (menu_change_screen): Remove some warnings.
2004-11-07 05:23:31 +00:00
Matthias Clasen
f7cc8cbb77 Don't unnecessarily call gtk_menu_position(), since that function has
2004-11-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (menu_change_screen): Don't unnecessarily
	call gtk_menu_position(), since that function has issues
	when called on a menu whose parent is unrealized.  (#157354,
	Adam Hooper)
2004-11-05 15:58:36 +00:00
Søren Sandmann
3d3e4699b8 Change from 50 to 20 to make the menus scroll faster.
Sun Sep 19 23:56:18 2004  Søren Sandmann  <sandmann@redhat.com>

	* gtk/gtkmenu.c (MENU_SCROLL_TIMEOUT2): Change from 50 to 20 to
	make the menus scroll faster.
2004-09-19 22:01:43 +00:00
Matthias Clasen
58034d80e4 Steal ATTACHED_MENUS list so its tail isn't freed when we re-set it,
2004-08-25  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_attach_to_widget): Steal ATTACHED_MENUS
	list so its tail isn't freed when we re-set it, noticed
	by Hans Petter Jansson.
2004-08-25 20:06:29 +00:00
Matthias Clasen
3612aee585 Add hidden aliases for exported symbols which are used internally in order
Mon Aug  9 12:48:04 2004  Matthias Clasen  <maclas@gmx.de>

	Add hidden aliases for exported symbols which are
	used internally in order to get rid of many PLT
	entries.  (#145519, Arjan van de Ven)

	* gtk/Makefile.am: Add rules to generate gtk.def and
	from gtk.symbols, and make make check check the abi
	with abicheck.sh.
	(gtk_private_h_sources): Add gtkinternals.h
	(gtk_built_private_headers): Add gtkalias.h
	(gtk_extra_sources): Add gtk.symbols
	(EXTRA_DIST): Add makegtkalias.pl and abicheck.sh

	* gtk/gtk.symbols: New file. Definition of the GTK+ ABI.
	The file can be processed by cpp to filter out certain
	subsets of symbols.

	* gtk/abicheck.sh: New file. Script to check the actually
	symbols exported from libgtk-x11.2.0.so against the symbols
	found in gtk.symbols.

	* gtk/makegtkalias.pl: New file. Perl script to generate the
	header containing the alias definitions for internally used
	exported symbols from a list of symbols.

	* gtk/gtkinternals.h: New file. An uninstalled header listing
	symbols which must be exported for some reason and do not appear
	in any other header.

	* gtk/*.c: Include gtkalias.h
2004-08-09 16:59:53 +00:00
Matthias Clasen
e50e5b3c6f Don't reparent back to menu->toplevel if it is already gone because we're
2004-07-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): Don't reparent
	back to menu->toplevel if it is already gone because we're
	shutting down.  (#147656, John Cupitt)
2004-07-15 16:43:55 +00:00
Matthias Clasen
aa794a6646 Make sure private->monitor_num is a valid monitor number before using it.
2004-07-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_position): Make sure
	private->monitor_num is a valid monitor number before
	using it.  (#139187, Michael Natterer)

2004-06-25  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid
	a crash if the font doesn't exist.  (#144967, Yevgen Muntyan)
2004-07-06 13:28:42 +00:00
Soeren Sandmann
eff6f6d3c7 Revert the "drag select" part of #141169. (#144011).
Thu Jun 10 00:22:51 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c: Revert the "drag select" part of
	#141169. (#144011).
2004-06-09 22:34:54 +00:00
Soeren Sandmann
ceebc5e983 Revert previous commit. It caused the problem of sticky right click menus
Thu Jun  3 08:07:59 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c: Revert previous commit. It caused the problem
	of sticky right click menus to return.
2004-06-03 00:15:48 +00:00
Soeren Sandmann
64bb108e2b Fix the stay up algorithm for combo boxes to better handle the "click"
Wed Jun  2 01:56:02 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

        * gtk/gtkmenu.c: Fix the stay up algorithm for combo boxes to
        better handle the "click" case. bug  Better fix for #141169.
2004-06-02 23:17:21 +00:00
Matthias Clasen
018511c3aa Handle accel_closure being NULL on an accel label. (#139641, Sam
Tue Jun  1 22:45:42 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c (get_accel_path): Handle accel_closure being
	NULL on an accel label. (#139641, Sam Stephenson, patch by
	Michael Natterer)

Tue Jun  1 22:19:55 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkicontheme.c (theme_subdir_load):  Prevent icon
	lookup finding icons in the wrong prefix.  (#143328,
	Mark McLoughlin)
2004-06-02 02:48:50 +00:00
Soeren Sandmann
01a5698e1d Make menus only stay up if you release within 500 milliseconds.
Wed Jun  2 00:39:58 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Make menus
	only stay up if you release within 500 milliseconds.
	(gtk_menu_shell_button_press): Set the activate_time to the event
	time when a button is pressed.

	* gtk/gtkmenu.c (gtk_menu_motion_notify, gtk_menu_enter_notify):
	Interprete button releases as activate when we have seen both an
	enter an a motion event.
2004-06-01 22:47:14 +00:00
Matthias Clasen
a682189045 Fix a naming blunder. 2004-05-10 04:51:13 +00:00
Matthias Clasen
48a89ec5c6 Make destruction of a torn off menu work like un-tearing off.
Mon May 10 00:48:08 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c: Make destruction of a torn off menu work
	like un-tearing off.
2004-05-10 04:49:11 +00:00
Matthias Clasen
30a4c82a3d Make the tearoff functionality model/view, the tearoffmenuitem being the
Fri May  7 00:41:46 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktearoffmenuitem.h:
	* gtk/gtktearoffmenuitem.c: Make the tearoff
	functionality model/view, the tearoffmenuitem being
	the view and the tearoff_state property of the menu
	being the model.  (#101185, Owen Taylor)

	* gtk/gtkmenu.c: Add a tearoff_state property.
2004-05-07 04:43:56 +00:00
Padraig O'Briain
1d66490a5f Add new function gtk_menu_get_for_attach_widget. (bug #113112).
2004-05-06  Padraig O'Briain  <padraig.obriain@sun.com>

	* gtk/gtkmenu.h:
	* gtk/gtkmenu.c: Add new function gtk_menu_get_for_attach_widget.
	(bug #113112).
2004-05-06 07:35:26 +00:00
Owen Taylor
3895bea4df #136672, reported by Christian Persch; fixes based on a patch by Soeren
Sun Mar 14 19:26:48 2004  Owen Taylor  <otaylor@redhat.com>

        #136672, reported by Christian Persch; fixes based
        on a patch by Soeren Sandmann.

        * gtk/gtkmenu.c: Change the handling of mixed gridded
        and non-gridded menu items; the old method was causing
        major performance problems even with the "avoid relayout
        on destruction" hack put in recently.

        Now we first lay out the gridded items and then put the
        non-gridded items into empty rows / after the gridded items.
        Layout is done in a central menu_shell_ensure_layout(). Also
        avoid emitting property notifications when we initially
        insert or attach items.

        * gtk/gtkmenushell.[ch] gtk/gtkmenu.c: Stop setting the
        unused menu_shell->menu_flag, and document it as unused
        in the header.

        * tests/testactions.c: Add a test of creating/removing
        lots of items.

        * test/testgtk.c: Add some more cruft to the menu test.
2004-03-15 02:03:59 +00:00
Owen Taylor
5c2b9546d6 Fix attach/attach->parent type. (#136919, Tim Mooney)
Thu Mar 11 16:28:15 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_get_toplevel): Fix attach/attach->parent
        type. (#136919, Tim Mooney)
2004-03-11 21:38:21 +00:00
Soeren Sandmann
db6cc5f788 Add boolean destroying (gtk_menu_destroy): Set priv->destroying
Tue Mar  9 02:11:50 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c Fix bug 136446.
	(struct _GtkMenuPrivate): Add boolean destroying
	(gtk_menu_destroy): Set priv->destroying
	(gtk_menu_remove): don't update the table information when the
	menu is being destroyed.

	* gtk/gtkmenu.c (gtk_menu_set_monitor): Formatting fix

	* gtk/gtktoolbar.[ch]: Some formatting fixes
2004-03-09 01:21:45 +00:00
Federico Mena Quintero
80581c3011 Fixes #136082 and #135265, patch by Morten Welinder.
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136082 and #135265, patch by Morten Welinder.

	* configure.in: Use AC_SYS_LARGEFILE.

	* */*.c: #include <config.h>
2004-03-06 03:38:59 +00:00
Soeren Sandmann
cddfd994ef Patch from Frederic Crozat, test code from Jean-Philippe Chancelier. Fixes
Tue Mar  2 21:23:30 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	Patch from Frederic Crozat, test code from Jean-Philippe
	Chancelier. Fixes bug #120479.

	* gtk/gtkcombo.c (gtk_combo_popup_list): Make sure popup belongs
	to the right window group.

	* gtk/gtkmenu.c (gtk_menu_popup): Same

	* tests/testsocket.c (main): Pack the plugs into an hbox instead
	of a vbox.

	* tests/testsocket_common.c: Add a GtkMenuBar, a GtkCombo and a
	GtkComboBox to the children.
2004-03-02 20:49:15 +00:00
Soeren Sandmann
41dfb5ec46 New internal function returning a good step value for the mouse wheel. For
Sun Feb 29 19:04:33 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkrange.c (_gtk_range_get_wheel_delta): New internal
	function returning a good step value for the mouse wheel. For
	scrollbars, base the step on page_size^(2/3), for other ranges,
	use 2 * step_increment.

	* gtk/gtkrange.c (gtk_range_scroll_event): Use it here ...

	* gtk/gtkscrolledwindow.c (gtk_scrolled_window_scroll_event):
	... and here.

	* gtk/gtkmenu.c (gtk_menu_leave_notify): Fix a warning.
2004-02-29 18:21:57 +00:00
Matthias Clasen
b1f74e779d Bug 112647 (Bill Haneman, patch by Narayana Pattipati):
Sun Feb 22 00:23:40 2004  Matthias Clasen  <maclas@gmx.de>

	Bug 112647 (Bill Haneman, patch by Narayana Pattipati):

	* gtk/gtkcheckmenuitem.c: Introduce a new style property
	indicator_size and use it instead of the hardcoded value.

	* gtk/gtkmenu.c (gtk_menu_size_request): Make sure each menu
	item gets enough vertical space for the label and the indicator.
2004-02-21 23:25:29 +00:00
Soeren Sandmann
d49a0c52bc Bug 132502
Sat Feb 21 19:18:26 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	Bug 132502

	* gtk/gtkmenu.c (gtk_menu_motion_notify): Make sure we pop down
	if we enter a non-selectable menu item.

	* gtk/gtkmenu.c (gtk_menu_leave_notify): Don't pop a submenu
	when the user has left the item.
2004-02-21 18:20:59 +00:00
Matthias Clasen
9397b0dc0a ...and don't forget to initalize priv->columns to 1.
Tue Feb 17 23:28:33 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c (gtk_menu_init): ...and don't forget to initalize
	priv->columns to 1.
2004-02-17 22:25:13 +00:00
Matthias Clasen
c1d9c02b09 Make sure that we keep priv->columns >= 1 even for empty menus, since we
Tue Feb 17 23:11:21 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep
	priv->columns >= 1 even for empty menus, since we divide by it
	somewhere else.  (#133428, Vincent Noel)
2004-02-17 22:16:02 +00:00
Matthias Clasen
519a586ac4 Make menus work better on Xinerama (#126150):
Tue Jan 27 01:46:54 2004  Matthias Clasen  <maclas@gmx.de>

	Make menus work better on Xinerama (#126150):

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
	monitor_num on the screen of the menu, not of the attach widget.

	* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
	(gtk_menu_window_size_request): Remember the monitor_num.
2004-01-27 00:49:03 +00:00
Soeren Sandmann
e133455aa7 Changing to 200 was a mistake. Change back to 225.
Fri Jan 23 16:58:28 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (DEFAULT_POPUP_DELAY): Changing to 200 was a
	mistake. Change back to 225.
2004-01-23 16:00:20 +00:00
Matthias Clasen
d49500e4b7 Remove the attach info after calling gtk_menu_do_remove(), since that
Thu Jan 22 21:45:24 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c (gtk_menu_remove): Remove the attach
	info after calling gtk_menu_do_remove(), since that function
	uses the attach info. Doh!

	* gtk/gtkmenu.c (gtk_menu_do_remove): Don't check priv->columns
	for being 1 directly after setting it to 0.
2004-01-22 20:45:36 +00:00
Matthias Clasen
d7bfabebdb Fixes for #130370, based on a patch by Michael Meeks:
Tue Jan 20 22:11:31 2004  Matthias Clasen  <maclas@gmx.de>

	Fixes for #130370, based on a patch by Michael Meeks:

	* gtk/gtkmenu.c (gtk_menu_do_remove): New auxiliary function to
	adjust cell positions and recalculate row and column counts after
	removing an item.

	* gtk/gtkmenu.c (gtk_menu_remove): Call gtk_menu_do_remove.

	* gtk/gtkmenu.c (gtk_menu_do_insert): Don't leave empty rows when
	appending items.

	* gtk/gtkmenu.c (gtk_menu_attach): Don't call gtk_menu_shell_append,
	to avoid an unintended recursion.
2004-01-20 21:11:30 +00:00
Matthias Clasen
07d4d314b6 The first part of the fix for #114351 (see also gdk-pixbuf/ChangeLog and
Fri Jan 16 23:59:01 2004  Matthias Clasen  <maclas@gmx.de>

	The first part of the fix for #114351 (see also
	gdk-pixbuf/ChangeLog and po/ChangeLog):

	* gtk/gtkintl.h:
	* gdk-pixbuf/gdk-pixbuf-i18n.h:
	* gdk/gdkintl.h: Define P_() for property blurbs and nicks.

	* gdk/gdkdisplaymanager.c:
	* gdk-pixbuf/gdk-pixbuf.c:
	* modules/input/gtkimcontextxim.c:
	* gtk/*.c:  Mark property blurbs and nicks with P_().

	* po/Makefile.in.in: Add --keyword=P_ to the xgettext
	invocation, since property blurbs and nicks are
	now marked with P_().
2004-01-16 23:10:05 +00:00
Matthias Clasen
b21fe1745c New function to emit the "cancel" signal on a menu shell.
Sun Dec 21 01:54:40 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenushell.h:
	* gtk/gtkmenushell.c (gtk_menu_shell_cancel): New function
	to emit the "cancel" signal on a menu shell.

	* gtk/gtkmenu.c (gtk_menu_key_press):
	* gtk/gtkoptionmenu.c (gtk_option_menu_remove_menu):
	* gtk/gtkmenubar.c (_gtk_menu_bar_cycle_focus): Use the
	new function instead of directly emitting the
	signal.  (#81803, Owen Taylor)
2003-12-21 00:59:46 +00:00
Kristian Rietveld
8a834dce94 move item insertion logic here from gtk_menu_real_insert(),
Fri Dec 19 21:52:46 2003  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkmenu.c (gtk_menu_do_insert): move item insertion logic
	here from gtk_menu_real_insert(),
	(gtk_menu_real_insert): just call gtk_menu_do_insert(),
	(gtk_menu_reorder_child): run _do_insert after inserting the child
	(unbreaks _reorder_child, reported by Tim Janik).
2003-12-19 20:56:19 +00:00
Owen Taylor
85c05a86c0 === Released 2.3.1 ===
Mon Dec  8 10:54:44 2003  Owen Taylor  <otaylor@redhat.com>

        * === Released 2.3.1 ===

        * NEWS: Updates for 2.3.1

        * configure.in: Version 2.3.1, interface age 0, binary age 301.

        * gtk/gtkmenuitem.c (gtk_menu_item_can_activate_accel):
        Rename from gtk_menu_item_real_can_activate_accel() to
        match GTK+ convention, improve comment.

        * gtk/gtkwidget.c: Document gtk_widget_can_activate_accel(),
        can ::can-activate-accel signal.

        * gtk/gtkwidget.c (closure_accel_activate): Fix spelling
        in comment.

        * gtk/gtkmenu.c (gtk_menu_real_can_activate_accel): Clean
        up comment.

        * gtk/gtkcellview{,menuitem}.[ch]: Move GET_PRIVATE() macros
        into the .c file.

Mon Dec  8 12:09:21 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkicontheme.c (find_builtin_icon): Fix a
        missing 'else'. (#128816, Jorn Baayen)
2003-12-08 22:55:03 +00:00
Tim Janik
47f63b8cb2 fix comment typo 2003-12-08 16:02:25 +00:00
Tim Janik
448b576dc1 allow accel activation depending on sensitivity and the attach widget.
Thu Nov 27 16:19:03 2003  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenu.c: allow accel activation depending on sensitivity
        and the attach widget.

        * gtk/gtkmenuitem.c: allow accel activation depending on visibility,
        sensitivity and the parent menu.

        * gtk/gtkwidget.[hc]: introduced ::can-activate-accel signal which
        checks whether accelerators may activate a widget. the default handler
        demands the widget be sensitive and visible+viewable.

        * gtk/gtkaccelgroup.[hc]: export gtk_accel_group_activate().
2003-11-27 15:51:32 +00:00
Manish Singh
d263d0bcc0 cast to GTK_WIDGET() for the gtk_widget_hide() call.
Thu Nov 20 15:41:56 2003  Manish Singh  <yosh@gimp.org>

        * gtk/gtkmenu.c (gtk_menu_set_tearoff_state): cast to GTK_WIDGET()
        for the gtk_widget_hide() call.
2003-11-20 23:42:08 +00:00
Soeren Sandmann
907483c615 set to 200 instead of 225 Impose a minimum width on items that have a
Wed Nov 19 18:15:00 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (DEFAULT_POPUP_DELAY): set to 200 instead of 225
	* gtk/gtkmenuitem.c (get_minimum_width): Impose a minimum width
	on items that have a submenu. (#120104).

Wed Nov 19 18:11:08 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtktoolbar.c (struct _ToolbarContent): Add a new
	"ItemState" field indicating the overflowed-ness etc. of the item.
	(gtk_toolbar_size_allocate): update the field here.
2003-11-19 19:44:45 +00:00
Matthias Clasen
80bb353808 Call gtk_widget_hide(menu) when reattaching the menu. (#126057)
Wed Nov 19 02:18:37 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): Call
	gtk_widget_hide(menu) when reattaching the menu.  (#126057)
2003-11-19 01:21:46 +00:00
Matthias Clasen
e71bcc8487 Changes to improve menu positioning on Xinerama (#108328):
Wed Nov 12 21:40:10 2003  Matthias Clasen  <maclas@gmx.de>

	Changes to improve menu positioning on Xinerama (#108328):

	* gtk/gtkmenu.c (struct _GtkMenuPrivate): Add a menu_num field
	to store the monitor on which the menu is to be positioned.

	* gtk/gtkmenu.[hc] (gtk_menu_position): Store the monitor number
	in the GtkMenuPrivate struct and fetch the monitor geometry after
	calling the position_func, in case it has been changed.

	* gtk/gtkmenu.c (gtk_menu_set_monitor): New function
	to be used in GtkMenuPositionFunc implementations for setting
	the monitor_num field in GtkMenuPrivate.

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Call
	gtk_menu_set_monitor.
2003-11-12 20:53:03 +00:00
Padraig O'Briain
9d84901592 Do not let pointer position affect window menu position when popped from
2003-11-12  Padraig O'Briain  <padraig.obriain@sun.com>

	* gtk/gtkmenu.c (gtk_menu_popup): Do not let pointer position
	affect window menu position when popped from keyboard. (#102660)
2003-11-12 09:09:25 +00:00
Matthias Clasen
3110ca2f17 Set torn off menus to be transient for the toplevel they were torn off
Wed Nov  5 22:49:36 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): Set torn off
	menus to be transient for the toplevel they were torn off from.
	(gtk_menu_get_toplevel): Auxiliary function to find the
	toplevel of a menu.  (#54775, Jon-Kare Hellan)
2003-11-05 21:50:51 +00:00
Matthias Clasen
d381967d5c Changes to make cross-process merging feasible:
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.
2003-09-21 22:04:48 +00:00
Matthias Clasen
6f81c10a54 Add table menu tests.
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)
2003-09-11 21:02:24 +00:00
Kristian Rietveld
e23ed60782 The table menu patch! Turns GtkMenu into a table, so you can attach menu
Wed Sep 10 22:25:04 2003  Kristian Rietveld  <kris@gtk.org>

	The table menu patch! Turns GtkMenu into a table, so you can attach
	menu items in numerous new ways! Be creative!

	Contains some bug fixes and RTL adaptions from Matthias Clasen.

	* gtk/gtkmenu.c [toplevel]: introduce ATTACH_INFO_KEY, extend
	GtkMenuPrivate, introduce AttachInfo, add child properties enum,
	(gtk_menu_free_private), (gtk_menu_get_private): we have to free
	the heights array in the private struct,
	(gtk_menu_class_init): reorder code a bit, install child properties,
	(get_attach_info), (get_child_attach): new utility functions,
	(gtk_menu_set_child_property), (gtk_menu_get_child_property): introduce
	child properties, for the attach info,
	(gtk_menu_remove): remove AttachInfo from menu item,
	(gtk_menu_real_insert): implemented algorithm to automagically place
	inserted menu items at the correct place in the table,
	(gtk_menu_size_request), (gtk_menu_size_allocate),
	(compute_child_offset): reworked/rewritten to support table menus,
	(gtk_menu_attach): new function,
	(find_child_containing), (gtk_menu_move_current): new functions to
	get table menu keynav right.

	* gtk/gtkmenu.h: add gtk_menu_attach() prototype.
2003-09-10 20:32:33 +00:00
Kristian Rietveld
bc61e7233b Merge from stable.
Wed Sep  3 23:18:17 2003  Kristian Rietveld  <kris@gtk.org>

	Merge from stable.

	* gtk/gtkmenu.c (gtk_menu_real_move_scroll): for the END case,
	use end_position - page_size instead of G_MAXINT, since
	gtk_menu_scroll_to doesn't CLAMP anymore internally. (Fixes #121237,
	reported by Havoc Pennington).
2003-09-03 21:26:13 +00:00
Kristian Rietveld
eccc733f29 brooooooooken pipe. 2003-09-03 19:57:05 +00:00
Kristian Rietveld
0321556d15 Thu Aug 21 21:27:45 2003 Kristian Rietveld <kris@gtk.org>A
Merge from stable.

	Fix option menu scrolling (#119821, Owen Taylor).

	* gtk/gtkmenu.c (gtk_menu_scroll_to): remove logic introduced
	by #80484 and the CLAMP,
	(get_menu_height): new function,
	(gtk_menu_real_move_scroll): sort of moved the CLAMP here to correct
	new_offset to handle page up/down right.
2003-08-21 19:42:44 +00:00
Owen Taylor
91d3768017 Fix some places that weren't properly Xinerama-ified.
Wed Aug 13 16:32:43 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request):
        Fix some places that weren't properly Xinerama-ified.

        * gtk/gtkmenu.c: Fix problem with windows that scroll
        at the top of the screen.
2003-08-13 20:45:37 +00:00
Soeren Sandmann
094657e85b New positioning algorithm.(#116649)
Tue Aug  5 00:24:13 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_position): New positioning
	algorithm.(#116649)
2003-08-04 22:09:02 +00:00
Søren Sandmann Pedersen
1a5a17d629 Revert accidentally committed changes. 2003-07-13 02:42:40 +00:00
Søren Sandmann Pedersen
31d6d0aab6 Broken pipe 2003-07-13 02:33:25 +00:00
Soeren Sandmann
d77b4c1448 new properties "horizontal-offset" and "vertical-offset" that determines
Sun Jul 13 01:37:51 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_class_init): new properties
	"horizontal-offset" and "vertical-offset" that determines the
	position of the menu when it is a submenu.

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): position
	submenus according to new vertical- and horizontal-offset
	properties.
2003-07-12 23:25:14 +00:00
Soeren Sandmann
c8515b2f8d add vertical_padding style property.
Sat Jul  5 10:34:00 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

        * gtk/gtkmenu.c: add vertical_padding style property.

        * gtk/gtkmenuitem.c: add style properties toggle_spacing,
        arrow_spacing and horizontal_padding. Also center separators and
        make them a bit taller.

        * gtk/*menuitem.c: use new style properties.

        * docs/widget_geometry.txt: Add note about GtkMenuItem

        * gtk/gtkstyle.c
        (gtk_default_draw_vline, gtk_default_draw_hline):
        fix +/-1 errors.

        (gtk_default_draw_shadow): draw a black border around menus.

        * gtk/gtkvseparator, gtk/gtkhseparator.c, gtk/gtkmenuitem.c: fix
        calls to gtk_paint_hline() and gtk_paint_vline() (they take x1,
        x2 and y1, y2 respectively, not x, width and y, height).
2003-07-06 13:14:28 +00:00
Manish Singh
dd74be94c6 demos/gtk-demo/main.c demos/gtk-demo/tree_store.c gdk/x11/gdkscreen-x11.c
Thu Feb 27 17:44:24 2003  Manish Singh  <yosh@gimp.org>

        * demos/gtk-demo/main.c
        * demos/gtk-demo/tree_store.c
        * gdk/x11/gdkscreen-x11.c
        * gtk/gtkcellrenderertoggle.c
        * gtk/gtkcolorsel.c
        * gtk/gtkdnd.c
        * gtk/gtkeditable.c
        * gtk/gtkentry.c
        * gtk/gtkmenu.c
        * gtk/gtkmenubar.c
        * gtk/gtkmenuitem.c
        * gtk/gtkmenushell.c
        * gtk/gtkrc.c
        * gtk/gtksettings.c
        * gtk/gtkstyle.c
        * gtk/gtktextbuffer.c
        * gtk/gtktextview.c
        * gtk/gtktreeviewcolumn.c
        * tests/testgtk.c
        * tests/testtext.c
        * tests/testtreeedit.c
        * tests/testtreefocus.c
        * tests/testtreeview.c: remove unnecessary G_OBJECT() casts.
2003-02-28 01:45:51 +00:00
Matthias Clasen
b414adc897 Replace uses of gtk_timeout_* and gtk_idle_* by their non-deprecated
GLib counterparts. Fully deprecate gtk_timeout_* and gtk_idle_*.
2003-02-05 23:48:11 +00:00
Owen Taylor
08a08cf1b5 Add a new binding signal, "move_scroll", and use it to hook up
Sat Dec 14 14:19:16 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c: Add a new binding signal, "move_scroll",
        and use it to hook up Home/End/Page_Up/Page_Down keybindings.
        (#80484, Narayana Pattipati, Marius Andreiana)

        * gtk/gtkmenu.c (gtk_menu_scroll_item_visible): Fix some
        bugs in the computation of when an item is visible. (#99545)

        * gtk/gtkbindings.[ch] (_gtk_binding_signal_new) gtk/gtkmenushell.c:
        Move here, export privately.

        * gtk/gtkmenushell.c (_gtk_menu_shell_select_last): Export
        privately.

        * gtk/gtkmenushell.c (gtk_menu_shell_select_item): Don't
        select the item if it is already selected.
2002-12-14 22:43:52 +00:00
Owen Taylor
ad3ca8430d Handle the case where the pointer isn't on the same screen as the widget
Sat Dec 14 01:00:12 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_position): Handle the case
        where the pointer isn't on the same screen as the widget
        by centering the menu on the widget's screen. (#94563)
2002-12-14 06:05:00 +00:00
Owen Taylor
d8bc318151 gdk/gdkscreen.c (gdk_screen_get_monitor_at_point) Provide a useful
Fri Dec 13 23:58:06 2002  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkscreen.c (gdk_screen_get_monitor_at_point)
	* gdk/gdkscreen.c (gdk_screen_get_monitor_at_window):
	Provide a useful fallback on failure - return a monitor
	close to the point or window. (#79991)

	* gtk/gtkmenu.c (gtk_menu_position): Remove a now
	unneeded check for failure of
	gdk_screen_get_monitor_at_point()
2002-12-14 05:27:23 +00:00
Owen Taylor
4f14fc15e6 If the screen for the menu changes while the menu is torn off, move the
Fri Dec 13 22:55:27 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (menu_change_screen): If the screen
        for the menu changes while the menu is torn off, move
        the tearoff along with it. (#85669)

        * gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
        reattaching, get rid of the get rid of the tearoff window.
2002-12-14 04:07:08 +00:00
Owen Taylor
17bbbde74a Use the correct screen for getting the height. (Fix from Stephen Browne,
Fri Dec  6 17:46:42 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_window_size_request): Use
        the correct screen for getting the height.
        (Fix from Stephen Browne, #96777)
2002-12-06 22:49:56 +00:00
Matthias Clasen
7cb3f99fc7 Document 2.2 API additions. 2002-11-28 00:33:17 +00:00
Matthias Clasen
7d62f9ed78 Fix doc comment typos. (#98480, Vitaly Tishkov)
* gtk/gtkmenu.c (gtk_menu_set_screen): Fix doc comment
	typos.  (#98480, Vitaly Tishkov)
2002-11-21 19:12:43 +00:00
Owen Taylor
c26787be57 Monitor the screen of the attach widget continually, rather than only
Thu Nov 14 00:33:26 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (attach_widget_screen_changed): Monitor
        the screen of the attach widget continually, rather than only
        setting the screen only on popup (#85710)

        * gtk/gtkmenu.c (gtk_menu_set_screen): Allow %NULL to
        go back to getting the screen from the attach widget.
2002-11-14 05:46:34 +00:00
Soeren Sandmann
3b5d33adc7 Do not return when menu_shell->ignore_enter is TRUE.
Tue Nov 12 14:20:53 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_enter_notify): Do not return when
	menu_shell->ignore_enter is TRUE.
2002-11-12 13:25:04 +00:00
Soeren Sandmann
a9cd971729 Don't return after calling gtk_menu_handle_scrolling() when
Sun Nov 10 22:55:39 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_enter_notify): Don't return after
	calling gtk_menu_handle_scrolling() when
	!menu_shell->ignore_enter.
2002-11-10 22:04:16 +00:00
Owen Taylor
6193ff1f10 Block button presses/releases over the scroll arrows to avoid popping down
Sat Nov  9 14:42:53 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_button_*): Block
        button presses/releases over the scroll arrows
        to avoid popping down the menu. (#73444, Ettore Perazzoli)

        * gtk/gtkmenu.c (gtk_menu_enter_notify): Obey the
        ignore_enter flag for scrolling as well.

        * gtk/gtkmenu.c (gtk_menu_stop_scrolling): Clear
        the upper_arrow_prelight, lower_arrow_prelight
        flags.

        * gtk/gtkmenu.c: Tweak the scroll speeds,
        timeouts, and fast-scroll area to make things
        zippier. (#73445, Ettore Perazzoli)
2002-11-09 20:52:31 +00:00
Soeren Sandmann
fe0b83b722 Change NAVIGATION_REGION_OVERSHOOT back to 50, and create stay-up regions
Tue Oct 29 20:39:16 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c: Change NAVIGATION_REGION_OVERSHOOT back to 50,
	and create stay-up regions by flipping a fourth quadrant triangle
	as appropriate.
2002-10-29 19:44:59 +00:00
Soeren Sandmann
bbecef6e1f Change NAVIGATION_REGION_OVERSHOOT from 50 to 5.
Fri Oct 25 23:36:30 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c: Change NAVIGATION_REGION_OVERSHOOT from 50 to 5.
2002-10-25 22:33:33 +00:00
Soeren Sandmann
4b08e835a4 gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
	gtkmenushell.h, gtkmenushell.h

	- make the delay before submenus appear below menu bars a
	  GtkSetting
	- make the delay before submenus pops up a GtkSetting
	- make the stay up triangle slightly larger
	- don't pop up the first submenu immediately.
	- make the default delay for submenus 225 ms, and 0 for menubars.
	- make the default delay before popping down inside the stay-up
	  triangle 1000 ms

	Fixes #74950
2002-10-20 22:29:57 +00:00
Havoc Pennington
727eb8afbd add g_return_if_fail for monitor number <= 0
2002-10-16  Havoc Pennington  <hp@redhat.com>

	* gdk/x11/gdkscreen-x11.c (gdk_screen_get_monitor_geometry): add
	g_return_if_fail for monitor number <= 0

	* gtk/gtkmenu.c (gtk_menu_position): handle case where pointer
	is outside the screen.

	* gtk/gtkwindow.c (get_monitor_center): factor out
	the code to position a window in center
	(gtk_window_compute_configure_request): use here
	(gtk_window_constrain_position): use here, the
	code here wasn't multihead-aware

	* gdk/x11/gdkevents-x11.c (get_real_window): function to
	return the window the event describes, rather than the window
	that received the event.
	(gdk_event_translate): use result of that function for
	filling in GdkEvent::window, which only matters for
	MapNotify/UnmapNotify and ConfigureNotify, in practice.

	Unbreaks various things using SubstructureNotifyMask.
2002-10-17 20:24:03 +00:00
Soeren Sandmann
a9d26e1478 Take arrows into account when clamping the offset. Fixes #95758.
Thu Oct 17 22:09:05 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_scroll_to): Take arrows into
	account when clamping the offset. Fixes #95758.
2002-10-17 20:09:39 +00:00
Soeren Sandmann
a130f089ca Documentation fixes.
Sun Oct 13 18:50:14 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtkmenu.c, gtkmenu.sgml, gtkitemfactory.c, gdkwindow.c,
	gtkwindow.c, gtkpaned.sgml, gtkdialog.c, gtkbox.h, gtkbutton.sgml,
	gtktreemodel.sgml,gtktable.sgml, gtktable.c:

	Documentation fixes.

	#85719, #90759, #95169, Owen Taylor;
	#89221, Yao Zhang, Matthias Clasen;
	#95592, Joost Faassen;
	#92637, Vitaly Tishkov;
	#94616, Ben Martin;
	#94772, sbaillie@bigpond.net.au;
2002-10-13 17:17:14 +00:00
Manish Singh
28bc53032b Deprecation cleanup
Wed Oct  9 17:40:13 2002  Manish Singh  <yosh@gimp.org>

        * gtk/gtkaccelmap.c gtk/gtkfixed.[ch] gtk/gtkkeyhash.c gtk/gtkmenu.c
        gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtkrc.c gtk/gtkspinbutton.[ch]
        gtk/gtktable.[ch] gtk/gtkthemes.c: Deprecation cleanup
2002-10-10 01:02:25 +00:00
Manish Singh
8409ada92f Deprecation cleanup
Fri Oct  4 18:40:50 2002  Manish Singh  <yosh@gimp.org>

        * gtkcheckmenuitem.[ch] gtkimagemenuitem.[ch] gtkmenu.[ch]
        gtkmenubar.[ch] gtkmenuitem.[ch] gtkmenushell.[ch]
        gtkradiomenuitem.[ch]: Deprecation cleanup
2002-10-05 01:51:16 +00:00
Owen Taylor
92fa223146 Fix error in computing length and a memory leak. (Fixes #94072, reported
Thu Oct  3 19:00:55 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
        Fix error in computing length and a memory leak.
        (Fixes #94072, reported by Hema Seetharamaiah)

        * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
        used instead of event.
2002-10-03 23:23:16 +00:00
Owen Taylor
ef33adff83 Add a 'type' parameter, make public.
Thu Oct  3 14:13:33 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkevents.c (gdk_event_new): Add a 'type'
        parameter, make public.

        * gdk/gdkevents.c (gdk_event_copy): Copy the screen.

        * gdk/gdkevents.c gdk/linux-fb/gdkmain-fb.c
        gdk/x11/gdkevents-x11.c gdk/win32/gdkevents-win32.c:
        _gdk_event_new() => gdk_event_new().

        * gdk/win32/gdkevents-win32.c (real_window_procedure):
        Fix event_private->screen breakage that results from evil
        encapsulation breakage here.

        * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcontainer.c
        gtk/gtkdialog.c gtk/gtkdnd.c gtk/gtkdrawingarea.c
        gtk/gtkimcontextsimple.c gtk/gtklist.c gtk/gtkmenu.c
        gtk/gtknotebook.c gtk/gtkplug.c gtk/gtkselection.c
        gtk/gtktext.c gtk/gtktreeitem.c gtk/gtktreeview.c
        gtk/gtkviewport.c gtk/gtkwindow-decorate.c gtk/gtkwindow.c
        tests/testgtk.c: Remove most usage of stack-allocated
        GdkEvent structures.

        * gtk/gtktreeview.c: Use a cut-and-paste of the full
        send_focus_event() from gtkwindow.c that does the necessary
        notification of the ::has-focus property and setting of
        the HAS_FOCUS flag.x

        * gtk/gtkdnd.c: Clean up some mess/duplicated code; removing
        an extraneous use of a GdkEvent.
2002-10-03 20:53:30 +00:00
Padraig O'Briain
7995a9ef97 Add gtk_menu_focus() so we do not waste time trying to focus a menu item.
* gtk/gtkmenu.c: Add gtk_menu_focus() so we do not waste time
trying to focus a menu item. (bug #91258)
2002-10-01 09:57:55 +00:00
Soren Sandmann
77eee887f3 Minor documentation fixes
2002-08-10  Soren Sandmann  <sandmann@daimi.au.dk>

	* docs/reference/gtk/tree_widget.sgml,
	docs/reference/gtk/tmpl/gtkdialog.sgml,
	docs/reference/gtk/tmpl/gtkentry.sgml,
	docs/reference/gtk/tmpl/gtkfilesel.sgml,
	docs/reference/gtk/tmpl/gtkfontsel.sgml,
	docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
	docs/reference/gtk/tmpl/gtktreemodel.sgml,
	docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
	gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
	gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
	gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
	gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
	gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
	gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
	gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
	gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
	gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
	gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
	gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
	gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
	gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
	gtk/gtkwindow.c:

	Minor documentation fixes

	(#89254, patch from Brett Nash;
	 #85809, patch from daten@dnetc.org;
	 #76391, patch from Ross Burton;
	 #74559, Manuel Clos;
	 #73569, #72005, Alexey A. Malyshev;
	 #70061, patch from Dennis Bj"orklund;
	 #64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
	 #78932, Vitaly Tishkov, patch from Ross Burton;
	 #73306)
2002-08-10 09:55:41 +00:00
Owen Taylor
786b3e298f Fix menus resizing dynamically while they are popped up or torn off.
Fri Aug  2 18:00:46 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c: Fix menus resizing dynamically while
        they are popped up or torn off. (#78949)
2002-08-02 22:03:23 +00:00
Michael Meeks
dc1a2846cf destroy the transfer window if the grab fails so we don't get events on
2002-05-30  Michael Meeks  <michael@ximian.com>

	* gtk/gtkmenu.c (gtk_menu_popup): destroy the transfer
	window if the grab fails so we don't get events on this
	window after the menu is finalized with a duff GtkWidget
	pointer: #82366
2002-05-31 16:44:03 +00:00
Soeren Sandmann
25e0ae0186 add gtk_menu_style_set(). fixes #79345
Thu May 30 07:59:38 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_style_set): add
	gtk_menu_style_set(). fixes #79345
2002-05-30 06:05:42 +00:00
Ettore Perazzoli
ff784b978b If the menu is scrolled down or up, and some of the widget area is empty,
* gtk/gtkmenu.c (gtk_menu_paint): If the menu is scrolled down or
up, and some of the widget area is empty, don't fill it in with
GTK_SHADOW_IN rectangles that make it looks strange.  Fixes
#72695.
2002-05-16 14:00:45 +00:00
Owen Taylor
f47470a9ef Fix format of selection data to be 8 rather than GTK_TYPE_POINTER.
Tue May 14 17:30:57 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkctree.c gtk/gtkclist.c: Fix format of
        selection data to be 8 rather than GTK_TYPE_POINTER.
        (#79751, James Henstridge)

        * gtk/gtkmenu.c (gtk_menu_key_press): Call
        gtk_accelerator_valid() with cleaned up
        accel_key/accel_mods, not the raw values from
        the event. (#80513, Havoc Pennington.)

        * gtk/gtkmenu.c (gtk_menu_set_tearoff_state): Remove
        some dead code that set the tearoff window not
        resizable and removed decorations. (#80235)
2002-05-14 21:36:32 +00:00
Erwann Chenede -
2325caf979 remove virtualization and made it cross platform. fix #79961 fixed
2002-05-01 Erwann Chenede - <erwann.chenede@sun.com>

  * gdk/gdkscreen.[hc] (gdk_screen_x11_get_monitor_at_window):
    remove virtualization and made it cross platform. fix #79961
  * gdk/x11/gdkdisplay-x11.c (check_solaris_xinerama):
    fixed initialization bugs.
  * gdk/x11/gdkscreen-x11.[hc] (gdk_screen_get_monitor_geometry):
  * tests/testxinerama.c:
  * gtk/gtkwindow.c (gtk_window_compute_configure_request):
  * gtk/gtkmenu.c (gtk_menu_position):
    take a GdkRectangle argument instead of returning
    a GdkRectangle * and propagated the changes. fix #79974
2002-05-01 17:22:54 +00:00
Alex Larsson
4632fb81c7 Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002  Owen Taylor  <otaylor@redhat.com>

	Integrate Erwann Chenede's multihead changes for the gtk/ directory.

	* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
	make internals multihead aware.

	* gtk/gtkcolorsel.[ch]: Add
	gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
	make up for non-multihead safety of
	gtk_color_selection_set_change_palette_hook()

	* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
	gtk_{invisible,menu,window}_set_screen(); add "screen" properties
	for GtkWindow and GtkMenu.

	* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
	gtk_plug_new_for_display(). Multihead fixes.

	* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
	make internals multihead aware.

	* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
	rid of now-useless gtk_settings_constructor().

	* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
	check/radio button indicators bitmap handling to be multihead
	safe.

	* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
	gtk_widget_get_display(), gtk_widget_get_clipboard(),
	gtk_widget_get_root_window().

	* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
	gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
	gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
	gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
	gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
	gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
	gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
	gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
	misc mechanical multihead-safety fixes.

	* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
	the dropper, look up the color palette only at realization time,
	other multihead fixes.

	* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
	unrealizing.

	* gtk/gtkentry.c: Only claim ownership of the primary selection
	when realized, misc multihead fixes.

	* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
	fix gtk_font_selection_get_font() for multihead.

	* gtk/gtkgc.c: make the depth => drawable hash per-screen.

	* gtk/gtkinvisible.c: Add a constructor that realizes the
	widget, so we get a realized widget with g_object_new() as
	well gtk_invisible_new() as before.

	* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
	variables.

	* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
	are used on the wrong screen.

	* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
	read properties and connect to settings when the screen is changed,
	rather than on init/finalize.

	* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
	default icon pixmaps/mask are only shared between windows on the
	same screen. Misc multihead fixes.

Sat Apr 27 13:49:53 2002  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
	Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.

2002-04-29  Alex Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
	Fix silly bug, noticed by Sven Neumann.

Sun Apr 28 22:43:55 2002  Jonathan Blandford  <jrb@gnome.org>

	* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
	so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
Tim Janik
b0d72c4d93 don't install/change accelerators from locked accel groups.
Tue Apr 16 07:53:49 2002  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenu.c (gtk_menu_key_press): don't install/change accelerators
        from locked accel groups.

        * gtk/gtkwidget.c (_gtk_widget_get_accel_path): export whether the
        accel path is from a locked accel group.
2002-04-16 05:57:45 +00:00
Owen Taylor
441488cdb4 Shuffle the ordering around some more (position before realizing) fixing
Tue Mar 26 14:46:50 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_popup): Shuffle the ordering around
        some more (position before realizing) fixing problems with
        arrows popping up at the wrong time (#73386), hopefully not
        introducing other problems. (Reported by Ettore Perrazoli, others)
2002-03-26 19:59:34 +00:00
Soeren Sandmann
7678a1ed16 Fix test for "active submenu".
Fri Mar 15 13:31:51 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_leave_notify): Fix test for "active
	submenu".
2002-03-15 13:15:17 +00:00
Soeren Sandmann
f280f6d080 change offset of cursor corner of navigation region from (-2, 2) to (-2,
Sun Mar  3 20:48:12 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_set_submenu_navigation_region): change
	offset of cursor corner of navigation region from (-2, 2) to
	(-2, 0).
2002-03-03 19:50:50 +00:00
Owen Taylor
86e7c7dfe9 Fix double set of bindings for page-up/down. (#72605, Tor Lillquist)
Mon Feb 25 22:10:47 2002  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkscrolledwindow.c (gtk_scrolled_window_class_init): Fix
	double set of bindings for page-up/down. (#72605, Tor Lillquist)

	* gtk/gtkmenu.c (gtk_menu_key_press): Remove consumed modiifers
	when setting up accelerator to make accelerators look prettier.
	(#65416, Guillermo S. Romero)
2002-02-26 03:23:45 +00:00
Owen Taylor
8fe564e37a Add some docs for GTK_NEED_REQUEST GTK_NEED_ALLOCATION.
Mon Feb 18 16:44:00 2002  Owen Taylor  <otaylor@redhat.com>

        * docs/widget_system.txt: Add some docs for GTK_NEED_REQUEST
        GTK_NEED_ALLOCATION.

        * gtk/gtkmenu.c (gtk_menu_popup): Scroll the menu
        to the right place before showing the menu to
        avoid spurious enter events.

        * gtk/gtkmenu.c (gtk_menu_realize): Only scroll
        if there is an active menu item.

        * gtk/gtkwidget.c (gtk_widget_init): Set RESIZE_NEEDED
        ALLOC_NEEDED initially.
2002-02-18 22:08:41 +00:00
Owen Taylor
2e8d083c3c Released 1.3.14
Sun Feb 17 21:30:49 2002  Owen Taylor  <otaylor@redhat.com>

        * Released 1.3.14

        * configure.in: Version 1.3.14, interface, binary age 0.

        * gdk/gdkregion-generic.c (miSubtractO): Fix out-of-bounds
        read. (#71619, reported by Morten Welinder)

        * gtk/gtkmenu.c (gtk_menu_class_init): Fix setting default.

        * gtk/gtkfilesel.c (gtk_file_selection_class_init): Add
        a select_multiple property to go along with thenew
        get/set_select_multiple.

        * gdk/gdkwindow.c: Patch from Soeren Sandmann to improve
        update debugging code. (#71703)
2002-02-18 03:29:00 +00:00
Tim Janik
f42cc7f7fb fix figuring accel path and changing behaviour.
Wed Feb 13 13:26:39 2002  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenu.c: fix figuring accel path and changing behaviour.
2002-02-13 12:28:33 +00:00
Darin Adler
6ec06edbbf isspace -> g_ascii_isspace Remove gdki8n.h include. Remove <ctype.h>
* demos/gtk-demo/main.c: (load_file): isspace -> g_ascii_isspace
	* gdk/x11/gdkim-x11.c: Remove gdki8n.h include.
	* gdk/x11/gdkkeys-x11.c: Remove <ctype.h> include.
	* gdk/x11/gdkmain-x11.c: Remove <ctype.h> include.
	* gtk/fnmatch.c: Remove <ctype.h> include.
	* gtk/gtkaccelgroup.c: Remove <ctype.h> include.
	* gtk/gtkaccellabel.c: (gtk_accel_label_refetch): toupper ->
	g_unichar_toupper, toupper -> g_unichar_totile
	* gtk/gtkbindings.c: Remove <ctype.h> include.
	* gtk/gtkfontsel.c: Remove <ctype.h> include.
	* gtk/gtkiconfactory.c: Remove <ctype.h> include.
	* gtk/gtkinputdialog.c: Remove <ctype.h> include.
	* gtk/gtklabel.c: Remove <ctype.h> include.
	* gtk/gtkmain.c: Remove <ctype.h> include.
	* gtk/gtkmenu.c: Remove <ctype.h> include.
	* gtk/gtkoldeditable.c: Remove <ctype.h> include.
	* gtk/gtkrc.c: Remove <ctype.h> include.
	* gtk/gtktextbtree.c: Remove <ctype.h> include.
	* gtk/gtktextiter.c: Remove <ctype.h> include.
	* gtk/gtktextsegment.c: Remove <ctype.h> include.
2002-02-08 19:12:34 +00:00
Padraig O'Briain
402f5b9d93 Fix leak of GdkEvent (#70519)
* gtk/gtkmenu.c (gtk_menu_popup):
Fix leak of GdkEvent (#70519)
2002-02-04 17:46:33 +00:00
Owen Taylor
ae7521bd9d Non-exported _gtk_menu_select_first() function that selects the first item
Sat Feb  2 20:16:04 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenushell.c (_gtk_menu_shell_select_first):
        Non-exported _gtk_menu_select_first() function that
        selects the first item of the menu in a standard
        way. (Skipping tearoffs.)

        * gtk/gtkmenushell.c gtk/gtkentry.c gtk/gtktextview.c
        gtkmenuitem.c: Use _gtk_menu_shell_select_first().

        * gtk/gtkmenuitem.c (gtk_real_menu_item_select): Remember
        if we are starting the timeout from a keypress so
        we can set menushell->ignore_enter properly.

        * gtk/gtknotebook.c (focus_child_in): Return something
        meaningful if there are no children.

        * gtk/gtkmenu.c (gtk_menu_key_press): Fix precendence
        problem.
2002-02-03 01:25:32 +00:00
Owen Taylor
0ed21b67d9 Fix some bugs in the determination of xgrab_shell.
Sat Feb  2 19:15:42 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_popup): Fix some bugs in
        the determination of xgrab_shell.
2002-02-03 00:18:41 +00:00
Owen Taylor
d6622d38d6 Add a GtkSetting (gtk-entry-select-on-focus) controlling whether the
Sat Feb  2 17:43:00 2002  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
	(gtk-entry-select-on-focus) controlling whether the
	contents of an entry are selected on focus in.

	* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
	(gtk-can-change-accels) controlling whether accelerators can be
	changed on the fly or not. (#51902)

	* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
	accelerators, now that accelerator changing can be turned
	off for those who won't expect it. (#61285)

	* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
	Backspace/Delete/KP_Delete as valid accelerators.

	* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
	Delete/Backspace as accelerators by making them toggle
	the menu item between empty and the pressed key.
	(#58605)

	* tests/testgtkrc: Remove the objectionably short cursor blink
	time setting.
2002-02-02 22:52:22 +00:00
Owen Taylor
2ee08d8ec6 To get around the fact that we may have a owner_events = FALSE grab in
Sat Feb  2 16:43:31 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
        that we may have a owner_events = FALSE grab in effect
        when we pop up a window, make a temporary grab on a
        different window, then grab on the real window. Fixes
        a problem where if a context menu popped up under the
        cursor, the first item would be stuck unselected.
        (#59812, reported by Arnaud Charlet.)
2002-02-02 21:50:46 +00:00
Owen Taylor
67ad02989f Remove the "select first item if popped up from keypress" hack -- was
Sat Feb  2 11:37:21 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_popup): Remove the
        "select first item if popped up from keypress" hack --
        was causing more problems than it was worth
        (#53191, #68483)

        * gtk/gtktextview.c (popup_targets_received):
         gtk/gtkentry.c (popup_targets_received): If activated
        from keyboard, select first item of popup menu.
2002-02-02 17:52:01 +00:00
Matthias Clasen
5c886d0b6c Documentation additions.
* gtk/gtkoldeditable.c, gtk/gtkrc.c,
        gtk/gtkstyle.c: Documentation additions.

        * gtk/gtkmenu.c (gtk_menu_set_accel_path),
        gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path),
        gtk/gtkwidget.c (gtk_widget_add_accelerator): Typo and markup fixes.

        * gtk/gtkitemfactory.c (gtk_item_factory_add_foreign): Document.

        * gtk/gtkaccelmap.c (gtk_accel_map_add_filter): Explain intended use.

        * gtk/running.sgml: Add ids to some elements to make them
        addressable as link targets.
2002-01-14 23:24:02 +00:00
Owen Taylor
095d7c33d7 Call gdk_window_get_pointer() on menu->bin_window not menu->window, so we
Thu Dec 27 15:38:20 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_stop_navigating_submenu_cb):
        Call gdk_window_get_pointer() on menu->bin_window not
        menu->window, so we get the correct window for the
        menu item. (#65213, Guillermo S. Romero)
2001-12-27 20:43:58 +00:00
Owen Taylor
aae695ab65 Allow unsetting the title by setting to NULL. Move docs inline. Update the
Thu Dec 27 15:13:44 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_set_title): Allow unsetting
	the title by setting to NULL. Move docs inline.
	Update the title if the tearoff window already
	exists. Code cleanup. (Fixes #65190, reported by
	Vitaly Tishkov.)
2001-12-27 20:22:16 +00:00
Owen Taylor
af7ab9c630 Remove support for "prepainting" the menu before realizing other than via
Wed Dec 12 16:18:26 2001  Owen Taylor  <otaylor@redhat.com>
        * gtk/gtkmenu.c (gtk_menu_realize): Remove support for
        "prepainting" the menu before realizing other than
        via gtk_style_set_background() - this was broken when
        we added menu scroll support.
        * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
        window in the expose event -- fixes problem with border
        flashing during scrolling.
2001-12-12 21:30:08 +00:00
James Henstridge
44b9c2d13f check GTK_MENU_ITEM (menu_item)->accel_path first when looking up the
2001-12-12  James Henstridge  <james@daa.com.au>

	* gtk/gtkmenu.c (gtk_menu_key_press): check GTK_MENU_ITEM
	(menu_item)->accel_path first when looking up the accel path.
2001-12-12 12:21:52 +00:00
Kristian Rietveld
209d0867e6 add checks for empty menu items to behave like insensitive items (#59456)
Thu Nov 29 21:35:56 2001  Kristian Rietveld  <kristian@planet.nl>

        * gtk/gtkmenu.c (gtk_menu_motion_notify): add checks for
        empty menu items to behave like insensitive items (#59456)

        * gtk/gtkmenuitem.c (gtk_real_menu_item_activate_item): select
        next item if the first item in the menu is a tear off item
        (#59456-2, suggestion by Matthias Clasen)

        * gtk/gtkmenushell.c (gtk_menu_shell_button_press),
        (gtk_menu_shell_button_release), (gtk_menu_shell_entry_notify),
        (gtk_menu_shell_leave_notify), (gtk_real_menu_shell_move_current),
        (gtk_real_menu_shell_activate_current): add check, so empty
        menu items behave like insensitive items (#59456)

        * gtk/gtkmenuitem.[ch]: add _gtk_menu_item_is_selectable to make
        the checks more readable ...

        * gtk/gtkmenushell.c (gtk_menu_shell_button_press),
        (gtk_menu_shell_button_release): causes the menu to dropdown if the
        caption is clicked again (#64977)
2001-11-29 20:36:12 +00:00
Owen Taylor
476d2a84b7 Move accounting of menu->tearoff_scrollbar width to here and make sure we
Wed Nov 28 18:19:12 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_set_tearoff_hints): Move
        accounting of menu->tearoff_scrollbar width to here
        and make sure we have the correct requisition.

        * gtk/gtkmenu.c (gtk_menu_position): Fix fixme
        by using gtk_window_move().

        * gtk/gtkmenu.c (gtk_menu_set_tearoff_state): Force
        the requisition to be updated by calling
        gtk_widget_size_request() (#65440)

        * gtk/gtktearoffmenuitem.c (gtk_tearoff_menu_item_activate):
        queue resize before calling gtk_menu_set_tearoff_state().
2001-11-28 23:26:17 +00:00
Tim Janik
9800f731e0 applied patch from owen to get rid of accel map notifiers. changed things
Tue Nov 20 21:25:08 2001  Tim Janik  <timj@gtk.org>

	* applied patch from owen to get rid of accel map notifiers.
	changed things to fix reentrancy and API as discussed on gtk-devel.

	* gtk/gtkaccelgroup.[hc]:
	(gtk_accel_group_finalize): unregister this accel group from all
	accel map paths.
	(accel_closure_invalidate): handle invalidation of closures by
	disconnecting their accelerators.
	(quick_accel_add): move closure connection and changed notification
	into this function to reduce code duplication. don't emit change
	notification on closurers without accelerators.
	(quick_accel_remove): rewrite, do the exact opposite of quick_accel_add
	for a GtkAccelGroupEntry.
	(gtk_accel_group_connect): get rid of the accel_path_quark argument.
	(gtk_accel_group_connect_by_path): new function to add accelerators
	with an accel path.
	(gtk_accel_group_disconnect_closure): new function, disconnect a
	closure from of an accel group.
	(gtk_accel_group_disconnect): loop over all closure for a accel_ley,
	accel_mods pair and remove them.
	(_gtk_accel_group_reconnect): new function that basically does
	gtk_accel_group_disconnect_closure() and
	gtk_accel_group_connect_by_path() once an accel path changed.
	(gtk_accel_groups_disconnect_closure): remove this, there's
	gtk_accel_group_disconnect_closure().

	* gtk/gtkaccelmap.[hc]: keep list of accel groups per entry now,
	nuke notifiers.
	(_gtk_accel_path_is_valid): make this non-static for
	gtkwidget.c and gtkaccelgroup.c assertions.
	(gtk_accel_map_add_notifer): removed this function.
	(gtk_accel_map_remove_notifer): same.
	(_gtk_accel_map_add_group):
	(_gtk_accel_map_remove_group): (un-)register accel groups, with
	accel paths for correct propagation.
	(gtk_accel_map_add_entry): return void.
	(gtk_accel_map_lookup): return gboolean instead of GQuark.

	* gtk/gtkitemfactory.c (gtk_item_factory_add_foreign): always
	set accel_path on widgets.

	* gtk/gtkwidget.[hc]:
	(accel_path_changed): got rid of this, changes are handled by
	accel maps internally now.
	(_gtk_widget_set_accel_path): get things to work without notifiers.
	(gtk_widget_list_accel_closures): list accel closures of a widget.

	* gtk/gtkwindow.[hc]: rename ::accels_changed, to ::keys_changed.
2001-11-20 23:43:03 +00:00
Tim Janik
d07573c090 added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001  Tim Janik  <timj@gtk.org>

        * added gtkaccelmap.sgml. other updates.

Mon Nov 12 23:08:37 2001  Tim Janik  <timj@gtk.org>

	* gtk/maketypes.awk: fix type utils generation on unix.

	* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
	registry.

	* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
	removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
	gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
	gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
	gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
	introduced ::accel_changed signal for change notification, and
	gtk_accel_group_connect/disconnect to connect closures to accel groups.
	made gtk_accel_group_attach/detach and gtk_accel_group_activate private
	functions.
	deprecated gtk_accel_group_ref/unref.

	* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
	to accel group changed notification and basically operate on closures.
	removed gtk_accel_label_get_accel_object and
	gtk_accel_label_set_accel_object.
	introduced gtk_accel_label_set_accel_closure, and for convenience,
	gtk_accel_label_set_accel_widget.

	* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
	which mostly moved into gtkaccelmap.[hc].
	removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
	and gtk_item_factory_print_func.

	* gtk/gtkmain.c: call _gtk_accel_map_init().

	* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
	that associates an accelerator path with menu items, through which
	persistent accelerator settings on menu items are enabled.

	* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
	paths of menu item can be default constructed to allow installation
	of accelerators on menu items that don't come with an accelerator
	binding by default.

	* gtk/gtksettings.c: fix STRING type rc settings by special casing
	them appropriately in the parser.

	* gtk/gtksignal.[hc]: allow a class function offset of 0 for
	gtk_signal_newv().

	* gtk/gtkwidget.[hc]: accelerator API revamp.
	removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
	gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
	gtk_widget_(un)lock_accelerators.
	accelerators maintained through gtk_widget_add/remove_accelerator()
	are not runtime changable now, the correct sequence to setup a
	widget for runtime changable accelerators is now:
	  gtk_accel_map_add_entry(accel_path, key, mods);
	  _gtk_widget_set_accel_path(widget, accel_path, accel_group);

	* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
	group changes (as well as mnemonic changes) through the new signal
	::accels_changed.

Sat Nov 10 12:08:56 2001  Tim Janik  <timj@gtk.org>

	* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
	GString->string conversions.
2001-11-13 00:53:47 +00:00
Hans Breuer
e2e6940366 to simplify parsing for exported functions: - made implementation
2001-10-27  Hans Breuer  <hans@breuer.org>

	* gtk/gtkbbox.c gtk/gtkctree.c gtk/gtkhbbox.c
	  gtk/gtkimmulticontext.c gtk/gtklabel.c gtk/gtkliststore.c
	  gtk/gtkmenu.c gtk/gtkpaned.c gtk/gtkrc.c gtk/gtkscale.c
	  gtk/gtkstyle.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
	  gtk/gtktexttag.c gtk/gtktexttagtable.c gtk/gtktextview.c
	  gtk/gtktreestore.c gtk/gtkvbbox.c :
	to simplify parsing for exported functions:
	- made implementation signature static, when the local
	  prototype already was
	- put the functions return value on it's own line
	- added as space between the function name and the
	  opening bracket

	* gtk/gtk.def : added the remaining exported functions
2001-10-27 00:41:12 +00:00
Kristian Rietveld
be317eb291 weight value should be an int
Sat Sep 22 16:50:34 2001  Kristian Rietveld  <kristian@planet.nl>

        * gtk/gtktexttag.c (gtk_text_tag_set_property): (case PROP_WEIGHT):
        weight value should be an int

Sat Sep 22 15:17:41 2001  Kristian Rietveld  <kristian@planet.nl>

        * gtk/gtkmenu.c (gtk_menu_select_item): move most code
        to gtk_menu_scroll_item_visible(). Only call
        gtk_menu_scroll_item_visible() if the menu widget has been
        realized. Fixes bug #55310.
2001-09-22 14:55:02 +00:00
Owen Taylor
8de6598f6a Break compatibility and make gtk_image_new() take no arguments. The
Fri Aug 24 23:09:05 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility
	and make gtk_image_new() take no arguments. The compiler will
	catch it, and it is vastly more useful than having
	gtk_image_new() be a deprecated alias for gtk_image_new_from_image().

	* gtk/gtkmenu.c (gtk_menu_set_property): Apply patch
	to add tearoff-title property (#51319, Lee Mallabone)
2001-08-25 03:15:26 +00:00
Owen Taylor
f0f3c6bfd2 Deprecate gtk_menu_bar_append/prepend/insert, forgot to do this when we
Thu Aug 23 19:10:01 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenubar.h (gtk_menu_bar_insert): Deprecate
	gtk_menu_bar_append/prepend/insert, forgot to do this
        when we deprecated gtk_menu_append/prepend/insert.

        * gtk/gtkmenu.h (gtk_menu_insert): Add casts to deprecated
        compat macros.

	       * gtk/gtkmenu.c: Fix problem with static gtk_menu_insert() being
	renamed by compat macro.

	* gtk/gtkfontsel.h: Deprecated gtk_font_selection_get_font(),
        gtk_font_selection_dialog_get_font(). (Suggested by
	       Vitaly Tishkov, #59383)
2001-08-23 23:30:43 +00:00
James Henstridge
e70939234c commiting patch after comments from Alex on IRC
2001-07-15  James Henstridge  <james@daa.com.au>

	* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
	(gtk_window_remove_accel_group): same here.
	(gtk_window_key_press_event): same here.

	* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
	(gtk_widget_remove_accelerator): same here.
	(gtk_widget_remove_accelerators): same here.

	* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.

	* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
	instead of GtkObject.

	* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
	now takes GObjects.

	* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
	pass a GObject to gtk_accel_group_entries_from_object.
	(gtk_item_factory_create_item): s/accel_widget/accel_object/

	* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.

	* gtk/gtkaccellabel.c: convert to handle GObject accel objects.

	* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
	GObjects can have accelerators set now.  Add compatibility
	defines.

	* gtk/gtkmarshal.list: add missing marshallers.

	* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
	accelerators on plain GObjects.  gtk_accel_group_object_destroy
	has been converted into a weak reference, and
	gtk_accel_group_delete_entries is now a destroy notify for that
	piece of data.
2001-07-25 13:36:02 +00:00
Owen Taylor
aa49527fa7 Enforce the widget/child realization/mapping invariants.
Sat Jul  7 02:50:14 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
	the widget/child realization/mapping invariants.

	* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
	gtk_widget_[get/set]_child_visible() to control
	whether visible children of a mapped window are
	mapped.

	* docs/widget_system.txt: Updated for changes in
	container contract, and addition of GTK_CHILD_VISIBLE.

	* gtk/gtkcontainer.c: Add generic map()/unmap()
	functions that work for almost all containers.

	* gtk/gtknotebook.c gtk/gtkpacker.c: Use
	gtk_widget_set_child_visible() where necessary.

	* gtk/*.c: Remove excess map(), unmap(), and
	realization/mapping invariant enforcing code
	from many containers.
2001-07-19 14:57:15 +00:00
Owen Taylor
4e2b60ac4d Patch from Matthias Clasen to remove remove all instances of
Wed Jul 18 19:28:46 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/*.c: Patch from Matthias Clasen to remove remove
	all instances of g_return_if_fail (foo != NULL); that are
	immediately before a g_return_if_fail (GTK_IS_FOO (foo));
	since the second check catches the NULL anyways.
2001-07-18 23:39:26 +00:00
Owen Taylor
b613a74cb2 Fix idles and timeouts to be properly surrounded by
Wed Jul 18 18:23:05 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkbutton.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtktextview.c
	gtktreeview.c: Fix idles and timeouts to be properly surrounded by
	GDK_THREADS_ENTER()/LEAVE() pairs.

	* gtk/gtkdialog.c gtk/gtkclipboard.c: Surround calls
	to g_main_loop_run() with GDK_THREADS_LEAVE()/ENTER()
	pairs. (Problem found by M. Meeks)
2001-07-18 22:43:41 +00:00
Owen Taylor
79d45ab85d Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
Thu Jul 12 13:43:27 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c
	  gtk/gtkctree.c gtk/gtkcurve.c gtk/gtkentry.c
	  gtk/gtkfontsel.c gtk/gtkhandlebox.c
	  gtk/gtkimcontextsimple.c gtk/gtkmain.c gtk/gtkmenu.c
	  gtk/gtkmenuitem.c gtk/gtkoptionmenu.c gtk/gtkpixmap.c
	  gtk/gtkselection.c gtk/gtktextdisplay.c gtk/gtktextview.c
	  gtk/gtktooltips.c gtk/gtkwidget.c gtk/gtkwindow.c:
	Formatting fixes from multihead brnach. [ mostly foo(bar) => foo (bar) ]
2001-07-12 17:50:14 +00:00
Owen Taylor
fbfc305174 Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
	for style to mean "revert to default style"

	* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
	  gtk_widget_restore_default_style): Make this functions
	deprecated aliases for gtk_widget_set_style (widget, NULL).

	* gtk/gtkwidget.[ch]: Remove:
	   gtk_widget_set_default_style ()
	   gtk_widget_push_style ()
	   gtk_widget_pop_style ()
	These functions interact are overriden by RC files, and
	thus virtually useless, and complicated.

Fri Jun 22 18:49:48 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkrc.c: Add a GtkRcContext structure to hold
	most of the previous global variables in gtkrc.c. This is
	in preparation for multi-head, since each screen can
	have different GtkSettings and RC information.

	* gtk/gtkrc.[ch]:

	* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
	GtkSettings parameter to GtkRcStyle::parse.

	* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
	Add two new settings gtk-theme-name, gtk-key-theme-name,
	for RC files that are loaded by name after reading
	the default RC files.

	* gtk/gtkrc.c: Allow priorities for styles, as wll as
	bindings.

	* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
	and use it by default for RC files loaded via
	gtk-theme-name, gtk-key-theme-name.

	* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
        gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
	tests/testgtkrc: Require pathnames to be absolute.

	* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
	the source when parsing, since the operation of looking up a
	pixmap from an RC file depends on the parsing context.

	* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
	reset RC styles on all widgets when files are reparsed.

	* tests/testgtk.c (create_rc_file)
	  gtk/gtkwindow.c (gtk_window_read_rcfiles):
	Simplify, now that gtk_rc_reparse_all() resets styles on
	all widgets itself.

	* gtk/gtkmain.c (gtk_get_default_language): Fix broken
	return value.

	* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
	GtkSettings argument.

	* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
	gtk_settings_get_global().

	* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
	to get the appropriate GtkSettings for a widget. (For now,
	just gets the default GtkSetttings.)

	* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
	  gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
        changes.

	* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
	getting a style for a path without actually having a widget.
	(Allows using a style for a subpart of a widget, for
	example.)

	* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
	the RC files to be reloaded for just one GtkSettings
	(not sure how useful this really is.)

	* gtk/gtkrc.h: Deprecate
	gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
Havoc Pennington
0bee26c7ba Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28  Havoc Pennington  <hp@pobox.com>

	* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
	image data to the screen, using a server grab to avoid race
	conditions.

	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
	check for NULL return from gtk_image_new_from_stock(), it never
	returns NULL.
	(gtk_item_factory_create_item): fix bug where we parsed the stock
	ID as an inline pixbuf

	* gtk/gtktext.c (gtk_text_key_press): numeric keypad support

	* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
	support

	* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support

	* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad

	* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad

	* gtk/gtkimcontextsimple.c
	(gtk_im_context_simple_filter_keypress): keypad

	* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad

	* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes

	* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support

	* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
	should be binding-setted)

	* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes

	* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes

	* gtk/gtkcalendar.c: numeric keypad fixes

	* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
	support

	* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
	screwup

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	clip the render area to the drawable's clip region in advance,
	so we don't get data from the server that we don't need.

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	check return value of gdk_pixbuf_get_from_drawable(), fall back
	to bilevel alpha if we can't get the pixbuf to composite against.

	* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap

	* gdk/gdkimage.c (gdk_image_get_colormap): add
	gdk_image_set_colormap, gdk_image_get_colormap

	* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
	take a region of the image, instead of converting the entire
	image.

	* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
	keybinding signal. Add default bindings for it. Add default
	handler for show_help that shows the tooltip for the widget.

	* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
	"close" keybinding signal, remove key press handler.

	* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
	it's not our usual practice to leave a deprecated function around
	with a runtime warning, plus we don't want it to appear in docs,
	plus if we make them yellow no one will want to change them
	anyhow.
2001-06-29 01:59:02 +00:00
Owen Taylor
cc223eeff6 Fix stupid error introduced last night that was making things decidedly
Sun Jun 24 11:29:35 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
	introduced last night that was making things decidedly not work.

	* gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
	so that we have getter/setter pairing everywhere it makes
	sense. (#55767)

	* gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
	Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
	deprecated compat macro. (#55516)

	* gtk/gtklabel.[ch]: Add functions
	gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
	gtk_label_set_label(), which mirror the property API for GtkLabel.
	Make gtk_label_get_attributes() only reflect the attributes
	set by gtk_label_set_attributes.

	* gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
	from gtk_notebook_set_page().
2001-06-24 15:34:48 +00:00
Havoc Pennington
7e9b154f0c fix warning
2001-04-27  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning

	* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable

	* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
	line/para separators
	(gtk_entry_create_layout): set single paragraph mode on the layout

	* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
	spacing between the image and label; instead, inside a button box
	the button will get extra space that will go there, but if people
	configure button box for 0 chubbiness, then there's no spacing.

	* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
	and min/max size style properties, so people can tune their
	chubbiness.

	* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
	functions

	* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
	space_style, and button_relief into style properties, remove
	functions for setting them

	* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
	it back down

	* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
	types from gtk_widget_style_get

	* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
	with a style property.

	* gdk/x11/gdkevents-x11.c: namespace the settings

	* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.

	* gtk/gtksettings.c (gtk_settings_class_init): remove code with
	side effects from inside g_assert(), so that G_DISABLE_ASSERT can
	be used. Also, translate doc strings for settings. Also, namespace
	the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
Owen Taylor
1586ade9c5 Add missing NULL on valist.
Wed Mar 28 19:20:43 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/testtext.c (create_buffer): Add missing NULL on
	valist.

	* gtk/gtkcheckmenuitem.c (gtk_check_menu_item_class_init): Fix
	c-n-p problem with INCONSISTENT property.

        [ Patch from Havoc Pennington  <hp@redhat.com> ]

	* gtk/gtkentry.h (struct _GtkEntryClass): add same populate_popup
	hook.

	* gtk/gtktextview.h (struct _GtkTextViewClass): add populate_popup
	signal as a hook for extending the default popup menu

	* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):
	use radio menu items for the input method menuitems

	* gtk/gtkimcontextsimple.c (check_hex): do better validation of
	inserted unicode from Ctrl-Shift-hex input method

	* gtk/gtktextbtree.c (_gtk_text_btree_insert): remove utf8
	validatation here, already done at GtkTextBuffer level.

	* gtk/gtkwidget.c (gtk_widget_class_init): add binding set, add
	popup_menu run action signal and Shift+F10 and Menu keybindings.

	* gtk/gtkentry.c: implement a default handler for popup_menu

	* gtk/gtktextview.c: implement a default handler for popup_menu

	* gtk/gtkmenu.c (gtk_menu_popup): select first item if popup is
	from a key event

	* gtk/gtklabel.c: remove "trailer" cruft
2001-03-29 00:24:58 +00:00
Alexander Larsson
de5eafede2 Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and removed
2001-03-21  Alexander Larsson  <alexl@redhat.com>

        * gtk/gtkbutton.[ch]:
	* gtk/gtkdialog.c:
	Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
	removed accel_group argument. Renamed gtk_button_new_accel() to
	gtk_button_new_with_mnemonic() and removed accel_group argument.

	* gtk/gtkcheckbutton.[ch]:
	New function gtk_check_button_new_with_mnemonic().

	* gtk/gtkentry.c:
	Override activate_mnemonic and just grab focus.

	* gtk/gtkitemfactory.c:
	Don't add menu uline accel group, instead use mnemonics support.

	* gtk/gtklabel.[ch]:
	New support for mnemonics.

	* gtk/gtkmarshal.list:
	Needed BOOLEAN:BOOLEAN for activate_mnemonic.

	* gtk/gtkmenu.[c]:
	* gtkmenushell.c:
	Use mnemonics instead of accel groups for uline
	support in menu items.
	Removed gtk_menu_get_uline_accel_group() and
	gtk_menu_ensure_uline_accel_group().

	* gtk/gtkmenuitem.c:
	Override activate_mnemonic to handle switching between
	menu items if there are collisions.

	* gtk/gtknotebook.c:
	Connect to activate_mnemonic on the tab_label, so that
	activating it switches to that notebook page.

	* gtk/gtkwidget.[ch]:
	Add activate_mnemonic signal. New function
	gtk_widget_activate_mnemonic() to emit it.
	Default implementation does activate/grab_focus.

	* gtk/gtkwindow.[ch]:
	Add support for mnemonics in windows.
	New functions:
	gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
	gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier

	* gtk/testgtk.c:
	Update to function name changes.
2001-03-21 18:58:28 +00:00
Alexander Larsson
e7d4a7f90d Document expose event->region change and that gtk_widget_event doesn't
2001-03-09  Alexander Larsson  <alexl@redhat.com>

	* docs/Changes-2.0.txt:
	Document expose event->region change and that gtk_widget_event
	doesn't allow passing expose events.

	* gdk/gdkevents.h:
	Add region to expose event.

	* gdk/gdkevents.c:
	Handle event->region in gdk_event_copy() and gdk_event_free().

	* gdk/gdkwindow.c (gdk_window_process_updates_internal):
	Generate expose_event->region when creating expose events.

	* gdk/x11/gdkevents-x11.c:
	Generate expose events with regions when translating X events.

	* gtk/gtkcontainer.[ch]:
	Default expose handler that propagates expose events to NO_WINDOW
	children. New function gtk_container_propagate_expose()

	* gtk/gtkwidget.[ch]:
	Moved gtk_widget_event implementation to gtk_widget_event_internal.
	gtk_widget_event calls gtk_widget_event_internal but doesn't allow
	expose events. New function gtk_widget_send_expose() to send expose
	events. New function gtk_widget_region_intersect() to calculate
	window/region intersections.

	* gtk/gtkmain.c (gtk_main_do_event):
	Use gdk_window_begin_paint_region() instead of gdk_window_begin_paint_rect().
	Use gtk_widget_send_expose() to send expose events.

	* gtk/gtkbin.c:
	* gtk/gtkbox.c:
	* gtk/gtkfixed.c:
	* gtk/gtkimagemenuitem.c:
	* gtk/gtklist.c:
	* gtk/gtkpacker.c:
	* gtk/gtktable.c:
	* gtk/gtktree.c:
	Remove expose handler, using the default container implementation
	instead.

	* gtk/gtkbutton.c:
	* gtk/gtkcheckbutton.c:
	* gtk/gtkeventbox.c:
	* gtk/gtkfixed.c:
	* gtk/gtkhandlebox.c:
	* gtk/gtklayout.c:
	* gtk/gtklistitem.c:
	* gtk/gtkmenu.c:
	* gtk/gtkmenubar.c:
	* gtk/gtkmenuitem.c:
	* gtk/gtknotebook.c:
	* gtk/gtkoptionmenu.c:
	* gtk/gtkpaned.c:
	* gtk/gtkscrolledwindow.c:
	* gtk/gtktogglebutton.c:
	* gtk/gtktoolbar.c:
	* gtk/gtktreeitem.c:
	* gtk/gtkviewport.c:
	Chain expose handler to parent class handler. Use
	gtk_container_propagate_expose() to propagate exposes.

	* gtk/gtkclist.c (check_exposures):
	* gtk/gtktext.c (process_exposes):
	Use gtk_widget_send_expose instead of gtk_widget_event.
2001-03-09 13:28:26 +00:00
Tim Janik
35af5c4eba marshaller fixes.
Wed Mar  7 13:24:57 2001  Tim Janik  <timj@gtk.org>

        * gtk/*.c: marshaller fixes.

        * gtk/gtkmarshal.list: extreme cleanup.

        * gtk/gtktreeview.c (gtk_tree_view_class_init): disable interface
        param spec for now.

        * gtk/gtktexttag.c (gtk_text_tag_set_property): use g_value_get_boxed()
        where appliable.

        * gtk/gtktypeutils.[hc]: updates to GLib API changes.
        special cased autogenerated boxed types from gtktypebuiltins_ids.c
        which are not reference counted:
        GtkSelectionData, GdkEvent, GdkColor, GtkTextIter, PangoTabArray,
        PangoFontDescription, GtkTreeIter and GtkTreePath.

Thu Mar  1 03:58:56 2001  Tim Janik  <timj@gtk.org>

        * gtk/gtktreeselection.h:
        * gtk/gtktreemodel.c:
        * gtk/gtktreedatalist.[hc]: fixed includes. no gobject/*
        file should be included directly, and gobject/gmarshal.h
        as well as gtk/gtkmarshal.h even can't be included directly.

        * Makefile.am: grr, install gtk-config-2.0.

        * gtk/testgtk.c:
        * gtk/simple.c:
        * gtk/gtkmenu.c:
        * gtk/gtkitemfactory.c: use g_object_connect() instead of
        passing "*signal*::*" args to gtk_widget_set().

        * gtk/gtktypeutils.[hc]: got rid of GTK_TYPE_SIGNAL.

        * gtk/*.c: removed trailer arg from property setters and getters.
        macro fixups.

Thu Mar  1 04:01:57 2001  Tim Janik  <timj@gtk.org>

        * test-gdk-pixbuf.c: fixed includes.
2001-03-07 14:49:21 +00:00
Alexander Larsson
e8a62bd877 Set GDK_WINDOW_TYPE_HINT_MENU on tearoff window.
2001-03-05  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
	Set GDK_WINDOW_TYPE_HINT_MENU on tearoff window.
2001-03-05 17:07:19 +00:00