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

/*///////////////////////////////////////////////////////////////////////*/
/* Copyright 2011-2021 Simon Schneegans*/
/**/
/* Permission is hereby granted, free of charge, to any person obtaining*/
/* a copy of this software and associated documentation files (the*/
/* "Software"), to deal in the Software without restriction, including*/
/* without limitation the rights to use, copy, modify, merge, publish,*/
/* distribute, sublicense, and/or sell copies of the Software, and to*/
/* permit persons to whom the Software is furnished to do so, subject to*/
/* the following conditions:*/
/* */
/* The above copyright notice and this permission notice shall be*/
/* included in all copies or substantial portions of the Software.*/
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,*/
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF*/
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY*/
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,*/
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE*/
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
/*///////////////////////////////////////////////////////////////////////*/

#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GNOME_PIE_TYPE_INDICATOR (gnome_pie_indicator_get_type ())
#define GNOME_PIE_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_INDICATOR, GnomePieIndicator))
#define GNOME_PIE_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_INDICATOR, GnomePieIndicatorClass))
#define GNOME_PIE_IS_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_INDICATOR))
#define GNOME_PIE_IS_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_INDICATOR))
#define GNOME_PIE_INDICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_INDICATOR, GnomePieIndicatorClass))

typedef struct _GnomePieIndicator GnomePieIndicator;
typedef struct _GnomePieIndicatorClass GnomePieIndicatorClass;
typedef struct _GnomePieIndicatorPrivate GnomePieIndicatorPrivate;

#define GNOME_PIE_TYPE_PREFERENCES_WINDOW (gnome_pie_preferences_window_get_type ())
#define GNOME_PIE_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PREFERENCES_WINDOW, GnomePiePreferencesWindow))
#define GNOME_PIE_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PREFERENCES_WINDOW, GnomePiePreferencesWindowClass))
#define GNOME_PIE_IS_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PREFERENCES_WINDOW))
#define GNOME_PIE_IS_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PREFERENCES_WINDOW))
#define GNOME_PIE_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PREFERENCES_WINDOW, GnomePiePreferencesWindowClass))

typedef struct _GnomePiePreferencesWindow GnomePiePreferencesWindow;
typedef struct _GnomePiePreferencesWindowClass GnomePiePreferencesWindowClass;
enum  {
	GNOME_PIE_INDICATOR_0_PROPERTY,
	GNOME_PIE_INDICATOR_ACTIVE_PROPERTY,
	GNOME_PIE_INDICATOR_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_indicator_properties[GNOME_PIE_INDICATOR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GNOME_PIE_TYPE_ABOUT_WINDOW (gnome_pie_about_window_get_type ())
#define GNOME_PIE_ABOUT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ABOUT_WINDOW, GnomePieAboutWindow))
#define GNOME_PIE_ABOUT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ABOUT_WINDOW, GnomePieAboutWindowClass))
#define GNOME_PIE_IS_ABOUT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ABOUT_WINDOW))
#define GNOME_PIE_IS_ABOUT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ABOUT_WINDOW))
#define GNOME_PIE_ABOUT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ABOUT_WINDOW, GnomePieAboutWindowClass))

typedef struct _GnomePieAboutWindow GnomePieAboutWindow;
typedef struct _GnomePieAboutWindowClass GnomePieAboutWindowClass;

#define GNOME_PIE_TYPE_CONFIG (gnome_pie_config_get_type ())
#define GNOME_PIE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_CONFIG, GnomePieConfig))
#define GNOME_PIE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_CONFIG, GnomePieConfigClass))
#define GNOME_PIE_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_CONFIG))
#define GNOME_PIE_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_CONFIG))
#define GNOME_PIE_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_CONFIG, GnomePieConfigClass))

typedef struct _GnomePieConfig GnomePieConfig;
typedef struct _GnomePieConfigClass GnomePieConfigClass;

struct _GnomePieIndicator {
	GObject parent_instance;
	GnomePieIndicatorPrivate * priv;
};

struct _GnomePieIndicatorClass {
	GObjectClass parent_class;
};

struct _GnomePieIndicatorPrivate {
	GtkStatusIcon* _indicator;
	GtkMenu* _menu;
	GnomePiePreferencesWindow* _prefs;
};

static gint GnomePieIndicator_private_offset;
static gpointer gnome_pie_indicator_parent_class = NULL;

VALA_EXTERN GType gnome_pie_indicator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieIndicator, g_object_unref)
VALA_EXTERN GType gnome_pie_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePreferencesWindow, g_object_unref)
VALA_EXTERN GnomePieIndicator* gnome_pie_indicator_new (void);
VALA_EXTERN GnomePieIndicator* gnome_pie_indicator_construct (GType object_type);
static void gnome_pie_indicator_set_indicator (GnomePieIndicator* self,
                                        GtkStatusIcon* value);
