imcontext: Add private activate_osk() vmethod
authorCarlos Garnacho <carlosg@gnome.org>
Sun, 27 Nov 2022 12:00:54 +0000 (13:00 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 28 Nov 2022 14:46:41 +0000 (15:46 +0100)
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.

gtk/gtkimcontext.c
gtk/gtkimcontext.h
gtk/gtkimcontextprivate.h [new file with mode: 0644]

index 008046264bd50bb114d67e273a18efea867d0e5b..bf3a4ddb0ee2b4187b4b6d8e474a974cff17df4f 100644 (file)
@@ -18,6 +18,7 @@
 #include "config.h"
 #include <string.h>
 #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);
+}
index 4fd25cf2ab6d73756a6bb9e909824977c1d31621..fe53feddf91bcb54308b10a3bedb9675bf49876b 100644 (file)
@@ -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 (file)
index 0000000..73b952f
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+ */
+
+#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__ */