/* RootTarget.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from RootTarget.vala, do not modify */

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

#include "gala.h"
#include <glib.h>
#include <glib-object.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 _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

static void _gala_gesture_controller_detached_gweak_notify (gpointer self,
                                                     GObject* object);
static GType gala_root_target_get_type_once (void);

static void
_gala_gesture_controller_detached_gweak_notify (gpointer self,
                                                GObject* object)
{
	gala_gesture_controller_detached ((GalaGestureController*) self);
}

void
gala_root_target_add_gesture_controller (GalaRootTarget* self,
                                         GalaGestureController* controller)
{
	GalaRootTarget* _tmp0_;
	GalaRootTarget* _tmp1_;
	g_return_if_fail (controller != NULL);
	_tmp0_ = gala_gesture_controller_get_target (controller);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ == NULL, "controller.target == null");
	gala_gesture_controller_attached (controller, self);
	g_object_weak_ref ((GObject*) self, _gala_gesture_controller_detached_gweak_notify, controller);
}

ClutterActor*
gala_root_target_get_actor (GalaRootTarget* self)
{
	GalaRootTargetIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GALA_ROOT_TARGET_GET_INTERFACE (self);
	if (_iface_->get_actor) {
		return _iface_->get_actor (self);
	}
	return NULL;
}

static void
gala_root_target_default_init (GalaRootTargetIface * iface,
                               gpointer iface_data)
{
	/**
	     * The actor manipulated by the gesture. The associated frame clock
	     * will be used for animation timelines.
	     */
	g_object_interface_install_property (iface, g_param_spec_object ("actor", "actor", "actor", clutter_actor_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

 G_GNUC_NO_INLINE static GType
gala_root_target_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaRootTargetIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_root_target_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gala_root_target_type_id;
	gala_root_target_type_id = g_type_register_static (G_TYPE_INTERFACE, "GalaRootTarget", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gala_root_target_type_id, G_TYPE_OBJECT);
	g_type_interface_add_prerequisite (gala_root_target_type_id, GALA_TYPE_GESTURE_TARGET);
	return gala_root_target_type_id;
}

GType
gala_root_target_get_type (void)
{
	static gsize gala_root_target_type_id__once = 0;
	if (g_once_init_enter (&gala_root_target_type_id__once)) {
		GType gala_root_target_type_id;
		gala_root_target_type_id = gala_root_target_get_type_once ();
		g_once_init_leave (&gala_root_target_type_id__once, gala_root_target_type_id);
	}
	return gala_root_target_type_id__once;
}

