diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-02-20 17:22:03 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-02-21 00:51:03 -0500 |
commit | 77aed615e803d3039af62a1416368248c0457c39 (patch) | |
tree | 7a3f7575ef1c2ee6444346760117bae36086ea22 /gtk/gtkeventcontrollerprivate.h | |
parent | 4947b94a41911bbba9d048e3fd4f9893da3b79fb (diff) | |
download | gtk+-77aed615e803d3039af62a1416368248c0457c39.tar.gz |
Keep more event controller api private
We don't want to expose the GtkCrossingData struct, and manually
feeding events to event controllers is not something we want to
encourage, going forward.
Diffstat (limited to 'gtk/gtkeventcontrollerprivate.h')
-rw-r--r-- | gtk/gtkeventcontrollerprivate.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gtk/gtkeventcontrollerprivate.h b/gtk/gtkeventcontrollerprivate.h index 1ae4808f48..e9e17f14e4 100644 --- a/gtk/gtkeventcontrollerprivate.h +++ b/gtk/gtkeventcontrollerprivate.h @@ -22,6 +22,47 @@ #include "gtkeventcontroller.h" +typedef enum { + GTK_CROSSING_FOCUS, + GTK_CROSSING_POINTER +} GtkCrossingType; + +typedef enum { + GTK_CROSSING_IN, + GTK_CROSSING_OUT +} GtkCrossingDirection; + +typedef struct _GtkCrossingData GtkCrossingData; + +/** + * GtkCrossingData: + * @type: the type of crossing event + * @direction: whether this is a focus-in or focus-out event + * @mode: the crossing mode + * @old_target: the old target + * @old_descendent: the direct child of the receiving widget that + * is an ancestor of @old_target, or %NULL if @old_target is not + * a descendent of the receiving widget + * @new_target: the new target + * @new_descendent: the direct child of the receiving widget that + * is an ancestor of @new_target, or %NULL if @new_target is not + * a descendent of the receiving widget + * + * The struct that is passed to gtk_event_controller_handle_crossing(). + * + * The @old_target and @new_target fields are set to the old or new + * focus or hover location. + */ +struct _GtkCrossingData { + GtkCrossingType type; + GtkCrossingDirection direction; + GdkCrossingMode mode; + GtkWidget *old_target; + GtkWidget *old_descendent; + GtkWidget *new_target; + GtkWidget *new_descendent; +}; + struct _GtkEventController { GObject parent_instance; @@ -58,4 +99,14 @@ struct _GtkEventControllerClass GtkWidget *gtk_event_controller_get_target (GtkEventController *controller); +gboolean gtk_event_controller_handle_event (GtkEventController *controller, + GdkEvent *event, + GtkWidget *target, + double x, + double y); +void gtk_event_controller_handle_crossing (GtkEventController *controller, + const GtkCrossingData *crossing, + double x, + double y); + #endif /* __GTK_EVENT_CONTROLLER_PRIVATE_H__ */ |