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.
This commit is contained in:
Carlos Garnacho 2022-11-27 13:00:54 +01:00
parent 59af80ab8b
commit 459583ba9e
3 changed files with 37 additions and 1 deletions

View 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);
}

View 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

25
gtk/gtkimcontextprivate.h Normal file
View File

@ -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__ */