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

/**/
/*  Copyright (C) 2014 Tom Beckmann*/
/**/
/*  This program is free software: you can redistribute it and/or modify*/
/*  it under the terms of the GNU General Public License as published by*/
/*  the Free Software Foundation, either version 3 of the License, or*/
/*  (at your option) any later version.*/
/**/
/*  This program is distributed in the hope that it will be useful,*/
/*  but WITHOUT ANY WARRANTY; without even the implied warranty of*/
/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the*/
/*  GNU General Public License for more details.*/
/**/
/*  You should have received a copy of the GNU General Public License*/
/*  along with this program.  If not, see <http://www.gnu.org/licenses/>.*/
/**/

#include <clutter/clutter.h>
#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include "gala.h"
#include <meta/prefs.h>
#include <meta/window.h>
#include <string.h>

#define GALA_WORKSPACE_INSERT_THUMB_EXPAND_DELAY 300
#define GALA_ICON_GROUP_CONTAINER_SPACING 48
#define GALA_ICON_GROUP_CONTAINER_GROUP_WIDTH 64
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GALA_TYPE_WORKSPACE_INSERT_THUMB (gala_workspace_insert_thumb_get_type ())
#define GALA_WORKSPACE_INSERT_THUMB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_WORKSPACE_INSERT_THUMB, GalaWorkspaceInsertThumb))
#define GALA_WORKSPACE_INSERT_THUMB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_WORKSPACE_INSERT_THUMB, GalaWorkspaceInsertThumbClass))
#define GALA_IS_WORKSPACE_INSERT_THUMB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_WORKSPACE_INSERT_THUMB))
#define GALA_IS_WORKSPACE_INSERT_THUMB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_WORKSPACE_INSERT_THUMB))
#define GALA_WORKSPACE_INSERT_THUMB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_WORKSPACE_INSERT_THUMB, GalaWorkspaceInsertThumbClass))

typedef struct _GalaWorkspaceInsertThumb GalaWorkspaceInsertThumb;
typedef struct _GalaWorkspaceInsertThumbClass GalaWorkspaceInsertThumbClass;
typedef struct _GalaWorkspaceInsertThumbPrivate GalaWorkspaceInsertThumbPrivate;
enum  {
	GALA_WORKSPACE_INSERT_THUMB_0_PROPERTY,
	GALA_WORKSPACE_INSERT_THUMB_WORKSPACE_INDEX_PROPERTY,
	GALA_WORKSPACE_INSERT_THUMB_EXPANDED_PROPERTY,
	GALA_WORKSPACE_INSERT_THUMB_DELAY_PROPERTY,
	GALA_WORKSPACE_INSERT_THUMB_NUM_PROPERTIES
};
static GParamSpec* gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_NUM_PROPERTIES];

#define GALA_TYPE_WINDOW_CLONE (gala_window_clone_get_type ())
#define GALA_WINDOW_CLONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_WINDOW_CLONE, GalaWindowClone))
#define GALA_WINDOW_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_WINDOW_CLONE, GalaWindowCloneClass))
#define GALA_IS_WINDOW_CLONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_WINDOW_CLONE))
#define GALA_IS_WINDOW_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_WINDOW_CLONE))
#define GALA_WINDOW_CLONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_WINDOW_CLONE, GalaWindowCloneClass))

typedef struct _GalaWindowClone GalaWindowClone;
typedef struct _GalaWindowCloneClass GalaWindowCloneClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GalaWorkspaceInsertThumb {
	ClutterActor parent_instance;
	GalaWorkspaceInsertThumbPrivate * priv;
};

struct _GalaWorkspaceInsertThumbClass {
	ClutterActorClass parent_class;
};

struct _GalaWorkspaceInsertThumbPrivate {
	gint _workspace_index;
	gboolean _expanded;
	gint _delay;
	guint expand_timeout;
};

static gint GalaWorkspaceInsertThumb_private_offset;
static gpointer gala_workspace_insert_thumb_parent_class = NULL;

VALA_EXTERN GType gala_workspace_insert_thumb_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaWorkspaceInsertThumb, g_object_unref)
VALA_EXTERN GalaWorkspaceInsertThumb* gala_workspace_insert_thumb_new (gint workspace_index);
VALA_EXTERN GalaWorkspaceInsertThumb* gala_workspace_insert_thumb_construct (GType object_type,
                                                                 gint workspace_index);
VALA_EXTERN gint gala_internal_utils_get_ui_scaling_factor (void);
static void __lambda104_ (GalaWorkspaceInsertThumb* self,
                   ClutterActor* target,
                   gboolean hovered);
