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

/*
 * Copyright 2025 elementary, Inc. <https://elementary.io>
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include "gala.h"
#include <glib.h>
#include <float.h>
#include <math.h>
#include <clutter/clutter.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.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

enum  {
	GALA_ROUNDED_CORNERS_EFFECT_0_PROPERTY,
	GALA_ROUNDED_CORNERS_EFFECT_CLIP_RADIUS_PROPERTY,
	GALA_ROUNDED_CORNERS_EFFECT_MONITOR_SCALE_PROPERTY,
	GALA_ROUNDED_CORNERS_EFFECT_NUM_PROPERTIES
};
static GParamSpec* gala_rounded_corners_effect_properties[GALA_ROUNDED_CORNERS_EFFECT_NUM_PROPERTIES];
#define __vala_ClutterActorBox_free0(var) ((var == NULL) ? NULL : (var = (_vala_ClutterActorBox_free (var), NULL)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#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);

struct _GalaRoundedCornersEffectPrivate {
	gint _clip_radius;
	gfloat _monitor_scale;
};

static gint GalaRoundedCornersEffect_private_offset;
static gpointer gala_rounded_corners_effect_parent_class = NULL;

static void gala_rounded_corners_effect_real_set_actor (ClutterActorMeta* base,
                                                 ClutterActor* new_actor);
static void gala_rounded_corners_effect_update_actor_size (GalaRoundedCornersEffect* self);
static void _gala_rounded_corners_effect_update_actor_size_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self);
static void gala_rounded_corners_effect_update_clip_radius (GalaRoundedCornersEffect* self);
static void gala_rounded_corners_effect_clutter_actor_box_enlarge_for_effects (GalaRoundedCornersEffect* self,
                                                                        ClutterActorBox* box);
static void _vala_ClutterActorBox_free (ClutterActorBox* self);
static gint gala_rounded_corners_effect_nearbyint (GalaRoundedCornersEffect* self,
                                            gfloat x);
static GObject * gala_rounded_corners_effect_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void gala_rounded_corners_effect_finalize (GObject * obj);
static GType gala_rounded_corners_effect_get_type_once (void);
static void _vala_gala_rounded_corners_effect_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_gala_rounded_corners_effect_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);

static inline gpointer
gala_rounded_corners_effect_get_instance_private (GalaRoundedCornersEffect* self)
{
	return G_STRUCT_MEMBER_P (self, GalaRoundedCornersEffect_private_offset);
}

GalaRoundedCornersEffect*
gala_rounded_corners_effect_construct (GType object_type,
                                       gint clip_radius,
                                       gfloat monitor_scale)
{
	GalaRoundedCornersEffect * self = NULL;
	self = (GalaRoundedCornersEffect*) g_object_new (object_type, "shader-type", CLUTTER_FRAGMENT_SHADER, "clip-radius", clip_radius, "monitor-scale", monitor_scale, NULL);
	return self;
}

GalaRoundedCornersEffect*
gala_rounded_corners_effect_new (gint clip_radius,
                                 gfloat monitor_scale)
{
	return gala_rounded_corners_effect_construct (GALA_TYPE_ROUNDED_CORNERS_EFFECT, clip_radius, monitor_scale);
}

static void
_gala_rounded_corners_effect_update_actor_size_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self)
{
	gala_rounded_corners_effect_update_actor_size ((GalaRoundedCornersEffect*) self);
}

static void
gala_rounded_corners_effect_real_set_actor (ClutterActorMeta* base,
                                            ClutterActor* new_actor)
{
	GalaRoundedCornersEffect * self;
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	ClutterActor* _tmp10_;
	ClutterActor* _tmp11_;
	self = (GalaRoundedCornersEffect*) base;
	_tmp0_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ClutterActor* _tmp2_;
		ClutterActor* _tmp3_;
		guint _tmp4_;
		GQuark _tmp5_;
		ClutterActor* _tmp6_;
		ClutterActor* _tmp7_;
		guint _tmp8_;
		GQuark _tmp9_;
		_tmp2_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
		_tmp3_ = _tmp2_;
		g_signal_parse_name ("notify::width", G_TYPE_OBJECT, &_tmp4_, &_tmp5_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, _tmp5_, NULL, (GCallback) _gala_rounded_corners_effect_update_actor_size_g_object_notify, self);
		_tmp6_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
		_tmp7_ = _tmp6_;
		g_signal_parse_name ("notify::height", G_TYPE_OBJECT, &_tmp8_, &_tmp9_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp7_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, _tmp9_, NULL, (GCallback) _gala_rounded_corners_effect_update_actor_size_g_object_notify, self);
	}
	CLUTTER_ACTOR_META_CLASS (gala_rounded_corners_effect_parent_class)->set_actor ((ClutterActorMeta*) G_TYPE_CHECK_INSTANCE_CAST (self, clutter_shader_effect_get_type (), ClutterShaderEffect), new_actor);
	_tmp10_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp11_ = _tmp10_;
	if (_tmp11_ != NULL) {
		ClutterActor* _tmp12_;
		ClutterActor* _tmp13_;
		ClutterActor* _tmp14_;
		ClutterActor* _tmp15_;
		_tmp12_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
		_tmp13_ = _tmp12_;
		g_signal_connect_object ((GObject*) _tmp13_, "notify::width", (GCallback) _gala_rounded_corners_effect_update_actor_size_g_object_notify, self, 0);
		_tmp14_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
		_tmp15_ = _tmp14_;
		g_signal_connect_object ((GObject*) _tmp15_, "notify::height", (GCallback) _gala_rounded_corners_effect_update_actor_size_g_object_notify, self, 0);
		gala_rounded_corners_effect_update_clip_radius (self);
		gala_rounded_corners_effect_update_actor_size (self);
	}
}

static void
gala_rounded_corners_effect_update_clip_radius (GalaRoundedCornersEffect* self)
{
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gfloat _tmp4_;
	gfloat _tmp5_;
	GValue _tmp6_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ != NULL, "actor != null");
	_tmp2_ = gala_rounded_corners_effect_get_clip_radius (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gala_rounded_corners_effect_get_monitor_scale (self);
	_tmp5_ = _tmp4_;
	g_value_init (&_tmp6_, G_TYPE_INT);
	g_value_set_int (&_tmp6_, gala_utils_scale_to_int (_tmp3_, _tmp5_));
	clutter_shader_effect_set_uniform_value ((ClutterShaderEffect*) self, "clip_radius", &_tmp6_);
	G_IS_VALUE (&_tmp6_) ? (g_value_unset (&_tmp6_), NULL) : NULL;
}

static void
_vala_ClutterActorBox_free (ClutterActorBox* self)
{
	g_boxed_free (clutter_actor_box_get_type (), self);
}

static void
gala_rounded_corners_effect_update_actor_size (GalaRoundedCornersEffect* self)
{
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	ClutterActorBox actor_box = {0};
	ClutterActor* _tmp2_;
	ClutterActor* _tmp3_;
	ClutterActorBox _tmp4_ = {0};
	gfloat* actor_size = NULL;
	gfloat* _tmp5_;
	gint actor_size_length1;
	gint _actor_size_size_;
	GValue actor_size_value = {0};
	GValue _tmp6_ = {0};
	GValue _tmp7_;
	GValue _tmp8_;
	ClutterActorBox* effect_box = NULL;
	ClutterActorBox* _tmp9_;
	gfloat* full_texture_size = NULL;
	ClutterActorBox* _tmp10_;
	ClutterActorBox* _tmp11_;
	gfloat* _tmp12_;
	gint full_texture_size_length1;
	gint _full_texture_size_size_;
	GValue full_texture_size_value = {0};
	GValue _tmp13_ = {0};
	GValue _tmp14_;
	GValue _tmp15_;
	gfloat* offset = NULL;
	ClutterActorBox _tmp16_;
	ClutterActorBox* _tmp17_;
	ClutterActorBox _tmp18_;
	ClutterActorBox* _tmp19_;
	gfloat* _tmp20_;
	gint offset_length1;
	gint _offset_size_;
	GValue offset_value = {0};
	GValue _tmp21_ = {0};
	GValue _tmp22_;
	GValue _tmp23_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ != NULL, "actor != null");
	_tmp2_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp3_ = _tmp2_;
	clutter_actor_get_allocation_box (_tmp3_, &_tmp4_);
	actor_box = _tmp4_;
	clutter_actor_box_clamp_to_pixel (&actor_box);
	_tmp5_ = g_new0 (gfloat, 2);
	_tmp5_[0] = ceilf (clutter_actor_box_get_width (&actor_box));
	_tmp5_[1] = ceilf (clutter_actor_box_get_height (&actor_box));
	actor_size = _tmp5_;
	actor_size_length1 = 2;
	_actor_size_size_ = actor_size_length1;
	g_value_init (&_tmp6_, clutter_shader_float_get_type ());
	actor_size_value = _tmp6_;
	_tmp7_ = actor_size_value;
	clutter_value_set_shader_float (&_tmp7_, (gint) actor_size_length1, actor_size);
	_tmp8_ = actor_size_value;
	clutter_shader_effect_set_uniform_value ((ClutterShaderEffect*) self, "actor_size", &_tmp8_);
	_tmp9_ = clutter_actor_box_copy (&actor_box);
	effect_box = _tmp9_;
	gala_rounded_corners_effect_clutter_actor_box_enlarge_for_effects (self, effect_box);
	_tmp10_ = effect_box;
	_tmp11_ = effect_box;
	_tmp12_ = g_new0 (gfloat, 2);
	_tmp12_[0] = ceilf (clutter_actor_box_get_width (_tmp10_));
	_tmp12_[1] = ceilf (clutter_actor_box_get_height (_tmp11_));
	full_texture_size = _tmp12_;
	full_texture_size_length1 = 2;
	_full_texture_size_size_ = full_texture_size_length1;
	g_value_init (&_tmp13_, clutter_shader_float_get_type ());
	full_texture_size_value = _tmp13_;
	_tmp14_ = full_texture_size_value;
	clutter_value_set_shader_float (&_tmp14_, (gint) full_texture_size_length1, full_texture_size);
	_tmp15_ = full_texture_size_value;
	clutter_shader_effect_set_uniform_value ((ClutterShaderEffect*) self, "full_texture_size", &_tmp15_);
	_tmp16_ = actor_box;
	_tmp17_ = effect_box;
	_tmp18_ = actor_box;
	_tmp19_ = effect_box;
	_tmp20_ = g_new0 (gfloat, 2);
	_tmp20_[0] = ceilf (_tmp16_.x1 - (*_tmp17_).x1);
	_tmp20_[1] = ceilf (_tmp18_.y1 - (*_tmp19_).y1);
	offset = _tmp20_;
	offset_length1 = 2;
	_offset_size_ = offset_length1;
	g_value_init (&_tmp21_, clutter_shader_float_get_type ());
	offset_value = _tmp21_;
	_tmp22_ = offset_value;
	clutter_value_set_shader_float (&_tmp22_, (gint) offset_length1, offset);
	_tmp23_ = offset_value;
	clutter_shader_effect_set_uniform_value ((ClutterShaderEffect*) self, "offset", &_tmp23_);
	G_IS_VALUE (&offset_value) ? (g_value_unset (&offset_value), NULL) : NULL;
	offset = (g_free (offset), NULL);
	G_IS_VALUE (&full_texture_size_value) ? (g_value_unset (&full_texture_size_value), NULL) : NULL;
	full_texture_size = (g_free (full_texture_size), NULL);
	__vala_ClutterActorBox_free0 (effect_box);
	G_IS_VALUE (&actor_size_value) ? (g_value_unset (&actor_size_value), NULL) : NULL;
	actor_size = (g_free (actor_size), NULL);
}

/**
     * This is the same as mutter's private _clutter_actor_box_enlarge_for_effects function
     * Mutter basically enlarges the texture a bit to "determine a stable quantized size in pixels
     * that doesn't vary due to the original box's sub-pixel position."
     *
     * We need to account for this in our shader code so this function is reimplemented here.
     */
