#include "flutter/shell/platform/linux/fl_platform_plugin.h"
#include <gtk/gtk.h>
#include <cstring>
#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_method_codec.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h"
Go to the source code of this file.
Classes | |
struct | _FlPlatformPlugin |
Functions | |
static void | send_response (FlMethodCall *method_call, FlMethodResponse *response) |
static void | clipboard_text_cb (GtkClipboard *clipboard, const gchar *text, gpointer user_data) |
static void | clipboard_text_has_strings_cb (GtkClipboard *clipboard, const gchar *text, gpointer user_data) |
static FlMethodResponse * | clipboard_set_data (FlPlatformPlugin *self, FlValue *args) |
static FlMethodResponse * | clipboard_get_data_async (FlPlatformPlugin *self, FlMethodCall *method_call) |
static FlMethodResponse * | clipboard_has_strings_async (FlPlatformPlugin *self, FlMethodCall *method_call) |
static gchar * | get_exit_response (FlMethodResponse *response) |
static void | quit_application () |
static void | request_app_exit_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
static void | request_app_exit (FlPlatformPlugin *self, const char *type) |
static FlMethodResponse * | system_intitialization_complete (FlPlatformPlugin *self, FlMethodCall *method_call) |
static FlMethodResponse * | system_exit_application (FlPlatformPlugin *self, FlMethodCall *method_call) |
static FlMethodResponse * | system_sound_play (FlPlatformPlugin *self, FlValue *args) |
static FlMethodResponse * | system_navigator_pop (FlPlatformPlugin *self) |
static void | method_call_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | fl_platform_plugin_dispose (GObject *object) |
static void | fl_platform_plugin_class_init (FlPlatformPluginClass *klass) |
static void | fl_platform_plugin_init (FlPlatformPlugin *self) |
FlPlatformPlugin * | fl_platform_plugin_new (FlBinaryMessenger *messenger) |
void | fl_platform_plugin_request_app_exit (FlPlatformPlugin *self) |
Variables | |
static constexpr char | kChannelName [] = "flutter/platform" |
static constexpr char | kBadArgumentsError [] = "Bad Arguments" |
static constexpr char | kUnknownClipboardFormatError [] |
static constexpr char | kInProgressError [] = "In Progress" |
static constexpr char | kGetClipboardDataMethod [] = "Clipboard.getData" |
static constexpr char | kSetClipboardDataMethod [] = "Clipboard.setData" |
static constexpr char | kClipboardHasStringsMethod [] = "Clipboard.hasStrings" |
static constexpr char | kExitApplicationMethod [] = "System.exitApplication" |
static constexpr char | kRequestAppExitMethod [] = "System.requestAppExit" |
static constexpr char | kInitializationCompleteMethod [] |
static constexpr char | kPlaySoundMethod [] = "SystemSound.play" |
static constexpr char | kSystemNavigatorPopMethod [] = "SystemNavigator.pop" |
static constexpr char | kTextKey [] = "text" |
static constexpr char | kValueKey [] = "value" |
static constexpr char | kExitTypeKey [] = "type" |
static constexpr char | kExitTypeCancelable [] = "cancelable" |
static constexpr char | kExitTypeRequired [] = "required" |
static constexpr char | kExitResponseKey [] = "response" |
static constexpr char | kExitResponseCancel [] = "cancel" |
static constexpr char | kExitResponseExit [] = "exit" |
static constexpr char | kTextPlainFormat [] = "text/plain" |
static constexpr char | kSoundTypeAlert [] = "SystemSoundType.alert" |
static constexpr char | kSoundTypeClick [] = "SystemSoundType.click" |
|
static |
Definition at line 119 of file fl_platform_plugin.cc.
References args, clipboard_text_cb(), fl_method_call_get_args(), fl_method_error_response_new(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, format, kBadArgumentsError, kTextPlainFormat, kUnknownClipboardFormatError, and method_call.
Referenced by method_call_cb().
|
static |
Definition at line 146 of file fl_platform_plugin.cc.
References clipboard_text_has_strings_cb(), and method_call.
Referenced by method_call_cb().
|
static |
Definition at line 97 of file fl_platform_plugin.cc.
References args, fl_method_error_response_new(), fl_method_success_response_new(), fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, kBadArgumentsError, and kTextKey.
Referenced by method_call_cb().
|
static |
Definition at line 64 of file fl_platform_plugin.cc.
References fl_method_success_response_new(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), kTextKey, method_call, result, send_response(), and user_data.
Referenced by clipboard_get_data_async().
|
static |
Definition at line 81 of file fl_platform_plugin.cc.
References fl_method_success_response_new(), fl_value_new_bool(), fl_value_new_map(), fl_value_set_string_take(), kValueKey, method_call, result, send_response(), and user_data.
Referenced by clipboard_has_strings_async().
|
static |
Definition at line 394 of file fl_platform_plugin.cc.
References fl_platform_plugin_dispose().
|
static |
Definition at line 382 of file fl_platform_plugin.cc.
Referenced by fl_platform_plugin_class_init().
|
static |
Definition at line 398 of file fl_platform_plugin.cc.
FlPlatformPlugin* fl_platform_plugin_new | ( | FlBinaryMessenger * | messenger | ) |
FlPlatformPlugin:
#FlPlatformPlugin is a plugin that implements the shell side of SystemChannels.platform from the Flutter services library. fl_platform_plugin_new: @messenger: an #FlBinaryMessenger
Creates a new plugin that implements SystemChannels.platform from the Flutter services library.
Returns: a new #FlPlatformPlugin
Definition at line 402 of file fl_platform_plugin.cc.
References fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), kChannelName, and method_call_cb().
Referenced by create_context_cb(), fl_test_application_activate(), and TEST().
void fl_platform_plugin_request_app_exit | ( | FlPlatformPlugin * | plugin | ) |
fl_platform_plugin_request_app_exit: @plugin: an #FlPlatformPlugin
Request the application exits (i.e. due to the window being requested to be closed).
Calling this will only send an exit request to the framework if the framework has already indicated that it is ready to receive requests by sending a "System.initializationComplete" method call on the platform channel. Calls before initialization is complete will result in an immediate exit.
Definition at line 418 of file fl_platform_plugin.cc.
References kExitTypeCancelable, and request_app_exit().
Referenced by G_DEFINE_TYPE_WITH_CODE().
|
static |
Definition at line 159 of file fl_platform_plugin.cc.
References error, fl_method_response_get_result(), fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, kExitResponseKey, and result.
Referenced by request_app_exit_response_cb().
|
static |
Definition at line 350 of file fl_platform_plugin.cc.
References args, clipboard_get_data_async(), clipboard_has_strings_async(), clipboard_set_data(), fl_method_call_get_args(), fl_method_call_get_name(), fl_method_not_implemented_response_new(), kClipboardHasStringsMethod, kExitApplicationMethod, kGetClipboardDataMethod, kInitializationCompleteMethod, kPlaySoundMethod, kSetClipboardDataMethod, kSystemNavigatorPopMethod, method_call, send_response(), system_exit_application(), system_intitialization_complete(), system_navigator_pop(), system_sound_play(), and user_data.
Referenced by fl_platform_plugin_new().
|
static |
Definition at line 184 of file fl_platform_plugin.cc.
Referenced by request_app_exit(), request_app_exit_response_cb(), system_exit_application(), and system_navigator_pop().
|
static |
Definition at line 253 of file fl_platform_plugin.cc.
References args, fl_method_channel_invoke_method(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), kExitTypeKey, kExitTypeRequired, kRequestAppExitMethod, quit_application(), request_app_exit_response_cb(), and type.
Referenced by fl_platform_plugin_request_app_exit(), and system_exit_application().
|
static |
Definition at line 206 of file fl_platform_plugin.cc.
References error, fl_method_call_respond(), fl_method_channel_invoke_method_finish(), fl_method_success_response_new(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), get_exit_response(), kExitResponseCancel, kExitResponseExit, kExitResponseKey, quit_application(), result, and user_data.
Referenced by request_app_exit().
|
static |
Definition at line 55 of file fl_platform_plugin.cc.
References error, fl_method_call_respond(), and method_call.
Referenced by clipboard_text_cb(), clipboard_text_has_strings_cb(), and method_call_cb().
|
static |
Definition at line 278 of file fl_platform_plugin.cc.
References args, fl_method_call_get_args(), fl_method_error_response_new(), fl_method_success_response_new(), fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, kBadArgumentsError, kExitResponseExit, kExitResponseKey, kExitTypeKey, kExitTypeRequired, kInProgressError, method_call, quit_application(), request_app_exit(), and type.
Referenced by method_call_cb().
|
static |
Definition at line 270 of file fl_platform_plugin.cc.
References fl_method_success_response_new(), and TRUE.
Referenced by method_call_cb().
|
static |
Definition at line 344 of file fl_platform_plugin.cc.
References fl_method_success_response_new(), and quit_application().
Referenced by method_call_cb().
|
static |
Definition at line 321 of file fl_platform_plugin.cc.
References args, fl_method_error_response_new(), fl_method_success_response_new(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, kBadArgumentsError, kSoundTypeAlert, kSoundTypeClick, and type.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 14 of file fl_platform_plugin.cc.
Referenced by clipboard_get_data_async(), clipboard_set_data(), system_exit_application(), and system_sound_play().
|
staticconstexpr |
Definition at line 13 of file fl_platform_plugin.cc.
Referenced by fl_platform_plugin_new().
|
staticconstexpr |
Definition at line 20 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 21 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 35 of file fl_platform_plugin.cc.
Referenced by request_app_exit_response_cb().
|
staticconstexpr |
Definition at line 36 of file fl_platform_plugin.cc.
Referenced by request_app_exit_response_cb(), and system_exit_application().
|
staticconstexpr |
Definition at line 34 of file fl_platform_plugin.cc.
Referenced by get_exit_response(), request_app_exit_response_cb(), and system_exit_application().
|
staticconstexpr |
Definition at line 31 of file fl_platform_plugin.cc.
Referenced by fl_platform_plugin_request_app_exit().
|
staticconstexpr |
Definition at line 30 of file fl_platform_plugin.cc.
Referenced by request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 32 of file fl_platform_plugin.cc.
Referenced by request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 18 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 23 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 17 of file fl_platform_plugin.cc.
Referenced by system_exit_application().
|
staticconstexpr |
Definition at line 25 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 22 of file fl_platform_plugin.cc.
Referenced by request_app_exit().
|
staticconstexpr |
Definition at line 19 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 40 of file fl_platform_plugin.cc.
Referenced by system_sound_play().
|
staticconstexpr |
Definition at line 41 of file fl_platform_plugin.cc.
Referenced by system_sound_play().
|
staticconstexpr |
Definition at line 26 of file fl_platform_plugin.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 27 of file fl_platform_plugin.cc.
Referenced by clipboard_set_data(), and clipboard_text_cb().
|
staticconstexpr |
Definition at line 38 of file fl_platform_plugin.cc.
Referenced by clipboard_get_data_async().
|
staticconstexpr |
Definition at line 15 of file fl_platform_plugin.cc.
Referenced by clipboard_get_data_async().
|
staticconstexpr |
Definition at line 28 of file fl_platform_plugin.cc.
Referenced by clipboard_text_has_strings_cb().