/* TouchpadPinchBackend.c generated by valac 0.56.19, the Vala compiler
 * generated from TouchpadPinchBackend.vala, do not modify */

/*
 * Copyright 2026 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authored by: Leonhard Kargl <leo.kargl@proton.me>
 */

#include <glib-object.h>
#include <clutter/clutter.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include "gala.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define GALA_TYPE_GESTURE_BACKEND (gala_gesture_backend_get_type ())
#define GALA_GESTURE_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_GESTURE_BACKEND, GalaGestureBackend))
#define GALA_IS_GESTURE_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_GESTURE_BACKEND))
#define GALA_GESTURE_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GALA_TYPE_GESTURE_BACKEND, GalaGestureBackendIface))

typedef struct _GalaGestureBackend GalaGestureBackend;
typedef struct _GalaGestureBackendIface GalaGestureBackendIface;

#define GALA_TYPE_TOUCHPAD_PINCH_BACKEND (gala_touchpad_pinch_backend_get_type ())
#define GALA_TOUCHPAD_PINCH_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackend))
#define GALA_TOUCHPAD_PINCH_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackendClass))
#define GALA_IS_TOUCHPAD_PINCH_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_TOUCHPAD_PINCH_BACKEND))
#define GALA_IS_TOUCHPAD_PINCH_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_TOUCHPAD_PINCH_BACKEND))
#define GALA_TOUCHPAD_PINCH_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackendClass))

typedef struct _GalaTouchpadPinchBackend GalaTouchpadPinchBackend;
typedef struct _GalaTouchpadPinchBackendClass GalaTouchpadPinchBackendClass;
typedef struct _GalaTouchpadPinchBackendPrivate GalaTouchpadPinchBackendPrivate;
typedef enum  {
	GALA_TOUCHPAD_PINCH_BACKEND_STATE_NONE,
	GALA_TOUCHPAD_PINCH_BACKEND_STATE_IGNORED,
	GALA_TOUCHPAD_PINCH_BACKEND_STATE_ONGOING
} GalaTouchpadPinchBackendState;

