/* nintendo-ds-layout.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from nintendo-ds-layout.vala, do not modify */

#include "gnome-games.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "games-nintendo-ds-plugin.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

VALA_EXTERN gchar* games_nintendo_ds_layout_get_value (GamesScreenLayout layout);
VALA_EXTERN GamesScreenLayout* games_nintendo_ds_layout_from_value (const gchar* value);
static GamesScreenLayout* _games_screen_layout_dup (GamesScreenLayout* self);

gchar*
games_nintendo_ds_layout_get_value (GamesScreenLayout layout)
{
	gchar* result;
	switch (layout) {
		case GAMES_SCREEN_LAYOUT_TOP_BOTTOM:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("top/bottom");
			result = _tmp0_;
			return result;
		}
		case GAMES_SCREEN_LAYOUT_LEFT_RIGHT:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("left/right");
			result = _tmp1_;
			return result;
		}
		case GAMES_SCREEN_LAYOUT_RIGHT_LEFT:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("right/left");
			result = _tmp2_;
			return result;
		}
		case GAMES_SCREEN_LAYOUT_QUICK_SWITCH:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("quick switch");
			result = _tmp3_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static GamesScreenLayout*
_games_screen_layout_dup (GamesScreenLayout* self)
{
	GamesScreenLayout* dup;
	dup = g_new0 (GamesScreenLayout, 1);
	memcpy (dup, self, sizeof (GamesScreenLayout));
	return dup;
}

static gpointer
__games_screen_layout_dup0 (gpointer self)
{
	return self ? _games_screen_layout_dup (self) : NULL;
}

GamesScreenLayout*
games_nintendo_ds_layout_from_value (const gchar* value)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	GamesScreenLayout* result;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = value;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("top/bottom")))) {
		switch (0) {
			default:
			{
				GamesScreenLayout _tmp3_;
				GamesScreenLayout* _tmp4_;
				_tmp3_ = GAMES_SCREEN_LAYOUT_TOP_BOTTOM;
				_tmp4_ = __games_screen_layout_dup0 (&_tmp3_);
				result = _tmp4_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("left/right")))) {
		switch (0) {
			default:
			{
				GamesScreenLayout _tmp5_;
				GamesScreenLayout* _tmp6_;
				_tmp5_ = GAMES_SCREEN_LAYOUT_LEFT_RIGHT;
				_tmp6_ = __games_screen_layout_dup0 (&_tmp5_);
				result = _tmp6_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("right/left")))) {
		switch (0) {
			default:
			{
				GamesScreenLayout _tmp7_;
				GamesScreenLayout* _tmp8_;
				_tmp7_ = GAMES_SCREEN_LAYOUT_RIGHT_LEFT;
				_tmp8_ = __games_screen_layout_dup0 (&_tmp7_);
				result = _tmp8_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("quick switch")))) {
		switch (0) {
			default:
			{
				GamesScreenLayout _tmp9_;
				GamesScreenLayout* _tmp10_;
				_tmp9_ = GAMES_SCREEN_LAYOUT_QUICK_SWITCH;
				_tmp10_ = __games_screen_layout_dup0 (&_tmp9_);
				result = _tmp10_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				g_warning ("nintendo-ds-layout.vala:36: Unknown screen layout: %s\n", value);
				result = NULL;
				return result;
			}
		}
	}
}

