Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
mock_gtk.cc File Reference
#include <dlfcn.h>
#include <gdk/gdkwayland.h>
#include <stdarg.h>
#include "flutter/shell/platform/linux/testing/mock_gtk.h"

Go to the source code of this file.

Classes

struct  _FlMockKeymap
 

Functions

static void fl_mock_keymap_class_init (FlMockKeymapClass *klass)
 
static void fl_mock_keymap_init (FlMockKeymap *self)
 
GType gdk_keymap_get_type ()
 
static void check_thread ()
 
GdkKeymap * gdk_keymap_get_for_display (GdkDisplay *display)
 
guint gdk_keymap_lookup_key (GdkKeymap *keymap, const GdkKeymapKey *key)
 
GdkDisplay * gdk_display_get_default ()
 
void gdk_display_beep (GdkDisplay *display)
 
int gdk_window_get_width (GdkWindow *window)
 
int gdk_window_get_height (GdkWindow *window)
 
gint gdk_window_get_scale_factor (GdkWindow *window)
 
GdkWindowState gdk_window_get_state (GdkWindow *window)
 
GdkDisplay * gdk_window_get_display (GdkWindow *window)
 
int gdk_display_get_n_monitors (GdkDisplay *display)
 
GdkMonitor * gdk_display_get_monitor (GdkDisplay *display, int n)
 
GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display, GdkWindow *window)
 
void gdk_monitor_get_geometry (GdkMonitor *monitor, GdkRectangle *geometry)
 
int gdk_monitor_get_refresh_rate (GdkMonitor *monitor)
 
int gdk_monitor_get_scale_factor (GdkMonitor *monitor)
 
GdkCursor * gdk_cursor_new_from_name (GdkDisplay *display, const gchar *name)
 
void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor)
 
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window, GError **error)
 
void gdk_cairo_set_source_rgba (cairo_t *cr, const GdkRGBA *rgba)
 
void gdk_gl_context_realize (GdkGLContext *context)
 
void gdk_gl_context_clear_current (GdkGLContext *context)
 
void gdk_gl_context_make_current (GdkGLContext *context)
 
void gdk_cairo_draw_from_gl (cairo_t *cr, GdkWindow *window, int source, int source_type, int buffer_scale, int x, int y, int width, int height)
 
GtkWidget * gtk_window_new (GtkWindowType type)
 
void gtk_window_set_default_size (GtkWindow *window, gint width, gint height)
 
void gtk_window_set_title (GtkWindow *window, const gchar *title)
 
void gtk_window_set_geometry_hints (GtkWindow *window, GtkWidget *widget, GdkGeometry *geometry, GdkWindowHints geometry_mask)
 
void gtk_window_resize (GtkWindow *window, gint width, gint height)
 
void gtk_window_maximize (GtkWindow *window)
 
void gtk_window_unmaximize (GtkWindow *window)
 
gboolean gtk_window_is_maximized (GtkWindow *window)
 
void gtk_window_iconify (GtkWindow *window)
 
void gtk_window_deiconify (GtkWindow *window)
 
void gtk_widget_add_events (GtkWidget *widget, gint events)
 
void gtk_widget_class_set_accessible_type (GtkWidget *widget, GType type)
 
void gtk_widget_get_allocation (GtkWidget *widget, GtkAllocation *allocation)
 
GdkDisplay * gtk_widget_get_display (GtkWidget *widget)
 
gint gtk_widget_get_scale_factor (GtkWidget *widget)
 
void gtk_widget_realize (GtkWidget *widget)
 
void gtk_widget_show (GtkWidget *widget)
 
void gtk_widget_queue_draw (GtkWidget *widget)
 
void gtk_widget_destroy (GtkWidget *widget)
 
void fl_gtk_widget_destroy (GtkWidget *widget)
 
gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget, GtkWidget *dest_widget, gint src_x, gint src_y, gint *dest_x, gint *dest_y)
 
GtkWidget * gtk_widget_get_toplevel (GtkWidget *widget)
 
GdkWindow * gtk_widget_get_window (GtkWidget *widget)
 
void gtk_im_context_set_client_window (GtkIMContext *context, GdkWindow *window)
 
void gtk_im_context_get_preedit_string (GtkIMContext *context, gchar **str, PangoAttrList **attrs, gint *cursor_pos)
 
