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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*-
 *
 * Copyright (C) 2011,2012 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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/>.
 *
 * Authored by: Michael Terry <michael.terry@canonical.com>
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <cairo-gobject.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <lightdm.h>

#define grid_size 40
#define GREETER_LIST_BOX_WIDTH 9
#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
#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 TYPE_LIST_STACK (list_stack_get_type ())
#define LIST_STACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIST_STACK, ListStack))
#define LIST_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIST_STACK, ListStackClass))
#define IS_LIST_STACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIST_STACK))
#define IS_LIST_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIST_STACK))
#define LIST_STACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIST_STACK, ListStackClass))

typedef struct _ListStack ListStack;
typedef struct _ListStackClass ListStackClass;
typedef struct _ListStackPrivate ListStackPrivate;
enum  {
	LIST_STACK_0_PROPERTY,
	LIST_STACK_NUM_CHILDREN_PROPERTY,
	LIST_STACK_NUM_PROPERTIES
};
static GParamSpec* list_stack_properties[LIST_STACK_NUM_PROPERTIES];

#define TYPE_FADABLE_BOX (fadable_box_get_type ())
#define FADABLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FADABLE_BOX, FadableBox))
#define FADABLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FADABLE_BOX, FadableBoxClass))
#define IS_FADABLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FADABLE_BOX))
#define IS_FADABLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FADABLE_BOX))
#define FADABLE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FADABLE_BOX, FadableBoxClass))

typedef struct _FadableBox FadableBox;
typedef struct _FadableBoxClass FadableBoxClass;

#define TYPE_GREETER_LIST (greeter_list_get_type ())
#define GREETER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GREETER_LIST, GreeterList))
#define GREETER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GREETER_LIST, GreeterListClass))
#define IS_GREETER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GREETER_LIST))
#define IS_GREETER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GREETER_LIST))
#define GREETER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GREETER_LIST, GreeterListClass))

typedef struct _GreeterList GreeterList;
typedef struct _GreeterListClass GreeterListClass;

#define TYPE_PROMPT_BOX (prompt_box_get_type ())
#define PROMPT_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROMPT_BOX, PromptBox))
#define PROMPT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROMPT_BOX, PromptBoxClass))
#define IS_PROMPT_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROMPT_BOX))
#define IS_PROMPT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROMPT_BOX))
#define PROMPT_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROMPT_BOX, PromptBoxClass))

typedef struct _PromptBox PromptBox;
typedef struct _PromptBoxClass PromptBoxClass;

#define TYPE_FADABLE (fadable_get_type ())
#define FADABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FADABLE, Fadable))
#define IS_FADABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FADABLE))
#define FADABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FADABLE, FadableIface))

typedef struct _Fadable Fadable;
typedef struct _FadableIface FadableIface;

#define TYPE_FADE_TRACKER (fade_tracker_get_type ())
#define FADE_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FADE_TRACKER, FadeTracker))
#define FADE_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FADE_TRACKER, FadeTrackerClass))
#define IS_FADE_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FADE_TRACKER))
#define IS_FADE_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FADE_TRACKER))
#define FADE_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FADE_TRACKER, FadeTrackerClass))

typedef struct _FadeTracker FadeTracker;
typedef struct _FadeTrackerClass FadeTrackerClass;
typedef struct _FadableBoxPrivate FadableBoxPrivate;
typedef struct _GreeterListPrivate GreeterListPrivate;

#define TYPE_DASH_BOX (dash_box_get_type ())
#define DASH_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DASH_BOX, DashBox))
#define DASH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DASH_BOX, DashBoxClass))
#define IS_DASH_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DASH_BOX))
#define IS_DASH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DASH_BOX))
#define DASH_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DASH_BOX, DashBoxClass))

typedef struct _DashBox DashBox;
typedef struct _DashBoxClass DashBoxClass;
typedef enum  {
	GREETER_LIST_MODE_ENTRY,
	GREETER_LIST_MODE_SCROLLING
} GreeterListMode;

#define GREETER_LIST_TYPE_MODE (greeter_list_mode_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ListStack {
	GtkFixed parent_instance;
	ListStackPrivate * priv;
};

struct _ListStackClass {
	GtkFixedClass parent_class;
};

struct _ListStackPrivate {
	gint width;
};

struct _FadableIface {
	GTypeInterface parent_iface;
	FadeTracker* (*get_fade_tracker) (Fadable* self);
	void (*set_fade_tracker) (Fadable* self, FadeTracker* value);
};

