Flutter Engine
The Flutter Engine
|
#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.
|
static |
Definition at line 106 of file fl_method_channel.cc.
|
static |
Definition at line 85 of file fl_method_channel.cc.
|
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.
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.
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.
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.
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.
|
static |
Definition at line 37 of file fl_method_channel.cc.
|
static |
Definition at line 63 of file fl_method_channel.cc.