Commit Graph

261 Commits

Author SHA1 Message Date
Matthias Clasen
ca2a7c1efd Document more structs 2017-12-26 14:39:24 -05:00
Matthias Clasen
278c4583fc Document new event getters
New API needs documentation.
2017-12-26 13:00:27 -05:00
Matthias Clasen
d6985d793f Try to make the docs build more quiet
Not sure if this really makes a difference.
2017-12-26 13:00:27 -05:00
Matthias Clasen
97dcf2461e gdk: Remove the event structs from the documentation
No longer public api.
2017-12-26 13:00:27 -05:00
Emmanuele Bassi
90a4e33415 Update annotations for GdkEvent API
The GdkEvent API is missing some gtk-doc stanzas, as well as some
introspection annotations.
2017-12-21 19:07:02 +00:00
Carlos Garnacho
f93837ceb2 gdk: Remove leftover variable
This is unused and leaked.
2017-12-19 22:58:51 +01:00
Benjamin Otte
a04afde35c gdk: Remove DRAG_STATUS and DROP_FINISHED events
Those are source-side events that are handled by signals of the
Dragontext these days.
2017-12-15 23:48:36 +01:00
Matthias Clasen
e92c0e85ec Replace gdk_keymap_get_for_display by gdk_display_get_keymap
Replace all uses of the old function by the new one.
No functional change.
2017-12-15 07:44:58 -05:00
Matthias Clasen
9194ee4973 gdk: Drop GDK_DAMAGE
We haven't been generating events of this type
since we dropped offscreen windows.
2017-12-14 23:35:08 -05:00
Matthias Clasen
65fc43a1f3 Drop GDK_CLIENT_EVENT
We never generate events of this type, so no need
to carry it around.
2017-12-14 22:55:03 -05:00
Matthias Clasen
bcf570cc16 Move code around
gdk_window_set_state is now an ordinary (private) setter,
so it should live in gdkwindow.c.
2017-12-14 22:35:27 -05:00
Matthias Clasen
11a946df39 gdk: Drop GdkEventWindowState
No longer generate this event. Instead, emit change
notification for GdkWindow::state.
2017-12-14 22:24:06 -05:00
Matthias Clasen
e5b1867118 gdk: Add a GdkWindow::state property
This will eventually replace the window state event.
2017-12-14 22:24:06 -05:00
Benjamin Otte
f2bb2024c8 gdk: Remove properties
They are not used anymore.

Gone with them are PropertyNotify events.
2017-12-14 03:05:34 +01:00
Carlos Garnacho
f79ac6d30b gdk: Remove gdk_window_[gs]et_event_compression()
Motion compression is now the unmodifiable default, callers may
call gdk_event_get_motion_history() to check the uncoalesced
motion history.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
ea216accd7 gdk: Implement motion history as motion event data
In the motion compression phase the coalesced events will be saved
as a GdkTimeCoord on the motion event that shall be delivered.