VALA_EXTERN GType gala_window_clone_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaWindowClone, g_object_unref)
static void gala_workspace_insert_thumb_transform (GalaWorkspaceInsertThumb* self,
                                            gboolean expand);
VALA_EXTERN gint gala_workspace_insert_thumb_get_delay (GalaWorkspaceInsertThumb* self);
static gboolean gala_workspace_insert_thumb_expand (GalaWorkspaceInsertThumb* self);
static gboolean _gala_workspace_insert_thumb_expand_gsource_func (gpointer self);
static void ___lambda104__gala_drag_drop_action_crossed (GalaDragDropAction* _sender,
                                                  ClutterActor* target,
                                                  gboolean hovered,
                                                  gpointer self);
VALA_EXTERN void gala_workspace_insert_thumb_set_window_thumb (GalaWorkspaceInsertThumb* self,
                                                   MetaWindow* window);
VALA_EXTERN void gala_workspace_insert_thumb_set_expanded (GalaWorkspaceInsertThumb* self,
                                               gboolean value);
static void gala_workspace_insert_thumb_add_pulse_animation (GalaWorkspaceInsertThumb* self);
VALA_EXTERN gint gala_workspace_insert_thumb_get_workspace_index (GalaWorkspaceInsertThumb* self);
VALA_EXTERN void gala_workspace_insert_thumb_set_workspace_index (GalaWorkspaceInsertThumb* self,
                                                      gint value);
VALA_EXTERN gboolean gala_workspace_insert_thumb_get_expanded (GalaWorkspaceInsertThumb* self);
VALA_EXTERN void gala_workspace_insert_thumb_set_delay (GalaWorkspaceInsertThumb* self,
                                            gint value);
static void gala_workspace_insert_thumb_finalize (GObject * obj);
static GType gala_workspace_insert_thumb_get_type_once (void);
static void _vala_gala_workspace_insert_thumb_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_gala_workspace_insert_thumb_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
gala_workspace_insert_thumb_get_instance_private (GalaWorkspaceInsertThumb* self)
{
	return G_STRUCT_MEMBER_P (self, GalaWorkspaceInsertThumb_private_offset);
}

static gboolean
_gala_workspace_insert_thumb_expand_gsource_func (gpointer self)
{
	gboolean result;
	result = gala_workspace_insert_thumb_expand ((GalaWorkspaceInsertThumb*) self);
	return result;
}

static void
__lambda104_ (GalaWorkspaceInsertThumb* self,
              ClutterActor* target,
              gboolean hovered)
{
	gboolean _tmp0_ = FALSE;
	if (!meta_prefs_get_dynamic_workspaces ()) {
		gboolean _tmp1_ = FALSE;
		if (target != NULL) {
			_tmp1_ = GALA_IS_WINDOW_CLONE (target);
		} else {
			_tmp1_ = FALSE;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	if (!hovered) {
		if (self->priv->expand_timeout != ((guint) 0)) {
			g_source_remove (self->priv->expand_timeout);
			self->priv->expand_timeout = (guint) 0;
		}
		gala_workspace_insert_thumb_transform (self, FALSE);
	} else {
		gint _tmp2_;
		_tmp2_ = self->priv->_delay;
		self->priv->expand_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) _tmp2_, _gala_workspace_insert_thumb_expand_gsource_func, g_object_ref (self), g_object_unref);
	}
}

static void
___lambda104__gala_drag_drop_action_crossed (GalaDragDropAction* _sender,
                                             ClutterActor* target,
                                             gboolean hovered,
                                             gpointer self)
{
	__lambda104_ ((GalaWorkspaceInsertThumb*) self, target, hovered);
}

GalaWorkspaceInsertThumb*
gala_workspace_insert_thumb_construct (GType object_type,
                                       gint workspace_index)
{
	GalaWorkspaceInsertThumb * self = NULL;
	gint scale = 0;
	GalaDragDropAction* drop = NULL;
	GalaDragDropAction* _tmp0_;
	self = (GalaWorkspaceInsertThumb*) g_object_new (object_type, "workspace-index", workspace_index, NULL);
	scale = gala_internal_utils_get_ui_scaling_factor ();
	clutter_actor_set_width ((ClutterActor*) self, (gfloat) (GALA_ICON_GROUP_CONTAINER_SPACING * scale));
	clutter_actor_set_height ((ClutterActor*) self, (gfloat) (GALA_ICON_GROUP_CONTAINER_GROUP_WIDTH * scale));
	clutter_actor_set_y ((ClutterActor*) self, (gfloat) (((GALA_ICON_GROUP_CONTAINER_GROUP_WIDTH * scale) - (GALA_ICON_GROUP_CONTAINER_SPACING * scale)) / 2));
	clutter_actor_set_opacity ((ClutterActor*) self, (guint) 0);
	clutter_actor_set_pivot_point ((ClutterActor*) self, 0.5f, 0.5f);
	clutter_actor_set_reactive ((ClutterActor*) self, TRUE);
	clutter_actor_set_x_align ((ClutterActor*) self, CLUTTER_ACTOR_ALIGN_CENTER);
	_tmp0_ = gala_drag_drop_action_new (GALA_DRAG_DROP_ACTION_TYPE_DESTINATION, "multitaskingview-window");
	g_object_ref_sink (_tmp0_);
	drop = _tmp0_;
	g_signal_connect_object (drop, "crossed", (GCallback) ___lambda104__gala_drag_drop_action_crossed, self, 0);
	clutter_actor_add_action ((ClutterActor*) self, (ClutterAction*) drop);
	_g_object_unref0 (drop);
	return self;
}

