Flutter Engine
 
Loading...
Searching...
No Matches
fl_platform_channel.cc File Reference

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"
 

Function Documentation

◆ clipboard_get_data()

static FlMethodResponse * clipboard_get_data ( FlPlatformChannel *  self,
FlMethodCall *  method_call 
)
static

Definition at line 68 of file fl_platform_channel.cc.

69 {
71
73 return FL_METHOD_RESPONSE(fl_method_error_response_new(
74 kBadArgumentsError, "Expected string", nullptr));
75 }
76 const gchar* format = fl_value_get_string(args);
77
78 return self->vtable->clipboard_get_data(method_call, format, self->user_data);
79}
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
static constexpr char kBadArgumentsError[]
uint32_t uint32_t * format
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition fl_value.cc:466
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition fl_value.cc:682
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition fl_value.h:42
@ FL_VALUE_TYPE_STRING
Definition fl_value.h:68

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, method_call, and self.

Referenced by method_call_cb().

◆ clipboard_has_strings()

static FlMethodResponse * clipboard_has_strings ( FlPlatformChannel *  self,
FlMethodCall *  method_call 
)
static

Definition at line 81 of file fl_platform_channel.cc.

82 {
83 return self->vtable->clipboard_has_strings(method_call, self->user_data);
84}

References method_call, and self.

Referenced by method_call_cb().

◆ clipboard_set_data()

static FlMethodResponse * clipboard_set_data ( FlPlatformChannel *  self,
FlMethodCall *  method_call 
)
static

Definition at line 48 of file fl_platform_channel.cc.

49 {
51
53 return FL_METHOD_RESPONSE(fl_method_error_response_new(
54 kBadArgumentsError, "Argument map missing or malformed", nullptr));
55 }
56
58 if (text_value == nullptr ||
60 return FL_METHOD_RESPONSE(fl_method_error_response_new(
61 kBadArgumentsError, "Missing clipboard text", nullptr));
62 }
63 const gchar* text = fl_value_get_string(text_value);
64
65 return self->vtable->clipboard_set_data(method_call, text, self->user_data);
66}
static constexpr char kTextKey[]
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition fl_value.cc:811
@ FL_VALUE_TYPE_MAP
Definition fl_value.h:74
std::u16string text

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, method_call, self, and text.

Referenced by method_call_cb().

◆ fl_platform_channel_class_init()

static void fl_platform_channel_class_init ( FlPlatformChannelClass *  klass)
static

Definition at line 216 of file fl_platform_channel.cc.

216 {
217 G_OBJECT_CLASS(klass)->dispose = fl_platform_channel_dispose;
218}
static void fl_platform_channel_dispose(GObject *object)

References fl_platform_channel_dispose().

◆ fl_platform_channel_dispose()

static void fl_platform_channel_dispose ( GObject *  object)
static

Definition at line 208 of file fl_platform_channel.cc.

208 {
209 FlPlatformChannel* self = FL_PLATFORM_CHANNEL(object);
210
211 g_clear_object(&self->channel);
212
213 G_OBJECT_CLASS(fl_platform_channel_parent_class)->dispose(object);
214}

References self.

Referenced by fl_platform_channel_class_init().

◆ fl_platform_channel_init()

static void fl_platform_channel_init ( FlPlatformChannel *  self)
static

Definition at line 220 of file fl_platform_channel.cc.

220{}

◆ fl_platform_channel_make_system_request_app_exit_response()

FlMethodResponse * fl_platform_channel_make_system_request_app_exit_response ( FlPlatformChannelExitResponse  exit_response)

Definition at line 330 of file fl_platform_channel.cc.

