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/gtkeventcontrollerfocus.c | |
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/gtkeventcontrollerfocus.c')
-rw-r--r-- | gtk/gtkeventcontrollerfocus.c | 72 |
1 files changed, 2 insertions, 70 deletions
diff --git a/gtk/gtkeventcontrollerfocus.c b/gtk/gtkeventcontrollerfocus.c index 0cec4344e9..a8a6aaa296 100644 --- a/gtk/gtkeventcontrollerfocus.c +++ b/gtk/gtkeventcontrollerfocus.c @@ -46,8 +46,6 @@ struct _GtkEventControllerFocus { GtkEventController parent_instance; - const GtkCrossingData *current_crossing; - guint is_focus : 1; guint contains_focus : 1; }; @@ -148,16 +146,8 @@ gtk_event_controller_focus_handle_crossing (GtkEventController *controller, double x, double y) { - GtkEventControllerFocus *focus = GTK_EVENT_CONTROLLER_FOCUS (controller); - - if (crossing->type != GTK_CROSSING_FOCUS) - return; - - focus->current_crossing = crossing; - - update_focus (controller, crossing); - - focus->current_crossing = NULL; + if (crossing->type == GTK_CROSSING_FOCUS) + update_focus (controller, crossing); } static void @@ -296,64 +286,6 @@ gtk_event_controller_focus_new (void) } /** - * gtk_event_controller_focus_get_focus_origin: - * @controller: a #GtkEventControllerFocus - * - * Returns the widget that was holding focus before. - * - * This function can only be used in handlers for the - * #GtkEventControllerFocus::focus-in and #GtkEventControllerFocus::focus-out signals. - * - * Returns: (transfer none): the previous focus - */ -GtkWidget * -gtk_event_controller_focus_get_focus_origin (GtkEventControllerFocus *controller) -{ - g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_FOCUS (controller), NULL); - g_return_val_if_fail (controller->current_crossing != NULL, NULL); - - return controller->current_crossing->old_target; -} - -/** - * gtk_event_controller_focus_get_focus_target: - * @controller: a #GtkEventControllerFocus - * - * Returns the widget that will be holding focus afterwards. - * - * This function can only be used in handlers for the - * #GtkEventControllerFocus::focus-in and #GtkEventControllerFocus::focus-out signals. - * - * Returns: (transfer none): the next focus - */ -GtkWidget * -gtk_event_controller_focus_get_focus_target (GtkEventControllerFocus *controller) -{ - g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_FOCUS (controller), NULL); - g_return_val_if_fail (controller->current_crossing != NULL, NULL); - - return controller->current_crossing->new_target; -} - -GtkWidget * -gtk_event_controller_focus_get_old_focus_child (GtkEventControllerFocus *controller) -{ - g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_FOCUS (controller), NULL); - g_return_val_if_fail (controller->current_crossing != NULL, NULL); - - return controller->current_crossing->old_descendent; -} - -GtkWidget * -gtk_event_controller_focus_get_new_focus_child (GtkEventControllerFocus *controller) -{ - g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_FOCUS (controller), NULL); - g_return_val_if_fail (controller->current_crossing != NULL, NULL); - - return controller->current_crossing->new_descendent; -} - -/** * gtk_event_controller_focus_contains_focus: * @self: a #GtkEventControllerFocus * |