static void
gala_rounded_corners_effect_clutter_actor_box_enlarge_for_effects (GalaRoundedCornersEffect* self,
                                                                   ClutterActorBox* box)
{
	gfloat width = 0.0F;
	ClutterActorBox _tmp0_;
	ClutterActorBox _tmp1_;
	gfloat height = 0.0F;
	ClutterActorBox _tmp2_;
	ClutterActorBox _tmp3_;
	ClutterActorBox _tmp4_;
	ClutterActorBox _tmp5_;
	ClutterActorBox _tmp6_;
	ClutterActorBox _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (box != NULL);
	if (((gdouble) clutter_actor_box_get_area (box)) == 0.0) {
		return;
	}
	_tmp0_ = *box;
	_tmp1_ = *box;
	width = _tmp0_.x2 - _tmp1_.x1;
	_tmp2_ = *box;
	_tmp3_ = *box;
	height = _tmp2_.y2 - _tmp3_.y1;
	width = (gfloat) gala_rounded_corners_effect_nearbyint (self, width);
	height = (gfloat) gala_rounded_corners_effect_nearbyint (self, height);
	_tmp4_ = *box;
	(*box).x2 = ceilf (_tmp4_.x2 + 0.75f);
	_tmp5_ = *box;
	(*box).y2 = ceilf (_tmp5_.y2 + 0.75f);
	_tmp6_ = *box;
	(*box).x1 = (_tmp6_.x2 - width) - 3;
	_tmp7_ = *box;
	(*box).y1 = (_tmp7_.y2 - height) - 3;
}

