Commit f28aa1ba authored by Emmanuele Bassi's avatar Emmanuele Bassi 👣
Browse files

Restructure the GdkEvent type hierarchy

GdkEvent has been a "I-can't-believe-this-is-not-OOP" type for ages,
using a union of sub-types. This has always been problematic when it
comes to implementing accessor functions: either you get generic API
that takes a GdkEvent and uses a massive switch() to determine which
event types have the data you're looking for; or you create namespaced
accessors, but break language bindings horribly, as boxed types cannot
have derived types.

The recent conversion of GskRenderNode (which had similar issues) to
GTypeInstance, and the fact that GdkEvent is now a completely opaque
type, provide us with the chance of moving GdkEvent to GTypeInstance,
and have sub-types for GdkEvent.

The change from boxed type to GTypeInstance is pretty small, all things
considered, but ends up cascading to a larger commit, as we still have
backends and code in GTK trying to access GdkEvent structures directly.
Additionally, the naming of the public getter functions requires
renaming all the da...
parent 96cfb129
Pipeline #170706 passed with stages
in 90 minutes and 20 seconds
......@@ -299,8 +299,9 @@
in GTK 4.
</para>
<para>
GdkEvent is now a strictly read-only boxed type, and you
can no longer change any of its fields.
GdkEvent is now a strictly read-only type, and you
can no longer change any of its fields, or construct new
events.
</para>
</section>
......@@ -308,7 +309,7 @@
<title>Stop using gdk_surface_set_event_compression</title>
<para>
Event compression is now always enabled. If you need to see the uncoalesced
motion history, use gdk_event_get_motion_history().
motion history, use gdk_motion_event_get_history() on the latest motion event.
</para>
</section>
......@@ -318,8 +319,8 @@
Warping the pointer is disorienting and unfriendly to users.
GTK 4 does not support it. In special circumstances (such as when
implementing remote connection UIs) it can be necessary to
warp the pointer; in this case, use platform APIs such as XWarpPointer
directly.
warp the pointer; in this case, use platform APIs such as
<function>XWarpPointer()</function> directly.
</para>
</section>
......
......@@ -100,7 +100,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
if (surface)
{
event = gdk_event_crossing_new (GDK_ENTER_NOTIFY,
event = gdk_crossing_event_new (GDK_ENTER_NOTIFY,
surface,
gdk_seat_get_pointer (seat),
gdk_seat_get_pointer (seat),
......@@ -119,7 +119,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
if (surface)
{
event = gdk_event_crossing_new (GDK_LEAVE_NOTIFY,
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
surface,
gdk_seat_get_pointer (seat),
gdk_seat_get_pointer (seat),
......@@ -141,7 +141,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
if (surface)
{
event = gdk_event_motion_new (surface,
event = gdk_motion_event_new (surface,
gdk_seat_get_pointer (seat),
gdk_seat_get_pointer (seat),
NULL,
......@@ -165,7 +165,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
if (surface)
{
event = gdk_event_button_new (message->base.type == BROADWAY_EVENT_BUTTON_PRESS
event = gdk_button_event_new (message->base.type == BROADWAY_EVENT_BUTTON_PRESS
? GDK_BUTTON_PRESS
: GDK_BUTTON_RELEASE,
surface,
......@@ -188,7 +188,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
if (surface)
{
event = gdk_event_discrete_scroll_new (surface,
event = gdk_scroll_event_new_discrete (surface,
gdk_seat_get_pointer (seat),
gdk_seat_get_pointer (seat),
NULL,
......@@ -243,7 +243,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
if (event_type == GDK_TOUCH_BEGIN || event_type == GDK_TOUCH_UPDATE)
state |= GDK_BUTTON1_MASK;
event = gdk_event_touch_new (event_type,
event = gdk_touch_event_new (event_type,
GUINT_TO_POINTER (message->touch.sequence_id),
surface,
gdk_seat_get_pointer (seat),
......@@ -271,7 +271,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
translated.consumed = 0;
translated.layout = 0;
translated.level = 0;
event = gdk_event_key_new (message->base.type == BROADWAY_EVENT_KEY_PRESS
event = gdk_key_event_new (message->base.type == BROADWAY_EVENT_KEY_PRESS
? GDK_KEY_PRESS
: GDK_KEY_RELEASE,
surface,
......@@ -298,7 +298,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->configure_notify.id));
if (surface)
{
event = gdk_event_configure_new (surface,
event = gdk_configure_event_new (surface,
message->configure_notify.width,
message->configure_notify.height);
......@@ -329,7 +329,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.old_id));
if (surface)
{
event = gdk_event_focus_new (surface,
event = gdk_focus_event_new (surface,
gdk_seat_get_keyboard (seat),
gdk_seat_get_keyboard (seat),
FALSE);
......@@ -340,7 +340,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.new_id));
if (surface)
{
event = gdk_event_focus_new (surface,
event = gdk_focus_event_new (surface,
gdk_seat_get_keyboard (seat),
gdk_seat_get_keyboard (seat),
TRUE);
......
......@@ -505,7 +505,7 @@ generate_grab_broken_event (GdkDisplay *display,
{
GdkEvent *event;
event = gdk_event_grab_broken_new (surface,
event = gdk_grab_broken_event_new (surface,
device,
device,
grab_surface,
......
......@@ -915,12 +915,12 @@ gdk_drop_emit_enter_event (GdkDrop *self,
g_warn_if_fail (!priv->entered);
event = gdk_event_drag_new (GDK_DRAG_ENTER,
priv->surface,
priv->device,
self,
time,
0, 0);
event = gdk_dnd_event_new (GDK_DRAG_ENTER,
priv->surface,
priv->device,
self,
time,
0, 0);
priv->entered = TRUE;
......@@ -939,12 +939,12 @@ gdk_drop_emit_motion_event (GdkDrop *self,
g_warn_if_fail (priv->entered);
event = gdk_event_drag_new (GDK_DRAG_MOTION,
priv->surface,
priv->device,
self,
time,
x, y);
event = gdk_dnd_event_new (GDK_DRAG_MOTION,
priv->surface,
priv->device,
self,
time,
x, y);
gdk_drop_do_emit_event (event, dont_queue);
}
......@@ -959,12 +959,12 @@ gdk_drop_emit_leave_event (GdkDrop *self,
g_warn_if_fail (priv->entered);
event = gdk_event_drag_new (GDK_DRAG_LEAVE,
priv->surface,
priv->device,
self,
time,
0, 0);
event = gdk_dnd_event_new (GDK_DRAG_LEAVE,
priv->surface,
priv->device,
self,
time,
0, 0);
priv->entered = FALSE;
......@@ -984,12 +984,12 @@ gdk_drop_emit_drop_event (GdkDrop *self,
g_warn_if_fail (priv->entered);
g_warn_if_fail (priv->state == GDK_DROP_STATE_NONE);
event = gdk_event_drag_new (GDK_DROP_START,
priv->surface,
priv->device,
self,
time,
x, y);
event = gdk_dnd_event_new (GDK_DROP_START,
priv->surface,
priv->device,
self,
time,
x, y);
priv->state = GDK_DROP_STATE_DROPPING;
......
This diff is collapsed.
......@@ -41,6 +41,10 @@ G_BEGIN_DECLS
#define GDK_TYPE_EVENT (gdk_event_get_type ())
#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
#define GDK_IS_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_EVENT))
#define GDK_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_EVENT, GdkEvent))
#define GDK_IS_EVENT_TYPE(event, type) (gdk_event_get_event_type ((event)) == (type))
/**
* GDK_PRIORITY_EVENTS:
......@@ -98,9 +102,38 @@ G_BEGIN_DECLS
*/
#define GDK_BUTTON_SECONDARY (3)
typedef struct _GdkEventSequence GdkEventSequence;
typedef union _GdkEvent GdkEvent;
typedef struct _GdkEventSequence GdkEventSequence;
typedef struct _GdkEvent GdkEvent;
#define GDK_TYPE_BUTTON_EVENT (gdk_button_event_get_type())
#define GDK_TYPE_CONFIGURE_EVENT (gdk_configure_event_get_type())
#define GDK_TYPE_CROSSING_EVENT (gdk_crossing_event_get_type())
#define GDK_TYPE_DELETE_EVENT (gdk_delete_event_get_type())
#define GDK_TYPE_DND_EVENT (gdk_dnd_event_get_type())
#define GDK_TYPE_FOCUS_EVENT (gdk_focus_event_get_type())
#define GDK_TYPE_GRAB_BROKEN_EVENT (gdk_grab_broken_event_get_type())
#define GDK_TYPE_KEY_EVENT (gdk_key_event_get_type())
#define GDK_TYPE_MOTION_EVENT (gdk_motion_event_get_type())
#define GDK_TYPE_PAD_EVENT (gdk_pad_event_get_type())
#define GDK_TYPE_PROXIMITY_EVENT (gdk_proximity_event_get_type())
#define GDK_TYPE_SCROLL_EVENT (gdk_scroll_event_get_type())
#define GDK_TYPE_TOUCH_EVENT (gdk_touch_event_get_type())
#define GDK_TYPE_TOUCHPAD_EVENT (gdk_touchpad_event_get_type())
typedef struct _GdkButtonEvent GdkButtonEvent;
typedef struct _GdkConfigureEvent GdkConfigureEvent;
typedef struct _GdkCrossingEvent GdkCrossingEvent;
typedef struct _GdkDeleteEvent GdkDeleteEvent;
typedef struct _GdkDNDEvent GdkDNDEvent;
typedef struct _GdkFocusEvent GdkFocusEvent;
typedef struct _GdkGrabBrokenEvent GdkGrabBrokenEvent;
typedef struct _GdkKeyEvent GdkKeyEvent;
typedef struct _GdkMotionEvent GdkMotionEvent;
typedef struct _GdkPadEvent GdkPadEvent;
typedef struct _GdkProximityEvent GdkProximityEvent;
typedef struct _GdkScrollEvent GdkScrollEvent;
typedef struct _GdkTouchEvent GdkTouchEvent;
typedef struct _GdkTouchpadEvent GdkTouchpadEvent;
/**
* GdkEventType:
......@@ -297,7 +330,6 @@ typedef enum
GDK_AVAILABLE_IN_ALL
GType gdk_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GType gdk_event_sequence_get_type (void) G_GNUC_CONST;
......@@ -348,9 +380,13 @@ gboolean gdk_event_get_axis (GdkEvent *event,
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_pointer_emulated (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_button_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint gdk_button_event_get_button (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_scroll_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkScrollDirection gdk_scroll_event_get_direction (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_scroll_event_get_deltas (GdkEvent *event,
......@@ -359,6 +395,8 @@ void gdk_scroll_event_get_deltas (GdkEvent *event,
GDK_AVAILABLE_IN_ALL
gboolean gdk_scroll_event_is_stop (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_key_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint gdk_key_event_get_keyval (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
guint gdk_key_event_get_keycode (GdkEvent *event);
......@@ -371,18 +409,30 @@ guint gdk_key_event_get_level (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
gboolean gdk_key_event_is_modifier (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_focus_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_focus_event_get_in (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_touch_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_touch_event_get_emulating_pointer (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_crossing_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkCrossingMode gdk_crossing_event_get_mode (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkNotifyType gdk_crossing_event_get_detail (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
gboolean gdk_crossing_event_get_focus (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_configure_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
void gdk_configure_event_get_size (GdkEvent *event,
int *width,
int *height);
GDK_AVAILABLE_IN_ALL
GType gdk_touchpad_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkTouchpadGesturePhase
gdk_touchpad_event_get_gesture_phase (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
......@@ -392,26 +442,41 @@ void gdk_touchpad_event_get_deltas (GdkEvent *event,
double *dx,
double *dy);
GDK_AVAILABLE_IN_ALL
double gdk_touchpad_pinch_event_get_angle_delta (GdkEvent *event);
double gdk_touchpad_event_get_pinch_angle_delta (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
double gdk_touchpad_event_get_pinch_scale (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_pad_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint gdk_pad_event_get_button (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
double gdk_touchpad_pinch_event_get_scale (GdkEvent *event);
void gdk_pad_event_get_axis_value (GdkEvent *event,
guint *index,
double *value);
GDK_AVAILABLE_IN_ALL
guint gdk_pad_button_event_get_button (GdkEvent *event);
void gdk_pad_event_get_group_mode (GdkEvent *event,
guint *group,
guint *mode);
GDK_AVAILABLE_IN_ALL
void gdk_pad_axis_event_get_value (GdkEvent *event,
guint *index,
double *value);
GType gdk_dnd_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
void gdk_pad_event_get_group_mode (GdkEvent *event,
guint *group,
guint *mode);
GdkDrop * gdk_dnd_event_get_drop (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkDrop * gdk_drag_event_get_drop (GdkEvent *event);
GType gdk_grab_broken_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_grab_broken_event_get_grab_surface (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
gboolean gdk_grab_broken_event_get_implicit (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GList * gdk_event_get_motion_history (GdkEvent *event);
GType gdk_motion_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GList * gdk_motion_event_get_history (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GType gdk_delete_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GType gdk_proximity_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_triggers_context_menu (GdkEvent *event);
......
This diff is collapsed.
......@@ -530,13 +530,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
0,
g_signal_accumulator_true_handled,
NULL,
_gdk_marshal_BOOLEAN__BOXED,
_gdk_marshal_BOOLEAN__POINTER,
G_TYPE_BOOLEAN,
1,
GDK_TYPE_EVENT);
g_signal_set_va_marshaller (signals[EVENT],
G_OBJECT_CLASS_TYPE (object_class),
_gdk_marshal_BOOLEAN__BOXEDv);
_gdk_marshal_BOOLEAN__POINTERv);
/**
* GdkSurface::enter-montor:
......@@ -2840,7 +2840,7 @@ add_event_mark (GdkEvent *event,
g_type_class_unref (class);
kind = value ? value->value_nick : "event";
switch (event_type)
switch ((int) event_type)
{
case GDK_MOTION_NOTIFY:
{
......@@ -2932,8 +2932,11 @@ gdk_surface_handle_event (GdkEvent *event)
if (gdk_event_get_event_type (event) == GDK_CONFIGURE)
{
int width, height;
gdk_configure_event_get_size (event, &width, &height);
g_signal_emit (gdk_event_get_surface (event), signals[SIZE_CHANGED], 0,
event->configure.width, event->configure.height);
width, height);
handled = TRUE;
}
else
......
......@@ -589,7 +589,7 @@ emulate_crossing (GdkSurface *surface,
double x, y;
gdk_surface_get_device_position (surface, device, &x, &y, &state);
event = gdk_event_crossing_new (type,
event = gdk_crossing_event_new (type,
surface,
device,
device,
......@@ -614,7 +614,7 @@ emulate_touch_crossing (GdkSurface *surface,
{
GdkEvent *event;
event = gdk_event_crossing_new (type,
event = gdk_crossing_event_new (type,
surface,
device,
source,
......@@ -633,7 +633,7 @@ emulate_focus (GdkSurface *surface,
gboolean focus_in,
guint32 time_)
{
GdkEvent *event = gdk_event_focus_new (surface, device, device, focus_in);
GdkEvent *event = gdk_focus_event_new (surface, device, device, focus_in);
_gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
......@@ -1360,7 +1360,7 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
GdkDevice *source;
source = get_scroll_device (seat, seat->pointer_info.frame.source);
event = gdk_event_discrete_scroll_new (seat->pointer_info.focus,
event = gdk_scroll_event_new_discrete (seat->pointer_info.focus,
seat->master_pointer,
source,
NULL,
......@@ -1382,7 +1382,7 @@ flush_smooth_scroll_event (GdkWaylandSeat *seat,
GdkDevice *source;
source = get_scroll_device (seat, seat->pointer_info.frame.source);
event = gdk_event_scroll_new (seat->pointer_info.focus,
event = gdk_scroll_event_new (seat->pointer_info.focus,
seat->master_pointer,
source,
NULL,
......@@ -1498,7 +1498,7 @@ pointer_handle_enter (void *data,
seat->pointer_info.surface_y = wl_fixed_to_double (sy);
seat->pointer_info.enter_serial = serial;
event = gdk_event_crossing_new (GDK_ENTER_NOTIFY,
event = gdk_crossing_event_new (GDK_ENTER_NOTIFY,
seat->pointer_info.focus,
seat->master_pointer,
seat->pointer,
......@@ -1541,7 +1541,7 @@ pointer_handle_leave (void *data,
_gdk_wayland_display_update_serial (display_wayland, serial);
event = gdk_event_crossing_new (GDK_LEAVE_NOTIFY,
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
seat->pointer_info.focus,
seat->master_pointer,
seat->pointer,
......@@ -1586,7 +1586,7 @@ pointer_handle_motion (void *data,
seat->pointer_info.surface_x = wl_fixed_to_double (sx);
seat->pointer_info.surface_y = wl_fixed_to_double (sy);
event = gdk_event_motion_new (seat->pointer_info.focus,
event = gdk_motion_event_new (seat->pointer_info.focus,
seat->master_pointer,
seat->pointer,
NULL,
......@@ -1649,7 +1649,7 @@ pointer_handle_button (void *data,
if (state)
seat->pointer_info.press_serial = serial;
event = gdk_event_button_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE,
event = gdk_button_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE,
seat->pointer_info.focus,
seat->master_pointer,
seat->pointer,
......@@ -1914,7 +1914,7 @@ keyboard_handle_enter (void *data,
g_object_ref (seat->keyboard_focus);
seat->repeat_key = 0;
event = gdk_event_focus_new (seat->keyboard_focus,
event = gdk_focus_event_new (seat->keyboard_focus,
seat->master_keyboard,
seat->keyboard,
TRUE);
......@@ -1949,7 +1949,7 @@ keyboard_handle_leave (void *data,
_gdk_wayland_display_update_serial (display, serial);
event = gdk_event_focus_new (seat->keyboard_focus,
event = gdk_focus_event_new (seat->keyboard_focus,
seat->master_keyboard,
seat->keyboard,
FALSE);
......@@ -2075,7 +2075,7 @@ deliver_key_event (GdkWaylandSeat *seat,
no_lock = translated;
}
event = gdk_event_key_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
event = gdk_key_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
seat->keyboard_focus,
seat->master_keyboard,
seat->keyboard,
......@@ -2375,7 +2375,7 @@ touch_handle_down (void *data,
touch->y = wl_fixed_to_double (y);
touch->touch_down_serial = serial;
event = gdk_event_touch_new (GDK_TOUCH_BEGIN,
event = gdk_touch_event_new (GDK_TOUCH_BEGIN,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->touch_master,
......@@ -2418,7 +2418,7 @@ touch_handle_up (void *data,
_gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_seat_get_touch (seat, id);
event = gdk_event_touch_new (GDK_TOUCH_END,
event = gdk_touch_event_new (GDK_TOUCH_END,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->touch_master,
......@@ -2463,7 +2463,7 @@ touch_handle_motion (void *data,
if (touch->initial_touch)
mimic_pointer_emulating_touch_info (seat->touch_master, touch);
event = gdk_event_touch_new (GDK_TOUCH_UPDATE,
event = gdk_touch_event_new (GDK_TOUCH_UPDATE,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->touch_master,
......@@ -2509,7 +2509,7 @@ touch_handle_cancel (void *data,
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
{
event = gdk_event_touch_new (GDK_TOUCH_CANCEL,
event = gdk_touch_event_new (GDK_TOUCH_CANCEL,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->touch_master,
......@@ -2541,7 +2541,7 @@ emit_gesture_swipe_event (GdkWaylandSeat *seat,
seat->pointer_info.time = _time;
event = gdk_event_touchpad_swipe_new (seat->pointer_info.focus,
event = gdk_touchpad_event_new_swipe (seat->pointer_info.focus,
seat->master_pointer,
seat->pointer,
_time,
......@@ -2638,7 +2638,7 @@ emit_gesture_pinch_event (GdkWaylandSeat *seat,
seat->pointer_info.time = _time;
event = gdk_event_touchpad_pinch_new (seat->pointer_info.focus,
event = gdk_touchpad_event_new_pinch (seat->pointer_info.focus,
seat->master_pointer,
seat->pointer,
_time,
......@@ -3469,7 +3469,7 @@ tablet_tool_handle_proximity_in (void *data,
gdk_wayland_device_tablet_clone_tool_axes (tablet, tool->tool);
gdk_wayland_mimic_device_axes (tablet->master, tablet->current_device);
event = gdk_event_proximity_new (GDK_PROXIMITY_IN,
event = gdk_proximity_event_new (GDK_PROXIMITY_IN,
tablet->pointer_info.focus,
tablet->master,
tablet->current_device,
......@@ -3500,7 +3500,7 @@ tablet_tool_handle_proximity_out (void *data,
g_message ("proximity out, seat %p, tool %d", tool->seat,
gdk_device_tool_get_tool_type (tool->tool)));
event = gdk_event_proximity_new (GDK_PROXIMITY_OUT,
event = gdk_proximity_event_new (GDK_PROXIMITY_OUT,
tablet->pointer_info.focus,
tablet->master,
tablet->current_device,
......@@ -3537,7 +3537,7 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkEvent *event;
event = gdk_event_button_new (evtype,
event = gdk_button_event_new (evtype,
tablet->pointer_info.focus,
tablet->master,
tablet->current_device,
......@@ -3603,7 +3603,7 @@ tablet_tool_handle_motion (void *data,
tablet->pointer_info.surface_x,
tablet->pointer_info.surface_y));
event = gdk_event_motion_new (tablet->pointer_info.focus,
event = gdk_motion_event_new (tablet->pointer_info.focus,
tablet->master,
tablet->current_device,
tool->tool,
......@@ -3765,7 +3765,7 @@ tablet_tool_handle_wheel (void *data,
return;
/* Send smooth event */
event = gdk_event_scroll_new (tablet->pointer_info.focus,
event = gdk_scroll_event_new (tablet->pointer_info.focus,
tablet->master,
tablet->current_device,
tablet->current_tool->tool,
......@@ -3777,7 +3777,7 @@ tablet_tool_handle_wheel (void *data,
_gdk_wayland_display_deliver_event (seat->display, event);
/* Send discrete event */
event = gdk_event_discrete_scroll_new (tablet->pointer_info.focus,
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
tablet->master,
tablet->current_device,
tablet->current_tool->tool,
......@@ -3888,7 +3888,7 @@ tablet_pad_ring_handle_frame (void *data,
GDK_SEAT_NOTE (seat, EVENTS,
g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
event = gdk_event_pad_ring_new (seat->keyboard_focus,