 |
Flutter Linux Embedder
|
|
Go to the documentation of this file.
20 "System.initializationComplete";
46 G_DEFINE_TYPE(FlPlatformChannel, fl_platform_channel, G_TYPE_OBJECT)
58 if (text_value ==
nullptr ||
65 return self->vtable->clipboard_set_data(
method_call, text, self->user_data);
83 return self->vtable->clipboard_has_strings(
method_call, self->user_data);
88 if (response ==
nullptr) {
92 g_autoptr(GError)
error =
nullptr;
94 if (result ==
nullptr) {
95 g_warning(
"Error returned from System.requestAppExit: %s",
error->message);
99 g_warning(
"System.requestAppExit result argument map missing or malformed");
105 g_warning(
"Invalid response from System.requestAppExit");
129 if (type_value ==
nullptr ||
150 FlPlatformChannel*
self) {
151 self->vtable->system_initialization_complete(self->user_data);
163 self->vtable->system_sound_play(
type, self->user_data);
169 self->vtable->system_navigator_pop(self->user_data);
176 FlPlatformChannel*
self = FL_PLATFORM_CHANNEL(
user_data);
181 g_autoptr(FlMethodResponse) response =
nullptr;
200 if (response !=
nullptr) {
201 g_autoptr(GError)
error =
nullptr;
203 g_warning(
"Failed to send method call response: %s",
error->message);
209 FlPlatformChannel*
self = FL_PLATFORM_CHANNEL(
object);
211 g_clear_object(&self->channel);
213 G_OBJECT_CLASS(fl_platform_channel_parent_class)->dispose(
object);
225 g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger),
nullptr);
226 g_return_val_if_fail(vtable !=
nullptr,
nullptr);
228 FlPlatformChannel*
self = FL_PLATFORM_CHANNEL(
229 g_object_new(fl_platform_channel_get_type(),
nullptr));
231 self->vtable = vtable;
245 GCancellable* cancellable,
246 GAsyncReadyCallback callback,
248 g_return_if_fail(FL_IS_PLATFORM_CHANNEL(
self));
251 const gchar* type_string;
260 g_assert_not_reached();
270 GAsyncResult* result,
274 FL_METHOD_CHANNEL(
object), result,
error);
275 if (response ==
nullptr) {
286 g_autoptr(
FlValue) result =
nullptr;
287 if (text !=
nullptr) {
292 g_autoptr(FlMethodResponse) response =
295 g_autoptr(GError)
error =
nullptr;
304 gboolean has_strings) {
308 g_autoptr(FlMethodResponse) response =
311 g_autoptr(GError)
error =
nullptr;
321 g_autoptr(FlMethodResponse) response =
323 g_autoptr(GError)
error =
nullptr;
325 g_warning(
"Failed to send response to System.exitApplication: %s",
333 const gchar* exit_response_string;
334 switch (exit_response) {
342 g_assert_not_reached();
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
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_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
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)