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

/*
* Copyright (c) 2011-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 "pantheon-photos-transitions.h"
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib.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

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static void _vala_array_add11 (GdkPixbuf** * array,
                        gint* length,
                        gint* size,
                        GdkPixbuf* value);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

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

static void
_vala_array_add11 (GdkPixbuf** * array,
                   gint* length,
                   gint* size,
                   GdkPixbuf* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GdkPixbuf*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

GdkPixbuf**
resources_load_icon_set (GFile* icon_file,
                         gint* result_length1)
{
	GdkPixbuf* icon = NULL;
	GdkPixbuf** _tmp12_;
	gint _tmp12__length1;
	GError* _inner_error0_ = NULL;
	GdkPixbuf** result;
	icon = NULL;
	{
		GdkPixbuf* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_;
		GdkPixbuf* _tmp3_;
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
		_tmp1_ = g_file_get_path (icon_file);
		_tmp2_ = _tmp1_;
		_tmp3_ = gdk_pixbuf_new_from_file (_tmp2_, &_inner_error0_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		_tmp0_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp5_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (icon);
		icon = _tmp5_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp6_;
		gchar* _tmp7_;
		g_clear_error (&_inner_error0_);
		_tmp6_ = g_file_get_path (icon_file);
		_tmp7_ = _tmp6_;
		g_warning ("Resources.vala:55: couldn't load icon set from %s.", _tmp7_);
		_g_free0 (_tmp7_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (icon);
		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 NULL;
	}
	if (icon_file != NULL) {
		GdkPixbuf** icon_pixbuf_set = NULL;
		GdkPixbuf** _tmp8_;
		gint icon_pixbuf_set_length1;
		gint _icon_pixbuf_set_size_;
		GdkPixbuf* _tmp9_;
		GdkPixbuf* _tmp10_;
		GdkPixbuf** _tmp11_;
		gint _tmp11__length1;
		_tmp8_ = g_new0 (GdkPixbuf*, 0 + 1);
		icon_pixbuf_set = _tmp8_;
		icon_pixbuf_set_length1 = 0;
		_icon_pixbuf_set_size_ = icon_pixbuf_set_length1;
		_tmp9_ = icon;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_vala_array_add11 (&icon_pixbuf_set, &icon_pixbuf_set_length1, &_icon_pixbuf_set_size_, _tmp10_);
		_tmp11_ = icon_pixbuf_set;
		_tmp11__length1 = icon_pixbuf_set_length1;
		if (result_length1) {
			*result_length1 = _tmp11__length1;
		}
		result = _tmp11_;
		_g_object_unref0 (icon);
		return result;
	}
	_tmp12_ = NULL;
	_tmp12__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp12__length1;
	}
	result = _tmp12_;
	_g_object_unref0 (icon);
	return result;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

