28G_DEFINE_TYPE(FlWindowMonitor, fl_window_monitor, G_TYPE_OBJECT)
31 GdkEventConfigure* event) {
39 GdkEventWindowState* event) {
41 self->on_state_changed();
48 self->on_is_active_notify();
53 self->on_title_notify();
70 FlWindowMonitor*
self = FL_WINDOW_MONITOR(
object);
74 g_signal_handlers_disconnect_by_data(
self->window,
self);
75 g_clear_object(&
self->window);
77 G_OBJECT_CLASS(fl_window_monitor_parent_class)->dispose(
object);
88 void (*on_configure)(
void),
89 void (*on_state_changed)(
void),
90 void (*on_is_active_notify)(
void),
91 void (*on_title_notify)(
void),
92 void (*on_close)(
void),
93 void (*on_destroy)(
void)) {
94 FlWindowMonitor*
self =
95 FL_WINDOW_MONITOR(g_object_new(fl_window_monitor_get_type(),
nullptr));
97 self->window = GTK_WINDOW(g_object_ref(
window));
99 self->on_configure = on_configure;
100 self->on_state_changed = on_state_changed;
101 self->on_is_active_notify = on_is_active_notify;
102 self->on_title_notify = on_title_notify;
103 self->on_close = on_close;
104 self->on_destroy = on_destroy;
105 g_signal_connect_swapped(
window,
"configure-event",
107 g_signal_connect_swapped(
window,
"window-state-event",
109 g_signal_connect_swapped(
window,
"notify::is-active",
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 destroy_cb(FlWindowMonitor *self)
static void is_active_notify_cb(FlWindowMonitor *self)
static void fl_window_monitor_dispose(GObject *object)
static void fl_window_monitor_class_init(FlWindowMonitorClass *klass)
static void title_notify_cb(FlWindowMonitor *self)
G_MODULE_EXPORT FlWindowMonitor * fl_window_monitor_new(GtkWindow *window, void(*on_configure)(void), void(*on_state_changed)(void), void(*on_is_active_notify)(void), void(*on_title_notify)(void), void(*on_close)(void), void(*on_destroy)(void))
static gboolean configure_event_cb(FlWindowMonitor *self, GdkEventConfigure *event)
static gboolean window_state_event_cb(FlWindowMonitor *self, GdkEventWindowState *event)
static void fl_window_monitor_init(FlWindowMonitor *self)
static gboolean delete_event_cb(FlWindowMonitor *self, GdkEvent *event)
void(* on_title_notify)(void)
void(* on_state_changed)(void)
void(* on_is_active_notify)(void)
void(* on_configure)(void)