5#include "flutter/shell/platform/linux/testing/mock_im_context.h"
15struct _FlMockIMContext {
16 GtkIMContext parent_instance;
20G_DEFINE_TYPE(FlMockIMContext, fl_mock_im_context, GTK_TYPE_IM_CONTEXT)
24 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
25 self->mock->gtk_im_context_set_client_window(context,
window);
30 PangoAttrList** attrs,
32 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
33 self->mock->gtk_im_context_get_preedit_string(context, str, attrs,
39 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
40 return self->mock->gtk_im_context_filter_keypress(context,
event);
44 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
45 self->mock->gtk_im_context_focus_in(context);
49 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
50 self->mock->gtk_im_context_focus_out(context);
54 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
55 self->mock->gtk_im_context_reset(context);
60 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
61 self->mock->gtk_im_context_set_cursor_location(context, area);
65 gboolean use_preedit) {
66 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
67 self->mock->gtk_im_context_set_use_preedit(context, use_preedit);
74 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
75 self->mock->gtk_im_context_set_surrounding(context,
text,
len, cursor_index);
81 FlMockIMContext*
self = FL_MOCK_IM_CONTEXT(context);
82 return self->mock->gtk_im_context_get_surrounding(context,
text,
87 GtkIMContextClass* im_context_class = GTK_IM_CONTEXT_CLASS(klass);
94 im_context_class->set_cursor_location =
104 FlMockIMContext*
self =
105 FL_MOCK_IM_CONTEXT(g_object_new(fl_mock_im_context_get_type(),
nullptr));
107 return GTK_IM_CONTEXT(
self);
110MockIMContext::~MockIMContext() {
111 if (FL_IS_MOCK_IM_CONTEXT(instance_)) {
112 g_clear_object(&instance_);
116MockIMContext::operator GtkIMContext*() {
117 if (instance_ ==
nullptr) {
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
static void fl_mock_im_context_set_use_preedit(GtkIMContext *context, gboolean use_preedit)
static void fl_mock_im_context_init(FlMockIMContext *self)
static gboolean fl_mock_im_context_filter_keypress(GtkIMContext *context, GdkEventKey *event)
static void fl_mock_im_context_focus_in(GtkIMContext *context)
static void fl_mock_im_context_get_preedit_string(GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos)
static GtkIMContext * fl_mock_im_context_new(MockIMContext *mock)
static void fl_mock_im_context_focus_out(GtkIMContext *context)
static gboolean fl_mock_im_context_get_surrounding(GtkIMContext *context, gchar **text, gint *cursor_index)
static void fl_mock_im_context_set_client_window(GtkIMContext *context, GdkWindow *window)
static void fl_mock_im_context_class_init(FlMockIMContextClass *klass)
static void fl_mock_im_context_set_surrounding(GtkIMContext *context, const gchar *text, gint len, gint cursor_index)
static void fl_mock_im_context_set_cursor_location(GtkIMContext *context, GdkRectangle *area)
static void fl_mock_im_context_reset(GtkIMContext *context)
G_DECLARE_FINAL_TYPE(FlMockIMContext, fl_mock_im_context, FL, MOCK_IM_CONTEXT, GtkIMContext) struct _FlMockIMContext