|
Flutter Linux Embedder
|
|
Go to the documentation of this file.
16 "Unknown Clipboard Format";
24 "System.initializationComplete";
52 G_DEFINE_TYPE(FlPlatformHandler, fl_platform_handler, G_TYPE_OBJECT)
56 FlMethodResponse* response) {
57 g_autoptr(GError)
error =
nullptr;
59 g_warning(
"Failed to send method call response: %s",
error->message);
70 if (text !=
nullptr) {
75 g_autoptr(FlMethodResponse) response =
91 g_autoptr(FlMethodResponse) response =
105 if (text_value ==
nullptr ||
111 GtkClipboard* clipboard =
112 gtk_clipboard_get_default(gdk_display_get_default());
135 GtkClipboard* clipboard =
136 gtk_clipboard_get_default(gdk_display_get_default());
147 FlPlatformHandler*
self,
149 GtkClipboard* clipboard =
150 gtk_clipboard_get_default(gdk_display_get_default());
160 if (response ==
nullptr) {
164 g_autoptr(GError)
error =
nullptr;
167 g_warning(
"Error returned from System.requestAppExit: %s",
error->message);
171 g_warning(
"System.requestAppExit result argument map missing or malformed");
177 g_warning(
"Invalid response from System.requestAppExit");
185 GApplication* app = g_application_get_default();
186 if (app ==
nullptr) {
194 if (GTK_IS_APPLICATION(app)) {
197 g_autoptr(GList) windows =
198 g_list_copy(gtk_application_get_windows(GTK_APPLICATION(app)));
199 for (GList* link = windows; link != NULL; link = link->next) {
200 GtkWidget* window = GTK_WIDGET(link->data);
201 gtk_window_set_application(GTK_WINDOW(window), NULL);
205 g_application_quit(app);
212 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
user_data);
214 g_autoptr(GError)
error =
nullptr;
215 g_autoptr(FlMethodResponse) method_response =
218 g_autofree gchar* exit_response =
nullptr;
219 if (method_response ==
nullptr) {
220 if (g_error_matches(
error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
223 g_warning(
"Failed to complete System.requestAppExit: %s",
error->message);
228 if (exit_response ==
nullptr) {
239 if (self->exit_application_method_call !=
nullptr) {
243 g_autoptr(FlMethodResponse) exit_response =
246 exit_response, &
error)) {
247 g_warning(
"Failed to send response to System.exitApplication: %s",
250 g_clear_object(&self->exit_application_method_call);
258 if (!self->app_initialization_complete ||
274 FlPlatformHandler*
self,
276 self->app_initialization_complete =
TRUE;
290 if (type_value ==
nullptr ||
298 if (self->exit_application_method_call !=
nullptr) {
302 self->exit_application_method_call =
307 if (!self->app_initialization_complete ||
333 GdkDisplay* display = gdk_display_get_default();
334 if (display !=
nullptr) {
335 gdk_display_beep(display);
340 g_warning(
"Ignoring unknown sound type %s in SystemSound.play.\n",
type);
356 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
user_data);
361 g_autoptr(FlMethodResponse) response =
nullptr;
380 if (response !=
nullptr) {
386 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
object);
388 g_cancellable_cancel(self->cancellable);
390 g_clear_object(&self->channel);
391 g_clear_object(&self->exit_application_method_call);
392 g_clear_object(&self->cancellable);
394 G_OBJECT_CLASS(fl_platform_handler_parent_class)->dispose(
object);
402 self->cancellable = g_cancellable_new();
406 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
408 FlPlatformHandler*
self = FL_PLATFORM_HANDLER(
409 g_object_new(fl_platform_handler_get_type(),
nullptr));
416 self->app_initialization_complete = FALSE;
422 g_return_if_fail(FL_IS_PLATFORM_HANDLER(
self));
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
typedefG_BEGIN_DECLS struct _FlValue FlValue
FlKeyEvent uint64_t FlKeyResponderAsyncCallback gpointer user_data
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
const G_MODULE_EXPORT gchar * fl_value_get_string(FlValue *self)
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
G_MODULE_EXPORT FlValue * fl_value_new_map()
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
const G_MODULE_EXPORT gchar * fl_method_call_get_name(FlMethodCall *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_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
uint32_t uint32_t * format
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)