static GtkStatusIcon* gnome_pie_indicator_get_indicator (GnomePieIndicator* self);
static void gnome_pie_indicator_set_menu (GnomePieIndicator* self,
                                   GtkMenu* value);
static GtkMenu* gnome_pie_indicator_get_menu (GnomePieIndicator* self);
VALA_EXTERN GnomePiePreferencesWindow* gnome_pie_preferences_window_new (void);
VALA_EXTERN GnomePiePreferencesWindow* gnome_pie_preferences_window_construct (GType object_type);
static void gnome_pie_indicator_set_prefs (GnomePieIndicator* self,
                                    GnomePiePreferencesWindow* value);
static void __lambda94_ (GnomePieIndicator* self);
static GnomePiePreferencesWindow* gnome_pie_indicator_get_prefs (GnomePieIndicator* self);
VALA_EXTERN void gnome_pie_preferences_window_show (GnomePiePreferencesWindow* self);
static void ___lambda94__gtk_menu_item_activate (GtkMenuItem* _sender,
                                          gpointer self);
static void __lambda95_ (GnomePieIndicator* self);
VALA_EXTERN GType gnome_pie_about_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAboutWindow, g_object_unref)
VALA_EXTERN GnomePieAboutWindow* gnome_pie_about_window_new (void);
VALA_EXTERN GnomePieAboutWindow* gnome_pie_about_window_construct (GType object_type);
static void ___lambda95__gtk_menu_item_activate (GtkMenuItem* _sender,
                                          gpointer self);
static void __lambda97_ (GnomePieIndicator* self);
static void ___lambda97__gtk_menu_item_activate (GtkMenuItem* _sender,
                                          gpointer self);
static void __lambda98_ (GnomePieIndicator* self,
                  guint btn,
                  guint time);
static void ___lambda98__gtk_status_icon_popup_menu (GtkStatusIcon* _sender,
                                              guint button,
                                              guint activate_time,
                                              gpointer self);
VALA_EXTERN GType gnome_pie_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieConfig, g_object_unref)
VALA_EXTERN GnomePieConfig* gnome_pie_config_get_global (void);
VALA_EXTERN gboolean gnome_pie_config_get_show_indicator (GnomePieConfig* self);
VALA_EXTERN void gnome_pie_indicator_set_active (GnomePieIndicator* self,
                                     gboolean value);
static void __lambda99_ (GnomePieIndicator* self,
                  GObject* s,
                  GParamSpec* p);
static void ___lambda99__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
VALA_EXTERN void gnome_pie_indicator_show_preferences (GnomePieIndicator* self);
VALA_EXTERN gboolean gnome_pie_indicator_get_active (GnomePieIndicator* self);
static void gnome_pie_indicator_finalize (GObject * obj);
static GType gnome_pie_indicator_get_type_once (void);
static void _vala_gnome_pie_indicator_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_gnome_pie_indicator_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);

static inline gpointer
gnome_pie_indicator_get_instance_private (GnomePieIndicator* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePieIndicator_private_offset);
}

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

static void
__lambda94_ (GnomePieIndicator* self)
{
	GnomePiePreferencesWindow* _tmp0_;
	_tmp0_ = self->priv->_prefs;
	gnome_pie_preferences_window_show (_tmp0_);
}

static void
___lambda94__gtk_menu_item_activate (GtkMenuItem* _sender,
                                     gpointer self)
{
	__lambda94_ ((GnomePieIndicator*) self);
}

static void
__lambda95_ (GnomePieIndicator* self)
{
	GnomePieAboutWindow* about = NULL;
	GnomePieAboutWindow* _tmp0_;
	_tmp0_ = gnome_pie_about_window_new ();
	g_object_ref_sink (_tmp0_);
	about = _tmp0_;
	gtk_dialog_run ((GtkDialog*) about);
	gtk_widget_destroy ((GtkWidget*) about);
	_g_object_unref0 (about);
}