/**
     * Mutter uses custom nearbyint macro instead of Math.nearbyintf
     */
static gint
gala_rounded_corners_effect_nearbyint (GalaRoundedCornersEffect* self,
                                       gfloat x)
{
	gfloat _tmp0_ = 0.0F;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	if (x < 0.0f) {
		_tmp0_ = x - 0.5f;
	} else {
		_tmp0_ = x + 0.5f;
	}
	result = (gint) _tmp0_;
	return result;
}

gint
gala_rounded_corners_effect_get_clip_radius (GalaRoundedCornersEffect* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_clip_radius;
	return result;
}

void
gala_rounded_corners_effect_set_clip_radius (GalaRoundedCornersEffect* self,
                                             gint value)
{
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	g_return_if_fail (self != NULL);
	self->priv->_clip_radius = value;
	_tmp0_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		gala_rounded_corners_effect_update_clip_radius (self);
	}
	g_object_notify_by_pspec ((GObject *) self, gala_rounded_corners_effect_properties[GALA_ROUNDED_CORNERS_EFFECT_CLIP_RADIUS_PROPERTY]);
}

gfloat
gala_rounded_corners_effect_get_monitor_scale (GalaRoundedCornersEffect* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, 0.0F);
	result = self->priv->_monitor_scale;
	return result;
}