GalaWorkspaceInsertThumb*
gala_workspace_insert_thumb_new (gint workspace_index)
{
	return gala_workspace_insert_thumb_construct (GALA_TYPE_WORKSPACE_INSERT_THUMB, workspace_index);
}

void
gala_workspace_insert_thumb_set_window_thumb (GalaWorkspaceInsertThumb* self,
                                              MetaWindow* window)
{
	gint scale = 0;
	GalaWindowIcon* icon = NULL;
	GalaWindowIcon* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	clutter_actor_destroy_all_children ((ClutterActor*) self);
	scale = gala_internal_utils_get_ui_scaling_factor ();
	_tmp0_ = gala_window_icon_new (window, GALA_ICON_GROUP_CONTAINER_GROUP_WIDTH, scale, FALSE);
	clutter_actor_set_x ((ClutterActor*) _tmp0_, (gfloat) GALA_ICON_GROUP_CONTAINER_SPACING);
	clutter_actor_set_x_align ((ClutterActor*) _tmp0_, CLUTTER_ACTOR_ALIGN_CENTER);
	g_object_ref_sink (_tmp0_);
	icon = _tmp0_;
	clutter_actor_add_child ((ClutterActor*) self, (ClutterActor*) icon);
	_g_object_unref0 (icon);
}

static gboolean
gala_workspace_insert_thumb_expand (GalaWorkspaceInsertThumb* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	self->priv->expand_timeout = (guint) 0;
	gala_workspace_insert_thumb_transform (self, TRUE);
	result = FALSE;
	return result;
}

static void
gala_workspace_insert_thumb_transform (GalaWorkspaceInsertThumb* self,
                                       gboolean expand)
{
	gint scale = 0;
	g_return_if_fail (self != NULL);
	clutter_actor_save_easing_state ((ClutterActor*) self);
	clutter_actor_set_easing_mode ((ClutterActor*) self, CLUTTER_EASE_OUT_QUAD);
	clutter_actor_set_easing_duration ((ClutterActor*) self, (guint) 200);
	scale = gala_internal_utils_get_ui_scaling_factor ();
	if (!expand) {
		clutter_actor_remove_transition ((ClutterActor*) self, "pulse");
		clutter_actor_set_opacity ((ClutterActor*) self, (guint) 0);
		clutter_actor_set_width ((ClutterActor*) self, (gfloat) (GALA_ICON_GROUP_CONTAINER_SPACING * scale));
		gala_workspace_insert_thumb_set_expanded (self, FALSE);
	} else {
		gala_workspace_insert_thumb_add_pulse_animation (self);
		clutter_actor_set_opacity ((ClutterActor*) self, (guint) 200);
		clutter_actor_set_width ((ClutterActor*) self, (gfloat) ((GALA_ICON_GROUP_CONTAINER_GROUP_WIDTH * scale) + (GALA_ICON_GROUP_CONTAINER_SPACING * 2)));
		gala_workspace_insert_thumb_set_expanded (self, TRUE);
	}
	clutter_actor_restore_easing_state ((ClutterActor*) self);
}