static void
___lambda95__gtk_menu_item_activate (GtkMenuItem* _sender,
                                     gpointer self)
{
	__lambda95_ ((GnomePieIndicator*) self);
}

static void
__lambda97_ (GnomePieIndicator* self)
{
	GApplication* _tmp0_;
	_tmp0_ = g_application_get_default ();
	g_application_release (_tmp0_);
}

static void
___lambda97__gtk_menu_item_activate (GtkMenuItem* _sender,
                                     gpointer self)
{
	__lambda97_ ((GnomePieIndicator*) self);
}

static void
__lambda98_ (GnomePieIndicator* self,
             guint btn,
             guint time)
{
	GtkMenu* _tmp0_;
	_tmp0_ = self->priv->_menu;
	gtk_menu_popup (_tmp0_, NULL, NULL, NULL, NULL, btn, (guint32) time);
}

static void
___lambda98__gtk_status_icon_popup_menu (GtkStatusIcon* _sender,
                                         guint button,
                                         guint activate_time,
                                         gpointer self)
{
	__lambda98_ ((GnomePieIndicator*) self, button, activate_time);
}

static void
__lambda99_ (GnomePieIndicator* self,
             GObject* s,
             GParamSpec* p)
{
	GnomePieConfig* _tmp0_;
	GnomePieConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (s != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = gnome_pie_config_get_global ();
	_tmp1_ = _tmp0_;
	_tmp2_ = gnome_pie_config_get_show_indicator (_tmp1_);
	_tmp3_ = _tmp2_;
	gnome_pie_indicator_set_active (self, _tmp3_);
}

static void
___lambda99__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda99_ ((GnomePieIndicator*) self, _sender, pspec);
}