gboolean gtk_im_context_filter_keypress (GtkIMContext *context, GdkEventKey *event)
 
void gtk_im_context_focus_in (GtkIMContext *context)
 
void gtk_im_context_focus_out (GtkIMContext *context)
 
void gtk_im_context_set_cursor_location (GtkIMContext *context, const GdkRectangle *area)
 
void gtk_im_context_set_surrounding (GtkIMContext *context, const gchar *text, gint len, gint cursor_index)
 
GtkClipboard * gtk_clipboard_get_default (GdkDisplay *display)
 
void gtk_clipboard_set_text (GtkClipboard *clipboard, const gchar *text, gint len)
 
void gtk_clipboard_request_text (GtkClipboard *clipboard, GtkClipboardTextReceivedFunc callback, gpointer user_data)
 
void atk_object_notify_state_change (AtkObject *accessible, AtkState state, gboolean value)
 
void g_object_set (gpointer object, const gchar *first_property_name,...)
 

Variables

static MockGtkmock = nullptr
 

Function Documentation

◆ atk_object_notify_state_change()

void atk_object_notify_state_change ( AtkObject *  accessible,
AtkState  state,
gboolean  value 
)

Definition at line 391 of file mock_gtk.cc.

393 {
394 check_thread();
395 if (mock != nullptr) {
396 mock->atk_object_notify_state_change(accessible, state, value);
397 }
398}
FlViewAccessible * accessible
static void check_thread()
Definition mock_gtk.cc:51
static MockGtk * mock
Definition mock_gtk.cc:33

References accessible, check_thread(), mock, and value.

