Commit Graph

51 Commits

Author SHA1 Message Date
Carlos Garnacho
e08e15ba51 gtkentry: Use gestures for entry icons
Instead of doing all handling manually in the ::event vfunc,
set up drag/multipress gestures on icon images, and implement
emission of ::icon-press/release and DnD there.

As a side effect, the GdkEvent field in ::icon-press/release
signals has been dropped. Callers that might be interested on it
may still use gtk_get_current_event*().
2018-06-21 12:50:57 +02:00
Daniel Boles
4f979469f1 a11y/entry: Fix copy-pasteo re 2ndary icon tooltip
The else case was wrongly resetting the accessible description on the
primary icon, which might not exist and can therefore cause a crash.

https://gitlab.gnome.org/GNOME/gtk/issues/1160
2018-06-19 18:37:25 +01:00
Benjamin Otte
7e574fa98c gdk: Get rid of gdk_event_free()
Events are objects, so use g_object_unref().
2018-05-29 21:53:44 +02:00
Samuel Thibault
8c8cb2bb12 gtkentryaccessible: Fix text-changed::delete length
The second parameter of the text-changed::delete event is to be the length,
not the end position.  This fixes spurious text removals in brltty
screen reading.

(cherry picked from commit 209f908a03)
2018-04-04 17:59:31 +02:00
Alexander Larsson
39851fbdbf Continue renaming window to surface
This renames a lot of arguments, local variables and functions.
2018-03-21 11:49:14 +01:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Alexander Larsson
3dce0dcca7 GdkSurface: Rename lots of stuff from window->surface
Mostly these are internal things, but the major public change is
that event.window is now event.surface.
2018-03-20 15:14:10 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Carlos Garnacho
33330ad001 gtk/a11y: Use allocated events
Using stack allocated GdkEvent will not be ok when they become
objects.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
b9db0b55cb gdk: Refurbish GdkEvent struct hierarchy
Make all specific event structs contain a GdkEventAny, so the base
struct can be extended without modifying structs all over the place.
2017-12-14 00:58:32 +01:00
Benjamin Otte
825612b419 a11y: Port to GdkClipboard 2017-12-03 05:46:47 +01:00
Benjamin Otte
a59572f96d widget: gtk_widget_get_clipboard => gtk_widget_get_old_clipboard
Just rename the function, so the previous one can be used for the
new clipboard.
2017-12-03 05:46:47 +01:00
Benjamin Otte
1c36c6ed4d widget: Remove gtk_widget_has_screen()
All widgets always have a screen (or display).
2017-10-31 04:33:11 +01:00
Daniel Boles
a5c0a5c546 a11y/entry: Fixups for previous commit
We still declare all variables at the start of the block.

Also, we can use the fast private _gtk_widget_get_allocation().

https://bugzilla.gnome.org/show_bug.cgi?id=784509
2017-10-15 12:58:25 +01:00
Samuel Thibault
9af088693a a11y/entry: Fix text coords not adjusted for alloc
What is missing is the "allocation" part of x/y coordinates. Since
gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
the coordinates returned by gdk_window_get_origin don't include it.

This patch fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784509
2017-10-15 12:37:44 +01:00
Matthias Clasen
d0c92fba69 entry accessible: Give up on GdkEvent api for now
Just include gdkeventsprivate.h here for now. This may be
resolved by just dropping icon support from GtkEntry down
the road.
2017-09-19 18:39:03 +02:00
Emmanuele Bassi
d8892c0fdb Remove redundant declarations 2016-10-17 11:10:14 +01:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00
Benjamin Otte
7e5b58c727 stylecontext: Move private a11y function to private header 2014-08-16 19:39:44 +02:00
Benjamin Otte
4b793dd508 a11y: Remove an outdated comment 2014-06-10 01:17:00 +02:00
Joanmarie Diggs
fc00381d30 GtkEntryAccessible: Emit signal after insertion
The signal needs to be emitted after the text insertion as at-spi gets
the text to compute the inserted text due to the AtkText::insert-text
signal not containing it.
Also adjust position to reflect changes to the offsets.

https://bugzilla.gnome.org/show_bug.cgi?id=731429
2014-06-10 01:07:57 +02:00
Jonas Danielsson
e7962f5871 a11y: atk_component_get_position is deprecated
Switch to using atk_component_get_extents instead.

https://bugzilla.gnome.org/show_bug.cgi?id=727313
2014-04-01 21:40:23 -04:00
Emmanuele Bassi
365919d5f6 a11y: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:28:49 +01:00
Alban Browaeys
da961b7ab8 GtkEntryAccessible: also handle entry icon tooltip NULL in notify_gtk.
To clear the tooltip one is to set the tooltip to NULL. Though
the GtkEntryAccessible expect this tooltip to not be NULL in
gtk_entry_accessible_notify_gtk (already handling this case
 in its _init).

