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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>

typedef enum  {
	TOOTLE_API_VISIBILITY_PUBLIC,
	TOOTLE_API_VISIBILITY_UNLISTED,
	TOOTLE_API_VISIBILITY_PRIVATE,
	TOOTLE_API_VISIBILITY_DIRECT
} TootleAPIVisibility;

#define TOOTLE_API_TYPE_VISIBILITY (tootle_api_visibility_get_type ())

GType tootle_api_visibility_get_type (void) G_GNUC_CONST ;
gchar* tootle_api_visibility_to_string (TootleAPIVisibility self);
TootleAPIVisibility tootle_api_visibility_from_string (const gchar* str);
gchar* tootle_api_visibility_get_name (TootleAPIVisibility self);
gchar* tootle_api_visibility_get_desc (TootleAPIVisibility self);
gchar* tootle_api_visibility_get_icon (TootleAPIVisibility self);
TootleAPIVisibility* tootle_api_visibility_all (gint* result_length1);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

gchar*
tootle_api_visibility_to_string (TootleAPIVisibility self)
{
	gchar* result = NULL;
	switch (self) {
		case TOOTLE_API_VISIBILITY_UNLISTED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("unlisted");
			result = _tmp0_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_PRIVATE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("private");
			result = _tmp1_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_DIRECT:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("direct");
			result = _tmp2_;
			return result;
		}
		default:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("public");
			result = _tmp3_;
			return result;
		}
	}
}

TootleAPIVisibility
tootle_api_visibility_from_string (const gchar* str)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	TootleAPIVisibility result = 0;
	g_return_val_if_fail (str != NULL, 0);
	_tmp0_ = str;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("unlisted")))) {
		switch (0) {
			default:
			{
				result = TOOTLE_API_VISIBILITY_UNLISTED;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("private")))) {
		switch (0) {
			default:
			{
				result = TOOTLE_API_VISIBILITY_PRIVATE;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("direct")))) {
		switch (0) {
			default:
			{
				result = TOOTLE_API_VISIBILITY_DIRECT;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = TOOTLE_API_VISIBILITY_PUBLIC;
				return result;
			}
		}
	}
}

gchar*
tootle_api_visibility_get_name (TootleAPIVisibility self)
{
	gchar* result = NULL;
	switch (self) {
		case TOOTLE_API_VISIBILITY_UNLISTED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Unlisted"));
			result = _tmp0_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_PRIVATE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup (_ ("Followers-only"));
			result = _tmp1_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_DIRECT:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup (_ ("Direct"));
			result = _tmp2_;
			return result;
		}
		default:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup (_ ("Public"));
			result = _tmp3_;
			return result;
		}
	}
}

gchar*
tootle_api_visibility_get_desc (TootleAPIVisibility self)
{
	gchar* result = NULL;
	switch (self) {
		case TOOTLE_API_VISIBILITY_UNLISTED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Don\'t post to public timelines"));
			result = _tmp0_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_PRIVATE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup (_ ("Post to followers only"));
			result = _tmp1_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_DIRECT:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup (_ ("Post to mentioned users only"));
			result = _tmp2_;
			return result;
		}
		default:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup (_ ("Post to public timelines"));
			result = _tmp3_;
			return result;
		}
	}
}

gchar*
tootle_api_visibility_get_icon (TootleAPIVisibility self)
{
	gchar* result = NULL;
	switch (self) {
		case TOOTLE_API_VISIBILITY_UNLISTED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("changes-allow-symbolic");
			result = _tmp0_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_PRIVATE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("changes-prevent-symbolic");
			result = _tmp1_;
			return result;
		}
		case TOOTLE_API_VISIBILITY_DIRECT:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("user-available-symbolic");
			result = _tmp2_;
			return result;
		}
		default:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("network-workgroup-symbolic");
			result = _tmp3_;
			return result;
		}
	}
}

TootleAPIVisibility*
tootle_api_visibility_all (gint* result_length1)
{
	TootleAPIVisibility* _tmp0_;
	TootleAPIVisibility* _tmp1_;
	gint _tmp1__length1;
	TootleAPIVisibility* result = NULL;
	_tmp0_ = g_new0 (TootleAPIVisibility, 4);
	_tmp0_[0] = TOOTLE_API_VISIBILITY_PUBLIC;
	_tmp0_[1] = TOOTLE_API_VISIBILITY_UNLISTED;
	_tmp0_[2] = TOOTLE_API_VISIBILITY_PRIVATE;
	_tmp0_[3] = TOOTLE_API_VISIBILITY_DIRECT;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 4;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static GType
tootle_api_visibility_get_type_once (void)
{
	static const GEnumValue values[] = {{TOOTLE_API_VISIBILITY_PUBLIC, "TOOTLE_API_VISIBILITY_PUBLIC", "public"}, {TOOTLE_API_VISIBILITY_UNLISTED, "TOOTLE_API_VISIBILITY_UNLISTED", "unlisted"}, {TOOTLE_API_VISIBILITY_PRIVATE, "TOOTLE_API_VISIBILITY_PRIVATE", "private"}, {TOOTLE_API_VISIBILITY_DIRECT, "TOOTLE_API_VISIBILITY_DIRECT", "direct"}, {0, NULL, NULL}};
	GType tootle_api_visibility_type_id;
	tootle_api_visibility_type_id = g_enum_register_static ("TootleAPIVisibility", values);
	return tootle_api_visibility_type_id;
}

GType
tootle_api_visibility_get_type (void)
{
	static volatile gsize tootle_api_visibility_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_api_visibility_type_id__volatile)) {
		GType tootle_api_visibility_type_id;
		tootle_api_visibility_type_id = tootle_api_visibility_get_type_once ();
		g_once_init_leave (&tootle_api_visibility_type_id__volatile, tootle_api_visibility_type_id);
	}
	return tootle_api_visibility_type_id__volatile;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