static void
gala_workspace_insert_thumb_add_pulse_animation (GalaWorkspaceInsertThumb* self)
{
	ClutterTransitionGroup* transition = NULL;
	ClutterTransitionGroup* _tmp0_ = NULL;
	ClutterPropertyTransition* scale_x_transition = NULL;
	ClutterPropertyTransition* _tmp1_;
	GValue _tmp2_ = {0};
	GValue _tmp3_ = {0};
	ClutterPropertyTransition* scale_y_transition = NULL;
	ClutterPropertyTransition* _tmp4_;
	GValue _tmp5_ = {0};
	GValue _tmp6_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = (ClutterTransitionGroup*) clutter_transition_group_new ();
	clutter_timeline_set_duration ((ClutterTimeline*) _tmp0_, (guint) 800);
	clutter_timeline_set_auto_reverse ((ClutterTimeline*) _tmp0_, TRUE);
	clutter_timeline_set_repeat_count ((ClutterTimeline*) _tmp0_, -1);
	clutter_timeline_set_progress_mode ((ClutterTimeline*) _tmp0_, CLUTTER_LINEAR);
	transition = _tmp0_;
	_tmp1_ = (ClutterPropertyTransition*) clutter_property_transition_new ("scale-x");
	scale_x_transition = _tmp1_;
	g_value_init (&_tmp2_, G_TYPE_DOUBLE);
	g_value_set_double (&_tmp2_, 0.8);
	clutter_transition_set_from_value ((ClutterTransition*) scale_x_transition, &_tmp2_);
	G_IS_VALUE (&_tmp2_) ? (g_value_unset (&_tmp2_), NULL) : NULL;
	g_value_init (&_tmp3_, G_TYPE_DOUBLE);
	g_value_set_double (&_tmp3_, 1.1);
	clutter_transition_set_to_value ((ClutterTransition*) scale_x_transition, &_tmp3_);
	G_IS_VALUE (&_tmp3_) ? (g_value_unset (&_tmp3_), NULL) : NULL;
	clutter_timeline_set_auto_reverse ((ClutterTimeline*) scale_x_transition, TRUE);
	_tmp4_ = (ClutterPropertyTransition*) clutter_property_transition_new ("scale-y");
	scale_y_transition = _tmp4_;
	g_value_init (&_tmp5_, G_TYPE_DOUBLE);
	g_value_set_double (&_tmp5_, 0.8);
	clutter_transition_set_from_value ((ClutterTransition*) scale_y_transition, &_tmp5_);
	G_IS_VALUE (&_tmp5_) ? (g_value_unset (&_tmp5_), NULL) : NULL;
	g_value_init (&_tmp6_, G_TYPE_DOUBLE);
	g_value_set_double (&_tmp6_, 1.1);
	clutter_transition_set_to_value ((ClutterTransition*) scale_y_transition, &_tmp6_);
	G_IS_VALUE (&_tmp6_) ? (g_value_unset (&_tmp6_), NULL) : NULL;
	clutter_timeline_set_auto_reverse ((ClutterTimeline*) scale_y_transition, TRUE);
	clutter_transition_group_add_transition (transition, (ClutterTransition*) scale_x_transition);
	clutter_transition_group_add_transition (transition, (ClutterTransition*) scale_y_transition);
	clutter_actor_add_transition ((ClutterActor*) self, "pulse", (ClutterTransition*) transition);
	_g_object_unref0 (scale_y_transition);
	_g_object_unref0 (scale_x_transition);
	_g_object_unref0 (transition);
}

gint
gala_workspace_insert_thumb_get_workspace_index (GalaWorkspaceInsertThumb* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_workspace_index;
	return result;
}

void
gala_workspace_insert_thumb_set_workspace_index (GalaWorkspaceInsertThumb* self,
                                                 gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_workspace_insert_thumb_get_workspace_index (self);
	if (old_value != value) {
		self->priv->_workspace_index = value;
		g_object_notify_by_pspec ((GObject *) self, gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_WORKSPACE_INDEX_PROPERTY]);
	}
}

gboolean
gala_workspace_insert_thumb_get_expanded (GalaWorkspaceInsertThumb* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_expanded;
	return result;
}

void
gala_workspace_insert_thumb_set_expanded (GalaWorkspaceInsertThumb* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_workspace_insert_thumb_get_expanded (self);
	if (old_value != value) {
		self->priv->_expanded = value;
		g_object_notify_by_pspec ((GObject *) self, gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_EXPANDED_PROPERTY]);
	}
}

gint
gala_workspace_insert_thumb_get_delay (GalaWorkspaceInsertThumb* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_delay;
	return result;
}

void
gala_workspace_insert_thumb_set_delay (GalaWorkspaceInsertThumb* self,
                                       gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_workspace_insert_thumb_get_delay (self);
	if (old_value != value) {
		self->priv->_delay = value;
		g_object_notify_by_pspec ((GObject *) self, gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_DELAY_PROPERTY]);
	}
}

