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

/*
* Copyright (c) 2017 Robert San <robertsanseries@gmail.com>
*
* 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 2 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 <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gobject/gvaluecollector.h>

#define CIANO_CONFIGS_PROPERTIES_TEXT_CONVERT_FILE _ ("Convert File")
#define CIANO_CONFIGS_PROPERTIES_TEXT_CONVERT_FILE_TO _ ("Convert file to")
#define CIANO_CONFIGS_PROPERTIES_NAME _ ("Name")
#define CIANO_CONFIGS_PROPERTIES_TEXT_ADD_ITEMS_TO_CONVERSION _ ("Add items to conversion:")
#define CIANO_CONFIGS_PROPERTIES_DIRECTORY _ ("Directory")
#define CIANO_CONFIGS_PROPERTIES_TEXT_ADD_FILE _ ("Add file")
#define CIANO_CONFIGS_PROPERTIES_TEXT_DELETE _ ("Delete")
#define CIANO_CONFIGS_PROPERTIES_TEXT_CANCEL _ ("Cancel")
#define CIANO_CONFIGS_PROPERTIES_TEXT_START_CONVERSION _ ("Start conversion")
#define CIANO_CONFIGS_PROPERTIES_TEXT_OUTPUT_FOLDER _ ("Output folder:")
#define CIANO_CONFIGS_PROPERTIES_TEXT_OUTPUT_SOURCE_FILE_FOLDER _ ("Files origin:")
#define CIANO_CONFIGS_PROPERTIES_TEXT_SELECT_OUTPUT_FOLDER _ ("Select the output folder:")
#define CIANO_CONFIGS_PROPERTIES_TEXT_NOTIFY _ ("Notifications:")
#define CIANO_CONFIGS_PROPERTIES_TEXT_COMPLETE_NOTIFY _ ("Notify about completed action:")
#define CIANO_CONFIGS_PROPERTIES_TEXT_ERRO_NOTIFY _ ("Notify about an error:")
#define CIANO_CONFIGS_PROPERTIES_TEXT_CLOSE _ ("Close")
#define CIANO_CONFIGS_PROPERTIES_TEXT_OPEN_OUTPUT_FOLDER _ ("Open output folder")
#define CIANO_CONFIGS_PROPERTIES_TEXT_SETTINGS _ ("Settings")
#define CIANO_CONFIGS_PROPERTIES_TEXT_PREFERENCES _ ("Preferences")
#define CIANO_CONFIGS_PROPERTIES_TEXT_EMPTY_CONVERTING_LIST _ ("Empty conversion list")
#define CIANO_CONFIGS_PROPERTIES_TEXT_SELECT_OPTION_TO_CONVERT _ ("Select an option from the side menu to which you want to \n" \
" convert your file")
#define CIANO_CONFIGS_PROPERTIES_TEXT_STARTING _ ("Starting...")
#define CIANO_CONFIGS_PROPERTIES_TEXT_CANCEL_CONVERSION _ ("Cancel conversion")
#define CIANO_CONFIGS_PROPERTIES_TEXT_REMOVE _ ("Remove")
#define CIANO_CONFIGS_PROPERTIES_TEXT_REMOVE_ITEM_FROM_LIST _ ("Remove item from list")
#define CIANO_CONFIGS_PROPERTIES_TEXT_VIDEO _ ("Video")
#define CIANO_CONFIGS_PROPERTIES_TEXT_MUSIC _ ("Music")
#define CIANO_CONFIGS_PROPERTIES_TEXT_IMAGE _ ("Image")
#define CIANO_CONFIGS_PROPERTIES_TEXT_SELECT_FILE _ ("Select file")
#define CIANO_CONFIGS_PROPERTIES_TEXT_ADD _ ("Add")
#define CIANO_CONFIGS_PROPERTIES_TEXT_SUCESS_IN_CONVERSION _ ("Conversion completed")
#define CIANO_CONFIGS_PROPERTIES_TEXT_CANCEL_IN_CONVERSION _ ("Conversion canceled")
#define CIANO_CONFIGS_PROPERTIES_TEXT_ERROR_IN_CONVERSION _ ("Error in conversion")
#define CIANO_CONFIGS_PROPERTIES_TEXT_PERCENTAGE _ ("percentage: ")
#define CIANO_CONFIGS_PROPERTIES_TEXT_SIZE_CUSTOM _ (" - size: ")
#define CIANO_CONFIGS_PROPERTIES_TEXT_TIME_CUSTOM _ (" - time: ")
#define CIANO_CONFIGS_PROPERTIES_TEXT_BITRATE_CUSTOM _ (" - bitrate: ")
#define CIANO_CONFIGS_PROPERTIES_MSG_ERROR_CODECS _ ("Error: Experimental codecs are not enabled")
#define CIANO_CONFIGS_PROPERTIES_MSG_ERROR_INVALID_INPUT_DATA _ ("Error: Invalid data found when processing input")
#define CIANO_CONFIGS_PROPERTIES_MSG_ERROR_NO_SUCH_FILE_DIRECTORY _ ("Error: No such file or directory")
#define CIANO_CONFIGS_PROPERTIES_MSG_ERROR_INVALID_ARGUMENT _ ("Error: Invalid argument")
#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 CIANO_CONFIGS_TYPE_PROPERTIES (ciano_configs_properties_get_type ())
#define CIANO_CONFIGS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CIANO_CONFIGS_TYPE_PROPERTIES, CianoConfigsProperties))
#define CIANO_CONFIGS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CIANO_CONFIGS_TYPE_PROPERTIES, CianoConfigsPropertiesClass))
#define CIANO_CONFIGS_IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CIANO_CONFIGS_TYPE_PROPERTIES))
#define CIANO_CONFIGS_IS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CIANO_CONFIGS_TYPE_PROPERTIES))
#define CIANO_CONFIGS_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CIANO_CONFIGS_TYPE_PROPERTIES, CianoConfigsPropertiesClass))

typedef struct _CianoConfigsProperties CianoConfigsProperties;
typedef struct _CianoConfigsPropertiesClass CianoConfigsPropertiesClass;
typedef struct _CianoConfigsPropertiesPrivate CianoConfigsPropertiesPrivate;
typedef struct _CianoConfigsParamSpecProperties CianoConfigsParamSpecProperties;

struct _CianoConfigsProperties {
	GTypeInstance parent_instance;
	volatile int ref_count;
	CianoConfigsPropertiesPrivate * priv;
};

struct _CianoConfigsPropertiesClass {
	GTypeClass parent_class;
	void (*finalize) (CianoConfigsProperties *self);
};

struct _CianoConfigsParamSpecProperties {
	GParamSpec parent_instance;
};

static gpointer ciano_configs_properties_parent_class = NULL;

VALA_EXTERN gpointer ciano_configs_properties_ref (gpointer instance);
VALA_EXTERN void ciano_configs_properties_unref (gpointer instance);
VALA_EXTERN GParamSpec* ciano_configs_param_spec_properties (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags);
VALA_EXTERN void ciano_configs_value_set_properties (GValue* value,
                                         gpointer v_object);
VALA_EXTERN void ciano_configs_value_take_properties (GValue* value,
                                          gpointer v_object);
VALA_EXTERN gpointer ciano_configs_value_get_properties (const GValue* value);
VALA_EXTERN GType ciano_configs_properties_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CianoConfigsProperties, ciano_configs_properties_unref)
VALA_EXTERN CianoConfigsProperties* ciano_configs_properties_new (void);
VALA_EXTERN CianoConfigsProperties* ciano_configs_properties_construct (GType object_type);
static void ciano_configs_properties_finalize (CianoConfigsProperties * obj);
static GType ciano_configs_properties_get_type_once (void);

CianoConfigsProperties*
ciano_configs_properties_construct (GType object_type)
{
	CianoConfigsProperties* self = NULL;
	self = (CianoConfigsProperties*) g_type_create_instance (object_type);
	return self;
}

CianoConfigsProperties*
ciano_configs_properties_new (void)
{
	return ciano_configs_properties_construct (CIANO_CONFIGS_TYPE_PROPERTIES);
}

static void
ciano_configs_value_properties_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
ciano_configs_value_properties_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		ciano_configs_properties_unref (value->data[0].v_pointer);
	}
}

static void
ciano_configs_value_properties_copy_value (const GValue* src_value,
                                           GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = ciano_configs_properties_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
ciano_configs_value_properties_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
ciano_configs_value_properties_collect_value (GValue* value,
                                              guint n_collect_values,
                                              GTypeCValue* collect_values,
                                              guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		CianoConfigsProperties * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = ciano_configs_properties_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
ciano_configs_value_properties_lcopy_value (const GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	CianoConfigsProperties ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = ciano_configs_properties_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
ciano_configs_param_spec_properties (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags)
{
	CianoConfigsParamSpecProperties* spec;
	g_return_val_if_fail (g_type_is_a (object_type, CIANO_CONFIGS_TYPE_PROPERTIES), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
ciano_configs_value_get_properties (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CIANO_CONFIGS_TYPE_PROPERTIES), NULL);
	return value->data[0].v_pointer;
}

void
ciano_configs_value_set_properties (GValue* value,
                                    gpointer v_object)
{
	CianoConfigsProperties * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CIANO_CONFIGS_TYPE_PROPERTIES));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CIANO_CONFIGS_TYPE_PROPERTIES));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		ciano_configs_properties_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ciano_configs_properties_unref (old);
	}
}

void
ciano_configs_value_take_properties (GValue* value,
                                     gpointer v_object)
{
	CianoConfigsProperties * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CIANO_CONFIGS_TYPE_PROPERTIES));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CIANO_CONFIGS_TYPE_PROPERTIES));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ciano_configs_properties_unref (old);
	}
}

static void
ciano_configs_properties_class_init (CianoConfigsPropertiesClass * klass,
                                     gpointer klass_data)
{
	ciano_configs_properties_parent_class = g_type_class_peek_parent (klass);
	((CianoConfigsPropertiesClass *) klass)->finalize = ciano_configs_properties_finalize;
}

static void
ciano_configs_properties_instance_init (CianoConfigsProperties * self,
                                        gpointer klass)
{
	self->ref_count = 1;
}

static void
ciano_configs_properties_finalize (CianoConfigsProperties * obj)
{
	CianoConfigsProperties * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CIANO_CONFIGS_TYPE_PROPERTIES, CianoConfigsProperties);
	g_signal_handlers_destroy (self);
}

/**
     * The {@code Properties} class is responsible for defining all 
     * the texts that are displayed in the application and must be translated.
     *
     * @since 0.1.0
     */
