Commit Graph

72 Commits

Author SHA1 Message Date
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Michael Natterer
3a0afce509 gtk: remove "gboolean homogeneous" from gtk_box_new()
Because it's FALSE in virtually all use cases.
2010-10-31 19:22:28 +01:00
Javier Jardón
a9894d4cf4 Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 05:22:58 +02:00
Javier Jardón
ccaf842919 docs: Move documentation to inline comments: GtkTooltip 2010-10-03 00:59:39 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
c54968e964 tooltip: Connect to draw signal 2010-09-26 15:11:40 +02:00
Benjamin Otte
2ee8fdb79b gtk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
9f47be2216 gtk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual 2010-09-26 15:11:33 +02:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Javier Jardón
3f101bb08c gtk/gtktooltip.c: use accessor functions to access GtkWidget 2010-08-22 21:25:22 +02:00
Matthias Clasen
dcdb00adb4 Avoid warnings with tooltips on toplevels
This was reported for tooltips on statusicons in bug 625235, but
it was affecting regular toplevel windows as well.
2010-08-05 00:12:41 -04:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Michael Natterer
6b4e19a132 Bug 607628 - DnD operation doesn't work when using offscreen
Turn find_widget_under_pointer() into internal API
_gtk_widget_find_at_coords() which is needed for fixing above
bug. This should actually be a public utility function, and will be
moved to another file when its final API has been decided.
(cherry picked from commit c4b1bbf3e2)
2010-05-26 17:21:09 +02:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Matthias Clasen
51ddf0e1c9 Better tooltip positioning
Avoid the covering up the widget that you are tipping, as
far as possible. Bug 599618.
2010-05-07 23:28:07 -04:00
Michael Natterer
ece97b2359 Bug 615162 - Fix tooltips on offscreen widgets
Fix the "widget under pointer" logic and keyboard tooltip positioning
to do the right thing on offscreen widgets.
2010-04-15 13:03:43 +02:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Javier Jardón
4f78f70b15 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 04:55:55 +01:00
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00
Christian Dywan
bb1824c131 Deprecate flag macros for toplevel, state, no window and composite child
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.

Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.

Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.

Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.

Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.

Gail and tests are updated as well.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-01-04 07:57:05 +01:00
Dan Winship
0b4af241b6 Change GtkIconSize to int in params/return values
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.

https://bugzilla.gnome.org/show_bug.cgi?id=604895
2009-12-19 10:32:35 +01:00
Matthias Clasen
097b254e4b Documentation and stylistic fixups 2009-11-01 16:12:43 -05:00
Marek Kasik
cf8c4a6a80 A small correction of previous commit
Correct of a typo.
2009-10-19 11:44:09 +02:00
Matthias Clasen
52ef2f2a3e Correct a small oversight
When changing themes, we also need to update the box spacing of
tooltips.
2009-10-18 20:38:28 -04:00
Bastien Nocera
df53e6ad8b Add ability to set a tooltip's image from a GIcon
Makes it easier to implement fallbacks whilst following
theme changes.

https://bugzilla.gnome.org/show_bug.cgi?id=598261
2009-10-14 13:22:14 +01:00
Xan Lopez
f0f39c34f8 Update last_window only when needed
_gtk_tooltip_handle_event, which is called for many events in the GTK+
main loop, calls gtk_tooltip_set_last_window, which keeps a weak
reference to the last window we passed through. If the window being
set is the same than the last one there's really no need to update our
weak reference, so add a check for that and exit early.
2009-09-29 23:45:03 -04:00
Paolo Borelli
f97a33ad9c Move timer removal in dispose
Move removal of timer function in dispose to prevent potentially running
them on a diposed-but-not-finalized tooltip
2009-09-01 15:50:42 +02:00
Kristian Rietveld
f84df976a7 Bug 478519 - GtkTooltip segfaults on NULL gdk-display-current-tooltip
Make the tooltip code a bit more robust for a case that only occurs when
GTK+ is used from a language binding.  It looks like this case appears
because the memory management / ref counting is handled differently in
some of the language bindings.  Instead of asserting, we will fail
silently.  Also fix a think-o in gtk_tooltip_start_delay().  Patch from
O. Andrieu.
2009-08-22 23:21:44 +02:00
Lin Ma
d0f887ddb1 Fix GtkTooltip destroy the custom widget
Fixed 576091, Custom_widget does not get destroyed when the tooltip
goes away. Add a release note for this fix.
2009-05-25 10:01:04 +08:00
Matthias Clasen
4995ea0fcb Set the root coordinates in the event correctly. Patch by Kristian
* gtk/gtktooltip.c (gtk_tooltip_trigger_query): Set the root
        coordinates in the event correctly. Patch by Kristian Rietveld.


