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

/*
* Copyright (c) 2009-2013 Yorba Foundation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include "io.elementary.photos.h"
#include <glib-object.h>
#include <glib.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _CollectionViewManagerPrivate {
	CollectionPage* page;
};

static gint CollectionViewManager_private_offset;
static gpointer collection_view_manager_parent_class = NULL;

static DataView* collection_view_manager_real_create_view (ViewManager* base,
                                                    DataSource* source);
static void collection_view_manager_finalize (ViewManager * obj);
static GType collection_view_manager_get_type_once (void);

static inline gpointer
collection_view_manager_get_instance_private (CollectionViewManager* self)
{
	return G_STRUCT_MEMBER_P (self, CollectionViewManager_private_offset);
}

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

CollectionViewManager*
collection_view_manager_construct (GType object_type,
                                   CollectionPage* page)
{
	CollectionViewManager* self = NULL;
	CollectionPage* _tmp0_;
	g_return_val_if_fail (page != NULL, NULL);
	self = (CollectionViewManager*) view_manager_construct (object_type);
	_tmp0_ = _g_object_ref0 (page);
	_g_object_unref0 (self->priv->page);
	self->priv->page = _tmp0_;
	return self;
}

CollectionViewManager*
collection_view_manager_new (CollectionPage* page)
{
	return collection_view_manager_construct (TYPE_COLLECTION_VIEW_MANAGER, page);
}

static DataView*
collection_view_manager_real_create_view (ViewManager* base,
                                          DataSource* source)
{
	CollectionViewManager * self;
	CollectionPage* _tmp0_;
	DataView* _tmp1_;
	DataView* result;
	self = (CollectionViewManager*) base;
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = self->priv->page;
	_tmp1_ = media_page_create_thumbnail ((MediaPage*) _tmp0_, source);
	result = _tmp1_;
	return result;
}

static void
collection_view_manager_class_init (CollectionViewManagerClass * klass,
                                    gpointer klass_data)
{
	collection_view_manager_parent_class = g_type_class_peek_parent (klass);
	((ViewManagerClass *) klass)->finalize = collection_view_manager_finalize;
	g_type_class_adjust_private_offset (klass, &CollectionViewManager_private_offset);
	((ViewManagerClass *) klass)->create_view = (DataView* (*) (ViewManager*, DataSource*)) collection_view_manager_real_create_view;
}

static void
collection_view_manager_instance_init (CollectionViewManager * self,
                                       gpointer klass)
{
	self->priv = collection_view_manager_get_instance_private (self);
}

static void
collection_view_manager_finalize (ViewManager * obj)
{
	CollectionViewManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_COLLECTION_VIEW_MANAGER, CollectionViewManager);
	_g_object_unref0 (self->priv->page);
	VIEW_MANAGER_CLASS (collection_view_manager_parent_class)->finalize (obj);
}

static GType
collection_view_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CollectionViewManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) collection_view_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CollectionViewManager), 0, (GInstanceInitFunc) collection_view_manager_instance_init, NULL };
	GType collection_view_manager_type_id;
	collection_view_manager_type_id = g_type_register_static (TYPE_VIEW_MANAGER, "CollectionViewManager", &g_define_type_info, 0);
	CollectionViewManager_private_offset = g_type_add_instance_private (collection_view_manager_type_id, sizeof (CollectionViewManagerPrivate));
	return collection_view_manager_type_id;
}

GType
collection_view_manager_get_type (void)
{
	static volatile gsize collection_view_manager_type_id__once = 0;
	if (g_once_init_enter (&collection_view_manager_type_id__once)) {
		GType collection_view_manager_type_id;
		collection_view_manager_type_id = collection_view_manager_get_type_once ();
		g_once_init_leave (&collection_view_manager_type_id__once, collection_view_manager_type_id);
	}
	return collection_view_manager_type_id__once;
}