#define GALA_TOUCHPAD_PINCH_BACKEND_TYPE_STATE (gala_touchpad_pinch_backend_state_get_type ())
enum  {
	GALA_TOUCHPAD_PINCH_BACKEND_0_PROPERTY,
	GALA_TOUCHPAD_PINCH_BACKEND_ACTOR_PROPERTY,
	GALA_TOUCHPAD_PINCH_BACKEND_NUM_PROPERTIES
};
static GParamSpec* gala_touchpad_pinch_backend_properties[GALA_TOUCHPAD_PINCH_BACKEND_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GALA_TYPE_GESTURE (gala_gesture_get_type ())
#define GALA_GESTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_GESTURE, GalaGesture))
#define GALA_GESTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_GESTURE, GalaGestureClass))
#define GALA_IS_GESTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_GESTURE))
#define GALA_IS_GESTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_GESTURE))
#define GALA_GESTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_GESTURE, GalaGestureClass))

typedef struct _GalaGesture GalaGesture;
typedef struct _GalaGestureClass GalaGestureClass;
typedef enum  {
	GALA_GESTURE_DIRECTION_UNKNOWN = 0,
	GALA_GESTURE_DIRECTION_UP = 1,
	GALA_GESTURE_DIRECTION_DOWN = 2,
	GALA_GESTURE_DIRECTION_LEFT = 3,
	GALA_GESTURE_DIRECTION_RIGHT = 4,
	GALA_GESTURE_DIRECTION_IN = 5,
	GALA_GESTURE_DIRECTION_OUT = 6
} GalaGestureDirection;

#define GALA_TYPE_GESTURE_DIRECTION (gala_gesture_direction_get_type ())
typedef struct _GalaGesturePrivate GalaGesturePrivate;
#define _gala_gesture_unref0(var) ((var == NULL) ? NULL : (var = (gala_gesture_unref (var), NULL)))

struct _GalaGestureBackendIface {
	GTypeInterface parent_iface;
	void (*cancel_gesture) (GalaGestureBackend* self);
};

struct _GalaTouchpadPinchBackend {
	GObject parent_instance;
	GalaTouchpadPinchBackendPrivate * priv;
};

struct _GalaTouchpadPinchBackendClass {
	GObjectClass parent_class;
};

struct _GalaTouchpadPinchBackendPrivate {
	ClutterActor* _actor;
	GalaTouchpadPinchBackendState state;
	gdouble percentage;
};

struct _GalaGesture {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GalaGesturePrivate * priv;
	ClutterEventType type;
	GalaGestureDirection direction;
	gint fingers;
	ClutterInputDeviceType performed_on_device_type;
};

struct _GalaGestureClass {
	GTypeClass parent_class;
	void (*finalize) (GalaGesture *self);
};

static gint GalaTouchpadPinchBackend_private_offset;
static gpointer gala_touchpad_pinch_backend_parent_class = NULL;
static GalaGestureBackendIface * gala_touchpad_pinch_backend_gala_gesture_backend_parent_iface = NULL;

 G_GNUC_INTERNAL GType gala_gesture_backend_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GType gala_touchpad_pinch_backend_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType gala_touchpad_pinch_backend_state_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GalaTouchpadPinchBackend* gala_touchpad_pinch_backend_new (ClutterActor* actor);
 G_GNUC_INTERNAL GalaTouchpadPinchBackend* gala_touchpad_pinch_backend_construct (GType object_type,
                                                                 ClutterActor* actor);
static void gala_touchpad_pinch_backend_real_cancel_gesture (GalaGestureBackend* base);
static gboolean gala_touchpad_pinch_backend_handle_event (GalaTouchpadPinchBackend* self,
                                                   ClutterEvent* event);
static void gala_touchpad_pinch_backend_reset (GalaTouchpadPinchBackend* self);
 G_GNUC_INTERNAL gpointer gala_gesture_ref (gpointer instance);
 G_GNUC_INTERNAL void gala_gesture_unref (gpointer instance);
 G_GNUC_INTERNAL GParamSpec* gala_param_spec_gesture (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
 G_GNUC_INTERNAL void gala_value_set_gesture (GValue* value,
                             gpointer v_object) G_GNUC_UNUSED ;
 G_GNUC_INTERNAL void gala_value_take_gesture (GValue* value,
                              gpointer v_object);
 G_GNUC_INTERNAL gpointer gala_value_get_gesture (const GValue* value) G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GType gala_gesture_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GalaGesture* gala_gesture_new (void);
 G_GNUC_INTERNAL GalaGesture* gala_gesture_construct (GType object_type);
 G_GNUC_INTERNAL GType gala_gesture_direction_get_type (void) G_GNUC_CONST ;
 G_GNUC_INTERNAL ClutterActor* gala_touchpad_pinch_backend_get_actor (GalaTouchpadPinchBackend* self);
static void gala_touchpad_pinch_backend_set_actor (GalaTouchpadPinchBackend* self,
                                            ClutterActor* value);
static GObject * gala_touchpad_pinch_backend_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static gboolean _gala_touchpad_pinch_backend_handle_event_clutter_actor_captured_event (ClutterActor* _sender,
                                                                                 ClutterEvent* event,
                                                                                 gpointer self);
 G_GNUC_INTERNAL void gala_gesture_backend_cancel_gesture (GalaGestureBackend* self);
static void gala_touchpad_pinch_backend_finalize (GObject * obj);
static GType gala_touchpad_pinch_backend_get_type_once (void);
static void _vala_gala_touchpad_pinch_backend_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_gala_touchpad_pinch_backend_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);

static inline gpointer
gala_touchpad_pinch_backend_get_instance_private (GalaTouchpadPinchBackend* self)
{
	return G_STRUCT_MEMBER_P (self, GalaTouchpadPinchBackend_private_offset);
}

 G_GNUC_NO_INLINE static GType
gala_touchpad_pinch_backend_state_get_type_once (void)
{
	static const GEnumValue values[] = {{GALA_TOUCHPAD_PINCH_BACKEND_STATE_NONE, "GALA_TOUCHPAD_PINCH_BACKEND_STATE_NONE", "none"}, {GALA_TOUCHPAD_PINCH_BACKEND_STATE_IGNORED, "GALA_TOUCHPAD_PINCH_BACKEND_STATE_IGNORED", "ignored"}, {GALA_TOUCHPAD_PINCH_BACKEND_STATE_ONGOING, "GALA_TOUCHPAD_PINCH_BACKEND_STATE_ONGOING", "ongoing"}, {0, NULL, NULL}};
	GType gala_touchpad_pinch_backend_state_type_id;
	gala_touchpad_pinch_backend_state_type_id = g_enum_register_static ("GalaTouchpadPinchBackendState", values);
	return gala_touchpad_pinch_backend_state_type_id;
}

static GType
gala_touchpad_pinch_backend_state_get_type (void)
{
	static gsize gala_touchpad_pinch_backend_state_type_id__once = 0;
	if (g_once_init_enter (&gala_touchpad_pinch_backend_state_type_id__once)) {
		GType gala_touchpad_pinch_backend_state_type_id;
		gala_touchpad_pinch_backend_state_type_id = gala_touchpad_pinch_backend_state_get_type_once ();
		g_once_init_leave (&gala_touchpad_pinch_backend_state_type_id__once, gala_touchpad_pinch_backend_state_type_id);
	}
	return gala_touchpad_pinch_backend_state_type_id__once;
}

 G_GNUC_INTERNAL GalaTouchpadPinchBackend*
gala_touchpad_pinch_backend_construct (GType object_type,
                                       ClutterActor* actor)
{
	GalaTouchpadPinchBackend * self = NULL;
	g_return_val_if_fail (actor != NULL, NULL);
	self = (GalaTouchpadPinchBackend*) g_object_new (object_type, "actor", actor, NULL);
	return self;
}

 G_GNUC_INTERNAL GalaTouchpadPinchBackend*
gala_touchpad_pinch_backend_new (ClutterActor* actor)
{
	return gala_touchpad_pinch_backend_construct (GALA_TYPE_TOUCHPAD_PINCH_BACKEND, actor);
}

static void
gala_touchpad_pinch_backend_real_cancel_gesture (GalaGestureBackend* base)
{
	GalaTouchpadPinchBackend * self;
	self = (GalaTouchpadPinchBackend*) base;
	self->priv->state = GALA_TOUCHPAD_PINCH_BACKEND_STATE_IGNORED;
}

static gboolean
gala_touchpad_pinch_backend_handle_event (GalaTouchpadPinchBackend* self,
                                          ClutterEvent* event)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (clutter_event_type (event) != CLUTTER_TOUCHPAD_PINCH) {
		result = CLUTTER_EVENT_PROPAGATE;
		return result;
	}
	if (self->priv->state != GALA_TOUCHPAD_PINCH_BACKEND_STATE_ONGOING) {
		gboolean _tmp1_ = FALSE;
		if (clutter_event_get_gesture_phase (event) == CLUTTER_TOUCHPAD_GESTURE_PHASE_END) {
			_tmp1_ = TRUE;
		} else {
			_tmp1_ = clutter_event_get_gesture_phase (event) == CLUTTER_TOUCHPAD_GESTURE_PHASE_CANCEL;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gala_touchpad_pinch_backend_reset (self);
		result = CLUTTER_EVENT_PROPAGATE;
		return result;
	}
	if (self->priv->state == GALA_TOUCHPAD_PINCH_BACKEND_STATE_IGNORED) {
		result = CLUTTER_EVENT_PROPAGATE;
		return result;
	}
	if (self->priv->state == GALA_TOUCHPAD_PINCH_BACKEND_STATE_NONE) {
		_tmp2_ = clutter_event_get_gesture_phase (event) != CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		result = CLUTTER_EVENT_PROPAGATE;
		return result;
	}
	if (self->priv->state != GALA_TOUCHPAD_PINCH_BACKEND_STATE_ONGOING) {
		GalaGesture* gesture = NULL;
		GalaGesture* _tmp3_;
		GalaGesture* _tmp4_;
		GalaGesture* _tmp5_;
		GalaGesture* _tmp6_;
		GalaGesture* _tmp7_;
		ClutterInputDevice* _tmp8_;
		GalaGesture* _tmp9_;
		gboolean _tmp10_ = FALSE;
		_tmp3_ = gala_gesture_new ();
		gesture = _tmp3_;
		_tmp4_ = gesture;
		_tmp4_->direction = GALA_GESTURE_DIRECTION_OUT;
		_tmp5_ = gesture;
		_tmp5_->type = clutter_event_type (event);
		_tmp6_ = gesture;
		_tmp6_->fingers = (gint) clutter_event_get_touchpad_gesture_finger_count (event);
		_tmp7_ = gesture;
		_tmp8_ = clutter_event_get_source_device (event);
		_tmp7_->performed_on_device_type = clutter_input_device_get_device_type (_tmp8_);
		_tmp9_ = gesture;
		g_signal_emit_by_name ((GalaGestureBackend*) self, "on-gesture-detected", _tmp9_, clutter_event_get_time (event), &_tmp10_);
		if (!_tmp10_) {
			self->priv->state = GALA_TOUCHPAD_PINCH_BACKEND_STATE_IGNORED;
			result = CLUTTER_EVENT_PROPAGATE;
			_gala_gesture_unref0 (gesture);
			return result;
		}
		self->priv->state = GALA_TOUCHPAD_PINCH_BACKEND_STATE_ONGOING;
		_gala_gesture_unref0 (gesture);
	}
	if (clutter_event_get_gesture_phase (event) == CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE) {
		self->priv->percentage = clutter_event_get_gesture_pinch_scale (event) - 1.0;
	}
	switch (clutter_event_get_gesture_phase (event)) {
		case CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN:
		{
			g_signal_emit_by_name ((GalaGestureBackend*) self, "on-begin", (gdouble) 0, (guint64) clutter_event_get_time (event));
			break;
		}
		case CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE:
		{
			g_signal_emit_by_name ((GalaGestureBackend*) self, "on-update", self->priv->percentage, (guint64) clutter_event_get_time (event));
			break;
		}
		case CLUTTER_TOUCHPAD_GESTURE_PHASE_END:
		case CLUTTER_TOUCHPAD_GESTURE_PHASE_CANCEL:
		{
			g_signal_emit_by_name ((GalaGestureBackend*) self, "on-end", self->priv->percentage, (guint64) clutter_event_get_time (event));
			gala_touchpad_pinch_backend_reset (self);
			break;
		}
		default:
		break;
	}
	result = CLUTTER_EVENT_STOP;
	return result;
}

static void
gala_touchpad_pinch_backend_reset (GalaTouchpadPinchBackend* self)
{
	g_return_if_fail (self != NULL);
	self->priv->state = GALA_TOUCHPAD_PINCH_BACKEND_STATE_NONE;
	self->priv->percentage = 0.0;
}

 G_GNUC_INTERNAL ClutterActor*
gala_touchpad_pinch_backend_get_actor (GalaTouchpadPinchBackend* self)
{
	ClutterActor* result;
	ClutterActor* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_actor;
	result = _tmp0_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
gala_touchpad_pinch_backend_set_actor (GalaTouchpadPinchBackend* self,
                                       ClutterActor* value)
{
	ClutterActor* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_touchpad_pinch_backend_get_actor (self);
	if (old_value != value) {
		ClutterActor* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_actor);
		self->priv->_actor = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_touchpad_pinch_backend_properties[GALA_TOUCHPAD_PINCH_BACKEND_ACTOR_PROPERTY]);
	}
}

