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

/*
 * SPDX-License-Identifier: GPL-2.0-or-later
 * SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io)
 */

#include "keyboard.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_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

static gchar** _vala_array_dup5 (gchar** self,
                          gssize length);
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 GType
keyboard_shortcuts_custom_shortcuts_action_type_get_type_once (void)
{
	static const GEnumValue values[] = {{KEYBOARD_SHORTCUTS_CUSTOM_SHORTCUTS_ACTION_TYPE_DESKTOP_FILE, "KEYBOARD_SHORTCUTS_CUSTOM_SHORTCUTS_ACTION_TYPE_DESKTOP_FILE", "desktop-file"}, {KEYBOARD_SHORTCUTS_CUSTOM_SHORTCUTS_ACTION_TYPE_COMMAND_LINE, "KEYBOARD_SHORTCUTS_CUSTOM_SHORTCUTS_ACTION_TYPE_COMMAND_LINE", "command-line"}, {0, NULL, NULL}};
	GType keyboard_shortcuts_custom_shortcuts_action_type_type_id;
	keyboard_shortcuts_custom_shortcuts_action_type_type_id = g_enum_register_static ("KeyboardShortcutsCustomShortcutsActionType", values);
	return keyboard_shortcuts_custom_shortcuts_action_type_type_id;
}

GType
keyboard_shortcuts_custom_shortcuts_action_type_get_type (void)
{
	static volatile gsize keyboard_shortcuts_custom_shortcuts_action_type_type_id__once = 0;
	if (g_once_init_enter (&keyboard_shortcuts_custom_shortcuts_action_type_type_id__once)) {
		GType keyboard_shortcuts_custom_shortcuts_action_type_type_id;
		keyboard_shortcuts_custom_shortcuts_action_type_type_id = keyboard_shortcuts_custom_shortcuts_action_type_get_type_once ();
		g_once_init_leave (&keyboard_shortcuts_custom_shortcuts_action_type_type_id__once, keyboard_shortcuts_custom_shortcuts_action_type_type_id);
	}
	return keyboard_shortcuts_custom_shortcuts_action_type_type_id__once;
}

static gpointer
_g_hash_table_ref0 (gpointer self)
{
	return self ? g_hash_table_ref (self) : NULL;
}

static gchar**
_vala_array_dup5 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
keyboard_shortcuts_custom_shortcuts_parsed_shortcut_copy (const KeyboardShortcutsCustomShortcutsParsedShortcut* self,
                                                          KeyboardShortcutsCustomShortcutsParsedShortcut* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	(*dest).type = (*self).type;
	_tmp0_ = (*self).target;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).target);
	(*dest).target = _tmp1_;
	_tmp2_ = (*self).parameters;
	_tmp3_ = _g_hash_table_ref0 (_tmp2_);
	_g_hash_table_unref0 ((*dest).parameters);
	(*dest).parameters = _tmp3_;
	_tmp4_ = (*self).keybindings;
	_tmp4__length1 = (*self).keybindings_length1;
	_tmp5_ = (_tmp4_ != NULL) ? _vala_array_dup5 (_tmp4_, _tmp4__length1) : _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	(*dest).keybindings = (_vala_array_free ((*dest).keybindings, (*dest).keybindings_length1, (GDestroyNotify) g_free), NULL);
	(*dest).keybindings = _tmp5_;
	(*dest).keybindings_length1 = _tmp5__length1;
}

void
keyboard_shortcuts_custom_shortcuts_parsed_shortcut_destroy (KeyboardShortcutsCustomShortcutsParsedShortcut* self)
{
	_g_free0 ((*self).target);
	_g_hash_table_unref0 ((*self).parameters);
	(*self).keybindings = (_vala_array_free ((*self).keybindings, (*self).keybindings_length1, (GDestroyNotify) g_free), NULL);
}

KeyboardShortcutsCustomShortcutsParsedShortcut*
keyboard_shortcuts_custom_shortcuts_parsed_shortcut_dup (const KeyboardShortcutsCustomShortcutsParsedShortcut* self)
{
	KeyboardShortcutsCustomShortcutsParsedShortcut* dup;
	dup = g_new0 (KeyboardShortcutsCustomShortcutsParsedShortcut, 1);
	keyboard_shortcuts_custom_shortcuts_parsed_shortcut_copy (self, dup);
	return dup;
}

void
keyboard_shortcuts_custom_shortcuts_parsed_shortcut_free (KeyboardShortcutsCustomShortcutsParsedShortcut* self)
{
	keyboard_shortcuts_custom_shortcuts_parsed_shortcut_destroy (self);
	g_free (self);
}

static GType
keyboard_shortcuts_custom_shortcuts_parsed_shortcut_get_type_once (void)
{
	GType keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id;
	keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id = g_boxed_type_register_static ("KeyboardShortcutsCustomShortcutsParsedShortcut", (GBoxedCopyFunc) keyboard_shortcuts_custom_shortcuts_parsed_shortcut_dup, (GBoxedFreeFunc) keyboard_shortcuts_custom_shortcuts_parsed_shortcut_free);
	return keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id;
}

GType
keyboard_shortcuts_custom_shortcuts_parsed_shortcut_get_type (void)
{
	static volatile gsize keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id__once = 0;
	if (g_once_init_enter (&keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id__once)) {
		GType keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id;
		keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id = keyboard_shortcuts_custom_shortcuts_parsed_shortcut_get_type_once ();
		g_once_init_leave (&keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id__once, keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id);
	}
	return keyboard_shortcuts_custom_shortcuts_parsed_shortcut_type_id__once;
}

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

