/* gamepad-view-configuration.c generated by valac 0.36.12.13-3ae08, the Vala compiler
 * generated from gamepad-view-configuration.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define GAMES_TYPE_GAMEPAD_INPUT_PATH (games_gamepad_input_path_get_type ())

#define GAMES_TYPE_GAMEPAD_INPUT (games_gamepad_input_get_type ())
typedef struct _GamesGamepadInput GamesGamepadInput;
typedef struct _GamesGamepadInputPath GamesGamepadInputPath;
#define _g_free0(var) (var = (g_free (var), NULL))

#define GAMES_TYPE_GAMEPAD_VIEW_CONFIGURATION (games_gamepad_view_configuration_get_type ())
typedef struct _GamesGamepadViewConfiguration GamesGamepadViewConfiguration;

struct _GamesGamepadInput {
	guint16 type;
	guint16 code;
};

struct _GamesGamepadInputPath {
	GamesGamepadInput input;
	gchar* path;
};

struct _GamesGamepadViewConfiguration {
	gchar* svg_path;
	GamesGamepadInputPath* input_paths;
	gint input_paths_length1;
	gint _input_paths_size_;
};



GType games_gamepad_input_path_get_type (void) G_GNUC_CONST;
GType games_gamepad_input_get_type (void) G_GNUC_CONST;
GamesGamepadInput* games_gamepad_input_dup (const GamesGamepadInput* self);
void games_gamepad_input_free (GamesGamepadInput* self);
GamesGamepadInputPath* games_gamepad_input_path_dup (const GamesGamepadInputPath* self);
void games_gamepad_input_path_free (GamesGamepadInputPath* self);
void games_gamepad_input_path_copy (const GamesGamepadInputPath* self, GamesGamepadInputPath* dest);
void games_gamepad_input_path_destroy (GamesGamepadInputPath* self);
GType games_gamepad_view_configuration_get_type (void) G_GNUC_CONST;
GamesGamepadViewConfiguration* games_gamepad_view_configuration_dup (const GamesGamepadViewConfiguration* self);
void games_gamepad_view_configuration_free (GamesGamepadViewConfiguration* self);
void games_gamepad_view_configuration_copy (const GamesGamepadViewConfiguration* self, GamesGamepadViewConfiguration* dest);
void games_gamepad_view_configuration_destroy (GamesGamepadViewConfiguration* self);
static void _vala_GamesGamepadInputPath_array_free (GamesGamepadInputPath * array, gint array_length);
static GamesGamepadInputPath* _vala_array_dup14 (GamesGamepadInputPath* self, int length);


void games_gamepad_input_path_copy (const GamesGamepadInputPath* self, GamesGamepadInputPath* dest) {
	GamesGamepadInput _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	_tmp0_ = (*self).input;
	(*dest).input = _tmp0_;
	_tmp1_ = (*self).path;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 ((*dest).path);
	(*dest).path = _tmp2_;
}


void games_gamepad_input_path_destroy (GamesGamepadInputPath* self) {
	_g_free0 ((*self).path);
}


GamesGamepadInputPath* games_gamepad_input_path_dup (const GamesGamepadInputPath* self) {
	GamesGamepadInputPath* dup;
	dup = g_new0 (GamesGamepadInputPath, 1);
	games_gamepad_input_path_copy (self, dup);
	return dup;
}


void games_gamepad_input_path_free (GamesGamepadInputPath* self) {
	games_gamepad_input_path_destroy (self);
	g_free (self);
}


GType games_gamepad_input_path_get_type (void) {
	static volatile gsize games_gamepad_input_path_type_id__volatile = 0;
	if (g_once_init_enter (&games_gamepad_input_path_type_id__volatile)) {
		GType games_gamepad_input_path_type_id;
		games_gamepad_input_path_type_id = g_boxed_type_register_static ("GamesGamepadInputPath", (GBoxedCopyFunc) games_gamepad_input_path_dup, (GBoxedFreeFunc) games_gamepad_input_path_free);
		g_once_init_leave (&games_gamepad_input_path_type_id__volatile, games_gamepad_input_path_type_id);
	}
	return games_gamepad_input_path_type_id__volatile;
}


static void _vala_GamesGamepadInputPath_array_free (GamesGamepadInputPath * array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			games_gamepad_input_path_destroy (&array[i]);
		}
	}
	g_free (array);
}


static GamesGamepadInputPath* _vala_array_dup14 (GamesGamepadInputPath* self, int length) {
	GamesGamepadInputPath* result;
	int i;
	result = g_new0 (GamesGamepadInputPath, length);
	for (i = 0; i < length; i++) {
		GamesGamepadInputPath _tmp0_ = {0};
		games_gamepad_input_path_copy (&self[i], &_tmp0_);
		result[i] = _tmp0_;
	}
	return result;
}


void games_gamepad_view_configuration_copy (const GamesGamepadViewConfiguration* self, GamesGamepadViewConfiguration* dest) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GamesGamepadInputPath* _tmp2_;
	gint _tmp2__length1;
	GamesGamepadInputPath* _tmp3_;
	gint _tmp3__length1;
	_tmp0_ = (*self).svg_path;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).svg_path);
	(*dest).svg_path = _tmp1_;
	_tmp2_ = (*self).input_paths;
	_tmp2__length1 = (*self).input_paths_length1;
	_tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup14 (_tmp2_, _tmp2__length1) : ((gpointer) _tmp2_);
	_tmp3__length1 = _tmp2__length1;
	(*dest).input_paths = (_vala_GamesGamepadInputPath_array_free ((*dest).input_paths, (*dest).input_paths_length1), NULL);
	(*dest).input_paths = _tmp3_;
	(*dest).input_paths_length1 = _tmp3__length1;
	(*dest)._input_paths_size_ = (*dest).input_paths_length1;
}


void games_gamepad_view_configuration_destroy (GamesGamepadViewConfiguration* self) {
	_g_free0 ((*self).svg_path);
	(*self).input_paths = (_vala_GamesGamepadInputPath_array_free ((*self).input_paths, (*self).input_paths_length1), NULL);
}


GamesGamepadViewConfiguration* games_gamepad_view_configuration_dup (const GamesGamepadViewConfiguration* self) {
	GamesGamepadViewConfiguration* dup;
	dup = g_new0 (GamesGamepadViewConfiguration, 1);
	games_gamepad_view_configuration_copy (self, dup);
	return dup;
}


void games_gamepad_view_configuration_free (GamesGamepadViewConfiguration* self) {
	games_gamepad_view_configuration_destroy (self);
	g_free (self);
}


GType games_gamepad_view_configuration_get_type (void) {
	static volatile gsize games_gamepad_view_configuration_type_id__volatile = 0;
	if (g_once_init_enter (&games_gamepad_view_configuration_type_id__volatile)) {
		GType games_gamepad_view_configuration_type_id;
		games_gamepad_view_configuration_type_id = g_boxed_type_register_static ("GamesGamepadViewConfiguration", (GBoxedCopyFunc) games_gamepad_view_configuration_dup, (GBoxedFreeFunc) games_gamepad_view_configuration_free);
		g_once_init_leave (&games_gamepad_view_configuration_type_id__volatile, games_gamepad_view_configuration_type_id);
	}
	return games_gamepad_view_configuration_type_id__volatile;
}



