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

/*
* Copyright 2015-2018 elementary, Inc. (https://elementary.io)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

#include "network.h"
#include <glib.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

gint
network_state_get_priority (NetworkState self)
{
	gint result;
	switch (self) {
		case NETWORK_STATE_CONNECTING_WIRED:
		{
			result = 0;
			return result;
		}
		case NETWORK_STATE_CONNECTING_WIFI:
		{
			result = 1;
			return result;
		}
		case NETWORK_STATE_CONNECTING_MOBILE:
		{
			result = 2;
			return result;
		}
		case NETWORK_STATE_CONNECTED_WIRED:
		{
			result = 3;
			return result;
		}
		case NETWORK_STATE_CONNECTED_WIFI_WEAK:
		case NETWORK_STATE_CONNECTED_WIFI_OK:
		case NETWORK_STATE_CONNECTED_WIFI_GOOD:
		case NETWORK_STATE_CONNECTED_WIFI_EXCELLENT:
		{
			result = 4;
			return result;
		}
		case NETWORK_STATE_CONNECTED_MOBILE_WEAK:
		case NETWORK_STATE_CONNECTED_MOBILE_OK:
		case NETWORK_STATE_CONNECTED_MOBILE_GOOD:
		case NETWORK_STATE_CONNECTED_MOBILE_EXCELLENT:
		{
			result = 5;
			return result;
		}
		case NETWORK_STATE_FAILED:
		case NETWORK_STATE_FAILED_WIFI:
		case NETWORK_STATE_FAILED_MOBILE:
		{
			result = 6;
			return result;
		}
		case NETWORK_STATE_DISCONNECTED_AIRPLANE_MODE:
		{
			result = 7;
			return result;
		}
		default:
		{
			result = 8;
			return result;
		}
	}
}

static GType
network_state_get_type_once (void)
{
	static const GEnumValue values[] = {{NETWORK_STATE_DISCONNECTED, "NETWORK_STATE_DISCONNECTED", "disconnected"}, {NETWORK_STATE_WIRED_UNPLUGGED, "NETWORK_STATE_WIRED_UNPLUGGED", "wired-unplugged"}, {NETWORK_STATE_DISCONNECTED_AIRPLANE_MODE, "NETWORK_STATE_DISCONNECTED_AIRPLANE_MODE", "disconnected-airplane-mode"}, {NETWORK_STATE_CONNECTED_WIRED, "NETWORK_STATE_CONNECTED_WIRED", "connected-wired"}, {NETWORK_STATE_CONNECTED_WIFI_WEAK, "NETWORK_STATE_CONNECTED_WIFI_WEAK", "connected-wifi-weak"}, {NETWORK_STATE_CONNECTED_WIFI_OK, "NETWORK_STATE_CONNECTED_WIFI_OK", "connected-wifi-ok"}, {NETWORK_STATE_CONNECTED_WIFI_GOOD, "NETWORK_STATE_CONNECTED_WIFI_GOOD", "connected-wifi-good"}, {NETWORK_STATE_CONNECTED_WIFI_EXCELLENT, "NETWORK_STATE_CONNECTED_WIFI_EXCELLENT", "connected-wifi-excellent"}, {NETWORK_STATE_CONNECTED_MOBILE_WEAK, "NETWORK_STATE_CONNECTED_MOBILE_WEAK", "connected-mobile-weak"}, {NETWORK_STATE_CONNECTED_MOBILE_OK, "NETWORK_STATE_CONNECTED_MOBILE_OK", "connected-mobile-ok"}, {NETWORK_STATE_CONNECTED_MOBILE_GOOD, "NETWORK_STATE_CONNECTED_MOBILE_GOOD", "connected-mobile-good"}, {NETWORK_STATE_CONNECTED_MOBILE_EXCELLENT, "NETWORK_STATE_CONNECTED_MOBILE_EXCELLENT", "connected-mobile-excellent"}, {NETWORK_STATE_CONNECTING_WIFI, "NETWORK_STATE_CONNECTING_WIFI", "connecting-wifi"}, {NETWORK_STATE_CONNECTING_MOBILE, "NETWORK_STATE_CONNECTING_MOBILE", "connecting-mobile"}, {NETWORK_STATE_CONNECTING_WIRED, "NETWORK_STATE_CONNECTING_WIRED", "connecting-wired"}, {NETWORK_STATE_FAILED, "NETWORK_STATE_FAILED", "failed"}, {NETWORK_STATE_FAILED_WIFI, "NETWORK_STATE_FAILED_WIFI", "failed-wifi"}, {NETWORK_STATE_FAILED_MOBILE, "NETWORK_STATE_FAILED_MOBILE", "failed-mobile"}, {0, NULL, NULL}};
	GType network_state_type_id;
	network_state_type_id = g_enum_register_static ("NetworkState", values);
	return network_state_type_id;
}

GType
network_state_get_type (void)
{
	static volatile gsize network_state_type_id__once = 0;
	if (g_once_init_enter (&network_state_type_id__once)) {
		GType network_state_type_id;
		network_state_type_id = network_state_get_type_once ();
		g_once_init_leave (&network_state_type_id__once, network_state_type_id);
	}
	return network_state_type_id__once;
}