For simplicity (and because history doesn't make much sense otherwise)
event history is only recorded while there are buttons pressed, this
also tidily ensures that those coalesced events would have the same
target widget on the gtk side than the delivered one, because of
implicit grabs.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
a040ed55cc gdk: Keep reference on tools from motion/button events. 2017-12-14 01:05:48 +01:00
Carlos Garnacho
8c9231dbb4 gdk: Move additional code in gdk_event_new() to GdkEvent::constructed
Now that the type is a construct only property, we can initialize the
event fields properly here.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
5ee1d4893a gdk: Make GdkEvent type a construct only property
So it must be set at the time of doing g_object_new().
2017-12-14 01:05:48 +01:00
Carlos Garnacho
ca89ad75b4 gdk: Remove gdk_event_is_allocated()
All events are allocated now.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
2acbb7b01d gdk: Turn GdkEvent into a GObject
Two warts remain. gdk_event_copy() should be unnecessary as
events should be considered static after delivery, so g_object_ref()
should be just as good. There's a few exceptional cases that the event
is copied and then modifier for later processing, those cases should be
reconsidered individually.

And gdk_event_free() could be likewise turned into g_object_unref(),
many callers remain though.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
1e1f2a6e67 gdk: Remove GdkDisplay from GdkEventPrivate
And add it to GdkEventAny.
2017-12-14 01:05:08 +01:00
Carlos Garnacho
8595e4b1d1 gdk: Figure out the GdkSeat of an event from the GdkDevice
Removes the need for gdk_event_set_seat() and the GdkSeat field from
GdkEventPrivate.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
526486da6b gdk: Use allocated events
Stack allocated GdkEvent structs will not be ok when events become
objects.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
59cab36035 gdk: Fold GdkEventPrivate fields into event structs
Now all events structs are private, it doesn't make as much sense
having GdkEventPrivate wrapping allocating events. This is a first
step towards removing it.
2017-12-14 00:58:32 +01:00
Carlos Garnacho
64decbfd74 gdk: Remove GdkEventType argument from GdkEvent union
It won't stand true anymore that the GdkEventType argument is the
first field of the GdkEvent* structs. All callers have been updated
to use event->any.type instead.
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
54f9aef0d4 gdk: Remove gdk_selection_convert()
It's not used anymore.
2017-12-14 00:44:26 +01:00
Benjamin Otte
4042d5f242 gdk: Remove ability to own a selection
With this, the GDK_EVENT_SELECTION_REQUEST and GDK_EVENT_SELECTION_CLEAR
and the associated GtkWidget signals are gone, too.
2017-12-13 23:39:02 +01:00
Benjamin Otte
8a453924a0 gdk: Remove gdk_event_put(), peek() etc
We don't want to treat events like they don't belong to displays. So
instead, people should use gdk_display_put/peek/get_event().
2017-12-13 00:56:52 +01:00
Benjamin Otte
437d70f569 gdk: Get rid of owner change events
They're unused now.
2017-12-03 05:46:49 +01:00
Matthias Clasen
1ec93bdda6 gdk: Move code around
Move the gdk_display functions to gdkdisplay.c.
They are misplaced in gdkevents.c.
2017-11-17 16:22:21 -05:00
Matthias Clasen
ce13dbba10 Drop gdk_set_double_click_time
This is an unnecessary and not-recommended-to-be-used
wrapper around gdk_display_set_double_click_time.
2017-11-16 22:04:25 -05:00
Matthias Clasen
5bd8884bf8 Stop providing the owner in GdkEventOwnerChange
This information is rarely useful, and it is one
of the last places where we create foreign windows.
2017-11-01 22:53:24 -04:00
Benjamin Otte
bd6b6ed93c gdk: Remove VisibilityNotify events 2017-11-01 22:00:34 +01:00
Matthias Clasen
f0189aecbc Drop gdk_event_set/get_screen
These functions have been replaced by display variants.
2017-10-30 22:22:00 -04:00
Matthias Clasen
c74ee7a159 Add gdk_event_get/set_display
The GdkScreen apis are going away, this is a replacement.
2017-10-30 22:22:00 -04:00
Matthias Clasen
209f24f962 Remove gdk_setting_get
This is a minor convenience api, and it is unused.
2017-10-30 15:31:02 -04:00
Matthias Clasen
10ba84a6a9 gdk: Drop settings events
We are not emitting these events anymore, so lets remove them
from the api. The GdkSettingAction enum is moved to xsettings-client.c
where its only use remains.
2017-10-30 09:49:02 -04:00
Marc-Antoine Perennou
4808829352 gdk: add accessor for GdkEventOwnerChange::reason
https://bugzilla.gnome.org/show_bug.cgi?id=789198

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-10-19 14:37:28 +02:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Timm Bäder
29dd0a940e GdkEvent: OWNER_CHANGE events have a selection as well 2017-09-28 20:01:01 +02:00
Timm Bäder
74ce20451f GdkEvent: Unref user_data in free
gdk_event_set_user_data refs it and this was creating pretty bad leaks.
2017-09-28 20:01:01 +02:00
Rico Tzschichholz
9f259a7391 gdk: Add g-i annotations for new event getters 2017-09-22 14:18:00 +02:00
Carlos Garnacho
44cb3ccfa1 gdk: Remove motion hints
Motion hints are now literally a thing of the past. Everything should be
using the full motion event stream.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
a9988e18b0 gtk: Remove 2BUTTON and 3BUTTON events and event types
Those should be interpreted by widget-local gestures, not guessed at a
high level with no notions of the specific context. Users will want
GtkGestureMultiPress to replace these events.
2017-09-19 18:40:50 +02:00
Matthias Clasen
7306f55912 Add some more GdkEvent getters 2017-09-19 18:39:03 +02:00
Matthias Clasen
66d8483fdf Add more GdkEvents API 2017-09-19 18:39:02 +02:00
Matthias Clasen
5488009150 Add more getters for event fields 2017-09-19 18:39:02 +02:00
Carlos Garnacho
c7431f46b5 gdk: Make GdkEvent structs/union opaque
All users are forced to deal with events as opaque pointers, only
using API to access the info.
2017-09-19 18:39:02 +02:00