331 {
332 g_autoptr(FlValue) exit_result = fl_value_new_map();
333 const gchar* exit_response_string;
334 switch (exit_response) {
336 exit_response_string = kExitResponseCancel;
337 break;
339 exit_response_string = kExitResponseExit;
340 break;
341 default:
342 g_assert_not_reached();
343 }
345 fl_value_new_string(exit_response_string));
346 return FL_METHOD_RESPONSE(fl_method_success_response_new(exit_result));
347}
g_autoptr(GMutexLocker) locker
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
static constexpr char kExitResponseExit[]
static constexpr char kExitResponseKey[]
static constexpr char kExitResponseCancel[]
@ FL_PLATFORM_CHANNEL_EXIT_RESPONSE_EXIT
@ FL_PLATFORM_CHANNEL_EXIT_RESPONSE_CANCEL
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition fl_value.cc:366
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition fl_value.cc:650
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition fl_value.cc:276

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(), g_autoptr(), kExitResponseCancel, kExitResponseExit, and kExitResponseKey.

Referenced by fl_platform_channel_respond_system_exit_application(), and system_exit_application().

◆ fl_platform_channel_new()

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.

224 {
225 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
226 g_return_val_if_fail(vtable != nullptr, nullptr);
227
228 FlPlatformChannel* self = FL_PLATFORM_CHANNEL(
229 g_object_new(fl_platform_channel_get_type(), nullptr));
230
231 self->vtable = vtable;
232 self->user_data = user_data;
233
234 g_autoptr(FlJsonMethodCodec) codec = fl_json_method_codec_new();
235 self->channel =
236 fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
238 nullptr);
239
240 return self;
241}
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 void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
static constexpr char kChannelName[]

References fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), g_autoptr(), kChannelName, method_call_cb(), self, and user_data.

Referenced by fl_platform_handler_new(), and TEST().

◆ fl_platform_channel_respond_clipboard_get_data()

void fl_platform_channel_respond_clipboard_get_data ( FlMethodCall *  method_call,
const gchar *  text 
)

Definition at line 284 of file fl_platform_channel.cc.

285 {
286 g_autoptr(FlValue) result = nullptr;
287 if (text != nullptr) {
288 result = fl_value_new_map();
290 }
291
292 g_autoptr(FlMethodResponse) response =
293 FL_METHOD_RESPONSE(fl_method_success_response_new(result));
294
295 g_autoptr(GError) error = nullptr;
296 if (!fl_method_call_respond(method_call, response, &error)) {
297 g_warning("Failed to send response to %s: %s", kGetClipboardDataMethod,
298 error->message);
299 }
300}
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
const uint8_t uint32_t uint32_t GError ** error
static constexpr char kGetClipboardDataMethod[]

References error, fl_method_call_respond(), fl_method_success_response_new(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), g_autoptr(), kGetClipboardDataMethod, kTextKey, method_call, and text.

Referenced by clipboard_text_cb().

◆ fl_platform_channel_respond_clipboard_has_strings()

void fl_platform_channel_respond_clipboard_has_strings ( FlMethodCall *  method_call,
gboolean  has_strings 
)

Definition at line 302 of file fl_platform_channel.cc.

304 {
307
308 g_autoptr(FlMethodResponse) response =
309 FL_METHOD_RESPONSE(fl_method_success_response_new(result));
310
311 g_autoptr(GError) error = nullptr;
312 if (!fl_method_call_respond(method_call, response, &error)) {
313 g_warning("Failed to send response to %s: %s", kClipboardHasStringsMethod,
314 error->message);
315 }
316}
static constexpr char kValueKey[]
static constexpr char kClipboardHasStringsMethod[]
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition fl_value.cc:255

References error, fl_method_call_respond(), fl_method_success_response_new(), fl_value_new_bool(), fl_value_new_map(), fl_value_set_string_take(), g_autoptr(), kClipboardHasStringsMethod, kValueKey, and method_call.

Referenced by clipboard_text_has_strings_cb().

◆ fl_platform_channel_respond_system_exit_application()

void fl_platform_channel_respond_system_exit_application ( FlMethodCall *  method_call,
FlPlatformChannelExitResponse  exit_response 
)