struct _FadableBox {
	GtkEventBox parent_instance;
	FadableBoxPrivate * priv;
};

struct _FadableBoxClass {
	GtkEventBoxClass parent_class;
	void (*draw_full_alpha) (FadableBox* self, cairo_t* c);
};

struct _GreeterList {
	FadableBox parent_instance;
	GreeterListPrivate * priv;
	gchar* greeter_authenticating_user;
	gboolean _always_show_manual;
	GList* entries;
	DashBox* greeter_box;
	GreeterListMode mode;
	gboolean will_clear;
	gboolean auth_interaction_seen;
	gboolean unacknowledged_messages;
	gchar* test_username;
	gboolean test_is_authenticated;
};

struct _GreeterListClass {
	FadableBoxClass parent_class;
	gchar* (*get_selected_id) (GreeterList* self);
	void (*focus_prompt) (GreeterList* self);
	void (*show_authenticated) (GreeterList* self, gboolean successful);
	void (*insert_entry) (GreeterList* self, PromptBox* entry);
	void (*add_manual_entry) (GreeterList* self);
	gint (*get_position_y) (GreeterList* self, gdouble position);
	void (*setup_prompt_box) (GreeterList* self, gboolean fade);
	void (*show_prompt_cb) (GreeterList* self, const gchar* text, LightDMPromptType type);
	void (*authentication_complete_cb) (GreeterList* self);
	void (*start_authentication) (GreeterList* self);
	gchar* (*get_lightdm_session) (GreeterList* self);
	void (*test_start_authentication) (GreeterList* self);
};

static gint ListStack_private_offset;
static gpointer list_stack_parent_class = NULL;

VALA_EXTERN GType list_stack_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ListStack, g_object_unref)
VALA_EXTERN GType fadable_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FadableBox, g_object_unref)
VALA_EXTERN GType greeter_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterList, g_object_unref)
VALA_EXTERN GreeterList* list_stack_top (ListStack* self);
VALA_EXTERN void list_stack_push (ListStack* self,
                      GreeterList* pushed);
VALA_EXTERN void greeter_list_set_start_scrolling (GreeterList* self,
                                       gboolean value);
VALA_EXTERN GType prompt_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PromptBox, g_object_unref)
VALA_EXTERN PromptBox* greeter_list_get_selected_entry (GreeterList* self);
VALA_EXTERN void prompt_box_reset_state (PromptBox* self);
VALA_EXTERN GType fade_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FadeTracker, g_object_unref)
VALA_EXTERN GType fadable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Fadable, g_object_unref)
VALA_EXTERN GType dash_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DashBox, g_object_unref)
VALA_EXTERN GType greeter_list_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void dash_box_push (DashBox* self,
                    GreeterList* l);
VALA_EXTERN void list_stack_pop (ListStack* self);
VALA_EXTERN void dash_box_pop (DashBox* self);
static void list_stack_real_size_allocate (GtkWidget* base,
                                    GtkAllocation* allocation);
static void list_stack_real_get_preferred_width (GtkWidget* base,
                                          gint* min,
                                          gint* nat);