static GType
ciano_configs_properties_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { ciano_configs_value_properties_init, ciano_configs_value_properties_free_value, ciano_configs_value_properties_copy_value, ciano_configs_value_properties_peek_pointer, "p", ciano_configs_value_properties_collect_value, "p", ciano_configs_value_properties_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (CianoConfigsPropertiesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ciano_configs_properties_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CianoConfigsProperties), 0, (GInstanceInitFunc) ciano_configs_properties_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType ciano_configs_properties_type_id;
	ciano_configs_properties_type_id = g_type_register_fundamental (g_type_fundamental_next (), "CianoConfigsProperties", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return ciano_configs_properties_type_id;
}

GType
ciano_configs_properties_get_type (void)
{
	static volatile gsize ciano_configs_properties_type_id__once = 0;
	if (g_once_init_enter (&ciano_configs_properties_type_id__once)) {
		GType ciano_configs_properties_type_id;
		ciano_configs_properties_type_id = ciano_configs_properties_get_type_once ();
		g_once_init_leave (&ciano_configs_properties_type_id__once, ciano_configs_properties_type_id);
	}
	return ciano_configs_properties_type_id__once;
}

gpointer
ciano_configs_properties_ref (gpointer instance)
{
	CianoConfigsProperties * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
ciano_configs_properties_unref (gpointer instance)
{
	CianoConfigsProperties * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		CIANO_CONFIGS_PROPERTIES_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

