28 G_DEFINE_TYPE(FlMouseCursorHandler, fl_mouse_cursor_handler, G_TYPE_OBJECT)
36 return g_hash_table_insert(
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 =
reinterpret_cast<const gchar*
>(
95 g_hash_table_lookup(self->system_cursor_table, kind));
96 if (cursor_name ==
nullptr) {
100 g_free(self->cursor_name);
101 self->cursor_name = g_strdup(cursor_name);
108 FlMouseCursorHandler*
self = FL_MOUSE_CURSOR_HANDLER(
object);
110 g_clear_object(&self->channel);
111 g_clear_pointer(&self->system_cursor_table, g_hash_table_unref);
112 g_clear_pointer(&self->cursor_name, g_free);
114 G_OBJECT_CLASS(fl_mouse_cursor_handler_parent_class)->dispose(
object);
118 FlMouseCursorHandlerClass* klass) {
122 g_signal_new(
"cursor-changed", fl_mouse_cursor_handler_get_type(),
123 G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
127 self->cursor_name = g_strdup(
"");
135 FlBinaryMessenger* messenger) {
136 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
138 FlMouseCursorHandler*
self = FL_MOUSE_CURSOR_HANDLER(
139 g_object_new(fl_mouse_cursor_handler_get_type(),
nullptr));
148 FlMouseCursorHandler*
self) {
149 g_return_val_if_fail(FL_IS_MOUSE_CURSOR_HANDLER(
self),
nullptr);
150 return self->cursor_name;