15 "Unknown Clipboard Format";
35 G_DEFINE_TYPE(FlPlatformHandler, fl_platform_handler, G_TYPE_OBJECT)
58 GtkClipboard* clipboard =
59 gtk_clipboard_get_default(gdk_display_get_default());
60 gtk_clipboard_set_text(clipboard, text, -1);
75 GtkClipboard* clipboard =
76 gtk_clipboard_get_default(gdk_display_get_default());
88 GtkClipboard* clipboard =
89 gtk_clipboard_get_default(gdk_display_get_default());
99 GApplication* app = g_application_get_default();
100 if (app ==
nullptr) {
108 if (GTK_IS_APPLICATION(app)) {
111 g_autoptr(GList) windows =
112 g_list_copy(gtk_application_get_windows(GTK_APPLICATION(app)));
113 for (GList* link = windows; link != NULL; link = link->next) {
114 GtkWidget*
window = GTK_WIDGET(link->data);
115 gtk_window_set_application(GTK_WINDOW(
window), NULL);
119 g_application_quit(app);
124 GAsyncResult* result,
126 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
user_data);
128 g_autoptr(GError)
error =
nullptr;
131 object, result, &exit_response, &
error)) {
132 if (g_error_matches(
error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
135 g_warning(
"Failed to complete System.requestAppExit: %s",
error->message);
145 if (self->exit_application_method_call !=
nullptr) {
147 self->exit_application_method_call, exit_response);
155 if (!self->app_initialization_complete ||
170 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
user_data);
171 self->app_initialization_complete =
TRUE;
178 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
user_data);
180 if (self->exit_application_method_call !=
nullptr) {
184 self->exit_application_method_call =
189 if (!self->app_initialization_complete ||
206 GdkDisplay* display = gdk_display_get_default();
207 if (display !=
nullptr) {
208 gdk_display_beep(display);
215 g_warning(
"Ignoring unknown sound type %s in SystemSound.play.\n",
type);
225 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
object);
227 g_cancellable_cancel(self->cancellable);
229 g_clear_object(&self->channel);
230 g_clear_object(&self->exit_application_method_call);
231 g_clear_object(&self->cancellable);
233 G_OBJECT_CLASS(fl_platform_handler_parent_class)->dispose(
object);
241 self->cancellable = g_cancellable_new();
255 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
257 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
258 g_object_new(fl_platform_handler_get_type(),
nullptr));
262 self->app_initialization_complete = FALSE;
268 g_return_if_fail(FL_IS_PLATFORM_HANDLER(
self));
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_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format