#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h"
#include <gmodule.h>
#include "flutter/shell/platform/linux/fl_method_call_private.h"
#include "flutter/shell/platform/linux/fl_method_channel_private.h"
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
Go to the source code of this file.
Classes | |
struct | _FlMethodChannel |
Functions | |
static void | message_cb (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
static void | message_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
static void | channel_closed_cb (gpointer user_data) |
static void | fl_method_channel_dispose (GObject *object) |
static void | fl_method_channel_class_init (FlMethodChannelClass *klass) |
static void | fl_method_channel_init (FlMethodChannel *self) |
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) |
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 FlMethodResponse * | fl_method_channel_invoke_method_finish (FlMethodChannel *self, GAsyncResult *result, GError **error) |
gboolean | fl_method_channel_respond (FlMethodChannel *self, FlBinaryMessengerResponseHandle *response_handle, FlMethodResponse *response, GError **error) |
|
static |
Definition at line 71 of file fl_method_channel.cc.
References TRUE, and user_data.
Referenced by fl_method_channel_new().
|
static |
Definition at line 106 of file fl_method_channel.cc.
References fl_method_channel_dispose().
|
static |
|
static |
Definition at line 110 of file fl_method_channel.cc.
G_MODULE_EXPORT void fl_method_channel_invoke_method | ( | FlMethodChannel * | channel, |
const gchar * | method, | ||
FlValue * | args, | ||
GCancellable * | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | user_data | ||
) |
fl_method_channel_invoke_method: @channel: an #FlMethodChannel. @method: the method to call. @args: (allow-none): arguments to the method, must match what the #FlMethodCodec supports. @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when the request is satisfied or NULL to ignore the response. @user_data: (closure): user data to pass to @callback.
Calls a method on this channel.
Definition at line 162 of file fl_method_channel.cc.
References args, callback, error, fl_binary_messenger_send_on_channel(), fl_method_codec_encode_method_call(), message_response_cb(), and user_data.
Referenced by cancel_channel(), listen_channel(), perform_action(), request_app_exit(), TEST(), update_editing_state(), and update_editing_state_with_delta().
G_MODULE_EXPORT FlMethodResponse* fl_method_channel_invoke_method_finish | ( | FlMethodChannel * | channel, |
GAsyncResult * | result, | ||
GError ** | error | ||
) |
fl_method_channel_invoke_method_finish: @channel: an #FlMethodChannel.
Completes request started with fl_method_channel_invoke_method().
Returns: (transfer full): an #FlMethodResponse or NULL on error.
Definition at line 192 of file fl_method_channel.cc.
References error, fl_binary_messenger_send_on_channel_finish(), fl_method_codec_decode_response(), and result.
Referenced by error_response_cb(), failure_response_cb(), method_response_cb(), not_implemented_response_cb(), nullptr_args_response_cb(), and request_app_exit_response_cb().
G_MODULE_EXPORT FlMethodChannel* fl_method_channel_new | ( | FlBinaryMessenger * | messenger, |
const gchar * | name, | ||
FlMethodCodec * | codec | ||
) |
Definition at line 112 of file fl_method_channel.cc.
References channel_closed_cb(), fl_binary_messenger_set_message_handler_on_channel(), and message_cb().
Referenced by cancel_channel(), fl_keyboard_manager_new(), fl_mouse_cursor_plugin_new(), fl_platform_plugin_new(), fl_text_input_plugin_new(), listen_channel(), and TEST().
gboolean fl_method_channel_respond | ( | FlMethodChannel * | channel, |
FlBinaryMessengerResponseHandle * | response_handle, | ||
FlMethodResponse * | response, | ||
GError ** | error | ||
) |
fl_method_channel_respond: @channel: an #FlMethodChannel. @response_handle: an #FlBinaryMessengerResponseHandle. @response: an #FlMethodResponse. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.
Responds to a method call.
Returns: TRUE on success.
Definition at line 211 of file fl_method_channel.cc.
References error, fl_binary_messenger_send_response(), fl_method_codec_encode_error_envelope(), fl_method_codec_encode_success_envelope(), fl_method_error_response_get_code(), fl_method_error_response_get_details(), fl_method_error_response_get_message(), and fl_method_success_response_get_result().
Referenced by fl_method_call_respond(), fl_method_call_respond_error(), fl_method_call_respond_not_implemented(), and fl_method_call_respond_success().
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler | ( | FlMethodChannel * | channel, |
FlMethodChannelMethodCallHandler | handler, | ||
gpointer | user_data, | ||
GDestroyNotify | destroy_notify | ||
) |
fl_method_channel_set_method_call_handler: @channel: an #FlMethodChannel. @handler: function to call when a method call is received on this channel. @user_data: (closure): user data to pass to @handler. @destroy_notify: (allow-none): a function which gets called to free @user_data, or NULL.
Sets the function called when a method call is received from the Dart side of the channel. See #FlMethodChannelMethodCallHandler for details on how to respond to method calls.
The handler is removed if the channel is closed or is replaced by another handler, set @destroy_notify if you want to detect this.
Definition at line 134 of file fl_method_channel.cc.
References user_data.
Referenced by fl_keyboard_manager_new(), fl_mouse_cursor_plugin_new(), fl_platform_plugin_new(), fl_text_input_plugin_new(), and TEST().
|
static |
Definition at line 37 of file fl_method_channel.cc.
References args, error, fl_method_call_new(), fl_method_codec_decode_method_call(), method_call, and user_data.
Referenced by fl_method_channel_new().
|
static |
Definition at line 63 of file fl_method_channel.cc.
References result, and user_data.
Referenced by fl_method_channel_invoke_method().