static void
gala_workspace_insert_thumb_class_init (GalaWorkspaceInsertThumbClass * klass,
                                        gpointer klass_data)
{
	gala_workspace_insert_thumb_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaWorkspaceInsertThumb_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_workspace_insert_thumb_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_workspace_insert_thumb_set_property;
	G_OBJECT_CLASS (klass)->finalize = gala_workspace_insert_thumb_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_WORKSPACE_INSERT_THUMB_WORKSPACE_INDEX_PROPERTY, gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_WORKSPACE_INDEX_PROPERTY] = g_param_spec_int ("workspace-index", "workspace-index", "workspace-index", 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_WORKSPACE_INSERT_THUMB_EXPANDED_PROPERTY, gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_EXPANDED_PROPERTY] = g_param_spec_boolean ("expanded", "expanded", "expanded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_WORKSPACE_INSERT_THUMB_DELAY_PROPERTY, gala_workspace_insert_thumb_properties[GALA_WORKSPACE_INSERT_THUMB_DELAY_PROPERTY] = g_param_spec_int ("delay", "delay", "delay", G_MININT, G_MAXINT, GALA_WORKSPACE_INSERT_THUMB_EXPAND_DELAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gala_workspace_insert_thumb_instance_init (GalaWorkspaceInsertThumb * self,
                                           gpointer klass)
{
	self->priv = gala_workspace_insert_thumb_get_instance_private (self);
	self->priv->_expanded = FALSE;
	self->priv->_delay = GALA_WORKSPACE_INSERT_THUMB_EXPAND_DELAY;
	self->priv->expand_timeout = (guint) 0;
}

static void
gala_workspace_insert_thumb_finalize (GObject * obj)
{
	GalaWorkspaceInsertThumb * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_WORKSPACE_INSERT_THUMB, GalaWorkspaceInsertThumb);
	G_OBJECT_CLASS (gala_workspace_insert_thumb_parent_class)->finalize (obj);
}

static GType
gala_workspace_insert_thumb_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaWorkspaceInsertThumbClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_workspace_insert_thumb_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaWorkspaceInsertThumb), 0, (GInstanceInitFunc) gala_workspace_insert_thumb_instance_init, NULL };
	GType gala_workspace_insert_thumb_type_id;
	gala_workspace_insert_thumb_type_id = g_type_register_static (clutter_actor_get_type (), "GalaWorkspaceInsertThumb", &g_define_type_info, 0);
	GalaWorkspaceInsertThumb_private_offset = g_type_add_instance_private (gala_workspace_insert_thumb_type_id, sizeof (GalaWorkspaceInsertThumbPrivate));
	return gala_workspace_insert_thumb_type_id;
}

GType
gala_workspace_insert_thumb_get_type (void)
{
	static volatile gsize gala_workspace_insert_thumb_type_id__once = 0;
	if (g_once_init_enter (&gala_workspace_insert_thumb_type_id__once)) {
		GType gala_workspace_insert_thumb_type_id;
		gala_workspace_insert_thumb_type_id = gala_workspace_insert_thumb_get_type_once ();
		g_once_init_leave (&gala_workspace_insert_thumb_type_id__once, gala_workspace_insert_thumb_type_id);
	}
	return gala_workspace_insert_thumb_type_id__once;
}

static void
_vala_gala_workspace_insert_thumb_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	GalaWorkspaceInsertThumb * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_WORKSPACE_INSERT_THUMB, GalaWorkspaceInsertThumb);
	switch (property_id) {
		case GALA_WORKSPACE_INSERT_THUMB_WORKSPACE_INDEX_PROPERTY:
		g_value_set_int (value, gala_workspace_insert_thumb_get_workspace_index (self));
		break;
		case GALA_WORKSPACE_INSERT_THUMB_EXPANDED_PROPERTY:
		g_value_set_boolean (value, gala_workspace_insert_thumb_get_expanded (self));
		break;
		case GALA_WORKSPACE_INSERT_THUMB_DELAY_PROPERTY:
		g_value_set_int (value, gala_workspace_insert_thumb_get_delay (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_workspace_insert_thumb_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	GalaWorkspaceInsertThumb * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_WORKSPACE_INSERT_THUMB, GalaWorkspaceInsertThumb);
	switch (property_id) {
		case GALA_WORKSPACE_INSERT_THUMB_WORKSPACE_INDEX_PROPERTY:
		gala_workspace_insert_thumb_set_workspace_index (self, g_value_get_int (value));
		break;
		case GALA_WORKSPACE_INSERT_THUMB_EXPANDED_PROPERTY:
		gala_workspace_insert_thumb_set_expanded (self, g_value_get_boolean (value));
		break;
		case GALA_WORKSPACE_INSERT_THUMB_DELAY_PROPERTY:
		gala_workspace_insert_thumb_set_delay (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