GnomePieIndicator*
gnome_pie_indicator_construct (GType object_type)
{
	GnomePieIndicator * self = NULL;
	gchar* icon = NULL;
	gchar* _tmp0_;
	GtkStatusIcon* _tmp1_;
	GtkStatusIcon* _tmp2_;
	GtkMenu* _tmp22_;
	GtkMenu* _tmp23_;
	GtkMenu* menu = NULL;
	GtkMenu* _tmp24_;
	GtkMenu* _tmp25_;
	GnomePiePreferencesWindow* _tmp26_;
	GnomePiePreferencesWindow* _tmp27_;
	GtkMenuItem* item = NULL;
	GtkMenuItem* _tmp28_;
	GtkMenuItem* _tmp29_;
	GtkMenuItem* _tmp30_;
	GtkMenuItem* _tmp31_;
	GtkMenuItem* _tmp32_;
	GtkMenuItem* _tmp33_;
	GtkMenuItem* _tmp34_;
	GtkMenuItem* _tmp35_;
	GtkSeparatorMenuItem* sepa = NULL;
	GtkSeparatorMenuItem* _tmp36_;
	GtkMenuItem* _tmp37_;
	GtkMenuItem* _tmp38_;
	GtkMenuItem* _tmp39_;
	GtkMenuItem* _tmp40_;
	GtkStatusIcon* _tmp41_;
	GnomePieConfig* _tmp42_;
	GnomePieConfig* _tmp43_;
	gboolean _tmp44_;
	gboolean _tmp45_;
	GnomePieConfig* _tmp46_;
	GnomePieConfig* _tmp47_;
	GError* _inner_error0_ = NULL;
	self = (GnomePieIndicator*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup ("gnome-pie-symbolic");
	icon = _tmp0_;
	_tmp1_ = gtk_status_icon_new ();
	_tmp2_ = _tmp1_;
	gnome_pie_indicator_set_indicator (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	{
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_;
		GFile* file = NULL;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GFile* _tmp13_;
		GFile* _tmp14_;
		GFile* _tmp15_;
		_tmp4_ = g_file_read_link ("/proc/self/exe", &_inner_error0_);
		_tmp3_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch0_g_file_error;
			}
			_g_free0 (icon);
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp5_ = g_path_get_dirname (_tmp3_);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat (_tmp6_, "/resources", NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strconcat (icon, ".svg", NULL);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_build_filename (_tmp8_, _tmp10_, NULL);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_file_new_for_path (_tmp12_);
		_tmp14_ = _tmp13_;
		_g_free0 (_tmp12_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp8_);
		_g_free0 (_tmp6_);
		file = _tmp14_;
		_tmp15_ = file;
		if (!g_file_query_exists (_tmp15_, NULL)) {
			GtkStatusIcon* _tmp16_;
			_tmp16_ = self->priv->_indicator;
			gtk_status_icon_set_from_icon_name (_tmp16_, icon);
		} else {
			GtkStatusIcon* _tmp17_;
			GFile* _tmp18_;
			gchar* _tmp19_;
			gchar* _tmp20_;
			_tmp17_ = self->priv->_indicator;
			_tmp18_ = file;
			_tmp19_ = g_file_get_path (_tmp18_);
			_tmp20_ = _tmp19_;
			gtk_status_icon_set_from_file (_tmp17_, _tmp20_);
			_g_free0 (_tmp20_);
		}
		_g_object_unref0 (file);
		_g_free0 (_tmp3_);
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		GtkStatusIcon* _tmp21_;
		g_clear_error (&_inner_error0_);
		g_warning ("indicator.vala:104: Failed to get path of executable!");
		_tmp21_ = self->priv->_indicator;
		gtk_status_icon_set_from_icon_name (_tmp21_, icon);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (icon);
		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 NULL;
	}
	_tmp22_ = (GtkMenu*) gtk_menu_new ();
	g_object_ref_sink (_tmp22_);
	_tmp23_ = _tmp22_;
	gnome_pie_indicator_set_menu (self, _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = self->priv->_menu;
	_tmp25_ = _g_object_ref0 (_tmp24_);
	menu = _tmp25_;
	_tmp26_ = gnome_pie_preferences_window_new ();
	_tmp27_ = _tmp26_;
	gnome_pie_indicator_set_prefs (self, _tmp27_);
	_g_object_unref0 (_tmp27_);
	_tmp28_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Preferences"));
	g_object_ref_sink (_tmp28_);
	item = _tmp28_;
	_tmp29_ = item;
	g_signal_connect_object (_tmp29_, "activate", (GCallback) ___lambda94__gtk_menu_item_activate, self, 0);
	_tmp30_ = item;
	gtk_widget_show ((GtkWidget*) _tmp30_);
	_tmp31_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp31_);
	_tmp32_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_About"));
	g_object_ref_sink (_tmp32_);
	_g_object_unref0 (item);
	item = _tmp32_;
	_tmp33_ = item;
	gtk_widget_show ((GtkWidget*) _tmp33_);
	_tmp34_ = item;
	g_signal_connect_object (_tmp34_, "activate", (GCallback) ___lambda95__gtk_menu_item_activate, self, 0);
	_tmp35_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp35_);
	_tmp36_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
	g_object_ref_sink (_tmp36_);
	sepa = _tmp36_;
	gtk_widget_show ((GtkWidget*) sepa);
	gtk_menu_shell_append ((GtkMenuShell*) menu, (GtkMenuItem*) sepa);
	_tmp37_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Quit"));
	g_object_ref_sink (_tmp37_);
	_g_object_unref0 (item);
	item = _tmp37_;
	_tmp38_ = item;
	g_signal_connect_object (_tmp38_, "activate", (GCallback) ___lambda97__gtk_menu_item_activate, self, 0);
	_tmp39_ = item;
	gtk_widget_show ((GtkWidget*) _tmp39_);
	_tmp40_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) menu, _tmp40_);
	_tmp41_ = self->priv->_indicator;
	g_signal_connect_object (_tmp41_, "popup-menu", (GCallback) ___lambda98__gtk_status_icon_popup_menu, self, 0);
	_tmp42_ = gnome_pie_config_get_global ();
	_tmp43_ = _tmp42_;
	_tmp44_ = gnome_pie_config_get_show_indicator (_tmp43_);
	_tmp45_ = _tmp44_;
	gnome_pie_indicator_set_active (self, _tmp45_);
	_tmp46_ = gnome_pie_config_get_global ();
	_tmp47_ = _tmp46_;
	g_signal_connect_object ((GObject*) _tmp47_, "notify::show-indicator", (GCallback) ___lambda99__g_object_notify, self, 0);
	_g_object_unref0 (sepa);
	_g_object_unref0 (item);
	_g_object_unref0 (menu);
	_g_free0 (icon);
	return self;
}

GnomePieIndicator*
gnome_pie_indicator_new (void)
{
	return gnome_pie_indicator_construct (GNOME_PIE_TYPE_INDICATOR);
}