VALA_EXTERN ListStack* list_stack_new (void);
VALA_EXTERN ListStack* list_stack_construct (GType object_type);
VALA_EXTERN guint list_stack_get_num_children (ListStack* self);
static GObject * list_stack_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties);
static void list_stack_finalize (GObject * obj);
static GType list_stack_get_type_once (void);
static void _vala_list_stack_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
list_stack_get_instance_private (ListStack* self)
{
	return G_STRUCT_MEMBER_P (self, ListStack_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 47 "../src/list-stack.vala"
	return self ? g_object_ref (self) : NULL;
#line 258 "list-stack.c"
}

GreeterList*
list_stack_top (ListStack* self)
{
	GList* children = NULL;
	GList* _tmp0_;
	GList* _tmp1_;
	GreeterList* result;
#line 41 "../src/list-stack.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 43 "../src/list-stack.vala"
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
#line 43 "../src/list-stack.vala"
	children = _tmp0_;
#line 44 "../src/list-stack.vala"
	_tmp1_ = children;
#line 44 "../src/list-stack.vala"
	if (_tmp1_ == NULL) {
#line 45 "../src/list-stack.vala"
		result = NULL;
#line 45 "../src/list-stack.vala"
		(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
#line 45 "../src/list-stack.vala"
		return result;
#line 284 "list-stack.c"
	} else {
		GList* _tmp2_;
		GList* _tmp3_;
		gconstpointer _tmp4_;
		GtkWidget* _tmp5_;
		GreeterList* _tmp6_;
#line 47 "../src/list-stack.vala"
		_tmp2_ = children;
#line 47 "../src/list-stack.vala"
		_tmp3_ = g_list_last (_tmp2_);
#line 47 "../src/list-stack.vala"
		_tmp4_ = _tmp3_->data;
#line 47 "../src/list-stack.vala"
		_tmp5_ = (GtkWidget*) _tmp4_;
#line 47 "../src/list-stack.vala"
		_tmp6_ = _g_object_ref0 (IS_GREETER_LIST (_tmp5_) ? ((GreeterList*) _tmp5_) : NULL);
#line 47 "../src/list-stack.vala"
		result = _tmp6_;
#line 47 "../src/list-stack.vala"
		(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
#line 47 "../src/list-stack.vala"
		return result;
#line 307 "list-stack.c"
	}
}

void
list_stack_push (ListStack* self,
                 GreeterList* pushed)
{
	GList* children = NULL;
	GList* _tmp0_;
	GList* _tmp1_;
#line 50 "../src/list-stack.vala"
	g_return_if_fail (self != NULL);
#line 50 "../src/list-stack.vala"
	g_return_if_fail (pushed != NULL);
#line 52 "../src/list-stack.vala"
	g_return_if_fail (pushed != NULL);
#line 54 "../src/list-stack.vala"
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
#line 54 "../src/list-stack.vala"
	children = _tmp0_;
#line 56 "../src/list-stack.vala"
	greeter_list_set_start_scrolling (pushed, FALSE);
#line 57 "../src/list-stack.vala"
	gtk_widget_set_size_request ((GtkWidget*) pushed, self->priv->width, -1);
#line 58 "../src/list-stack.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) pushed);
#line 60 "../src/list-stack.vala"
	_tmp1_ = children;
#line 60 "../src/list-stack.vala"
	if (_tmp1_ != NULL) {
#line 338 "list-stack.c"
		GreeterList* current = NULL;
		GList* _tmp2_;
		GList* _tmp3_;
		gconstpointer _tmp4_;
		GtkWidget* _tmp5_;
		GreeterList* _tmp6_;
		GreeterList* _tmp7_;
		PromptBox* _tmp8_;
		PromptBox* _tmp9_;
		GreeterList* _tmp10_;
		DashBox* _tmp11_;
#line 62 "../src/list-stack.vala"
		_tmp2_ = children;
#line 62 "../src/list-stack.vala"
		_tmp3_ = g_list_last (_tmp2_);
#line 62 "../src/list-stack.vala"
		_tmp4_ = _tmp3_->data;
#line 62 "../src/list-stack.vala"
		_tmp5_ = (GtkWidget*) _tmp4_;
#line 62 "../src/list-stack.vala"
		_tmp6_ = _g_object_ref0 (IS_GREETER_LIST (_tmp5_) ? ((GreeterList*) _tmp5_) : NULL);
#line 62 "../src/list-stack.vala"
		current = _tmp6_;
#line 64 "../src/list-stack.vala"
		_tmp7_ = current;
#line 64 "../src/list-stack.vala"
		_tmp8_ = greeter_list_get_selected_entry (_tmp7_);
#line 64 "../src/list-stack.vala"
		_tmp9_ = _tmp8_;
#line 64 "../src/list-stack.vala"
		prompt_box_reset_state (_tmp9_);
#line 65 "../src/list-stack.vala"
		_tmp10_ = current;
#line 65 "../src/list-stack.vala"
		_tmp11_ = _tmp10_->greeter_box;
#line 65 "../src/list-stack.vala"
		dash_box_push (_tmp11_, pushed);
#line 60 "../src/list-stack.vala"
		_g_object_unref0 (current);
#line 378 "list-stack.c"
	}
#line 50 "../src/list-stack.vala"
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
#line 382 "list-stack.c"
}

void
list_stack_pop (ListStack* self)
{
	GList* children = NULL;
	GList* _tmp0_;
	GList* _tmp1_;
	GList* prev = NULL;
	GList* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
#line 69 "../src/list-stack.vala"
	g_return_if_fail (self != NULL);
#line 71 "../src/list-stack.vala"
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
#line 71 "../src/list-stack.vala"
	children = _tmp0_;
#line 73 "../src/list-stack.vala"
	_tmp1_ = children;
#line 73 "../src/list-stack.vala"
	g_return_if_fail (_tmp1_ != NULL);
#line 75 "../src/list-stack.vala"
	_tmp2_ = children;
#line 75 "../src/list-stack.vala"
	_tmp3_ = g_list_last (_tmp2_);
#line 75 "../src/list-stack.vala"
	_tmp4_ = _tmp3_->prev;
#line 75 "../src/list-stack.vala"
	prev = _tmp4_;
#line 76 "../src/list-stack.vala"
	_tmp5_ = prev;
#line 76 "../src/list-stack.vala"
	if (_tmp5_ != NULL) {
#line 418 "list-stack.c"
		GList* _tmp6_;
		gconstpointer _tmp7_;
		GtkWidget* _tmp8_;
		DashBox* _tmp9_;
#line 77 "../src/list-stack.vala"
		_tmp6_ = prev;
#line 77 "../src/list-stack.vala"
		_tmp7_ = _tmp6_->data;
#line 77 "../src/list-stack.vala"
		_tmp8_ = (GtkWidget*) _tmp7_;
#line 77 "../src/list-stack.vala"
		_tmp9_ = (IS_GREETER_LIST (_tmp8_) ? ((GreeterList*) _tmp8_) : NULL)->greeter_box;
#line 77 "../src/list-stack.vala"
		dash_box_pop (_tmp9_);
#line 433 "list-stack.c"
	}
#line 69 "../src/list-stack.vala"
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
#line 437 "list-stack.c"
}

static void
list_stack_real_size_allocate (GtkWidget* base,
                               GtkAllocation* allocation)
{
	ListStack * self;
	GtkAllocation _tmp0_;
	GList* children = NULL;
	GList* _tmp1_;
	GList* _tmp2_;
#line 80 "../src/list-stack.vala"
	self = (ListStack*) base;
#line 80 "../src/list-stack.vala"
	g_return_if_fail (allocation != NULL);
#line 82 "../src/list-stack.vala"
	_tmp0_ = *allocation;
#line 82 "../src/list-stack.vala"
	GTK_WIDGET_CLASS (list_stack_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_fixed_get_type (), GtkFixed), &_tmp0_);
#line 83 "../src/list-stack.vala"
	_tmp1_ = gtk_container_get_children ((GtkContainer*) self);
#line 83 "../src/list-stack.vala"
	children = _tmp1_;
#line 84 "../src/list-stack.vala"
	_tmp2_ = children;
#line 463 "list-stack.c"
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
#line 84 "../src/list-stack.vala"
		child_collection = _tmp2_;
#line 84 "../src/list-stack.vala"
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
#line 471 "list-stack.c"
			GtkWidget* child = NULL;
#line 84 "../src/list-stack.vala"
			child = (GtkWidget*) child_it->data;
#line 475 "list-stack.c"
			{
				GtkWidget* _tmp3_;
				GtkAllocation _tmp4_;
#line 86 "../src/list-stack.vala"
				_tmp3_ = child;
#line 86 "../src/list-stack.vala"
				_tmp4_ = *allocation;
#line 86 "../src/list-stack.vala"
				gtk_widget_size_allocate (_tmp3_, &_tmp4_);
#line 485 "list-stack.c"
			}
		}
	}
#line 80 "../src/list-stack.vala"
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
#line 491 "list-stack.c"
}

