/* video-filter.c generated by valac 0.36.1.17-97a62, the Vala compiler
 * generated from video-filter.vala, do not modify */

/* This file is part of retro-gtk. License: GPL-3.0+.*/

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


#define RETRO_TYPE_VIDEO_FILTER (retro_video_filter_get_type ())
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))

typedef enum  {
	RETRO_VIDEO_FILTER_SMOOTH,
	RETRO_VIDEO_FILTER_SHARP
} RetroVideoFilter;



GType retro_video_filter_get_type (void) G_GNUC_CONST;
RetroVideoFilter retro_video_filter_from_string (const gchar* filter);
static GEnumValue* _g_enum_value_dup (GEnumValue* self);


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


static gpointer __g_enum_value_dup0 (gpointer self) {
	return self ? _g_enum_value_dup (self) : NULL;
}


RetroVideoFilter retro_video_filter_from_string (const gchar* filter) {
	RetroVideoFilter result = 0;
	GEnumClass* enumc;
	GTypeClass* _tmp0_;
	GEnumValue* eval;
	GEnumClass* _tmp1_;
	const gchar* _tmp2_;
	GEnumValue* _tmp3_;
	GEnumValue* _tmp4_;
	RetroVideoFilter _tmp5_ = 0;
	GEnumValue* _tmp6_;
	g_return_val_if_fail (filter != NULL, 0);
	_tmp0_ = g_type_class_ref (RETRO_TYPE_VIDEO_FILTER);
	enumc = (GEnumClass*) _tmp0_;
	_tmp1_ = enumc;
	_tmp2_ = filter;
	_tmp3_ = g_enum_get_value_by_nick (_tmp1_, _tmp2_);
	_tmp4_ = __g_enum_value_dup0 (_tmp3_);
	eval = _tmp4_;
	_tmp6_ = eval;
	if (_tmp6_ == NULL) {
		_tmp5_ = RETRO_VIDEO_FILTER_SMOOTH;
	} else {
		GEnumValue* _tmp7_;
		gint _tmp8_;
		_tmp7_ = eval;
		_tmp8_ = (*_tmp7_).value;
		_tmp5_ = (RetroVideoFilter) _tmp8_;
	}
	result = _tmp5_;
	_g_free0 (eval);
	_g_type_class_unref0 (enumc);
	return result;
}


GType retro_video_filter_get_type (void) {
	static volatile gsize retro_video_filter_type_id__volatile = 0;
	if (g_once_init_enter (&retro_video_filter_type_id__volatile)) {
		static const GEnumValue values[] = {{RETRO_VIDEO_FILTER_SMOOTH, "RETRO_VIDEO_FILTER_SMOOTH", "smooth"}, {RETRO_VIDEO_FILTER_SHARP, "RETRO_VIDEO_FILTER_SHARP", "sharp"}, {0, NULL, NULL}};
		GType retro_video_filter_type_id;
		retro_video_filter_type_id = g_enum_register_static ("RetroVideoFilter", values);
		g_once_init_leave (&retro_video_filter_type_id__volatile, retro_video_filter_type_id);
	}
	return retro_video_filter_type_id__volatile;
}