svn path=/trunk/; revision=22277
2009-02-04 01:16:35 +00:00
Matthias Clasen
f72dd13a36 Avoid uninitialized memory warnings
svn path=/trunk/; revision=21603
2008-10-07 18:06:00 +00:00
Sven Neumann
2a95978506 gtk/gtkaboutdialog.c gtk/gtkcellrendereraccel.c gtk/gtkcellrenderercombo.c
2008-08-11  Sven Neumann  <sven@gimp.org>

	* gtk/gtkaboutdialog.c
	* gtk/gtkcellrendereraccel.c
	* gtk/gtkcellrenderercombo.c
	* gtk/gtkcellrendererspin.c
	* gtk/gtkcellrenderertext.c
	* gtk/gtkclipboard.c
	* gtk/gtkcolorsel.c
	* gtk/gtkcombo.c
	* gtk/gtkcombobox.c
	* gtk/gtkdnd-quartz.c
	* gtk/gtkdnd.c
	* gtk/gtkentry.c
	* gtk/gtkentrycompletion.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilechooserentry.c
	* gtk/gtkfontsel.c
	* gtk/gtkinputdialog.c
	* gtk/gtkmenutoolbutton.c
	* gtk/gtkpathbar.c
	* gtk/gtktooltip.c: use canonical signal names in 
g_signal_connect().


svn path=/trunk/; revision=21060
2008-08-11 09:17:49 +00:00
Kristian Rietveld
4cceb2f1dc Bug 455268 - Add gtk-enable-tooltips GtkSetting
2008-07-02  Kristian Rietveld  <kris@imendio.com>

	Bug 455268 - Add gtk-enable-tooltips GtkSetting

	* gtk/gtk.symbols:
	* gtk/gtktoolbar.[ch] (gtk_toolbar_[gs]et_tooltips): deprecated.

	* gtk/gtksettings.c: introduce gtk-enable-tooltips XSetting.

	* gtk/gtktooltip.c (_gtk_tooltip_handle_event): take the newly
	introduced XSetting into account.

	* demos/gtk-demo/appwindow.c: don't use the now deprecated
	gtk_toolbar_set_tooltips().


svn path=/trunk/; revision=20730
2008-07-02 09:32:14 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Kristian Rietveld
382ce2f138 Bug 504087 - make gtk_tooltip_set_custom a no-op for setting the current
2008-05-28  Kristian Rietveld  <kris@imendio.com>

	Bug 504087 - make gtk_tooltip_set_custom a no-op for setting the
	current widget again.

	* gtk/gtktooltip.c (gtk_tooltip_set_custom),
	(gtk_tooltip_reset), (gtk_tooltip_run_requery): use a
	custom_was_reset field to check if the custom widget is set again in
	the query-tooltip callback; if not, we set it to NULL.  Based on a
	patch by Xavier Claessens, insightful comments from Jean-Yves Lefort
	and Christian Persch.


svn path=/trunk/; revision=20215
2008-05-28 14:00:31 +00:00
Matthias Clasen
45e33fe9c2 Go back to 2.13.0 as version for now, as there was no consensus to do the
2008-02-15  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Go back to 2.13.0 as version for now,
        as there was no consensus to do the jump.

        * many other places: Update Since: tags.



svn path=/trunk/; revision=19586
2008-02-15 23:42:42 +00:00
Michael Natterer
a362eecc4a gtk/gtkbutton.h gtk/gtkcellrenderer.h gtk/gtkimcontext.h gtk/gtkstyle.h
2008-01-25  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkbutton.h
	* gtk/gtkcellrenderer.h
	* gtk/gtkimcontext.h
	* gtk/gtkstyle.h
	* gtk/gtktoolbar.h
	* gtk/gtktooltip.h
	* gtk/gtktreeprivate.h
	* gtk/gtktreeviewcolumn.h
	* gtk/gtkwidget.h: add const to constant structs which are passed
	into GTK+. Also add some forgotten const for const strings.

	* gtk/gtkbutton.c
	* gtk/gtkcellrenderer.c
	* gtk/gtkimcontext.c
	* gtk/gtkstyle.c
	* gtk/gtktoolbar.c
	* gtk/gtktooltip.c
	* gtk/gtktreeview.c
	* gtk/gtktreeviewcolumn.c
	* gtk/gtkwidget.c: changed accordingly.


svn path=/trunk/; revision=19399
2008-01-25 09:30:40 +00:00
Kristian Rietveld
239fd8ace2 use a weak pointer to set last_window to NULL as soon as it's destroyed.
2007-12-17  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktooltip.c (gtk_tooltip_finalize),
	(gtk_tooltip_set_last_window): use a weak pointer to set last_window
	to NULL as soon as it's destroyed.  (#496546, patch from
	Benjamin Berg).


