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

/*
 * Copyright (c) 2017 elementary LLC. (http://launchpad.net/elementary)
 *
 * 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 "networkapplet.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <NetworkManager.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

enum  {
	NETWORK_VPN_INTERFACE_0_PROPERTY,
	NETWORK_VPN_INTERFACE_NUM_PROPERTIES
};
static GParamSpec* network_vpn_interface_properties[NETWORK_VPN_INTERFACE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _NetworkVpnInterfacePrivate {
	NetworkWidgetsSwitch* vpn_item;
	GtkRevealer* revealer;
};

static gint NetworkVpnInterface_private_offset;
static gpointer network_vpn_interface_parent_class = NULL;
static GType network_vpn_interface_type_id = 0;

static void __lambda32_ (NetworkVpnInterface* self);
static void ___lambda32__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static gint network_vpn_interface_sort_vpnlist (NetworkVpnInterface* self,
                                         GtkListBoxRow* row1,
                                         GtkListBoxRow* row2);
static gint _network_vpn_interface_sort_vpnlist_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                 GtkListBoxRow* row2,
                                                                 gpointer self);
static void network_vpn_interface_check_vpn_availability (NetworkVpnInterface* self);
static void _network_vpn_interface_check_vpn_availability_gtk_container_add (GtkContainer* _sender,
                                                                      GtkWidget* widget,
                                                                      gpointer self);
static void _network_vpn_interface_check_vpn_availability_gtk_container_remove (GtkContainer* _sender,
                                                                         GtkWidget* widget,
                                                                         gpointer self);
static void _network_widget_nm_interface_update_g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self);
static void network_vpn_interface_real_update (NetworkWidgetNMInterface* base);
static void network_vpn_interface_show_vpn (NetworkVpnInterface* self,
                                     gboolean show);
static void network_vpn_interface_real_vpn_activate_cb (NetworkAbstractVpnInterface* base,
                                                 NetworkVpnMenuItem* item);
static gboolean __lambda34_ (NetworkVpnInterface* self);
static gboolean ___lambda34__gsource_func (gpointer self);
static void network_vpn_interface_real_vpn_deactivate_cb (NetworkAbstractVpnInterface* base);
static gboolean __lambda33_ (NetworkVpnInterface* self);
static gboolean ___lambda33__gsource_func (gpointer self);
static GObject * network_vpn_interface_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void network_vpn_interface_finalize (GObject * obj);

static inline gpointer
network_vpn_interface_get_instance_private (NetworkVpnInterface* self)
{
	return G_STRUCT_MEMBER_P (self, NetworkVpnInterface_private_offset);
}

static void
__lambda32_ (NetworkVpnInterface* self)
{
	GtkRevealer* _tmp0_;
	NetworkWidgetsSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	NetworkWidgetsSwitch* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	_tmp0_ = self->priv->revealer;
	_tmp1_ = self->priv->vpn_item;
	_tmp2_ = network_widgets_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp3_);
	_tmp4_ = self->priv->vpn_item;
	_tmp5_ = network_widgets_switch_get_active (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		network_abstract_vpn_interface_vpn_deactivate_cb ((NetworkAbstractVpnInterface*) self);
	}
}

static void
___lambda32__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda32_ ((NetworkVpnInterface*) self);
}

static gint
_network_vpn_interface_sort_vpnlist_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                            GtkListBoxRow* row2,
                                                            gpointer self)
{
	gint result;
	result = network_vpn_interface_sort_vpnlist ((NetworkVpnInterface*) self, row1, row2);
	return result;
}

static void
_network_vpn_interface_check_vpn_availability_gtk_container_add (GtkContainer* _sender,
                                                                 GtkWidget* widget,
                                                                 gpointer self)
{
	network_vpn_interface_check_vpn_availability ((NetworkVpnInterface*) self);
}

static void
_network_vpn_interface_check_vpn_availability_gtk_container_remove (GtkContainer* _sender,
                                                                    GtkWidget* widget,
                                                                    gpointer self)
{
	network_vpn_interface_check_vpn_availability ((NetworkVpnInterface*) self);
}

static void
_network_widget_nm_interface_update_g_object_notify (GObject* _sender,
                                                     GParamSpec* pspec,
                                                     gpointer self)
{
	network_widget_nm_interface_update ((NetworkWidgetNMInterface*) self);
}

NetworkVpnInterface*
network_vpn_interface_construct (GType object_type,
                                 NMClient* nm_client)
{
	NetworkVpnInterface * self = NULL;
	NetworkWidgetsSwitch* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	NetworkWidgetsSwitch* _tmp3_;
	GtkStyleContext* _tmp4_;
	NetworkWidgetsSwitch* _tmp5_;
	GtkListBox* _tmp6_;
	GtkListBox* _tmp7_;
	GtkListBox* _tmp8_;
	g_return_val_if_fail (nm_client != NULL, NULL);
	self = (NetworkVpnInterface*) network_abstract_vpn_interface_construct (object_type);
	network_abstract_vpn_interface_init_vpn_interface ((NetworkAbstractVpnInterface*) self, nm_client);
	_tmp0_ = self->priv->vpn_item;
	_tmp1_ = network_widget_nm_interface_get_display_title ((NetworkWidgetNMInterface*) self);
	_tmp2_ = _tmp1_;
	network_widgets_switch_set_caption (_tmp0_, _tmp2_);
	g_debug ("VpnInterface.vala:25: Starting VPN Interface");
	_tmp3_ = self->priv->vpn_item;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_add_class (_tmp4_, "h4");
	_tmp5_ = self->priv->vpn_item;
	g_signal_connect_object ((GObject*) _tmp5_, "notify::active", (GCallback) ___lambda32__g_object_notify, self, 0);
	_tmp6_ = ((NetworkAbstractVpnInterface*) self)->vpn_list;
	gtk_list_box_set_sort_func (_tmp6_, _network_vpn_interface_sort_vpnlist_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp7_ = ((NetworkAbstractVpnInterface*) self)->vpn_list;
	g_signal_connect_object ((GtkContainer*) _tmp7_, "add", (GCallback) _network_vpn_interface_check_vpn_availability_gtk_container_add, self, 0);
	_tmp8_ = ((NetworkAbstractVpnInterface*) self)->vpn_list;
	g_signal_connect_object ((GtkContainer*) _tmp8_, "remove", (GCallback) _network_vpn_interface_check_vpn_availability_gtk_container_remove, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::vpn_state", (GCallback) _network_widget_nm_interface_update_g_object_notify, (NetworkWidgetNMInterface*) self, 0);
	return self;
}

NetworkVpnInterface*
network_vpn_interface_new (NMClient* nm_client)
{
	return network_vpn_interface_construct (NETWORK_TYPE_VPN_INTERFACE, nm_client);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static gint
network_vpn_interface_sort_vpnlist (NetworkVpnInterface* self,
                                    GtkListBoxRow* row1,
                                    GtkListBoxRow* row2)
{
	NetworkVpnMenuItem* _tmp0_ = NULL;
	NetworkVpnMenuItem* item1 = NULL;
	NetworkVpnMenuItem* _tmp1_;
	NetworkVpnMenuItem* _tmp2_ = NULL;
	NetworkVpnMenuItem* item2 = NULL;
	NetworkVpnMenuItem* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	NetworkVpnMenuItem* _tmp7_;
	NetworkVpnMenuItem* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	NetworkVpnMenuItem* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (row1 != NULL, -1);
	g_return_val_if_fail (row2 != NULL, -1);
	if (NETWORK_IS_VPN_MENU_ITEM (row1)) {
		_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (row1, NETWORK_TYPE_VPN_MENU_ITEM, NetworkVpnMenuItem);
	} else {
		_tmp0_ = NULL;
	}
	_tmp1_ = _g_object_ref0 (_tmp0_);
	item1 = _tmp1_;
	if (NETWORK_IS_VPN_MENU_ITEM (row2)) {
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (row2, NETWORK_TYPE_VPN_MENU_ITEM, NetworkVpnMenuItem);
	} else {
		_tmp2_ = NULL;
	}
	_tmp3_ = _g_object_ref0 (_tmp2_);
	item2 = _tmp3_;
	_tmp7_ = item1;
	if (_tmp7_ == NULL) {
		_tmp6_ = TRUE;
	} else {
		NetworkVpnMenuItem* _tmp8_;
		_tmp8_ = item2;
		_tmp6_ = _tmp8_ == NULL;
	}
	if (_tmp6_) {
		_tmp5_ = TRUE;
	} else {
		NetworkVpnMenuItem* _tmp9_;
		NMRemoteConnection* _tmp10_;
		NMRemoteConnection* _tmp11_;
		_tmp9_ = item1;
		_tmp10_ = network_vpn_menu_item_get_connection (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp5_ = _tmp11_ == NULL;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		NetworkVpnMenuItem* _tmp12_;
		NMRemoteConnection* _tmp13_;
		NMRemoteConnection* _tmp14_;
		_tmp12_ = item2;
		_tmp13_ = network_vpn_menu_item_get_connection (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp4_ = _tmp14_ == NULL;
	}
	if (_tmp4_) {
		result = 0;
		_g_object_unref0 (item2);
		_g_object_unref0 (item1);
		return result;
	}
	_tmp15_ = item1;
	_tmp16_ = network_vpn_menu_item_get_id (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = item2;
	_tmp19_ = network_vpn_menu_item_get_id (_tmp18_);
	_tmp20_ = _tmp19_;
	result = g_utf8_collate (_tmp17_, _tmp20_);
	_g_object_unref0 (item2);
	_g_object_unref0 (item1);
	return result;
}

static void
network_vpn_interface_real_update (NetworkWidgetNMInterface* base)
{
	NetworkVpnInterface * self;
	NetworkVpnMenuItem* _tmp0_;
	NetworkVpnMenuItem* _tmp1_;
	self = (NetworkVpnInterface*) base;
	NETWORK_WIDGET_NM_INTERFACE_CLASS (network_vpn_interface_parent_class)->update ((NetworkWidgetNMInterface*) G_TYPE_CHECK_INSTANCE_CAST (self, NETWORK_TYPE_ABSTRACT_VPN_INTERFACE, NetworkAbstractVpnInterface));
	network_vpn_interface_check_vpn_availability (self);
	_tmp0_ = network_abstract_vpn_interface_get_active_vpn_item ((NetworkAbstractVpnInterface*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		NetworkWidgetsSwitch* _tmp2_;
		_tmp2_ = self->priv->vpn_item;
		network_widgets_switch_set_active (_tmp2_, TRUE);
	}
}

static void
network_vpn_interface_check_vpn_availability (NetworkVpnInterface* self)
{
	guint length = 0U;
	GtkListBox* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	guint _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((NetworkAbstractVpnInterface*) self)->vpn_list;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_list_length (_tmp2_);
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_list_free (_tmp2_), NULL));
	length = _tmp3_;
	network_vpn_interface_show_vpn (self, length > ((guint) 1));
}

static void
network_vpn_interface_show_vpn (NetworkVpnInterface* self,
                                gboolean show)
{
	NetworkWidgetsSeparator* _tmp0_;
	NetworkWidgetsSeparator* _tmp1_;
	NetworkWidgetsSeparator* _tmp2_;
	NetworkWidgetsSeparator* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = network_widget_nm_interface_get_sep ((NetworkWidgetNMInterface*) self);
	_tmp1_ = _tmp0_;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp1_, !show);
	gtk_widget_set_no_show_all ((GtkWidget*) self, !show);
	_tmp2_ = network_widget_nm_interface_get_sep ((NetworkWidgetNMInterface*) self);
	_tmp3_ = _tmp2_;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, show);
	gtk_widget_set_visible ((GtkWidget*) self, show);
}

static gboolean
__lambda34_ (NetworkVpnInterface* self)
{
	gboolean result;
	network_widget_nm_interface_update ((NetworkWidgetNMInterface*) self);
	result = FALSE;
	return result;
}

static gboolean
___lambda34__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda34_ ((NetworkVpnInterface*) self);
	return result;
}

static void
network_vpn_interface_real_vpn_activate_cb (NetworkAbstractVpnInterface* base,
                                            NetworkVpnMenuItem* item)
{
	NetworkVpnInterface * self;
	NMRemoteConnection* _tmp0_;
	NMRemoteConnection* _tmp1_;
	const gchar* _tmp2_;
	NMClient* _tmp3_;
	NMRemoteConnection* _tmp4_;
	NMRemoteConnection* _tmp5_;
	self = (NetworkVpnInterface*) base;
	g_return_if_fail (item != NULL);
	g_warning ("VpnInterface.vala:92: Activating connection");
	network_abstract_vpn_interface_vpn_deactivate_cb ((NetworkAbstractVpnInterface*) self);
	_tmp0_ = network_vpn_menu_item_get_connection (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = nm_connection_get_id ((NMConnection*) _tmp1_);
	g_debug ("VpnInterface.vala:95: Connecting to VPN : %s", _tmp2_);
	_tmp3_ = ((NetworkAbstractVpnInterface*) self)->nm_client;
	_tmp4_ = network_vpn_menu_item_get_connection (item);
	_tmp5_ = _tmp4_;
	nm_client_activate_connection_async (_tmp3_, (NMConnection*) _tmp5_, NULL, NULL, NULL, NULL, NULL);
	network_abstract_vpn_interface_set_active_vpn_item ((NetworkAbstractVpnInterface*) self, item);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda34__gsource_func, g_object_ref (self), g_object_unref);
}

static gboolean
__lambda33_ (NetworkVpnInterface* self)
{
	gboolean result;
	network_widget_nm_interface_update ((NetworkWidgetNMInterface*) self);
	result = FALSE;
	return result;
}

static gboolean
___lambda33__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda33_ ((NetworkVpnInterface*) self);
	return result;
}

static void
network_vpn_interface_real_vpn_deactivate_cb (NetworkAbstractVpnInterface* base)
{
	NetworkVpnInterface * self;
	NMVpnConnection* _tmp0_;
	NMVpnConnection* _tmp1_;
	const gchar* _tmp2_;
	GError* _inner_error0_ = NULL;
	self = (NetworkVpnInterface*) base;
	_tmp0_ = ((NetworkAbstractVpnInterface*) self)->active_vpn_connection;
	if (_tmp0_ == NULL) {
		network_widget_nm_interface_update ((NetworkWidgetNMInterface*) self);
		return;
	}
	_tmp1_ = ((NetworkAbstractVpnInterface*) self)->active_vpn_connection;
	_tmp2_ = nm_active_connection_get_id ((NMActiveConnection*) _tmp1_);
	g_debug ("VpnInterface.vala:107: Deactivating VPN : %s", _tmp2_);
	{
		NMClient* _tmp3_;
		NMVpnConnection* _tmp4_;
		_tmp3_ = ((NetworkAbstractVpnInterface*) self)->nm_client;
		_tmp4_ = ((NetworkAbstractVpnInterface*) self)->active_vpn_connection;
		nm_client_deactivate_connection (_tmp3_, (NMActiveConnection*) _tmp4_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		g_warning ("VpnInterface.vala:111: %s", _tmp6_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda33__gsource_func, g_object_ref (self), g_object_unref);
}

static GObject *
network_vpn_interface_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	NetworkVpnInterface * self;
	NetworkWidgetsSwitch* _tmp0_;
	NetworkWidgetsSwitch* _tmp1_;
	GtkStyleContext* _tmp2_;
	NetworkWidgetsSwitch* _tmp3_;
	GtkScrolledWindow* scrolled_box = NULL;
	GtkScrolledWindow* _tmp4_;
	GtkScrolledWindow* _tmp5_;
	GtkScrolledWindow* _tmp6_;
	GtkScrolledWindow* _tmp7_;
	GtkScrolledWindow* _tmp8_;
	GtkListBox* _tmp9_;
	GtkRevealer* _tmp10_;
	GtkRevealer* _tmp11_;
	GtkScrolledWindow* _tmp12_;
	GtkRevealer* _tmp13_;
	parent_class = G_OBJECT_CLASS (network_vpn_interface_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NETWORK_TYPE_VPN_INTERFACE, NetworkVpnInterface);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = network_widgets_switch_new ("");
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->vpn_item);
	self->priv->vpn_item = _tmp0_;
	_tmp1_ = self->priv->vpn_item;
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _tmp1_);
	gtk_style_context_add_class (_tmp2_, "h4");
	_tmp3_ = self->priv->vpn_item;
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp3_, TRUE, TRUE, (guint) 0);
	_tmp4_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp4_);
	scrolled_box = _tmp4_;
	_tmp5_ = scrolled_box;
	g_object_set (_tmp5_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	_tmp6_ = scrolled_box;
	gtk_scrolled_window_set_max_content_height (_tmp6_, 512);
	_tmp7_ = scrolled_box;
	gtk_scrolled_window_set_propagate_natural_height (_tmp7_, TRUE);
	_tmp8_ = scrolled_box;
	_tmp9_ = ((NetworkAbstractVpnInterface*) self)->vpn_list;
	gtk_container_add ((GtkContainer*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->revealer);
	self->priv->revealer = _tmp10_;
	_tmp11_ = self->priv->revealer;
	_tmp12_ = scrolled_box;
	gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = self->priv->revealer;
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp13_, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (scrolled_box);
	return obj;
}

static void
network_vpn_interface_class_init (NetworkVpnInterfaceClass * klass,
                                  gpointer klass_data)
{
	network_vpn_interface_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &NetworkVpnInterface_private_offset);
	((NetworkWidgetNMInterfaceClass *) klass)->update = (void (*) (NetworkWidgetNMInterface*)) network_vpn_interface_real_update;
	((NetworkAbstractVpnInterfaceClass *) klass)->vpn_activate_cb = (void (*) (NetworkAbstractVpnInterface*, NetworkVpnMenuItem*)) network_vpn_interface_real_vpn_activate_cb;
	((NetworkAbstractVpnInterfaceClass *) klass)->vpn_deactivate_cb = (void (*) (NetworkAbstractVpnInterface*)) network_vpn_interface_real_vpn_deactivate_cb;
	G_OBJECT_CLASS (klass)->constructor = network_vpn_interface_constructor;
	G_OBJECT_CLASS (klass)->finalize = network_vpn_interface_finalize;
}

static void
network_vpn_interface_instance_init (NetworkVpnInterface * self,
                                     gpointer klass)
{
	self->priv = network_vpn_interface_get_instance_private (self);
}

static void
network_vpn_interface_finalize (GObject * obj)
{
	NetworkVpnInterface * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NETWORK_TYPE_VPN_INTERFACE, NetworkVpnInterface);
	_g_object_unref0 (self->priv->vpn_item);
	_g_object_unref0 (self->priv->revealer);
	G_OBJECT_CLASS (network_vpn_interface_parent_class)->finalize (obj);
}

GType
network_vpn_interface_get_type (void)
{
	return network_vpn_interface_type_id;
}

GType
network_vpn_interface_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (NetworkVpnInterfaceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) network_vpn_interface_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NetworkVpnInterface), 0, (GInstanceInitFunc) network_vpn_interface_instance_init, NULL };
	network_vpn_interface_type_id = g_type_module_register_type (module, NETWORK_TYPE_ABSTRACT_VPN_INTERFACE, "NetworkVpnInterface", &g_define_type_info, 0);
	NetworkVpnInterface_private_offset = sizeof (NetworkVpnInterfacePrivate);
	return network_vpn_interface_type_id;
}