static void
list_stack_real_get_preferred_width (GtkWidget* base,
                                     gint* min,
                                     gint* nat)
{
	ListStack * self;
	gint _vala_min = 0;
	gint _vala_nat = 0;
#line 90 "../src/list-stack.vala"
	self = (ListStack*) base;
#line 92 "../src/list-stack.vala"
	_vala_min = self->priv->width;
#line 93 "../src/list-stack.vala"
	_vala_nat = self->priv->width;
#line 90 "../src/list-stack.vala"
	if (min) {
#line 90 "../src/list-stack.vala"
		*min = _vala_min;
#line 512 "list-stack.c"
	}
#line 90 "../src/list-stack.vala"
	if (nat) {
#line 90 "../src/list-stack.vala"
		*nat = _vala_nat;
#line 518 "list-stack.c"
	}
}

ListStack*
list_stack_construct (GType object_type)
{
	ListStack * self = NULL;
#line 20 "../src/list-stack.vala"
	self = (ListStack*) g_object_new (object_type, NULL);
#line 20 "../src/list-stack.vala"
	return self;
#line 530 "list-stack.c"
}

ListStack*
list_stack_new (void)
{
#line 20 "../src/list-stack.vala"
	return list_stack_construct (TYPE_LIST_STACK);
#line 538 "list-stack.c"
}

