Flutter Linux Embedder
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 }

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().

◆ 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.

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 ||
59  fl_value_get_type(text_value) != FL_VALUE_TYPE_STRING) {
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 }

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().

◆ 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 }

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 }

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 }

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().

◆ 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 }

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().

◆ 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 }

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().

◆ 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  {
305  g_autoptr(FlValue) result = fl_value_new_map();
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 }

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().

◆ 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 }

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().

◆ 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 
250  g_autoptr(FlValue) args = fl_value_new_map();
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 }

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().

◆ 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 }

References error, fl_method_channel_invoke_method_finish(), 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 }

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().

◆ 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) {
183  response = clipboard_set_data(self, method_call);
184  } else if (strcmp(method, kGetClipboardDataMethod) == 0) {
185  response = clipboard_get_data(self, method_call);
186  } else if (strcmp(method, kClipboardHasStringsMethod) == 0) {
187  response = clipboard_has_strings(self, method_call);
188  } else if (strcmp(method, kExitApplicationMethod) == 0) {
189  response = system_exit_application(self, method_call);
190  } else if (strcmp(method, kInitializationCompleteMethod) == 0) {
191  response = system_initialization_complete(self);
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 }

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().

◆ 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 ||
130  fl_value_get_type(type_value) != FL_VALUE_TYPE_STRING) {
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 }

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().

◆ 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().

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().

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, 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

constexpr char kExitResponseExit[] = "exit"
staticconstexpr

◆ kExitResponseKey

constexpr char kExitResponseKey[] = "response"
staticconstexpr

◆ 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

Definition at line 18 of file fl_platform_channel.cc.

Referenced by fl_platform_channel_system_request_app_exit().