Fixes:
** (epiphany:23914): CRITICAL **: atk_object_set_description: assertion
`description != NULL' failed
when epiphany g_object_set the entry icon tooltip to NULL (clear the
tooltip) in its find bar.

https://bugzilla.gnome.org/show_bug.cgi?id=695375
2013-03-17 16:12:52 -04:00
Matthias Clasen
935d458fa1 Improve AtkAction implementations
Implement get_localized_name, and also translate the strings
returned by get_description.
https://bugzilla.gnome.org/show_bug.cgi?id=525226
2013-02-04 00:57:46 -05:00
Matthias Clasen
221ac71278 Cosmetics
Replace GAIL in top comments by 'GTK+ - accessibility implementations'.
2012-12-27 11:27:44 -05:00
Matthias Clasen
e4b5e94eb9 Make accessible implementations public
This commit exposes the get_type() functions and standard
headers for accessible implementations. This makes it possible
to derive from the GTK accessible implementations without
GType magic tricks. This is necessary, because we require the
a11y type hierarchy to be parallel to the widget type hierarchy.
So, if you derive a widget and need to adjust its a11y implementation,
you have to be able to derive its accessible implementation.

This commit probably exposes more than is absolutely necessary,
it also exposes accessibles of widgets that are unlikely candidates
for deriving from.
2012-12-27 11:23:22 -05:00
Mario Sanchez Prada
57e1e0de94 Add missing NULL-check in GtkEntryAccessible
Only call to atk_object_set_name if gtk_entry_get_icon_name() is not NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=689923
2012-12-09 11:52:11 +01:00
Mike Gorse
b7743430aa Add accessibles for GtkEntry icons
Expose GtkEntry icons as child accessibles of a GtkEntry, and provide
actions to simulate clicking them. Also, refactor the a11y children test
slightly to add a test.

https://bugzilla.gnome.org/show_bug.cgi?id=686347
2012-11-12 09:21:27 -06:00
Matthias Clasen
4745adaeff GtkEntryAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 15:59:58 -04:00
Colin Walters
9ca355b460 GtkEntryAccessible: Remove unused variable 2012-08-16 10:37:05 -04:00
Mario Sanchez Prada
63e2a0ff0c Expose the masked string for password fields to assistive technologies.
Call _gtk_entry_get_display_text()from gtkentryaccessible.c to make
sure we always consider the actual text being displayed when
implementing the functions from the AtkTet interface.

https://bugzilla.gnome.org/show_bug.cgi?id=681591
2012-08-10 18:09:06 +02:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
902c5c6979 a11y: emit entry signals immediately
We want to emit signals when stuff happens, not sometime later. That way
we can also catch the correct text that was deleted.

https://bugzilla.gnome.org/show_bug.cgi?id=659445
2011-12-19 16:17:14 +01:00
Dan Winship
c4a5c99074 Fix cut-and-paste error in GtkEntryAccessible/GtkLabelAccessible
The y position of the character depends on the window's y coordinate,
not its x coordinate.
2011-08-10 15:19:56 -04:00
Matthias Clasen
e756b2e50d Use canonical names
Use canonical names for both signals and properties.
2011-07-17 18:52:37 -04:00
Matthias Clasen
a20c7ed214 Avoid unnecessary includes
Including string.h makes the compiler complain about parameters
and variables called index, which is not nice.
2011-07-10 00:10:15 -04:00
Matthias Clasen
d98622b2ea Reduce the number of unwanted exports
_-prefix most of the get_type functions in a11y/.
There are still some more symbols left.
2011-07-09 16:32:40 -04:00
Benjamin Otte
2870b58638 a11y: Don't use an idle handler for entry actions 2011-07-06 16:40:04 +02:00
Matthias Clasen
775ccf39e7 Initial conversion of GailWidget to GtkWidgetAccessible 2011-07-05 16:09:57 -04:00
Matthias Clasen
a3113386df Drop unneeded includes of gdkkeysyms.h
Just a minor cleanup; gtk.h includes this header in GTK+ 3.
2011-07-05 16:08:57 -04:00
Matthias Clasen
7371e3f7cf Convert GailComboBox to GtkComboBoxAccessible 2011-07-05 16:08:56 -04:00
Matthias Clasen
42cc6ad6c6 GtkEntryAccessible: Slight simplification of attribute handling
Make this use the same convenience function as is used elsewhwere.
2011-07-05 16:08:09 -04:00
Matthias Clasen
2358be732d Minor optimization
No need to get the cursor position twice in a row.
2011-07-05 16:08:09 -04:00
Matthias Clasen
2f758b9b50 GtkEntryAccessible: shorten some function names
Just cosmetics
2011-07-05 16:08:09 -04:00
Matthias Clasen
ca166c9a1e Remove a bit of dead code 2011-07-05 16:08:08 -04:00
Matthias Clasen
442ec1b624 GtkEntryAccessible: Clean up the AtkAction implementation a bit
No functional changes.
2011-07-05 16:08:08 -04:00
Matthias Clasen
99a54565a3 Purge traces of insert idle handler 2011-07-05 16:08:08 -04:00
Matthias Clasen
212241ffda GtkEntryAccessible: Rework text_changed handling
No more signal emission from an idle.
2011-07-05 16:08:08 -04:00
Matthias Clasen
7872c2c19e GtkEntryAccessible: port from GailTextUtil to GtkPango
Also clean up and rearrange the code.
As a side-effect, the no-longer-existing stipple attributes
are dropped.  Update test results to match.
2011-07-05 16:08:08 -04:00