Flutter Linux Embedder
fl_mouse_cursor_handler.h File Reference

Go to the source code of this file.

Functions

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (FlMouseCursorHandler, fl_mouse_cursor_handler, FL, MOUSE_CURSOR_HANDLER, GObject)
 
FlMouseCursorHandler * fl_mouse_cursor_handler_new (FlBinaryMessenger *messenger, FlView *view)
 

Function Documentation

◆ fl_mouse_cursor_handler_new()

FlMouseCursorHandler* fl_mouse_cursor_handler_new ( FlBinaryMessenger *  messenger,
FlView *  view 
)

FlMouseCursorHandler:

#FlMouseCursorHandler is a mouse_cursor channel that implements the shell side of SystemChannels.mouseCursor from the Flutter services library. fl_mouse_cursor_handler_new: @messenger: an #FlBinaryMessenger. @view: an #FlView to control.

Creates a new handler that implements SystemChannels.mouseCursor from the Flutter services library.

Returns: a new #FlMouseCursorHandler.

Definition at line 164 of file fl_mouse_cursor_handler.cc.

165  {
166  g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
167 
168  FlMouseCursorHandler* self = FL_MOUSE_CURSOR_HANDLER(
169  g_object_new(fl_mouse_cursor_handler_get_type(), nullptr));
170 
171  g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
172  self->channel =
173  fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
175  nullptr);
176  self->view = view;
177  if (view != nullptr) {
178  g_object_add_weak_pointer(G_OBJECT(view),
179  reinterpret_cast<gpointer*>(&(self->view)));
180  }
181 
182  return self;
183 }

References fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), kChannelName, method_call_cb(), and view.

Referenced by create_context_cb().

◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE ( FlMouseCursorHandler  ,
fl_mouse_cursor_handler  ,
FL  ,
MOUSE_CURSOR_HANDLER  ,
GObject   
)
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_standard_method_codec_new
G_MODULE_EXPORT FlStandardMethodCodec * fl_standard_method_codec_new()
Definition: fl_standard_method_codec.cc:291
method_call_cb
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
Definition: fl_mouse_cursor_handler.cc:122
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
view
FlView * view
Definition: fl_application.cc:35
kChannelName
static constexpr char kChannelName[]
Definition: fl_mouse_cursor_handler.cc:13