28G_DEFINE_TYPE(FlMouseCursorHandler, fl_mouse_cursor_handler, G_TYPE_OBJECT)
37 table,
reinterpret_cast<gpointer
>(
const_cast<gchar*
>(
key)),
38 reinterpret_cast<gpointer
>(
const_cast<gchar*
>(
value)));
87 FlMouseCursorHandler*
self = FL_MOUSE_CURSOR_HANDLER(
user_data);
89 if (
self->system_cursor_table ==
nullptr) {
90 self->system_cursor_table = g_hash_table_new(g_str_hash, g_str_equal);
94 const gchar* cursor_name =
95 kind !=
nullptr ?
reinterpret_cast<const gchar*
>(g_hash_table_lookup(
96 self->system_cursor_table, kind))
98 if (cursor_name ==
nullptr) {
102 g_free(
self->cursor_name);
103 self->cursor_name = g_strdup(cursor_name);
110 FlMouseCursorHandler*
self = FL_MOUSE_CURSOR_HANDLER(
object);
112 g_clear_object(&
self->channel);
113 g_clear_pointer(&
self->system_cursor_table, g_hash_table_unref);
114 g_clear_pointer(&
self->cursor_name, g_free);
116 G_OBJECT_CLASS(fl_mouse_cursor_handler_parent_class)->dispose(
object);
120 FlMouseCursorHandlerClass* klass) {
124 g_signal_new(
"cursor-changed", fl_mouse_cursor_handler_get_type(),
125 G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
129 self->cursor_name = g_strdup(
"");
137 FlBinaryMessenger* messenger) {
138 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
140 FlMouseCursorHandler*
self = FL_MOUSE_CURSOR_HANDLER(
141 g_object_new(fl_mouse_cursor_handler_get_type(),
nullptr));
150 FlMouseCursorHandler*
self) {
151 g_return_val_if_fail(FL_IS_MOUSE_CURSOR_HANDLER(
self),
nullptr);
152 return self->cursor_name;
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
g_hash_table_insert(self->handlers, g_strdup(channel), handler_new(handler, user_data, destroy_notify))
FlMouseCursorChannel * fl_mouse_cursor_channel_new(FlBinaryMessenger *messenger, FlMouseCursorChannelVTable *vtable, gpointer user_data)
static void populate_system_cursor_table(GHashTable *table)
static void activate_system_cursor(const gchar *kind, gpointer user_data)
static void fl_mouse_cursor_handler_init(FlMouseCursorHandler *self)
const gchar * fl_mouse_cursor_handler_get_cursor_name(FlMouseCursorHandler *self)
static constexpr char kFallbackCursor[]
static void fl_mouse_cursor_handler_class_init(FlMouseCursorHandlerClass *klass)
FlMouseCursorHandler * fl_mouse_cursor_handler_new(FlBinaryMessenger *messenger)
static guint fl_mouse_cursor_handler_signals[LAST_SIGNAL]
static bool define_system_cursor(GHashTable *table, const gchar *key, const gchar *value)
static FlMouseCursorChannelVTable mouse_cursor_vtable
static void fl_mouse_cursor_handler_dispose(GObject *object)
GHashTable * system_cursor_table
FlMouseCursorChannel * channel
void(* activate_system_cursor)(const gchar *kind, gpointer user_data)