 |
Flutter Linux Embedder
|
|
Go to the documentation of this file.
16 "Unknown Clipboard Format";
24 "System.initializationComplete";
52 G_DEFINE_TYPE(FlPlatformPlugin, fl_platform_plugin, 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 FlPlatformPlugin*
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) {
190 g_application_quit(app);
198 FlPlatformPlugin*
self = FL_PLATFORM_PLUGIN(
user_data);
200 g_autoptr(GError)
error =
nullptr;
201 g_autoptr(FlMethodResponse) method_response =
204 g_autofree gchar* exit_response =
nullptr;
205 if (method_response ==
nullptr) {
206 if (g_error_matches(
error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
209 g_warning(
"Failed to complete System.requestAppExit: %s",
error->message);
214 if (exit_response ==
nullptr) {
225 if (
self->exit_application_method_call !=
nullptr) {
229 g_autoptr(FlMethodResponse) exit_response =
232 exit_response, &
error)) {
233 g_warning(
"Failed to send response to System.exitApplication: %s",
236 g_clear_object(&
self->exit_application_method_call);
244 if (!
self->app_initialization_complete ||
260 FlPlatformPlugin*
self,
262 self->app_initialization_complete =
TRUE;
276 if (type_value ==
nullptr ||
284 if (
self->exit_application_method_call !=
nullptr) {
288 self->exit_application_method_call =
293 if (!
self->app_initialization_complete ||
319 GdkDisplay* display = gdk_display_get_default();
320 if (display !=
nullptr) {
321 gdk_display_beep(display);
326 g_warning(
"Ignoring unknown sound type %s in SystemSound.play.\n", type);
342 FlPlatformPlugin*
self = FL_PLATFORM_PLUGIN(
user_data);
347 g_autoptr(FlMethodResponse) response =
nullptr;
366 if (response !=
nullptr) {
372 FlPlatformPlugin*
self = FL_PLATFORM_PLUGIN(
object);
374 g_cancellable_cancel(
self->cancellable);
376 g_clear_object(&
self->channel);
377 g_clear_object(&
self->exit_application_method_call);
378 g_clear_object(&
self->cancellable);
380 G_OBJECT_CLASS(fl_platform_plugin_parent_class)->dispose(
object);
388 self->cancellable = g_cancellable_new();
392 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
394 FlPlatformPlugin*
self =
395 FL_PLATFORM_PLUGIN(g_object_new(fl_platform_plugin_get_type(),
nullptr));
402 self->app_initialization_complete = FALSE;
408 g_return_if_fail(FL_IS_PLATFORM_PLUGIN(
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)