Definition at line 318 of file fl_platform_channel.cc.

320 {
321 g_autoptr(FlMethodResponse) response =
323 g_autoptr(GError) error = nullptr;
324 if (!fl_method_call_respond(method_call, response, &error)) {
325 g_warning("Failed to send response to System.exitApplication: %s",
326 error->message);
327 }
328}
FlMethodResponse * fl_platform_channel_make_system_request_app_exit_response(FlPlatformChannelExitResponse exit_response)

References error, fl_method_call_respond(), fl_platform_channel_make_system_request_app_exit_response(), g_autoptr(), and method_call.

Referenced by request_app_exit_response_cb().

◆ fl_platform_channel_system_request_app_exit()

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.

247 {
248 g_return_if_fail(FL_IS_PLATFORM_CHANNEL(self));
249
251 const gchar* type_string;
252 switch (type) {
254 type_string = kExitTypeCancelable;
255 break;
257 type_string = kExitTypeRequired;
258 break;
259 default:
260 g_assert_not_reached();
261 }
263 fl_value_new_string(type_string));
265 cancellable, callback, user_data);
266}
GLenum type
G_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static constexpr char kExitTypeCancelable[]
static constexpr char kRequestAppExitMethod[]
static constexpr char kExitTypeRequired[]
static constexpr char kExitTypeKey[]
@ FL_PLATFORM_CHANNEL_EXIT_TYPE_CANCELABLE
@ FL_PLATFORM_CHANNEL_EXIT_TYPE_REQUIRED
FlutterDesktopBinaryReply callback

References args, callback, 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(), g_autoptr(), kExitTypeCancelable, kExitTypeKey, kExitTypeRequired, kRequestAppExitMethod, self, type, and user_data.

Referenced by request_app_exit(), and TEST().

◆ fl_platform_channel_system_request_app_exit_finish()

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.

272 {
273 g_autoptr(FlMethodResponse) response = fl_method_channel_invoke_method_finish(
274 FL_METHOD_CHANNEL(object), result, error);
275 if (response == nullptr) {
276 return FALSE;
277 }
278
279 *exit_response = get_exit_response(response);
280
281 return TRUE;
282}
return TRUE
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
FlPlatformChannelExitResponse get_exit_response(FlMethodResponse *response)

References error, fl_method_channel_invoke_method_finish(), g_autoptr(), get_exit_response(), and TRUE.

Referenced by request_app_exit_response_cb(), and TEST().

◆ get_exit_response()

FlPlatformChannelExitResponse get_exit_response ( FlMethodResponse *  response)

Definition at line 87 of file fl_platform_channel.cc.

87 {
88 if (response == nullptr) {
90 }
91
92 g_autoptr(GError) error = nullptr;
93 FlValue* result = fl_method_response_get_result(response, &error);
94 if (result == nullptr) {
95 g_warning("Error returned from System.requestAppExit: %s", error->message);
97 }
98 if (fl_value_get_type(result) != FL_VALUE_TYPE_MAP) {
99 g_warning("System.requestAppExit result argument map missing or malformed");
101 }
102
103 FlValue* response_value = fl_value_lookup_string(result, kExitResponseKey);
104 if (fl_value_get_type(response_value) != FL_VALUE_TYPE_STRING) {
105 g_warning("Invalid response from System.requestAppExit");
107 }
108 const char* response_string = fl_value_get_string(response_value);
109
110 if (strcmp(response_string, kExitResponseCancel) == 0) {
112 } else if (strcmp(response_string, kExitResponseExit) == 0) {
114 }
115
116 // If something went wrong, then just exit.
118}
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)

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, g_autoptr(), kExitResponseCancel, kExitResponseExit, and kExitResponseKey.

Referenced by fl_platform_channel_system_request_app_exit_finish().

◆ method_call_cb()