void
gala_rounded_corners_effect_set_monitor_scale (GalaRoundedCornersEffect* self,
                                               gfloat value)
{
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	g_return_if_fail (self != NULL);
	self->priv->_monitor_scale = value;
	_tmp0_ = clutter_actor_meta_get_actor ((ClutterActorMeta*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		gala_rounded_corners_effect_update_clip_radius (self);
		gala_rounded_corners_effect_update_actor_size (self);
	}
	g_object_notify_by_pspec ((GObject *) self, gala_rounded_corners_effect_properties[GALA_ROUNDED_CORNERS_EFFECT_MONITOR_SCALE_PROPERTY]);
}

static GObject *
gala_rounded_corners_effect_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaRoundedCornersEffect * self;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (gala_rounded_corners_effect_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_ROUNDED_CORNERS_EFFECT, GalaRoundedCornersEffect);
	{
		GBytes* bytes = NULL;
		GBytes* _tmp0_;
		GBytes* _tmp1_;
		gsize _tmp2_ = 0;
		guint8* _tmp3_;
		_tmp0_ = g_resources_lookup_data ("/io/elementary/desktop/gala/shaders/rounded-corners.frag", G_RESOURCE_LOOKUP_FLAGS_NONE, &_inner_error0_);
		bytes = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = bytes;
		_tmp3_ = g_bytes_get_data (_tmp1_, &_tmp2_);
		clutter_shader_effect_set_shader_source ((ClutterShaderEffect*) self, (const gchar*) _tmp3_);
		_g_bytes_unref0 (bytes);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("RoundedCornersEffect.vala:53: Unable to load rounded-corners.frag: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	return obj;
}

static void
gala_rounded_corners_effect_class_init (GalaRoundedCornersEffectClass * klass,
                                        gpointer klass_data)
{
	gala_rounded_corners_effect_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaRoundedCornersEffect_private_offset);
	((ClutterActorMetaClass *) klass)->set_actor = (void (*) (ClutterActorMeta*, ClutterActor*)) gala_rounded_corners_effect_real_set_actor;
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_rounded_corners_effect_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_rounded_corners_effect_set_property;
	G_OBJECT_CLASS (klass)->constructor = gala_rounded_corners_effect_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_rounded_corners_effect_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ROUNDED_CORNERS_EFFECT_CLIP_RADIUS_PROPERTY, gala_rounded_corners_effect_properties[GALA_ROUNDED_CORNERS_EFFECT_CLIP_RADIUS_PROPERTY] = g_param_spec_int ("clip-radius", "clip-radius", "clip-radius", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_ROUNDED_CORNERS_EFFECT_MONITOR_SCALE_PROPERTY, gala_rounded_corners_effect_properties[GALA_ROUNDED_CORNERS_EFFECT_MONITOR_SCALE_PROPERTY] = g_param_spec_float ("monitor-scale", "monitor-scale", "monitor-scale", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}

static void
gala_rounded_corners_effect_instance_init (GalaRoundedCornersEffect * self,
                                           gpointer klass)
{
	self->priv = gala_rounded_corners_effect_get_instance_private (self);
	self->priv->_monitor_scale = 1.0f;
}

static void
gala_rounded_corners_effect_finalize (GObject * obj)
{
	GalaRoundedCornersEffect * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_ROUNDED_CORNERS_EFFECT, GalaRoundedCornersEffect);
	G_OBJECT_CLASS (gala_rounded_corners_effect_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_rounded_corners_effect_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaRoundedCornersEffectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_rounded_corners_effect_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaRoundedCornersEffect), 0, (GInstanceInitFunc) gala_rounded_corners_effect_instance_init, NULL };
	GType gala_rounded_corners_effect_type_id;
	gala_rounded_corners_effect_type_id = g_type_register_static (clutter_shader_effect_get_type (), "GalaRoundedCornersEffect", &g_define_type_info, 0);
	GalaRoundedCornersEffect_private_offset = g_type_add_instance_private (gala_rounded_corners_effect_type_id, sizeof (GalaRoundedCornersEffectPrivate));
	return gala_rounded_corners_effect_type_id;
}

GType
gala_rounded_corners_effect_get_type (void)
{
	static gsize gala_rounded_corners_effect_type_id__once = 0;
	if (g_once_init_enter (&gala_rounded_corners_effect_type_id__once)) {
		GType gala_rounded_corners_effect_type_id;
		gala_rounded_corners_effect_type_id = gala_rounded_corners_effect_get_type_once ();
		g_once_init_leave (&gala_rounded_corners_effect_type_id__once, gala_rounded_corners_effect_type_id);
	}
	return gala_rounded_corners_effect_type_id__once;
}

static void
_vala_gala_rounded_corners_effect_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	GalaRoundedCornersEffect * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_ROUNDED_CORNERS_EFFECT, GalaRoundedCornersEffect);
	switch (property_id) {
		case GALA_ROUNDED_CORNERS_EFFECT_CLIP_RADIUS_PROPERTY:
		g_value_set_int (value, gala_rounded_corners_effect_get_clip_radius (self));
		break;
		case GALA_ROUNDED_CORNERS_EFFECT_MONITOR_SCALE_PROPERTY:
		g_value_set_float (value, gala_rounded_corners_effect_get_monitor_scale (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_rounded_corners_effect_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	GalaRoundedCornersEffect * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_ROUNDED_CORNERS_EFFECT, GalaRoundedCornersEffect);
	switch (property_id) {
		case GALA_ROUNDED_CORNERS_EFFECT_CLIP_RADIUS_PROPERTY:
		gala_rounded_corners_effect_set_clip_radius (self, g_value_get_int (value));
		break;
		case GALA_ROUNDED_CORNERS_EFFECT_MONITOR_SCALE_PROPERTY:
		gala_rounded_corners_effect_set_monitor_scale (self, g_value_get_float (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

