From: Carlos Garnacho Date: Sun, 27 Nov 2022 12:00:54 +0000 (+0100) Subject: imcontext: Add private activate_osk() vmethod X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~65^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=459583ba9ef47aeb0accf90ce6b04b5f68873102;p=gtk4.git imcontext: Add private activate_osk() vmethod This method is so far private for both external GtkIMContext implementations and external GtkIMContext users, and is meant to activate the OSK in the environments where this may happen. --- diff --git a/gtk/gtkimcontext.c b/gtk/gtkimcontext.c index 008046264b..bf3a4ddb0e 100644 --- a/gtk/gtkimcontext.c +++ b/gtk/gtkimcontext.c @@ -18,6 +18,7 @@ #include "config.h" #include #include "gtkimcontext.h" +#include "gtkimcontextprivate.h" #include "gtkprivate.h" #include "gtktypebuiltins.h" #include "gtkmarshalers.h" @@ -1005,3 +1006,12 @@ gtk_im_context_set_property (GObject *obj, break; } } + +void +gtk_im_context_activate_osk (GtkIMContext *context) +{ + g_return_if_fail (GTK_IS_IM_CONTEXT (context)); + + if (GTK_IM_CONTEXT_GET_CLASS (context)->activate_osk) + GTK_IM_CONTEXT_GET_CLASS (context)->activate_osk (context); +} diff --git a/gtk/gtkimcontext.h b/gtk/gtkimcontext.h index 4fd25cf2ab..fe53feddf9 100644 --- a/gtk/gtkimcontext.h +++ b/gtk/gtkimcontext.h @@ -96,12 +96,13 @@ struct _GtkIMContextClass int *anchor_index); /*< private >*/ + void (* activate_osk) (GtkIMContext *context); + /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void); void (*_gtk_reserved4) (void); - void (*_gtk_reserved5) (void); }; GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkimcontextprivate.h b/gtk/gtkimcontextprivate.h new file mode 100644 index 0000000000..73b952ffd0 --- /dev/null +++ b/gtk/gtkimcontextprivate.h @@ -0,0 +1,25 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 2022 Red Hat Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#ifndef __GTK_IM_CONTEXT_PRIVATE_H__ +#define __GTK_IM_CONTEXT_PRIVATE_H__ + +#include "gtkimcontext.h" + +void gtk_im_context_activate_osk (GtkIMContext *context); + +#endif /* __GTK_IM_CONTEXT_PRIVATE_H__ */