From f28aa1ba026dad82c4d3a128f99d4e99615a5a52 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 16 Apr 2020 17:23:36 +0100 Subject: 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 data structures to conform to the namespace/type-name pattern. --- gtk/gtkimcontextsimple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gtk/gtkimcontextsimple.c') diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index da85eee183..17e8f68505 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -806,7 +806,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple, translated.consumed = 0; translated.layout = 0; translated.level = 0; - GdkEvent *tmp_event = gdk_event_key_new (GDK_KEY_PRESS, + GdkEvent *tmp_event = gdk_key_event_new (GDK_KEY_PRESS, gdk_event_get_surface (event), gdk_event_get_device (event), gdk_event_get_source_device (event), -- cgit v1.2.1