#include "flutter/shell/platform/linux/fl_platform_channel.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 | _FlPlatformChannel |
Functions | |
static FlMethodResponse * | clipboard_set_data (FlPlatformChannel *self, FlMethodCall *method_call) |
static FlMethodResponse * | clipboard_get_data (FlPlatformChannel *self, FlMethodCall *method_call) |
static FlMethodResponse * | clipboard_has_strings (FlPlatformChannel *self, FlMethodCall *method_call) |
FlPlatformChannelExitResponse | get_exit_response (FlMethodResponse *response) |
static FlMethodResponse * | system_exit_application (FlPlatformChannel *self, FlMethodCall *method_call) |
static FlMethodResponse * | system_initialization_complete (FlPlatformChannel *self) |
static FlMethodResponse * | system_sound_play (FlPlatformChannel *self, FlValue *args) |
static FlMethodResponse * | system_navigator_pop (FlPlatformChannel *self) |
static void | method_call_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | fl_platform_channel_dispose (GObject *object) |
static void | fl_platform_channel_class_init (FlPlatformChannelClass *klass) |
static void | fl_platform_channel_init (FlPlatformChannel *self) |
FlPlatformChannel * | fl_platform_channel_new (FlBinaryMessenger *messenger, FlPlatformChannelVTable *vtable, gpointer user_data) |
void | fl_platform_channel_system_request_app_exit (FlPlatformChannel *self, FlPlatformChannelExitType type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) |
gboolean | fl_platform_channel_system_request_app_exit_finish (GObject *object, GAsyncResult *result, FlPlatformChannelExitResponse *exit_response, GError **error) |
void | fl_platform_channel_respond_clipboard_get_data (FlMethodCall *method_call, const gchar *text) |
void | fl_platform_channel_respond_clipboard_has_strings (FlMethodCall *method_call, gboolean has_strings) |
void | fl_platform_channel_respond_system_exit_application (FlMethodCall *method_call, FlPlatformChannelExitResponse exit_response) |
FlMethodResponse * | fl_platform_channel_make_system_request_app_exit_response (FlPlatformChannelExitResponse exit_response) |
Variables | |
static constexpr char | kChannelName [] = "flutter/platform" |
static constexpr char | kBadArgumentsError [] = "Bad Arguments" |
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 |
Definition at line 68 of file fl_platform_channel.cc.
References args, fl_method_call_get_args(), fl_method_error_response_new(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, format, kBadArgumentsError, and method_call.
Referenced by method_call_cb().
|
static |
Definition at line 81 of file fl_platform_channel.cc.
References method_call.
Referenced by method_call_cb().
|
static |
Definition at line 48 of file fl_platform_channel.cc.
References args, fl_method_call_get_args(), fl_method_error_response_new(), fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, kBadArgumentsError, kTextKey, and method_call.
Referenced by method_call_cb().
|
static |
Definition at line 216 of file fl_platform_channel.cc.
References fl_platform_channel_dispose().
|
static |
Definition at line 208 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_class_init().
|
static |
Definition at line 220 of file fl_platform_channel.cc.
FlMethodResponse* fl_platform_channel_make_system_request_app_exit_response | ( | FlPlatformChannelExitResponse | exit_response | ) |
Definition at line 330 of file fl_platform_channel.cc.
References fl_method_success_response_new(), FL_PLATFORM_CHANNEL_EXIT_RESPONSE_CANCEL, FL_PLATFORM_CHANNEL_EXIT_RESPONSE_EXIT, fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), kExitResponseCancel, kExitResponseExit, and kExitResponseKey.
Referenced by fl_platform_channel_respond_system_exit_application(), and system_exit_application().
FlPlatformChannel* fl_platform_channel_new | ( | FlBinaryMessenger * | messenger, |
FlPlatformChannelVTable * | vtable, | ||
gpointer | user_data | ||
) |
fl_platform_channel_new: @messenger: an #FlBinaryMessenger @vtable: callbacks for incoming method calls. @user_data: data to pass in callbacks.
Creates a new channel that implements SystemChannels.platform from the Flutter services library.
Returns: a new #FlPlatformChannel
Definition at line 222 of file fl_platform_channel.cc.
References fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), kChannelName, method_call_cb(), and user_data.
Referenced by fl_platform_handler_new(), and TEST().
void fl_platform_channel_respond_clipboard_get_data | ( | FlMethodCall * | method_call, |
const gchar * | text | ||
) |
Definition at line 284 of file fl_platform_channel.cc.
References error, fl_method_call_respond(), fl_method_success_response_new(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), kGetClipboardDataMethod, kTextKey, and method_call.
Referenced by clipboard_text_cb().
void fl_platform_channel_respond_clipboard_has_strings | ( | FlMethodCall * | method_call, |
gboolean | has_strings | ||
) |
Definition at line 302 of file fl_platform_channel.cc.
References error, fl_method_call_respond(), fl_method_success_response_new(), fl_value_new_bool(), fl_value_new_map(), fl_value_set_string_take(), kClipboardHasStringsMethod, kValueKey, and method_call.
Referenced by clipboard_text_has_strings_cb().
void fl_platform_channel_respond_system_exit_application | ( | FlMethodCall * | method_call, |
FlPlatformChannelExitResponse | exit_response | ||
) |
Definition at line 318 of file fl_platform_channel.cc.
References error, fl_method_call_respond(), fl_platform_channel_make_system_request_app_exit_response(), and method_call.
Referenced by request_app_exit_response_cb().
void fl_platform_channel_system_request_app_exit | ( | FlPlatformChannel * | channel, |
FlPlatformChannelExitType | type, | ||
GCancellable * | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | user_data | ||
) |
fl_platform_channel_system_request_app_exit: @channel: an #FlPlatformChannel
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 243 of file fl_platform_channel.cc.
References args, fl_method_channel_invoke_method(), FL_PLATFORM_CHANNEL_EXIT_TYPE_CANCELABLE, FL_PLATFORM_CHANNEL_EXIT_TYPE_REQUIRED, fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), kExitTypeCancelable, kExitTypeKey, kExitTypeRequired, kRequestAppExitMethod, type, and user_data.
Referenced by request_app_exit(), and TEST().
gboolean fl_platform_channel_system_request_app_exit_finish | ( | GObject * | object, |
GAsyncResult * | result, | ||
FlPlatformChannelExitResponse * | exit_response, | ||
GError ** | error | ||
) |
Definition at line 268 of file fl_platform_channel.cc.
References error, fl_method_channel_invoke_method_finish(), get_exit_response(), and TRUE.
Referenced by request_app_exit_response_cb(), and TEST().
FlPlatformChannelExitResponse get_exit_response | ( | FlMethodResponse * | response | ) |
Definition at line 87 of file fl_platform_channel.cc.
References error, fl_method_response_get_result(), FL_PLATFORM_CHANNEL_EXIT_RESPONSE_CANCEL, FL_PLATFORM_CHANNEL_EXIT_RESPONSE_EXIT, fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, kExitResponseCancel, kExitResponseExit, and kExitResponseKey.
Referenced by fl_platform_channel_system_request_app_exit_finish().
|
static |
Definition at line 173 of file fl_platform_channel.cc.
References args, clipboard_get_data(), clipboard_has_strings(), clipboard_set_data(), error, fl_method_call_get_args(), fl_method_call_get_name(), fl_method_call_respond(), fl_method_not_implemented_response_new(), kClipboardHasStringsMethod, kExitApplicationMethod, kGetClipboardDataMethod, kInitializationCompleteMethod, kPlaySoundMethod, kSetClipboardDataMethod, kSystemNavigatorPopMethod, method_call, system_exit_application(), system_initialization_complete(), system_navigator_pop(), system_sound_play(), and user_data.
Referenced by fl_platform_channel_new().
|
static |
Definition at line 120 of file fl_platform_channel.cc.
References args, fl_method_call_get_args(), fl_method_error_response_new(), FL_PLATFORM_CHANNEL_EXIT_TYPE_CANCELABLE, FL_PLATFORM_CHANNEL_EXIT_TYPE_REQUIRED, fl_value_get_string(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, kBadArgumentsError, kExitTypeCancelable, kExitTypeKey, kExitTypeRequired, method_call, and type.
Referenced by method_call_cb().
|
static |
Definition at line 149 of file fl_platform_channel.cc.
References fl_method_success_response_new().
Referenced by method_call_cb().
|
static |
Definition at line 168 of file fl_platform_channel.cc.
References fl_method_success_response_new().
Referenced by method_call_cb().
|
static |
Definition at line 155 of file fl_platform_channel.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, and type.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 13 of file fl_platform_channel.cc.
Referenced by clipboard_get_data(), clipboard_set_data(), system_exit_application(), and system_sound_play().
|
staticconstexpr |
Definition at line 12 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_new().
|
staticconstexpr |
Definition at line 16 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_respond_clipboard_has_strings(), and method_call_cb().
|
staticconstexpr |
Definition at line 17 of file fl_platform_channel.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 31 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_make_system_request_app_exit_response(), and get_exit_response().
|
staticconstexpr |
Definition at line 32 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_make_system_request_app_exit_response(), and get_exit_response().
|
staticconstexpr |
Definition at line 30 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_make_system_request_app_exit_response(), and get_exit_response().
|
staticconstexpr |
Definition at line 27 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_system_request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 26 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_system_request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 28 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_system_request_app_exit(), and system_exit_application().
|
staticconstexpr |
Definition at line 14 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_respond_clipboard_get_data(), and method_call_cb().
|
staticconstexpr |
Definition at line 19 of file fl_platform_channel.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 21 of file fl_platform_channel.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 18 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_system_request_app_exit().
|
staticconstexpr |
Definition at line 15 of file fl_platform_channel.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 22 of file fl_platform_channel.cc.
Referenced by method_call_cb().
|
staticconstexpr |
Definition at line 23 of file fl_platform_channel.cc.
Referenced by clipboard_set_data(), and fl_platform_channel_respond_clipboard_get_data().
|
staticconstexpr |
Definition at line 24 of file fl_platform_channel.cc.
Referenced by fl_platform_channel_respond_clipboard_has_strings().