void
gnome_pie_indicator_show_preferences (GnomePieIndicator* self)
{
	GnomePiePreferencesWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_prefs;
	gnome_pie_preferences_window_show (_tmp0_);
}

static GtkStatusIcon*
gnome_pie_indicator_get_indicator (GnomePieIndicator* self)
{
	GtkStatusIcon* result;
	GtkStatusIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_indicator;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_indicator_set_indicator (GnomePieIndicator* self,
                                   GtkStatusIcon* value)
{
	GtkStatusIcon* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_indicator);
	self->priv->_indicator = _tmp0_;
}

static GtkMenu*
gnome_pie_indicator_get_menu (GnomePieIndicator* self)
{
	GtkMenu* result;
	GtkMenu* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_menu;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_indicator_set_menu (GnomePieIndicator* self,
                              GtkMenu* value)
{
	GtkMenu* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_menu);
	self->priv->_menu = _tmp0_;
}

static GnomePiePreferencesWindow*
gnome_pie_indicator_get_prefs (GnomePieIndicator* self)
{
	GnomePiePreferencesWindow* result;
	GnomePiePreferencesWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_prefs;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_indicator_set_prefs (GnomePieIndicator* self,
                               GnomePiePreferencesWindow* value)
{
	GnomePiePreferencesWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_prefs);
	self->priv->_prefs = _tmp0_;
}

gboolean
gnome_pie_indicator_get_active (GnomePieIndicator* self)
{
	gboolean result;
	GtkStatusIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_indicator;
	result = gtk_status_icon_get_visible (_tmp0_);
	return result;
}

void
gnome_pie_indicator_set_active (GnomePieIndicator* self,
                                gboolean value)
{
	GtkStatusIcon* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_indicator;
	gtk_status_icon_set_visible (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, gnome_pie_indicator_properties[GNOME_PIE_INDICATOR_ACTIVE_PROPERTY]);
}

static void
gnome_pie_indicator_class_init (GnomePieIndicatorClass * klass,
                                gpointer klass_data)
{
	gnome_pie_indicator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePieIndicator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_indicator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_indicator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_indicator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_INDICATOR_ACTIVE_PROPERTY, gnome_pie_indicator_properties[GNOME_PIE_INDICATOR_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gnome_pie_indicator_instance_init (GnomePieIndicator * self,
                                   gpointer klass)
{
	self->priv = gnome_pie_indicator_get_instance_private (self);
}

static void
gnome_pie_indicator_finalize (GObject * obj)
{
	GnomePieIndicator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_INDICATOR, GnomePieIndicator);
	_g_object_unref0 (self->priv->_indicator);
	_g_object_unref0 (self->priv->_menu);
	_g_object_unref0 (self->priv->_prefs);
	G_OBJECT_CLASS (gnome_pie_indicator_parent_class)->finalize (obj);
}

static GType
gnome_pie_indicator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieIndicatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_indicator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieIndicator), 0, (GInstanceInitFunc) gnome_pie_indicator_instance_init, NULL };
	GType gnome_pie_indicator_type_id;
	gnome_pie_indicator_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePieIndicator", &g_define_type_info, 0);
	GnomePieIndicator_private_offset = g_type_add_instance_private (gnome_pie_indicator_type_id, sizeof (GnomePieIndicatorPrivate));
	return gnome_pie_indicator_type_id;
}

GType
gnome_pie_indicator_get_type (void)
{
	static volatile gsize gnome_pie_indicator_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_indicator_type_id__once)) {
		GType gnome_pie_indicator_type_id;
		gnome_pie_indicator_type_id = gnome_pie_indicator_get_type_once ();
		g_once_init_leave (&gnome_pie_indicator_type_id__once, gnome_pie_indicator_type_id);
	}
	return gnome_pie_indicator_type_id__once;
}

static void
_vala_gnome_pie_indicator_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GnomePieIndicator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_INDICATOR, GnomePieIndicator);
	switch (property_id) {
		case GNOME_PIE_INDICATOR_ACTIVE_PROPERTY:
		g_value_set_boolean (value, gnome_pie_indicator_get_active (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_indicator_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	GnomePieIndicator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_INDICATOR, GnomePieIndicator);
	switch (property_id) {
		case GNOME_PIE_INDICATOR_ACTIVE_PROPERTY:
		gnome_pie_indicator_set_active (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