static gboolean
_gala_touchpad_pinch_backend_handle_event_clutter_actor_captured_event (ClutterActor* _sender,
                                                                        ClutterEvent* event,
                                                                        gpointer self)
{
	gboolean result;
	result = gala_touchpad_pinch_backend_handle_event ((GalaTouchpadPinchBackend*) self, event);
	return result;
}

static GObject *
gala_touchpad_pinch_backend_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaTouchpadPinchBackend * self;
	ClutterActor* _tmp0_;
	parent_class = G_OBJECT_CLASS (gala_touchpad_pinch_backend_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackend);
	_tmp0_ = self->priv->_actor;
	g_signal_connect_object (_tmp0_, "captured-event", (GCallback) _gala_touchpad_pinch_backend_handle_event_clutter_actor_captured_event, self, 0);
	return obj;
}

static void
gala_touchpad_pinch_backend_class_init (GalaTouchpadPinchBackendClass * klass,
                                        gpointer klass_data)
{
	gala_touchpad_pinch_backend_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaTouchpadPinchBackend_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_touchpad_pinch_backend_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_touchpad_pinch_backend_set_property;
	G_OBJECT_CLASS (klass)->constructor = gala_touchpad_pinch_backend_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_touchpad_pinch_backend_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_TOUCHPAD_PINCH_BACKEND_ACTOR_PROPERTY, gala_touchpad_pinch_backend_properties[GALA_TOUCHPAD_PINCH_BACKEND_ACTOR_PROPERTY] = g_param_spec_object ("actor", "actor", "actor", clutter_actor_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_touchpad_pinch_backend_gala_gesture_backend_interface_init (GalaGestureBackendIface * iface,
                                                                 gpointer iface_data)
{
	gala_touchpad_pinch_backend_gala_gesture_backend_parent_iface = g_type_interface_peek_parent (iface);
	iface->cancel_gesture = (void (*) (GalaGestureBackend*)) gala_touchpad_pinch_backend_real_cancel_gesture;
}

static void
gala_touchpad_pinch_backend_instance_init (GalaTouchpadPinchBackend * self,
                                           gpointer klass)
{
	self->priv = gala_touchpad_pinch_backend_get_instance_private (self);
	self->priv->state = GALA_TOUCHPAD_PINCH_BACKEND_STATE_NONE;
	self->priv->percentage = 0.0;
}

static void
gala_touchpad_pinch_backend_finalize (GObject * obj)
{
	GalaTouchpadPinchBackend * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackend);
	_g_object_unref0 (self->priv->_actor);
	G_OBJECT_CLASS (gala_touchpad_pinch_backend_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_touchpad_pinch_backend_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaTouchpadPinchBackendClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_touchpad_pinch_backend_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaTouchpadPinchBackend), 0, (GInstanceInitFunc) gala_touchpad_pinch_backend_instance_init, NULL };
	static const GInterfaceInfo gala_gesture_backend_info = { (GInterfaceInitFunc) gala_touchpad_pinch_backend_gala_gesture_backend_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gala_touchpad_pinch_backend_type_id;
	gala_touchpad_pinch_backend_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaTouchpadPinchBackend", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (gala_touchpad_pinch_backend_type_id, GALA_TYPE_GESTURE_BACKEND, &gala_gesture_backend_info);
	GalaTouchpadPinchBackend_private_offset = g_type_add_instance_private (gala_touchpad_pinch_backend_type_id, sizeof (GalaTouchpadPinchBackendPrivate));
	return gala_touchpad_pinch_backend_type_id;
}

 G_GNUC_INTERNAL GType
gala_touchpad_pinch_backend_get_type (void)
{
	static gsize gala_touchpad_pinch_backend_type_id__once = 0;
	if (g_once_init_enter (&gala_touchpad_pinch_backend_type_id__once)) {
		GType gala_touchpad_pinch_backend_type_id;
		gala_touchpad_pinch_backend_type_id = gala_touchpad_pinch_backend_get_type_once ();
		g_once_init_leave (&gala_touchpad_pinch_backend_type_id__once, gala_touchpad_pinch_backend_type_id);
	}
	return gala_touchpad_pinch_backend_type_id__once;
}

static void
_vala_gala_touchpad_pinch_backend_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	GalaTouchpadPinchBackend * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackend);
	switch (property_id) {
		case GALA_TOUCHPAD_PINCH_BACKEND_ACTOR_PROPERTY:
		g_value_set_object (value, gala_touchpad_pinch_backend_get_actor (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_touchpad_pinch_backend_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	GalaTouchpadPinchBackend * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_TOUCHPAD_PINCH_BACKEND, GalaTouchpadPinchBackend);
	switch (property_id) {
		case GALA_TOUCHPAD_PINCH_BACKEND_ACTOR_PROPERTY:
		gala_touchpad_pinch_backend_set_actor (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