guint
list_stack_get_num_children (ListStack* self)
{
	guint result;
	GList* children = NULL;
	GList* _tmp0_;
#line 24 "../src/list-stack.vala"
	g_return_val_if_fail (self != NULL, 0U);
#line 26 "../src/list-stack.vala"
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
#line 26 "../src/list-stack.vala"
	children = _tmp0_;
#line 27 "../src/list-stack.vala"
	result = g_list_length (children);
#line 27 "../src/list-stack.vala"
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
#line 27 "../src/list-stack.vala"
	return result;
#line 559 "list-stack.c"
}

static GObject *
list_stack_constructor (GType type,
                        guint n_construct_properties,
                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ListStack * self;
#line 33 "../src/list-stack.vala"
	parent_class = G_OBJECT_CLASS (list_stack_parent_class);
#line 33 "../src/list-stack.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 33 "../src/list-stack.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIST_STACK, ListStack);
#line 36 "../src/list-stack.vala"
	gtk_container_set_resize_mode ((GtkContainer*) self, GTK_RESIZE_QUEUE);
#line 38 "../src/list-stack.vala"
	self->priv->width = grid_size * GREETER_LIST_BOX_WIDTH;
#line 33 "../src/list-stack.vala"
	return obj;
#line 582 "list-stack.c"
}

static void
list_stack_class_init (ListStackClass * klass,
                       gpointer klass_data)
{
#line 20 "../src/list-stack.vala"
	list_stack_parent_class = g_type_class_peek_parent (klass);
#line 20 "../src/list-stack.vala"
	g_type_class_adjust_private_offset (klass, &ListStack_private_offset);
#line 20 "../src/list-stack.vala"
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, GtkAllocation*)) list_stack_real_size_allocate;
#line 20 "../src/list-stack.vala"
	((GtkWidgetClass *) klass)->get_preferred_width = (void (*) (GtkWidget*, gint*, gint*)) list_stack_real_get_preferred_width;
#line 20 "../src/list-stack.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_list_stack_get_property;
#line 20 "../src/list-stack.vala"
	G_OBJECT_CLASS (klass)->constructor = list_stack_constructor;
#line 20 "../src/list-stack.vala"
	G_OBJECT_CLASS (klass)->finalize = list_stack_finalize;
#line 20 "../src/list-stack.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), LIST_STACK_NUM_CHILDREN_PROPERTY, list_stack_properties[LIST_STACK_NUM_CHILDREN_PROPERTY] = g_param_spec_uint ("num-children", "num-children", "num-children", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
#line 605 "list-stack.c"
}

static void
list_stack_instance_init (ListStack * self,
                          gpointer klass)
{
#line 20 "../src/list-stack.vala"
	self->priv = list_stack_get_instance_private (self);
#line 614 "list-stack.c"
}

static void
list_stack_finalize (GObject * obj)
{
	ListStack * self;
#line 20 "../src/list-stack.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIST_STACK, ListStack);
#line 20 "../src/list-stack.vala"
	G_OBJECT_CLASS (list_stack_parent_class)->finalize (obj);
#line 625 "list-stack.c"
}

static GType
list_stack_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ListStackClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) list_stack_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ListStack), 0, (GInstanceInitFunc) list_stack_instance_init, NULL };
	GType list_stack_type_id;
	list_stack_type_id = g_type_register_static (gtk_fixed_get_type (), "ListStack", &g_define_type_info, 0);
	ListStack_private_offset = g_type_add_instance_private (list_stack_type_id, sizeof (ListStackPrivate));
	return list_stack_type_id;
}

GType
list_stack_get_type (void)
{
	static volatile gsize list_stack_type_id__once = 0;
	if (g_once_init_enter (&list_stack_type_id__once)) {
		GType list_stack_type_id;
		list_stack_type_id = list_stack_get_type_once ();
		g_once_init_leave (&list_stack_type_id__once, list_stack_type_id);
	}
	return list_stack_type_id__once;
}

static void
_vala_list_stack_get_property (GObject * object,
                               guint property_id,
                               GValue * value,
                               GParamSpec * pspec)
{
	ListStack * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_LIST_STACK, ListStack);
#line 20 "../src/list-stack.vala"
	switch (property_id) {
#line 20 "../src/list-stack.vala"
		case LIST_STACK_NUM_CHILDREN_PROPERTY:
#line 20 "../src/list-stack.vala"
		g_value_set_uint (value, list_stack_get_num_children (self));
#line 20 "../src/list-stack.vala"
		break;
#line 666 "list-stack.c"
		default:
#line 20 "../src/list-stack.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "../src/list-stack.vala"
		break;
#line 672 "list-stack.c"
	}
}

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;
}