svn path=/trunk/; revision=19189
2007-12-17 15:33:45 +00:00
Matthias Clasen
da057b5675 Close an api gap in tooltips
svn path=/trunk/; revision=19175
2007-12-14 05:00:51 +00:00
Kristian Rietveld
aed59b3ea9 Fix #482841, patch by Karl Tomlinson.
2007-10-08  Kristian Rietveld  <kris@imendio.com>

	Fix #482841, patch by Karl Tomlinson.

	* gtk/gtktooltip.c (gtk_tooltip_display_closed): use g_object_set_data
	instead of g_object_set ...
	(_gtk_tooltip_toggle_keyboard_mode),
	(_gtk_tooltip_handle_event): connect to GdkDisplay::closed after
	creating tooltip.


svn path=/trunk/; revision=18890
2007-10-08 12:39:02 +00:00
Kristian Rietveld
7adde1e4fd update alignment padding after theme changes. (Fixes #467003, patch by
2007-08-21  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktooltip.c (gtk_tooltip_init),
	(gtk_tooltip_window_style_set): update alignment padding after
	theme changes. (Fixes #467003, patch by Benjamin Berg).


svn path=/trunk/; revision=18667
2007-08-21 13:13:42 +00:00
Kristian Rietveld
ef1da5f6c2 always set hide_tooltip to TRUE if we are handling a leave notify event.
2007-08-21  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktooltip.c (_gtk_tooltip_handle_event): always set
	hide_tooltip to TRUE if we are handling a leave notify event. (Fixes
	#468245, reported by Dennis Jacobfeuerborn).


svn path=/trunk/; revision=18666
2007-08-21 11:09:42 +00:00
Kristian Rietveld
f6235caef9 Fix #457642, reported by Christian Persch.
2007-08-21  Kristian Rietveld  <kris@imendio.com>

	Fix #457642, reported by Christian Persch.

	* gtk/gtktooltip.c: added debugging output which can be compiled
	in with a #define, annotated all coordinate translations in the
	source code,
	(find_widget_under_pointer): remove the "no-window correction";
	always convert the coordinates from window relative to allocation
	relative; after recursing through a container, translate the
	coordinates from container allocation relative to child widget
	allocation relative;
	(find_topmost_widget_from_event): now we get allocation relative
	coordinates here we do not have to distinguish no-window and window
	widgets.


svn path=/trunk/; revision=18663
2007-08-21 10:52:43 +00:00
Kristian Rietveld
02eda450ea Disable tooltips in touchscreen mode.
2007-08-07  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktooltip.c (_gtk_tooltip_handle_event): Disable tooltips
	in touchscreen mode.


svn path=/trunk/; revision=18586
2007-08-07 11:28:01 +00:00
Matthias Clasen
b11262594c Make the label wrap, for compatibility with the old tooltips code. This
2007-07-31  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktooltip.c (gtk_tooltip_init): Make the label
        wrap, for compatibility with the old tooltips code. This
        fixes absurdly long tooltips in the color selector.



svn path=/trunk/; revision=18558
2007-07-31 17:38:27 +00:00
Matthias Clasen
ef8bdfb703 Call gtk_tooltip_hide_tooltip() even if the tooltip is not visible yet.
2007-07-25  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktooltip.c (_gtk_tooltip_handle_event): Call
        gtk_tooltip_hide_tooltip() even if the tooltip is not
        visible yet. This fixes annoying dangling tooltips
        on systray icons.


svn path=/trunk/; revision=18544
2007-07-25 17:45:22 +00:00
Matthias Clasen
17aacf414d Protect against recursion via gtk_container_remove(). (#459561, Christian
2007-07-23  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktooltip.c (gtk_tooltip_set_custom): Protect against
        recursion via gtk_container_remove().  (#459561, Christian Persch)
        (gtk_tooltip_window_hide): Simplify.



svn path=/trunk/; revision=18534
2007-07-24 03:54:16 +00:00
Matthias Clasen
c8c42229f1 Don't pop up under the cursor.
2007-07-20  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktooltip.c (gtk_tooltip_position): Don't pop up
        under the cursor.



svn path=/trunk/; revision=18512
2007-07-20 12:13:24 +00:00
Kristian Rietveld
9719e5fb3c handle no-window and regular widgets seperately.
2007-07-19  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle
	no-window and regular widgets seperately.

	* gtk/gtktreeview.c (gkt_tree_view_set_tooltip_cell): rect.x should
	be zero.


svn path=/trunk/; revision=18502
2007-07-19 15:03:18 +00:00