#include "flutter/shell/platform/linux/fl_platform_handler.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 | _FlPlatformHandler |
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 (FlPlatformHandler *self, FlValue *args) |
static FlMethodResponse * | clipboard_get_data_async (FlPlatformHandler *self, FlMethodCall *method_call) |
static FlMethodResponse * | clipboard_has_strings_async (FlPlatformHandler *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 (FlPlatformHandler *self, const char *type) |
static FlMethodResponse * | system_intitialization_complete (FlPlatformHandler *self, FlMethodCall *method_call) |
static FlMethodResponse * | system_exit_application (FlPlatformHandler *self, FlMethodCall *method_call) |
static FlMethodResponse * | system_sound_play (FlPlatformHandler *self, FlValue *args) |
static FlMethodResponse * | system_navigator_pop (FlPlatformHandler *self) |
static void | method_call_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | fl_platform_handler_dispose (GObject *object) |
static void | fl_platform_handler_class_init (FlPlatformHandlerClass *klass) |
static void | fl_platform_handler_init (FlPlatformHandler *self) |
FlPlatformHandler * | fl_platform_handler_new (FlBinaryMessenger *messenger) |
void | fl_platform_handler_request_app_exit (FlPlatformHandler *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_handler.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_handler.cc.
References clipboard_text_has_strings_cb(), and method_call.
Referenced by method_call_cb().
|
static |
Definition at line 97 of file fl_platform_handler.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_handler.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_handler.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 397 of file fl_platform_handler.cc.
References fl_platform_handler_dispose().
|
static |
Definition at line 385 of file fl_platform_handler.cc.
Referenced by fl_platform_handler_class_init().
|
static |
Definition at line 401 of file fl_platform_handler.cc.
FlPlatformHandler* fl_platform_handler_new | ( | FlBinaryMessenger * | messenger | ) |
FlPlatformHandler:
#FlPlatformHandler is a handler that implements the shell side of SystemChannels.platform from the Flutter services library. fl_platform_handler_new: @messenger: an #FlBinaryMessenger
Creates a new handler that implements SystemChannels.platform from the Flutter services library.
Returns: a new #FlPlatformHandler
Definition at line 405 of file fl_platform_handler.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_handler_request_app_exit | ( | FlPlatformHandler * | handler | ) |
fl_platform_handler_request_app_exit: @handler: an #FlPlatformHandler
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 421 of file fl_platform_handler.cc.
References kExitTypeCancelable, and request_app_exit().
Referenced by window_delete_event_cb().
|
static |
Definition at line 159 of file fl_platform_handler.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 353 of file fl_platform_handler.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_handler_new().
|
static |
Definition at line 184 of file fl_platform_handler.cc.
Referenced by request_app_exit(), request_app_exit_response_cb(), system_exit_application(), and system_navigator_pop().
|
static |
Definition at line 256 of file fl_platform_handler.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_handler_request_app_exit(), and system_exit_application().
|
static |
Definition at line 209 of file fl_platform_handler.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_handler.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 281 of file fl_platform_handler.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 273 of file fl_platform_handler.cc.
References fl_method_success_response_new(), and TRUE.
Referenced by method_call_cb().
|
static |
Definition at line 347 of file fl_platform_handler.cc.
References fl_method_success_response_new(), and quit_application().
Referenced by method_call_cb().
|
static |
Definition at line 324 of file fl_platform_handler.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_handler.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_handler.cc.
Referenced by fl_platform_handler_new().
|
staticconstexpr |
Definition at line 20 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 21 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 35 of file fl_platform_handler.cc.
Referenced by request_app_exit_response_cb().
|
staticconstexpr |
Definition at line 36 of file fl_platform_handler.cc.
Referenced by request_app_exit_response_cb(), and system_exit_application().
|
staticconstexpr |
Definition at line 34 of file fl_platform_handler.cc.
Referenced by get_exit_response(), request_app_exit_response_cb(), and system_exit_application().
|
staticconstexpr |
Definition at line 31 of file fl_platform_handler.cc.
Referenced by fl_platform_handler_request_app_exit().
|
staticconstexpr |
Definition at line 30 of file fl_platform_handler.cc.
Referenced by request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 32 of file fl_platform_handler.cc.
Referenced by request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 18 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 23 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 17 of file fl_platform_handler.cc.
Referenced by system_exit_application().
|
staticconstexpr |
Definition at line 25 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 22 of file fl_platform_handler.cc.
Referenced by request_app_exit().
|
staticconstexpr |
Definition at line 19 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 40 of file fl_platform_handler.cc.
Referenced by system_sound_play().
|
staticconstexpr |
Definition at line 41 of file fl_platform_handler.cc.
Referenced by system_sound_play().
|
staticconstexpr |
Definition at line 26 of file fl_platform_handler.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 27 of file fl_platform_handler.cc.
Referenced by clipboard_set_data(), and clipboard_text_cb().
|
staticconstexpr |
Definition at line 38 of file fl_platform_handler.cc.
Referenced by clipboard_get_data_async().
|
staticconstexpr |
Definition at line 15 of file fl_platform_handler.cc.
Referenced by clipboard_get_data_async().
|
staticconstexpr |
Definition at line 28 of file fl_platform_handler.cc.
Referenced by clipboard_text_has_strings_cb().