static void method_call_cb ( FlMethodChannel *  channel,
FlMethodCall *  method_call,
gpointer  user_data 
)
static

Definition at line 173 of file fl_platform_channel.cc.

175 {
176 FlPlatformChannel* self = FL_PLATFORM_CHANNEL(user_data);
177
178 const gchar* method = fl_method_call_get_name(method_call);
180
181 g_autoptr(FlMethodResponse) response = nullptr;
182 if (strcmp(method, kSetClipboardDataMethod) == 0) {
184 } else if (strcmp(method, kGetClipboardDataMethod) == 0) {
186 } else if (strcmp(method, kClipboardHasStringsMethod) == 0) {
188 } else if (strcmp(method, kExitApplicationMethod) == 0) {
190 } else if (strcmp(method, kInitializationCompleteMethod) == 0) {
192 } else if (strcmp(method, kPlaySoundMethod) == 0) {
193 response = system_sound_play(self, args);
194 } else if (strcmp(method, kSystemNavigatorPopMethod) == 0) {
195 response = system_navigator_pop(self);
196 } else {
197 response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new());
198 }
199
200 if (response != nullptr) {
201 g_autoptr(GError) error = nullptr;
202 if (!fl_method_call_respond(method_call, response, &error)) {
203 g_warning("Failed to send method call response: %s", error->message);
204 }
205 }
206}
G_MODULE_EXPORT const gchar * fl_method_call_get_name(FlMethodCall *self)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
static constexpr char kSystemNavigatorPopMethod[]
static constexpr char kInitializationCompleteMethod[]
static FlMethodResponse * system_initialization_complete(FlPlatformChannel *self)
static FlMethodResponse * clipboard_has_strings(FlPlatformChannel *self, FlMethodCall *method_call)
static FlMethodResponse * clipboard_set_data(FlPlatformChannel *self, FlMethodCall *method_call)
static constexpr char kExitApplicationMethod[]
static FlMethodResponse * clipboard_get_data(FlPlatformChannel *self, FlMethodCall *method_call)
static FlMethodResponse * system_sound_play(FlPlatformChannel *self, FlValue *args)
static constexpr char kPlaySoundMethod[]
static FlMethodResponse * system_exit_application(FlPlatformChannel *self, FlMethodCall *method_call)
static constexpr char kSetClipboardDataMethod[]
static FlMethodResponse * system_navigator_pop(FlPlatformChannel *self)

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(), g_autoptr(), kClipboardHasStringsMethod, kExitApplicationMethod, kGetClipboardDataMethod, kInitializationCompleteMethod, kPlaySoundMethod, kSetClipboardDataMethod, kSystemNavigatorPopMethod, method_call, self, system_exit_application(), system_initialization_complete(), system_navigator_pop(), system_sound_play(), and user_data.

Referenced by fl_platform_channel_new().

◆ system_exit_application()

static FlMethodResponse * system_exit_application ( FlPlatformChannel *  self,
FlMethodCall *  method_call 
)
static

Definition at line 120 of file fl_platform_channel.cc.

121 {
124 return FL_METHOD_RESPONSE(fl_method_error_response_new(
125 kBadArgumentsError, "Argument map missing or malformed", nullptr));
126 }
127
129 if (type_value == nullptr ||
131 return FL_METHOD_RESPONSE(fl_method_error_response_new(
132 kBadArgumentsError, "Missing type argument", nullptr));
133 }
134 const char* type_string = fl_value_get_string(type_value);
136 if (strcmp(type_string, kExitTypeCancelable) == 0) {
138 } else if (strcmp(type_string, kExitTypeRequired) == 0) {
140 } else {
141 return FL_METHOD_RESPONSE(fl_method_error_response_new(
142 kBadArgumentsError, "Invalid exit type", nullptr));
143 }
144
145 return self->vtable->system_exit_application(method_call, type,
146 self->user_data);
147}
FlPlatformChannelExitType

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, self, and type.