Referenced by fl_accessible_node_set_flags_impl(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ check_thread()

static void check_thread ( )
static

Definition at line 51 of file mock_gtk.cc.

51 {
52 if (mock != nullptr) {
53 EXPECT_EQ(mock->thread, g_thread_self());
54 }
55}

References mock.

Referenced by atk_object_notify_state_change(), fl_gtk_widget_destroy(), g_object_set(), gdk_cairo_draw_from_gl(), gdk_cairo_set_source_rgba(), gdk_cursor_new_from_name(), gdk_display_beep(), gdk_display_get_default(), gdk_display_get_monitor(), gdk_display_get_monitor_at_window(), gdk_display_get_n_monitors(), gdk_gl_context_clear_current(), gdk_gl_context_make_current(), gdk_gl_context_realize(), gdk_keymap_get_for_display(), gdk_keymap_lookup_key(), gdk_monitor_get_geometry(), gdk_monitor_get_refresh_rate(), gdk_monitor_get_scale_factor(), gdk_window_create_gl_context(), gdk_window_get_display(), gdk_window_get_height(), gdk_window_get_scale_factor(), gdk_window_get_state(), gdk_window_get_width(), gdk_window_set_cursor(), gtk_clipboard_get_default(), gtk_clipboard_request_text(), gtk_clipboard_set_text(), gtk_im_context_filter_keypress(), gtk_im_context_focus_in(), gtk_im_context_focus_out(), gtk_im_context_get_preedit_string(), gtk_im_context_set_client_window(), gtk_im_context_set_cursor_location(), gtk_im_context_set_surrounding(), gtk_widget_add_events(), gtk_widget_class_set_accessible_type(), gtk_widget_destroy(), gtk_widget_get_allocation(), gtk_widget_get_display(), gtk_widget_get_scale_factor(), gtk_widget_get_toplevel(), gtk_widget_get_window(), gtk_widget_queue_draw(), gtk_widget_realize(), gtk_widget_show(), gtk_widget_translate_coordinates(), gtk_window_deiconify(), gtk_window_iconify(), gtk_window_is_maximized(), gtk_window_maximize(), gtk_window_new(), gtk_window_resize(), gtk_window_set_default_size(), gtk_window_set_geometry_hints(), gtk_window_set_title(), and gtk_window_unmaximize().

◆ fl_gtk_widget_destroy()

void fl_gtk_widget_destroy ( GtkWidget *  widget)

Definition at line 280 of file mock_gtk.cc.

280 {
281 check_thread();
282 void (*destroy)(GtkWidget*) = reinterpret_cast<void (*)(GtkWidget*)>(
283 dlsym(RTLD_NEXT, "gtk_widget_destroy"));
284 destroy(widget);
285}
int_closure destroy

References check_thread(), and destroy.

Referenced by TEST_F(), TEST_F(), and TEST_F().

◆ fl_mock_keymap_class_init()

static void fl_mock_keymap_class_init ( FlMockKeymapClass *  klass)
static

Definition at line 21 of file mock_gtk.cc.

21 {
22 g_signal_new("keys-changed", fl_mock_keymap_get_type(), G_SIGNAL_RUN_LAST, 0,
23 nullptr, nullptr, nullptr, G_TYPE_NONE, 0);
24}

◆ fl_mock_keymap_init()

static void fl_mock_keymap_init ( FlMockKeymap *  self)
static

Definition at line 26 of file mock_gtk.cc.

26{}

◆ g_object_set()

void g_object_set ( gpointer  object,
const gchar *  first_property_name,
  ... 
)

Definition at line 400 of file mock_gtk.cc.

400 {
401 check_thread();
402 if (first_property_name == nullptr) {
403 return;
404 }
405
406 va_list args;
407 va_start(args, first_property_name);
408
409 const gchar* name = first_property_name;
410 while (name != nullptr) {
411 // Extract the value (as gint, works for enums like GtkInputPurpose and
412 // GtkInputHints)
413 gint value = va_arg(args, gint);
414
415 // Check if this is a property we want to mock (input-purpose or
416 // input-hints)
417 if (mock != nullptr && (g_strcmp0(name, "input-purpose") == 0 ||
418 g_strcmp0(name, "input-hints") == 0)) {
419 mock->g_object_set(G_OBJECT(object), name, value);
420 }
421
422 // Get next property name (or nullptr to terminate)
423 name = va_arg(args, gchar*);
424 }
425
426 va_end(args);
427}
int32_t value
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const char * name
Definition fuchsia.cc:50

References args, check_thread(), mock, flutter::name, and value.

Referenced by configure(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ gdk_cairo_draw_from_gl()

void gdk_cairo_draw_from_gl ( cairo_t *  cr,
GdkWindow *  window,
int  source,
int  source_type,
int  buffer_scale,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 170 of file mock_gtk.cc.

178 {
179 check_thread();
180}

References check_thread().

Referenced by fl_compositor_opengl_render().

◆ gdk_cairo_set_source_rgba()

void gdk_cairo_set_source_rgba ( cairo_t *  cr,
const GdkRGBA *  rgba 
)

Definition at line 154 of file mock_gtk.cc.

154 {
155 check_thread();
156}

References check_thread().

Referenced by paint_background().

◆ gdk_cursor_new_from_name()

GdkCursor * gdk_cursor_new_from_name ( GdkDisplay *  display,
const gchar *  name 
)

Definition at line 140 of file mock_gtk.cc.

140 {
141 check_thread();
142 return nullptr;
143}

References check_thread().

Referenced by cursor_changed_cb().

◆ gdk_display_beep()

void gdk_display_beep ( GdkDisplay *  display)

Definition at line 75 of file mock_gtk.cc.

75 {
77}

References check_thread().

Referenced by system_sound_play().

◆ gdk_display_get_default()

GdkDisplay * gdk_display_get_default ( )

Definition at line 70 of file mock_gtk.cc.

70 {
72 return GDK_DISPLAY(g_object_new(gdk_wayland_display_get_type(), nullptr));
73}

References check_thread().

Referenced by clipboard_get_data(), clipboard_has_strings(), clipboard_set_data(), fl_engine_init(), fl_keyboard_manager_init(), fl_opengl_manager_init(), system_sound_play(), and TEST_F().

◆ gdk_display_get_monitor()

GdkMonitor * gdk_display_get_monitor ( GdkDisplay *  display,
int  n 
)

Definition at line 115 of file mock_gtk.cc.

115 {
116 check_thread();
117 return GDK_MONITOR(g_object_new(gdk_monitor_get_type(), nullptr));
118}

References check_thread().

Referenced by notify_display_update().

◆ gdk_display_get_monitor_at_window()

GdkMonitor * gdk_display_get_monitor_at_window ( GdkDisplay *  display,
GdkWindow *  window 
)

Definition at line 120 of file mock_gtk.cc.

121 {
122 check_thread();
123 return nullptr;
124}

References check_thread().

Referenced by handle_geometry_changed().

◆ gdk_display_get_n_monitors()

int gdk_display_get_n_monitors ( GdkDisplay *  display)

Definition at line 110 of file mock_gtk.cc.

110 {
111 check_thread();
112 return 1;
113}

References check_thread().

Referenced by notify_display_update().

◆ gdk_gl_context_clear_current()

void gdk_gl_context_clear_current ( GdkGLContext *  context)

Definition at line 162 of file mock_gtk.cc.

162 {
163 check_thread();
164}

References check_thread().

Referenced by fl_view_renderer_draw().

◆ gdk_gl_context_make_current()

void gdk_gl_context_make_current ( GdkGLContext *  context)

Definition at line 166 of file mock_gtk.cc.

166 {
167 check_thread();
168}

References check_thread().

Referenced by fl_view_renderer_draw().

◆ gdk_gl_context_realize()

void gdk_gl_context_realize ( GdkGLContext *  context)

Definition at line 158 of file mock_gtk.cc.

158 {
159 check_thread();
160}

References check_thread().

Referenced by setup_opengl().

◆ gdk_keymap_get_for_display()

GdkKeymap * gdk_keymap_get_for_display ( GdkDisplay *  display)

Definition at line 57 of file mock_gtk.cc.

57 {
59 FlMockKeymap* keymap =
60 FL_MOCK_KEYMAP(g_object_new(fl_mock_keymap_get_type(), nullptr));
61 (void)FL_IS_MOCK_KEYMAP(keymap);
62 return reinterpret_cast<GdkKeymap*>(keymap);
63}

References check_thread().

Referenced by fl_keyboard_manager_init().

◆ gdk_keymap_get_type()

GType gdk_keymap_get_type ( )

Definition at line 29 of file mock_gtk.cc.

29 {
30 return fl_mock_keymap_get_type();
31}

◆ gdk_keymap_lookup_key()

guint gdk_keymap_lookup_key ( GdkKeymap *  keymap,
const GdkKeymapKey *  key 
)

Definition at line 65 of file mock_gtk.cc.

65 {
67 return mock->gdk_keymap_lookup_key(keymap, key);
68}

References check_thread(), key, and mock.

Referenced by convert_key_to_char().

◆ gdk_monitor_get_geometry()

void gdk_monitor_get_geometry ( GdkMonitor *  monitor,
GdkRectangle *  geometry 
)

Definition at line 126 of file mock_gtk.cc.

126 {
127 check_thread();
128}

References check_thread().

Referenced by notify_display_update().

◆ gdk_monitor_get_refresh_rate()

int gdk_monitor_get_refresh_rate ( GdkMonitor *  monitor)

Definition at line 130 of file mock_gtk.cc.

130 {
131 check_thread();
132 return 60000;
133}

References check_thread().

Referenced by notify_display_update().

◆ gdk_monitor_get_scale_factor()

int gdk_monitor_get_scale_factor ( GdkMonitor *  monitor)

Definition at line 135 of file mock_gtk.cc.

135 {
136 check_thread();
137 return 1;
138}

References check_thread().

Referenced by notify_display_update().

◆ gdk_window_create_gl_context()

GdkGLContext * gdk_window_create_gl_context ( GdkWindow *  window,
GError **  error 
)

Definition at line 149 of file mock_gtk.cc.

149 {
150 check_thread();
151 return nullptr;
152}

References check_thread().

Referenced by setup_opengl().

◆ gdk_window_get_display()

GdkDisplay * gdk_window_get_display ( GdkWindow *  window)

Definition at line 105 of file mock_gtk.cc.

105 {
106 check_thread();
107 return GDK_DISPLAY(g_object_new(gdk_wayland_display_get_type(), nullptr));
108}

References check_thread().

Referenced by cursor_changed_cb().

◆ gdk_window_get_height()

int gdk_window_get_height ( GdkWindow *  window)

Definition at line 87 of file mock_gtk.cc.

87 {
89 if (mock == nullptr) {
90 return 100;
91 }
92 return mock->gdk_window_get_height(window);
93}
GLFWwindow * window
Definition main.cc:60

References check_thread(), mock, and window.

Referenced by fl_compositor_opengl_render(), fl_compositor_software_render(), flutter::testing::MockGtk::MockGtk(), and TEST_F().

◆ gdk_window_get_scale_factor()

gint gdk_window_get_scale_factor ( GdkWindow *  window)

Definition at line 95 of file mock_gtk.cc.

95 {
97 return 1;
98}

References check_thread().

Referenced by fl_compositor_opengl_render(), and fl_compositor_software_render().

◆ gdk_window_get_state()

GdkWindowState gdk_window_get_state ( GdkWindow *  window)

Definition at line 100 of file mock_gtk.cc.

100 {
101 check_thread();
102 return mock->gdk_window_get_state(window);
103}

References check_thread(), mock, and window.

Referenced by fl_window_state_monitor_new(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ gdk_window_get_width()

int gdk_window_get_width ( GdkWindow *  window)

Definition at line 79 of file mock_gtk.cc.

79 {
81 if (mock == nullptr) {
82 return 100;
83 }
84 return mock->gdk_window_get_width(window);
85}

References check_thread(), mock, and window.

Referenced by fl_compositor_opengl_render(), fl_compositor_software_render(), flutter::testing::MockGtk::MockGtk(), and TEST_F().

◆ gdk_window_set_cursor()

void gdk_window_set_cursor ( GdkWindow *  window,
GdkCursor *  cursor 
)

Definition at line 145 of file mock_gtk.cc.

145 {
146 check_thread();
147}

References check_thread().

Referenced by cursor_changed_cb().

◆ gtk_clipboard_get_default()

GtkClipboard * gtk_clipboard_get_default ( GdkDisplay *  display)

Definition at line 374 of file mock_gtk.cc.

374 {
375 check_thread();
376 return nullptr;
377}

References check_thread().

Referenced by clipboard_get_data(), clipboard_has_strings(), and clipboard_set_data().

◆ gtk_clipboard_request_text()

void gtk_clipboard_request_text ( GtkClipboard *  clipboard,
GtkClipboardTextReceivedFunc  callback,
gpointer  user_data 
)

Definition at line 385 of file mock_gtk.cc.

387 {
388 check_thread();
389}

References check_thread().

Referenced by clipboard_get_data(), and clipboard_has_strings().

◆ gtk_clipboard_set_text()

void gtk_clipboard_set_text ( GtkClipboard *  clipboard,
const gchar *  text,
gint  len 
)

Definition at line 379 of file mock_gtk.cc.

381 {
382 check_thread();
383}

References check_thread().

Referenced by clipboard_set_data().

◆ gtk_im_context_filter_keypress()

gboolean gtk_im_context_filter_keypress ( GtkIMContext *  context,
GdkEventKey *  event 
)

Definition at line 332 of file mock_gtk.cc.

333 {
334 check_thread();
335 if (mock == nullptr) {
336 return TRUE;
337 }
338
339 return mock->gtk_im_context_filter_keypress(context, event);
340}
return TRUE
std::shared_ptr< ContextGLES > context

References check_thread(), context, mock, and TRUE.

Referenced by fl_text_input_handler_filter_keypress().

◆ gtk_im_context_focus_in()

void gtk_im_context_focus_in ( GtkIMContext *  context)

Definition at line 342 of file mock_gtk.cc.

342 {
343 check_thread();
344 if (mock != nullptr) {
345 mock->gtk_im_context_focus_in(context);
346 }
347}

References check_thread(), context, and mock.

Referenced by show(), TEST_F(), and TEST_F().

◆ gtk_im_context_focus_out()

void gtk_im_context_focus_out ( GtkIMContext *  context)

Definition at line 349 of file mock_gtk.cc.

349 {
350 check_thread();
351 if (mock != nullptr) {
352 mock->gtk_im_context_focus_out(context);
353 }
354}

References check_thread(), context, and mock.

Referenced by fl_text_input_handler_new(), hide(), TEST_F(), and TEST_F().

◆ gtk_im_context_get_preedit_string()

void gtk_im_context_get_preedit_string ( GtkIMContext *  context,
gchar **  str,
PangoAttrList **  attrs,
gint *  cursor_pos 
)

Definition at line 322 of file mock_gtk.cc.

325 {
326 check_thread();
327 if (mock != nullptr) {
328 mock->gtk_im_context_get_preedit_string(context, str, attrs, cursor_pos);
329 }
330}

References check_thread(), context, and mock.

Referenced by im_preedit_changed_cb(), TEST_F(), and TEST_F().

◆ gtk_im_context_set_client_window()

void gtk_im_context_set_client_window ( GtkIMContext *  context,
GdkWindow *  window 
)

Definition at line 314 of file mock_gtk.cc.

315 {
316 check_thread();
317 if (mock != nullptr) {
318 mock->gtk_im_context_set_client_window(context, window);
319 }
320}

References check_thread(), context, mock, and window.

Referenced by fl_text_input_handler_set_widget().

◆ gtk_im_context_set_cursor_location()

void gtk_im_context_set_cursor_location ( GtkIMContext *  context,
const GdkRectangle *  area 
)

Definition at line 356 of file mock_gtk.cc.

357 {
358 check_thread();
359 if (mock != nullptr) {
360 mock->gtk_im_context_set_cursor_location(context, area);
361 }
362}

References check_thread(), context, and mock.

Referenced by TEST_F(), and update_im_cursor_position().

◆ gtk_im_context_set_surrounding()

void gtk_im_context_set_surrounding ( GtkIMContext *  context,
const gchar *  text,
gint  len,
gint  cursor_index 
)

Definition at line 364 of file mock_gtk.cc.

367 {
368 check_thread();
369 if (mock != nullptr) {
370 mock->gtk_im_context_set_surrounding(context, text, len, cursor_index);
371 }
372}
std::u16string text

References check_thread(), context, mock, and text.

Referenced by im_retrieve_surrounding_cb(), and TEST_F().

◆ gtk_widget_add_events()

void gtk_widget_add_events ( GtkWidget *  widget,
gint  events 
)

Definition at line 237 of file mock_gtk.cc.

237 {
238 check_thread();
239}

References check_thread().

Referenced by fl_view_init().

◆ gtk_widget_class_set_accessible_type()

void gtk_widget_class_set_accessible_type ( GtkWidget *  widget,
GType  type 
)

Definition at line 241 of file mock_gtk.cc.

241 {
242 check_thread();
243}

References check_thread().

Referenced by fl_view_class_init().

◆ gtk_widget_destroy()

void gtk_widget_destroy ( GtkWidget *  widget)

Definition at line 275 of file mock_gtk.cc.

275 {
276 check_thread();
277 mock->gtk_widget_destroy(widget);
278}

References check_thread(), and mock.

◆ gtk_widget_get_allocation()

void gtk_widget_get_allocation ( GtkWidget *  widget,
GtkAllocation *  allocation 
)

Definition at line 245 of file mock_gtk.cc.

245 {
246 check_thread();
247 allocation->x = 0;
248 allocation->y = 0;
249 allocation->width = 100;
250 allocation->height = 100;
251}

References check_thread().

Referenced by handle_geometry_changed(), and redraw_cb().

◆ gtk_widget_get_display()

GdkDisplay * gtk_widget_get_display ( GtkWidget *  widget)

Definition at line 253 of file mock_gtk.cc.

253 {
254 check_thread();
255 return nullptr;
256}

References check_thread().

Referenced by handle_geometry_changed(), and setup_opengl().

◆ gtk_widget_get_scale_factor()

◆ gtk_widget_get_toplevel()

GtkWidget * gtk_widget_get_toplevel ( GtkWidget *  widget)

Definition at line 304 of file mock_gtk.cc.

304 {
305 check_thread();
306 return widget;
307}

References check_thread().

Referenced by cursor_changed_cb(), handle_geometry_changed(), realize_cb(), redraw_cb(), and update_im_cursor_position().

◆ gtk_widget_get_window()

GdkWindow * gtk_widget_get_window ( GtkWidget *  widget)

◆ gtk_widget_queue_draw()

void gtk_widget_queue_draw ( GtkWidget *  widget)

Definition at line 271 of file mock_gtk.cc.

271 {
272 check_thread();
273}

References check_thread().

Referenced by redraw_cb().

◆ gtk_widget_realize()

void gtk_widget_realize ( GtkWidget *  widget)

Definition at line 263 of file mock_gtk.cc.

263 {
264 check_thread();
265}

References check_thread().

Referenced by fl_application_activate(), and fl_view_realize().

◆ gtk_widget_show()

void gtk_widget_show ( GtkWidget *  widget)

◆ gtk_widget_translate_coordinates()

gboolean gtk_widget_translate_coordinates ( GtkWidget *  src_widget,
GtkWidget *  dest_widget,
gint  src_x,
gint  src_y,
gint *  dest_x,
gint *  dest_y 
)

Definition at line 287 of file mock_gtk.cc.

292 {
293 check_thread();
294 if (mock == nullptr) {
295 *dest_x = src_x;
296 *dest_y = src_y;
297 return TRUE;
298 }
299
300 return mock->gtk_widget_translate_coordinates(src_widget, dest_widget, src_x,
301 src_y, dest_x, dest_y);
302}

References check_thread(), mock, and TRUE.

Referenced by TEST_F(), TEST_F(), and update_im_cursor_position().

◆ gtk_window_deiconify()

void gtk_window_deiconify ( GtkWindow *  window)

Definition at line 232 of file mock_gtk.cc.

232 {
233 check_thread();
234 mock->gtk_window_deiconify(window);
235}

References check_thread(), mock, and window.

◆ gtk_window_iconify()

void gtk_window_iconify ( GtkWindow *  window)

Definition at line 227 of file mock_gtk.cc.

227 {
228 check_thread();
229 mock->gtk_window_iconify(window);
230}

References check_thread(), mock, and window.

◆ gtk_window_is_maximized()

gboolean gtk_window_is_maximized ( GtkWindow *  window)

Definition at line 222 of file mock_gtk.cc.

222 {
223 check_thread();
224 return mock->gtk_window_is_maximized(window);
225}

References check_thread(), mock, and window.

◆ gtk_window_maximize()

void gtk_window_maximize ( GtkWindow *  window)

Definition at line 212 of file mock_gtk.cc.

212 {
213 check_thread();
214 mock->gtk_window_maximize(window);
215}

References check_thread(), mock, and window.

◆ gtk_window_new()

GtkWidget * gtk_window_new ( GtkWindowType  type)

Definition at line 182 of file mock_gtk.cc.

182 {
183 check_thread();
184 GtkWindow* window = GTK_WINDOW(g_object_new(gtk_window_get_type(), nullptr));
185 mock->gtk_window_new(window, type);
186 return GTK_WIDGET(window);
187}
impeller::ShaderType type

References check_thread(), mock, type, and window.

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ gtk_window_resize()

void gtk_window_resize ( GtkWindow *  window,
gint  width,
gint  height 
)

Definition at line 207 of file mock_gtk.cc.

207 {
208 check_thread();
209 mock->gtk_window_resize(window, width, height);
210}
int32_t height
int32_t width

References check_thread(), height, mock, width, and window.

Referenced by redraw_cb().

◆ gtk_window_set_default_size()

void gtk_window_set_default_size ( GtkWindow *  window,
gint  width,
gint  height 
)

Definition at line 189 of file mock_gtk.cc.

189 {
190 check_thread();
191 mock->gtk_window_set_default_size(window, width, height);
192}

References check_thread(), height, mock, width, and window.

◆ gtk_window_set_geometry_hints()

void gtk_window_set_geometry_hints ( GtkWindow *  window,
GtkWidget *  widget,
GdkGeometry *  geometry,
GdkWindowHints  geometry_mask 
)

Definition at line 199 of file mock_gtk.cc.

202 {
203 check_thread();
204 mock->gtk_window_set_geometry_hints(window, widget, geometry, geometry_mask);
205}

References check_thread(), mock, and window.

◆ gtk_window_set_title()

void gtk_window_set_title ( GtkWindow *  window,
const gchar *  title 
)

Definition at line 194 of file mock_gtk.cc.

194 {
195 check_thread();
196 mock->gtk_window_set_title(window, title);
197}

References check_thread(), mock, and window.

◆ gtk_window_unmaximize()

void gtk_window_unmaximize ( GtkWindow *  window)

Definition at line 217 of file mock_gtk.cc.

217 {
218 check_thread();
219 mock->gtk_window_unmaximize(window);
220}

References check_thread(), mock, and window.

Variable Documentation

◆ mock

MockGtk* mock = nullptr
static

Definition at line 33 of file mock_gtk.cc.