39 case GDK_BUTTON_PRIMARY:
42 case GDK_BUTTON_MIDDLE:
45 case GDK_BUTTON_SECONDARY:
68 case GDK_BUTTON_PRIMARY:
71 case GDK_BUTTON_SECONDARY:
74 case GDK_BUTTON_MIDDLE:
93 if (
self->pointer_inside) {
105 y, device_kind, 0, 0,
self->button_state, rotation, pressure);
109 FlPointerManager*
self = FL_POINTER_MANAGER(
object);
111 g_weak_ref_clear(&
self->engine);
113 G_OBJECT_CLASS(fl_pointer_manager_parent_class)->dispose(
object);
124 FlPointerManager*
self =
125 FL_POINTER_MANAGER(g_object_new(fl_pointer_manager_get_type(),
nullptr));
134 FlPointerManager*
self,
142 g_return_val_if_fail(FL_IS_POINTER_MANAGER(
self), FALSE);
145 if (!
get_button(device_kind, gdk_button, &button)) {
152 if ((
self->button_state & button) != 0) {
156 int old_button_state =
self->button_state;
158 self->button_state ^= button;
159 phase = old_button_state == 0 ?
kDown :
kMove;
168 y, device_kind, 0, 0,
self->button_state, rotation, pressure);
174 FlPointerManager*
self,
182 g_return_val_if_fail(FL_IS_POINTER_MANAGER(
self), FALSE);
185 if (!
get_button(device_kind, gdk_button, &button)) {
190 if ((
self->button_state & button) == 0) {
195 self->button_state ^= button;
206 y, device_kind, 0, 0,
self->button_state, rotation, pressure);
218 g_return_val_if_fail(FL_IS_POINTER_MANAGER(
self), FALSE);
230 self->button_state, rotation, pressure);
242 g_return_val_if_fail(FL_IS_POINTER_MANAGER(
self), FALSE);
261 g_return_val_if_fail(FL_IS_POINTER_MANAGER(
self), FALSE);
271 if (
self->pointer_inside &&
self->button_state == 0) {
274 x,
y, device_kind, 0, 0,
275 self->button_state, rotation, pressure);
276 self->pointer_inside = FALSE;
FlutterPointerPhase
The phase of the pointer event.
@ kHover
The pointer moved while up.
@ kFlutterPointerButtonMousePrimary
@ kFlutterPointerButtonMouseMiddle
@ kFlutterPointerButtonMouseForward
@ kFlutterPointerButtonMouseBack
@ kFlutterPointerButtonMouseSecondary
@ kFlutterPointerButtonStylusSecondary
@ kFlutterPointerButtonStylusPrimary
@ kFlutterPointerButtonStylusContact
FlutterPointerDeviceKind
The device type that created a pointer event.
@ kFlutterPointerDeviceKindInvertedStylus
@ kFlutterPointerDeviceKindStylus
g_autoptr(FlEngine) engine
void fl_engine_send_mouse_pointer_event(FlEngine *self, FlutterViewId view_id, FlutterPointerPhase phase, size_t timestamp, double x, double y, FlutterPointerDeviceKind device_kind, double scroll_delta_x, double scroll_delta_y, int64_t buttons, double rotation, double pressure)
static gboolean get_button(FlutterPointerDeviceKind device_kind, guint gdk_button, int64_t *button)
gboolean fl_pointer_manager_handle_enter(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, gdouble rotation, gdouble pressure)
FlPointerManager * fl_pointer_manager_new(FlutterViewId view_id, FlEngine *engine)
G_DEFINE_TYPE(FlPointerManager, fl_pointer_manager, G_TYPE_OBJECT)
static void ensure_pointer_added(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, gdouble rotation, gdouble pressure)
static gboolean get_mouse_button(guint gdk_button, int64_t *button)
static void fl_pointer_manager_dispose(GObject *object)
static constexpr int kMicrosecondsPerMillisecond
gboolean fl_pointer_manager_handle_button_press(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, guint gdk_button, gdouble rotation, gdouble pressure)
static constexpr guint kMouseButtonForward
static constexpr guint kMouseButtonBack
static void fl_pointer_manager_class_init(FlPointerManagerClass *klass)
static void fl_pointer_manager_init(FlPointerManager *self)
gboolean fl_pointer_manager_handle_motion(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, gdouble rotation, gdouble pressure)
gboolean fl_pointer_manager_handle_button_release(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, guint gdk_button, gdouble rotation, gdouble pressure)
gboolean fl_pointer_manager_handle_leave(FlPointerManager *self, guint event_time, FlutterPointerDeviceKind device_kind, gdouble x, gdouble y, gdouble rotation, gdouble pressure)
G_BEGIN_DECLS FlutterViewId view_id