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

/*
 * This file is part of budgie-desktop
 *
 * Copyright (C) 2015-2016 Solus Project
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include <glib.h>
#include <glib-object.h>
#include <libpeas/peas.h>
#include <plugin.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>


#define TYPE_PLACES_INDICATOR (places_indicator_get_type ())
#define PLACES_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLACES_INDICATOR, PlacesIndicator))
#define PLACES_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLACES_INDICATOR, PlacesIndicatorClass))
#define IS_PLACES_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLACES_INDICATOR))
#define IS_PLACES_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLACES_INDICATOR))
#define PLACES_INDICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLACES_INDICATOR, PlacesIndicatorClass))

typedef struct _PlacesIndicator PlacesIndicator;
typedef struct _PlacesIndicatorClass PlacesIndicatorClass;
typedef struct _PlacesIndicatorPrivate PlacesIndicatorPrivate;

#define TYPE_PLACES_INDICATOR_APPLET (places_indicator_applet_get_type ())
#define PLACES_INDICATOR_APPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorApplet))
#define PLACES_INDICATOR_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorAppletClass))
#define IS_PLACES_INDICATOR_APPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLACES_INDICATOR_APPLET))
#define IS_PLACES_INDICATOR_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLACES_INDICATOR_APPLET))
#define PLACES_INDICATOR_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorAppletClass))

typedef struct _PlacesIndicatorApplet PlacesIndicatorApplet;
typedef struct _PlacesIndicatorAppletClass PlacesIndicatorAppletClass;

#define TYPE_PLACES_INDICATOR_SETTINGS (places_indicator_settings_get_type ())
#define PLACES_INDICATOR_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLACES_INDICATOR_SETTINGS, PlacesIndicatorSettings))
#define PLACES_INDICATOR_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLACES_INDICATOR_SETTINGS, PlacesIndicatorSettingsClass))
#define IS_PLACES_INDICATOR_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLACES_INDICATOR_SETTINGS))
#define IS_PLACES_INDICATOR_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLACES_INDICATOR_SETTINGS))
#define PLACES_INDICATOR_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLACES_INDICATOR_SETTINGS, PlacesIndicatorSettingsClass))

typedef struct _PlacesIndicatorSettings PlacesIndicatorSettings;
typedef struct _PlacesIndicatorSettingsClass PlacesIndicatorSettingsClass;
typedef struct _PlacesIndicatorSettingsPrivate PlacesIndicatorSettingsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _PlacesIndicatorAppletPrivate PlacesIndicatorAppletPrivate;

#define TYPE_PLACES_INDICATOR_WINDOW (places_indicator_window_get_type ())
#define PLACES_INDICATOR_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLACES_INDICATOR_WINDOW, PlacesIndicatorWindow))
#define PLACES_INDICATOR_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLACES_INDICATOR_WINDOW, PlacesIndicatorWindowClass))
#define IS_PLACES_INDICATOR_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLACES_INDICATOR_WINDOW))
#define IS_PLACES_INDICATOR_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLACES_INDICATOR_WINDOW))
#define PLACES_INDICATOR_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLACES_INDICATOR_WINDOW, PlacesIndicatorWindowClass))

typedef struct _PlacesIndicatorWindow PlacesIndicatorWindow;
typedef struct _PlacesIndicatorWindowClass PlacesIndicatorWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _PlacesIndicator {
	PeasExtensionBase parent_instance;
	PlacesIndicatorPrivate * priv;
};

struct _PlacesIndicatorClass {
	PeasExtensionBaseClass parent_class;
};

struct _PlacesIndicatorSettings {
	GtkGrid parent_instance;
	PlacesIndicatorSettingsPrivate * priv;
};

struct _PlacesIndicatorSettingsClass {
	GtkGridClass parent_class;
};

struct _PlacesIndicatorSettingsPrivate {
	GtkSwitch* switch_label;
	GtkSwitch* switch_places;
	GtkSwitch* switch_drives;
	GtkSwitch* switch_networks;
	GSettings* settings;
};

struct _PlacesIndicatorApplet {
	BudgieApplet parent_instance;
	PlacesIndicatorAppletPrivate * priv;
};

struct _PlacesIndicatorAppletClass {
	BudgieAppletClass parent_class;
};

struct _PlacesIndicatorAppletPrivate {
	GtkEventBox* ebox;
	PlacesIndicatorWindow* popover;
	GtkLabel* label;
	GtkImage* image;
	BudgiePopoverManager* manager;
	GSettings* settings;
	gchar* _uuid;
};


static gpointer places_indicator_parent_class = NULL;
static BudgiePluginIface* places_indicator_budgie_plugin_parent_iface = NULL;
static GType places_indicator_type_id = 0;
static gpointer places_indicator_settings_parent_class = NULL;
static GType places_indicator_settings_type_id = 0;
static gpointer places_indicator_applet_parent_class = NULL;
static GType places_indicator_applet_type_id = 0;

GType places_indicator_get_type (void) G_GNUC_CONST;
GType places_indicator_register_type (GTypeModule * module);
enum  {
	PLACES_INDICATOR_DUMMY_PROPERTY
};
static BudgieApplet* places_indicator_real_get_panel_widget (BudgiePlugin* base, const gchar* uuid);
PlacesIndicatorApplet* places_indicator_applet_new (const gchar* uuid);
PlacesIndicatorApplet* places_indicator_applet_construct (GType object_type, const gchar* uuid);
GType places_indicator_applet_get_type (void) G_GNUC_CONST;
GType places_indicator_applet_register_type (GTypeModule * module);
PlacesIndicator* places_indicator_new (void);
PlacesIndicator* places_indicator_construct (GType object_type);
GType places_indicator_settings_get_type (void) G_GNUC_CONST;
GType places_indicator_settings_register_type (GTypeModule * module);
#define PLACES_INDICATOR_SETTINGS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLACES_INDICATOR_SETTINGS, PlacesIndicatorSettingsPrivate))
enum  {
	PLACES_INDICATOR_SETTINGS_DUMMY_PROPERTY
};
PlacesIndicatorSettings* places_indicator_settings_new (GSettings* settings);
PlacesIndicatorSettings* places_indicator_settings_construct (GType object_type, GSettings* settings);
static void places_indicator_settings_finalize (GObject* obj);
GType places_indicator_window_get_type (void) G_GNUC_CONST;
GType places_indicator_window_register_type (GTypeModule * module);
#define PLACES_INDICATOR_APPLET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorAppletPrivate))
enum  {
	PLACES_INDICATOR_APPLET_DUMMY_PROPERTY,
	PLACES_INDICATOR_APPLET_UUID
};
static GtkWidget* places_indicator_applet_real_get_settings_ui (BudgieApplet* base);
const gchar* places_indicator_applet_get_uuid (PlacesIndicatorApplet* self);
static gboolean places_indicator_applet_real_supports_settings (BudgieApplet* base);
void places_indicator_applet_on_settings_changed (PlacesIndicatorApplet* self, const gchar* key);
static void _places_indicator_applet_on_settings_changed_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
PlacesIndicatorWindow* places_indicator_window_new (GtkWidget* window_parent);
PlacesIndicatorWindow* places_indicator_window_construct (GType object_type, GtkWidget* window_parent);
static gboolean __lambda18_ (PlacesIndicatorApplet* self, GdkEventButton* e);
void places_indicator_applet_toggle_popover (PlacesIndicatorApplet* self);
static gboolean ___lambda18__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static void places_indicator_applet_real_invoke_action (BudgieApplet* base, BudgiePanelAction action);
static void places_indicator_applet_real_update_popovers (BudgieApplet* base, BudgiePopoverManager* manager);
void places_indicator_window_set_show_places (PlacesIndicatorWindow* self, gboolean value);
void places_indicator_window_set_show_drives (PlacesIndicatorWindow* self, gboolean value);
void places_indicator_window_set_show_networks (PlacesIndicatorWindow* self, gboolean value);
void places_indicator_applet_set_uuid (PlacesIndicatorApplet* self, const gchar* value);
static void places_indicator_applet_finalize (GObject* obj);
static void _vala_places_indicator_applet_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_places_indicator_applet_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
void peas_register_types (GTypeModule* module);


static BudgieApplet* places_indicator_real_get_panel_widget (BudgiePlugin* base, const gchar* uuid) {
	PlacesIndicator * self;
	BudgieApplet* result = NULL;
	const gchar* _tmp0_ = NULL;
	PlacesIndicatorApplet* _tmp1_ = NULL;
	self = (PlacesIndicator*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = uuid;
	_tmp1_ = places_indicator_applet_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	result = (BudgieApplet*) _tmp1_;
	return result;
}


PlacesIndicator* places_indicator_construct (GType object_type) {
	PlacesIndicator * self = NULL;
	self = (PlacesIndicator*) g_object_new (object_type, NULL);
	return self;
}


PlacesIndicator* places_indicator_new (void) {
	return places_indicator_construct (TYPE_PLACES_INDICATOR);
}


static void places_indicator_class_init (PlacesIndicatorClass * klass) {
	places_indicator_parent_class = g_type_class_peek_parent (klass);
}


static void places_indicator_budgie_plugin_interface_init (BudgiePluginIface * iface) {
	places_indicator_budgie_plugin_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_panel_widget = (BudgieApplet* (*)(BudgiePlugin*, const gchar*)) places_indicator_real_get_panel_widget;
}


static void places_indicator_instance_init (PlacesIndicator * self) {
}


GType places_indicator_get_type (void) {
	return places_indicator_type_id;
}


GType places_indicator_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (PlacesIndicatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) places_indicator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlacesIndicator), 0, (GInstanceInitFunc) places_indicator_instance_init, NULL };
	static const GInterfaceInfo budgie_plugin_info = { (GInterfaceInitFunc) places_indicator_budgie_plugin_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	places_indicator_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "PlacesIndicator", &g_define_type_info, 0);
	g_type_module_add_interface (module, places_indicator_type_id, budgie_plugin_get_type (), &budgie_plugin_info);
	return places_indicator_type_id;
}


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


PlacesIndicatorSettings* places_indicator_settings_construct (GType object_type, GSettings* settings) {
	PlacesIndicatorSettings * self = NULL;
	GSettings* _tmp0_ = NULL;
	GSettings* _tmp1_ = NULL;
	GSettings* _tmp2_ = NULL;
	GtkSwitch* _tmp3_ = NULL;
	GSettings* _tmp4_ = NULL;
	GtkSwitch* _tmp5_ = NULL;
	GSettings* _tmp6_ = NULL;
	GtkSwitch* _tmp7_ = NULL;
	GSettings* _tmp8_ = NULL;
	GtkSwitch* _tmp9_ = NULL;
	self = (PlacesIndicatorSettings*) g_object_new (object_type, NULL);
	_tmp0_ = settings;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = settings;
	_tmp3_ = self->priv->switch_label;
	g_settings_bind (_tmp2_, "show-label", (GObject*) _tmp3_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = settings;
	_tmp5_ = self->priv->switch_places;
	g_settings_bind (_tmp4_, "show-places", (GObject*) _tmp5_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp6_ = settings;
	_tmp7_ = self->priv->switch_drives;
	g_settings_bind (_tmp6_, "show-drives", (GObject*) _tmp7_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp8_ = settings;
	_tmp9_ = self->priv->switch_networks;
	g_settings_bind (_tmp8_, "show-networks", (GObject*) _tmp9_, "active", G_SETTINGS_BIND_DEFAULT);
	return self;
}


PlacesIndicatorSettings* places_indicator_settings_new (GSettings* settings) {
	return places_indicator_settings_construct (TYPE_PLACES_INDICATOR_SETTINGS, settings);
}


static void places_indicator_settings_class_init (PlacesIndicatorSettingsClass * klass) {
	gint PlacesIndicatorSettings_private_offset;
	places_indicator_settings_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (PlacesIndicatorSettingsPrivate));
	G_OBJECT_CLASS (klass)->finalize = places_indicator_settings_finalize;
	PlacesIndicatorSettings_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/solus-project/places-indicator/settings.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "switch_label", FALSE, PlacesIndicatorSettings_private_offset + G_STRUCT_OFFSET (PlacesIndicatorSettingsPrivate, switch_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "switch_places", FALSE, PlacesIndicatorSettings_private_offset + G_STRUCT_OFFSET (PlacesIndicatorSettingsPrivate, switch_places));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "switch_drives", FALSE, PlacesIndicatorSettings_private_offset + G_STRUCT_OFFSET (PlacesIndicatorSettingsPrivate, switch_drives));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "switch_networks", FALSE, PlacesIndicatorSettings_private_offset + G_STRUCT_OFFSET (PlacesIndicatorSettingsPrivate, switch_networks));
}


static void places_indicator_settings_instance_init (PlacesIndicatorSettings * self) {
	self->priv = PLACES_INDICATOR_SETTINGS_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void places_indicator_settings_finalize (GObject* obj) {
	PlacesIndicatorSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PLACES_INDICATOR_SETTINGS, PlacesIndicatorSettings);
	_g_object_unref0 (self->priv->switch_label);
	_g_object_unref0 (self->priv->switch_places);
	_g_object_unref0 (self->priv->switch_drives);
	_g_object_unref0 (self->priv->switch_networks);
	_g_object_unref0 (self->priv->settings);
	G_OBJECT_CLASS (places_indicator_settings_parent_class)->finalize (obj);
}


GType places_indicator_settings_get_type (void) {
	return places_indicator_settings_type_id;
}


GType places_indicator_settings_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (PlacesIndicatorSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) places_indicator_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlacesIndicatorSettings), 0, (GInstanceInitFunc) places_indicator_settings_instance_init, NULL };
	places_indicator_settings_type_id = g_type_module_register_type (module, gtk_grid_get_type (), "PlacesIndicatorSettings", &g_define_type_info, 0);
	return places_indicator_settings_type_id;
}


static GtkWidget* places_indicator_applet_real_get_settings_ui (BudgieApplet* base) {
	PlacesIndicatorApplet * self;
	GtkWidget* result = NULL;
	const gchar* _tmp0_ = NULL;
	GSettings* _tmp1_ = NULL;
	GSettings* _tmp2_ = NULL;
	PlacesIndicatorSettings* _tmp3_ = NULL;
	GtkWidget* _tmp4_ = NULL;
	self = (PlacesIndicatorApplet*) base;
	_tmp0_ = self->priv->_uuid;
	_tmp1_ = budgie_applet_get_applet_settings ((BudgieApplet*) self, _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = places_indicator_settings_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = (GtkWidget*) _tmp3_;
	_g_object_unref0 (_tmp2_);
	result = _tmp4_;
	return result;
}


static gboolean places_indicator_applet_real_supports_settings (BudgieApplet* base) {
	PlacesIndicatorApplet * self;
	gboolean result = FALSE;
	self = (PlacesIndicatorApplet*) base;
	result = TRUE;
	return result;
}


static void _places_indicator_applet_on_settings_changed_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	places_indicator_applet_on_settings_changed ((PlacesIndicatorApplet*) self, key);
}


static gboolean __lambda18_ (PlacesIndicatorApplet* self, GdkEventButton* e) {
	gboolean result = FALSE;
	GdkEventButton* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = e;
	_tmp1_ = _tmp0_->button;
	if (_tmp1_ != ((guint) 1)) {
		result = GDK_EVENT_PROPAGATE;
		return result;
	}
	places_indicator_applet_toggle_popover (self);
	result = GDK_EVENT_STOP;
	return result;
}


static gboolean ___lambda18__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = __lambda18_ ((PlacesIndicatorApplet*) self, event);
	return result;
}


PlacesIndicatorApplet* places_indicator_applet_construct (GType object_type, const gchar* uuid) {
	PlacesIndicatorApplet * self = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GSettings* _tmp2_ = NULL;
	GSettings* _tmp3_ = NULL;
	GtkEventBox* _tmp4_ = NULL;
	GtkBox* layout = NULL;
	GtkBox* _tmp5_ = NULL;
	GtkEventBox* _tmp6_ = NULL;
	GtkImage* _tmp7_ = NULL;
	GtkImage* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkLabel* _tmp13_ = NULL;
	GtkImage* _tmp14_ = NULL;
	PlacesIndicatorWindow* _tmp15_ = NULL;
	GtkEventBox* _tmp16_ = NULL;
	PlacesIndicatorWindow* _tmp17_ = NULL;
	GtkWidget* _tmp18_ = NULL;
	GtkEventBox* _tmp19_ = NULL;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = uuid;
	self = (PlacesIndicatorApplet*) g_object_new (object_type, "uuid", _tmp0_, NULL);
	budgie_applet_set_settings_schema ((BudgieApplet*) self, "com.solus-project.places-indicator");
	budgie_applet_set_settings_prefix ((BudgieApplet*) self, "/com/solus-project/budgie-panel/instance/places-indicator");
	_tmp1_ = uuid;
	_tmp2_ = budgie_applet_get_applet_settings ((BudgieApplet*) self, _tmp1_);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp2_;
	_tmp3_ = self->priv->settings;
	g_signal_connect_object (_tmp3_, "changed", (GCallback) _places_indicator_applet_on_settings_changed_g_settings_changed, self, 0);
	_tmp4_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->ebox);
	self->priv->ebox = _tmp4_;
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp5_);
	layout = _tmp5_;
	_tmp6_ = self->priv->ebox;
	gtk_container_add ((GtkContainer*) _tmp6_, (GtkWidget*) layout);
	_tmp7_ = (GtkImage*) gtk_image_new_from_icon_name ("drive-harddisk-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->image);
	self->priv->image = _tmp7_;
	_tmp8_ = self->priv->image;
	gtk_box_pack_start (layout, (GtkWidget*) _tmp8_, FALSE, FALSE, (guint) 3);
	_tmp9_ = _ ("Places");
	_tmp10_ = (GtkLabel*) gtk_label_new (_tmp9_);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp10_;
	_tmp11_ = self->priv->label;
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	_tmp12_ = self->priv->label;
	gtk_widget_hide ((GtkWidget*) _tmp12_);
	_tmp13_ = self->priv->label;
	gtk_box_pack_start (layout, (GtkWidget*) _tmp13_, TRUE, TRUE, (guint) 3);
	_tmp14_ = self->priv->image;
	_tmp15_ = places_indicator_window_new ((GtkWidget*) _tmp14_);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->popover);
	self->priv->popover = _tmp15_;
	_tmp16_ = self->priv->ebox;
	g_signal_connect_object ((GtkWidget*) _tmp16_, "button-press-event", (GCallback) ___lambda18__gtk_widget_button_press_event, self, 0);
	_tmp17_ = self->priv->popover;
	_tmp18_ = gtk_bin_get_child ((GtkBin*) _tmp17_);
	gtk_widget_show_all (_tmp18_);
	_tmp19_ = self->priv->ebox;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp19_);
	gtk_widget_show_all ((GtkWidget*) self);
	places_indicator_applet_on_settings_changed (self, "show-label");
	places_indicator_applet_on_settings_changed (self, "show-places");
	places_indicator_applet_on_settings_changed (self, "show-drives");
	places_indicator_applet_on_settings_changed (self, "show-networks");
	_g_object_unref0 (layout);
	return self;
}


PlacesIndicatorApplet* places_indicator_applet_new (const gchar* uuid) {
	return places_indicator_applet_construct (TYPE_PLACES_INDICATOR_APPLET, uuid);
}


void places_indicator_applet_toggle_popover (PlacesIndicatorApplet* self) {
	PlacesIndicatorWindow* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->popover;
	_tmp1_ = gtk_widget_get_visible ((GtkWidget*) _tmp0_);
	if (_tmp1_) {
		PlacesIndicatorWindow* _tmp2_ = NULL;
		_tmp2_ = self->priv->popover;
		gtk_widget_hide ((GtkWidget*) _tmp2_);
	} else {
		PlacesIndicatorWindow* _tmp3_ = NULL;
		GtkWidget* _tmp4_ = NULL;
		BudgiePopoverManager* _tmp5_ = NULL;
		GtkEventBox* _tmp6_ = NULL;
		_tmp3_ = self->priv->popover;
		_tmp4_ = gtk_bin_get_child ((GtkBin*) _tmp3_);
		gtk_widget_show_all (_tmp4_);
		_tmp5_ = self->priv->manager;
		_tmp6_ = self->priv->ebox;
		budgie_popover_manager_show_popover (_tmp5_, (GtkWidget*) _tmp6_);
	}
}


static void places_indicator_applet_real_invoke_action (BudgieApplet* base, BudgiePanelAction action) {
	PlacesIndicatorApplet * self;
	self = (PlacesIndicatorApplet*) base;
	places_indicator_applet_toggle_popover (self);
}


static void places_indicator_applet_real_update_popovers (BudgieApplet* base, BudgiePopoverManager* manager) {
	PlacesIndicatorApplet * self;
	BudgiePopoverManager* _tmp0_ = NULL;
	BudgiePopoverManager* _tmp1_ = NULL;
	GtkEventBox* _tmp2_ = NULL;
	PlacesIndicatorWindow* _tmp3_ = NULL;
	self = (PlacesIndicatorApplet*) base;
	_tmp0_ = manager;
	self->priv->manager = _tmp0_;
	_tmp1_ = manager;
	_tmp2_ = self->priv->ebox;
	_tmp3_ = self->priv->popover;
	budgie_popover_manager_register_popover (_tmp1_, (GtkWidget*) _tmp2_, (GtkPopover*) _tmp3_);
}


void places_indicator_applet_on_settings_changed (PlacesIndicatorApplet* self, const gchar* key) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	static GQuark _tmp2_label3 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = key;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("show-label")))) {
		switch (0) {
			default:
			{
				GtkLabel* _tmp4_ = NULL;
				GSettings* _tmp5_ = NULL;
				const gchar* _tmp6_ = NULL;
				gboolean _tmp7_ = FALSE;
				_tmp4_ = self->priv->label;
				_tmp5_ = self->priv->settings;
				_tmp6_ = key;
				_tmp7_ = g_settings_get_boolean (_tmp5_, _tmp6_);
				gtk_widget_set_visible ((GtkWidget*) _tmp4_, _tmp7_);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("show-places")))) {
		switch (0) {
			default:
			{
				PlacesIndicatorWindow* _tmp8_ = NULL;
				GSettings* _tmp9_ = NULL;
				const gchar* _tmp10_ = NULL;
				gboolean _tmp11_ = FALSE;
				_tmp8_ = self->priv->popover;
				_tmp9_ = self->priv->settings;
				_tmp10_ = key;
				_tmp11_ = g_settings_get_boolean (_tmp9_, _tmp10_);
				places_indicator_window_set_show_places (_tmp8_, _tmp11_);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("show-drives")))) {
		switch (0) {
			default:
			{
				PlacesIndicatorWindow* _tmp12_ = NULL;
				GSettings* _tmp13_ = NULL;
				const gchar* _tmp14_ = NULL;
				gboolean _tmp15_ = FALSE;
				_tmp12_ = self->priv->popover;
				_tmp13_ = self->priv->settings;
				_tmp14_ = key;
				_tmp15_ = g_settings_get_boolean (_tmp13_, _tmp14_);
				places_indicator_window_set_show_drives (_tmp12_, _tmp15_);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("show-networks")))) {
		switch (0) {
			default:
			{
				PlacesIndicatorWindow* _tmp16_ = NULL;
				GSettings* _tmp17_ = NULL;
				const gchar* _tmp18_ = NULL;
				gboolean _tmp19_ = FALSE;
				_tmp16_ = self->priv->popover;
				_tmp17_ = self->priv->settings;
				_tmp18_ = key;
				_tmp19_ = g_settings_get_boolean (_tmp17_, _tmp18_);
				places_indicator_window_set_show_networks (_tmp16_, _tmp19_);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
}


const gchar* places_indicator_applet_get_uuid (PlacesIndicatorApplet* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uuid;
	result = _tmp0_;
	return result;
}


void places_indicator_applet_set_uuid (PlacesIndicatorApplet* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_uuid);
	self->priv->_uuid = _tmp1_;
	g_object_notify ((GObject *) self, "uuid");
}


static void places_indicator_applet_class_init (PlacesIndicatorAppletClass * klass) {
	places_indicator_applet_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (PlacesIndicatorAppletPrivate));
	((BudgieAppletClass *) klass)->get_settings_ui = places_indicator_applet_real_get_settings_ui;
	((BudgieAppletClass *) klass)->supports_settings = places_indicator_applet_real_supports_settings;
	((BudgieAppletClass *) klass)->invoke_action = places_indicator_applet_real_invoke_action;
	((BudgieAppletClass *) klass)->update_popovers = places_indicator_applet_real_update_popovers;
	G_OBJECT_CLASS (klass)->get_property = _vala_places_indicator_applet_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_places_indicator_applet_set_property;
	G_OBJECT_CLASS (klass)->finalize = places_indicator_applet_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PLACES_INDICATOR_APPLET_UUID, g_param_spec_string ("uuid", "uuid", "uuid", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void places_indicator_applet_instance_init (PlacesIndicatorApplet * self) {
	self->priv = PLACES_INDICATOR_APPLET_GET_PRIVATE (self);
	self->priv->manager = NULL;
}


static void places_indicator_applet_finalize (GObject* obj) {
	PlacesIndicatorApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorApplet);
	_g_object_unref0 (self->priv->ebox);
	_g_object_unref0 (self->priv->popover);
	_g_object_unref0 (self->priv->label);
	_g_object_unref0 (self->priv->image);
	_g_object_unref0 (self->priv->settings);
	_g_free0 (self->priv->_uuid);
	G_OBJECT_CLASS (places_indicator_applet_parent_class)->finalize (obj);
}


GType places_indicator_applet_get_type (void) {
	return places_indicator_applet_type_id;
}


GType places_indicator_applet_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (PlacesIndicatorAppletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) places_indicator_applet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlacesIndicatorApplet), 0, (GInstanceInitFunc) places_indicator_applet_instance_init, NULL };
	places_indicator_applet_type_id = g_type_module_register_type (module, budgie_applet_get_type (), "PlacesIndicatorApplet", &g_define_type_info, 0);
	return places_indicator_applet_type_id;
}


static void _vala_places_indicator_applet_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	PlacesIndicatorApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorApplet);
	switch (property_id) {
		case PLACES_INDICATOR_APPLET_UUID:
		g_value_set_string (value, places_indicator_applet_get_uuid (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_places_indicator_applet_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	PlacesIndicatorApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PLACES_INDICATOR_APPLET, PlacesIndicatorApplet);
	switch (property_id) {
		case PLACES_INDICATOR_APPLET_UUID:
		places_indicator_applet_set_uuid (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


void peas_register_types (GTypeModule* module) {
	PeasObjectModule* objmodule = NULL;
	GTypeModule* _tmp0_ = NULL;
	PeasObjectModule* _tmp1_ = NULL;
	g_return_if_fail (module != NULL);
	places_indicator_register_type (module);
	places_indicator_settings_register_type (module);
	places_indicator_applet_register_type (module);
	places_indicator_window_register_type (module);
	message_revealer_register_type (module);
	places_section_register_type (module);
	list_item_register_type (module);
	volume_item_register_type (module);
	mount_item_register_type (module);
	place_item_register_type (module);
	_tmp0_ = module;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, peas_object_module_get_type ()) ? ((PeasObjectModule*) _tmp0_) : NULL);
	objmodule = _tmp1_;
	peas_object_module_register_extension_type (objmodule, budgie_plugin_get_type (), TYPE_PLACES_INDICATOR);
	_g_object_unref0 (objmodule);
}