◆ 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
kExitApplicationMethod
static constexpr char kExitApplicationMethod[]
Definition: fl_platform_channel.cc:17
fl_json_method_codec_new
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
Definition: fl_json_method_codec.cc:205
FL_VALUE_TYPE_MAP
@ FL_VALUE_TYPE_MAP
Definition: fl_value.h:74
kClipboardHasStringsMethod
static constexpr char kClipboardHasStringsMethod[]
Definition: fl_platform_channel.cc:16
fl_platform_channel_make_system_request_app_exit_response
FlMethodResponse * fl_platform_channel_make_system_request_app_exit_response(FlPlatformChannelExitResponse exit_response)
Definition: fl_platform_channel.cc:330
fl_method_channel_new
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
Definition: fl_method_channel.cc:112
fl_method_error_response_new
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
Definition: fl_method_response.cc:144
type
uint8_t type
Definition: fl_standard_message_codec_test.cc:1115
kExitResponseCancel
static constexpr char kExitResponseCancel[]
Definition: fl_platform_channel.cc:31
fl_value_set_string_take
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:650
fl_method_not_implemented_response_new
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
Definition: fl_method_response.cc:179
kExitTypeKey
static constexpr char kExitTypeKey[]
Definition: fl_platform_channel.cc:26
fl_method_channel_invoke_method_finish
G_MODULE_EXPORT FlMethodResponse * fl_method_channel_invoke_method_finish(FlMethodChannel *self, GAsyncResult *result, GError **error)
Definition: fl_method_channel.cc:192
fl_value_new_bool
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:255
FlValue
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
clipboard_has_strings
static FlMethodResponse * clipboard_has_strings(FlPlatformChannel *self, FlMethodCall *method_call)
Definition: fl_platform_channel.cc:81
clipboard_get_data
static FlMethodResponse * clipboard_get_data(FlPlatformChannel *self, FlMethodCall *method_call)
Definition: fl_platform_channel.cc:68
kChannelName
static constexpr char kChannelName[]
Definition: fl_platform_channel.cc:12
kExitResponseKey
static constexpr char kExitResponseKey[]
Definition: fl_platform_channel.cc:30
fl_method_response_get_result
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
Definition: fl_method_response.cc:82
fl_value_lookup_string
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:811
fl_value_get_string
const G_MODULE_EXPORT gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:682
FL_PLATFORM_CHANNEL_EXIT_RESPONSE_CANCEL
@ FL_PLATFORM_CHANNEL_EXIT_RESPONSE_CANCEL
Definition: fl_platform_channel.h:19
kExitResponseExit
static constexpr char kExitResponseExit[]
Definition: fl_platform_channel.cc:32
fl_method_success_response_new
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
Definition: fl_method_response.cc:126
kPlaySoundMethod
static constexpr char kPlaySoundMethod[]
Definition: fl_platform_channel.cc:21
kExitTypeRequired
static constexpr char kExitTypeRequired[]
Definition: fl_platform_channel.cc:28
system_exit_application
static FlMethodResponse * system_exit_application(FlPlatformChannel *self, FlMethodCall *method_call)
Definition: fl_platform_channel.cc:120
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_method_call_respond
G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall *self, FlMethodResponse *response, GError **error)
Definition: fl_method_call.cc:77
kGetClipboardDataMethod
static constexpr char kGetClipboardDataMethod[]
Definition: fl_platform_channel.cc:14
fl_value_new_map
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:366
kValueKey
static constexpr char kValueKey[]
Definition: fl_platform_channel.cc:24
fl_value_get_type
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:466
method_call_cb
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
Definition: fl_platform_channel.cc:173
method_call
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
Definition: fl_method_channel.h:120
FL_VALUE_TYPE_STRING
@ FL_VALUE_TYPE_STRING
Definition: fl_value.h:68
FlPlatformChannelExitType
FlPlatformChannelExitType
Definition: fl_platform_channel.h:13
fl_method_call_get_name
const G_MODULE_EXPORT gchar * fl_method_call_get_name(FlMethodCall *self)
Definition: fl_method_call.cc:67
fl_platform_channel_dispose
static void fl_platform_channel_dispose(GObject *object)
Definition: fl_platform_channel.cc:208
kRequestAppExitMethod
static constexpr char kRequestAppExitMethod[]
Definition: fl_platform_channel.cc:18
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
fl_method_channel_invoke_method
G_MODULE_EXPORT void fl_method_channel_invoke_method(FlMethodChannel *self, const gchar *method, FlValue *args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_method_channel.cc:162
FL_PLATFORM_CHANNEL_EXIT_TYPE_CANCELABLE
@ FL_PLATFORM_CHANNEL_EXIT_TYPE_CANCELABLE
Definition: fl_platform_channel.h:14
kBadArgumentsError
static constexpr char kBadArgumentsError[]
Definition: fl_platform_channel.cc:13
FL_PLATFORM_CHANNEL_EXIT_TYPE_REQUIRED
@ FL_PLATFORM_CHANNEL_EXIT_TYPE_REQUIRED
Definition: fl_platform_channel.h:15
fl_method_channel_set_method_call_handler
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_method_channel.cc:134
system_sound_play
static FlMethodResponse * system_sound_play(FlPlatformChannel *self, FlValue *args)
Definition: fl_platform_channel.cc:155
system_navigator_pop
static FlMethodResponse * system_navigator_pop(FlPlatformChannel *self)
Definition: fl_platform_channel.cc:168
FL_PLATFORM_CHANNEL_EXIT_RESPONSE_EXIT
@ FL_PLATFORM_CHANNEL_EXIT_RESPONSE_EXIT
Definition: fl_platform_channel.h:20
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition: fl_event_channel.h:89
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
kTextKey
static constexpr char kTextKey[]
Definition: fl_platform_channel.cc:23
get_exit_response
FlPlatformChannelExitResponse get_exit_response(FlMethodResponse *response)
Definition: fl_platform_channel.cc:87
fl_method_call_get_args
G_MODULE_EXPORT FlValue * fl_method_call_get_args(FlMethodCall *self)
Definition: fl_method_call.cc:72
system_initialization_complete
static FlMethodResponse * system_initialization_complete(FlPlatformChannel *self)
Definition: fl_platform_channel.cc:149
kSystemNavigatorPopMethod
static constexpr char kSystemNavigatorPopMethod[]
Definition: fl_platform_channel.cc:22
kSetClipboardDataMethod
static constexpr char kSetClipboardDataMethod[]
Definition: fl_platform_channel.cc:15
clipboard_set_data
static FlMethodResponse * clipboard_set_data(FlPlatformChannel *self, FlMethodCall *method_call)
Definition: fl_platform_channel.cc:48
format
uint32_t uint32_t * format
Definition: fl_texture_registrar_test.cc:42
kExitTypeCancelable
static constexpr char kExitTypeCancelable[]
Definition: fl_platform_channel.cc:27
fl_value_new_string
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:276
kInitializationCompleteMethod
static constexpr char kInitializationCompleteMethod[]
Definition: fl_platform_channel.cc:19