Referenced by method_call_cb().

◆ system_initialization_complete()

static FlMethodResponse * system_initialization_complete ( FlPlatformChannel *  self)
static

Definition at line 149 of file fl_platform_channel.cc.

150 {
151 self->vtable->system_initialization_complete(self->user_data);
152 return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
153}

References fl_method_success_response_new(), and self.

Referenced by method_call_cb().

◆ system_navigator_pop()

static FlMethodResponse * system_navigator_pop ( FlPlatformChannel *  self)
static

Definition at line 168 of file fl_platform_channel.cc.

168 {
169 self->vtable->system_navigator_pop(self->user_data);
170 return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
171}

References fl_method_success_response_new(), and self.

Referenced by method_call_cb().

◆ system_sound_play()

static FlMethodResponse * system_sound_play ( FlPlatformChannel *  self,
FlValue args 
)
static

Definition at line 155 of file fl_platform_channel.cc.

156 {
158 return FL_METHOD_RESPONSE(fl_method_error_response_new(
159 kBadArgumentsError, "Expected string", nullptr));
160 }
161 const gchar* type = fl_value_get_string(args);
162
163 self->vtable->system_sound_play(type, self->user_data);
164
165 return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
166}

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, self, and type.

Referenced by method_call_cb().

Variable Documentation

◆ kBadArgumentsError

constexpr char kBadArgumentsError[] = "Bad Arguments"
staticconstexpr

◆ kChannelName

constexpr char kChannelName[] = "flutter/platform"
staticconstexpr

Definition at line 12 of file fl_platform_channel.cc.

Referenced by fl_platform_channel_new().

◆ kClipboardHasStringsMethod

constexpr char kClipboardHasStringsMethod[] = "Clipboard.hasStrings"
staticconstexpr

◆ kExitApplicationMethod

constexpr char kExitApplicationMethod[] = "System.exitApplication"
staticconstexpr

Definition at line 17 of file fl_platform_channel.cc.

Referenced by method_call_cb().

◆ kExitResponseCancel

constexpr char kExitResponseCancel[] = "cancel"
staticconstexpr

◆ kExitResponseExit

◆ kExitResponseKey

◆ kExitTypeCancelable

constexpr char kExitTypeCancelable[] = "cancelable"
staticconstexpr

◆ kExitTypeKey

constexpr char kExitTypeKey[] = "type"
staticconstexpr

◆ kExitTypeRequired

constexpr char kExitTypeRequired[] = "required"
staticconstexpr

◆ kGetClipboardDataMethod

constexpr char kGetClipboardDataMethod[] = "Clipboard.getData"
staticconstexpr

◆ kInitializationCompleteMethod

constexpr char kInitializationCompleteMethod[]
staticconstexpr
Initial value:
=
"System.initializationComplete"

Definition at line 19 of file fl_platform_channel.cc.

Referenced by method_call_cb().

◆ kPlaySoundMethod

constexpr char kPlaySoundMethod[] = "SystemSound.play"
staticconstexpr

Definition at line 21 of file fl_platform_channel.cc.

Referenced by method_call_cb().

◆ kRequestAppExitMethod

constexpr char kRequestAppExitMethod[] = "System.requestAppExit"
staticconstexpr

◆ kSetClipboardDataMethod

constexpr char kSetClipboardDataMethod[] = "Clipboard.setData"
staticconstexpr

Definition at line 15 of file fl_platform_channel.cc.

Referenced by method_call_cb().

◆ kSystemNavigatorPopMethod

constexpr char kSystemNavigatorPopMethod[] = "SystemNavigator.pop"
staticconstexpr

Definition at line 22 of file fl_platform_channel.cc.

Referenced by method_call_cb().

◆ kTextKey

constexpr char kTextKey[] = "text"
staticconstexpr

◆ kValueKey

constexpr char kValueKey[] = "value"
staticconstexpr