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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*-
 *
 * Copyright (C) 2011,2012 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Robert Ancell <robert.ancell@canonical.com>
 *          Michael Terry <michael.terry@canonical.com>
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gtk/gtk.h>
#include <cairo-gobject.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <gdk/gdk.h>
#include <lightdm.h>
#include <stdio.h>
#include <gtk/gtkx.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/Xregion.h>
#include <atk/atk.h>
#include <sys/utsname.h>

#define MENU_BAR_HEIGHT 24
#define MENU_BAR_BLUR_RADIUS 8
#define UG_SETTINGS_KEY_ONSCREEN_KEYBOARD "onscreen-keyboard"
#define UG_SETTINGS_KEY_HIGH_CONTRAST "high-contrast"
#define UG_SETTINGS_KEY_SCREEN_READER "screen-reader"
#define UG_SETTINGS_KEY_ONSCREEN_KEYBOARD_LAYOUT "onscreen-keyboard-layout"
#define UG_SETTINGS_KEY_SHOW_QUIT "show-quit"
#define UG_SETTINGS_KEY_SHOW_CLOCK "show-clock"
#define UG_SETTINGS_KEY_CLOCK_FORMAT "clock-format"
#define UG_SETTINGS_KEY_SHOW_POWER "show-power"
#define UG_SETTINGS_KEY_SHOW_KEYBOARD "show-keyboard"
#define UG_SETTINGS_KEY_SHOW_A11Y "show-a11y"
#define UG_SETTINGS_KEY_SHOW_HOSTNAME "show-hostname"
#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 UPOWER_TYPE_DAEMON (upower_daemon_get_type ())
#define UPOWER_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UPOWER_TYPE_DAEMON, UPowerDaemon))
#define UPOWER_IS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UPOWER_TYPE_DAEMON))
#define UPOWER_DAEMON_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), UPOWER_TYPE_DAEMON, UPowerDaemonIface))

typedef struct _UPowerDaemon UPowerDaemon;
typedef struct _UPowerDaemonIface UPowerDaemonIface;

#define UPOWER_TYPE_DAEMON_PROXY (upower_daemon_proxy_get_type ())
enum  {
	UPOWER_DAEMON_DEVICE_ADDED_SIGNAL,
	UPOWER_DAEMON_DEVICE_REMOVED_SIGNAL,
	UPOWER_DAEMON_DEVICE_CHANGED_SIGNAL,
	UPOWER_DAEMON_CHANGED_SIGNAL,
	UPOWER_DAEMON_SLEEPING_SIGNAL,
	UPOWER_DAEMON_RESUMING_SIGNAL,
	UPOWER_DAEMON_NUM_SIGNALS
};
static guint upower_daemon_signals[UPOWER_DAEMON_NUM_SIGNALS] = {0};
typedef GDBusProxy UPowerDaemonProxy;
typedef GDBusProxyClass UPowerDaemonProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define UPOWER_TYPE_DEVICE (upower_device_get_type ())
#define UPOWER_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UPOWER_TYPE_DEVICE, UPowerDevice))
#define UPOWER_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UPOWER_TYPE_DEVICE))
#define UPOWER_DEVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), UPOWER_TYPE_DEVICE, UPowerDeviceIface))

typedef struct _UPowerDevice UPowerDevice;
typedef struct _UPowerDeviceIface UPowerDeviceIface;

#define UPOWER_TYPE_DEVICE_PROXY (upower_device_proxy_get_type ())
enum  {
	UPOWER_DEVICE_CHANGED_SIGNAL,
	UPOWER_DEVICE_NUM_SIGNALS
};
static guint upower_device_signals[UPOWER_DEVICE_NUM_SIGNALS] = {0};
typedef GDBusProxy UPowerDeviceProxy;
typedef GDBusProxyClass UPowerDeviceProxyClass;

#define TYPE_MENU_BAR (menu_bar_get_type ())
#define MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MENU_BAR, MenuBar))
#define MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MENU_BAR, MenuBarClass))
#define IS_MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MENU_BAR))
#define IS_MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MENU_BAR))
#define MENU_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MENU_BAR, MenuBarClass))

typedef struct _MenuBar MenuBar;
typedef struct _MenuBarClass MenuBarClass;
typedef struct _MenuBarPrivate MenuBarPrivate;

#define TYPE_BACKGROUND (background_get_type ())
#define BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND, Background))
#define BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKGROUND, BackgroundClass))
#define IS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND))
#define IS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKGROUND))
#define BACKGROUND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKGROUND, BackgroundClass))

typedef struct _Background Background;
typedef struct _BackgroundClass BackgroundClass;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;
enum  {
	MENU_BAR_0_PROPERTY,
	MENU_BAR_BACKGROUND_PROPERTY,
	MENU_BAR_HIGH_CONTRAST_PROPERTY,
	MENU_BAR_KEYBOARD_WINDOW_PROPERTY,
	MENU_BAR_ACCEL_GROUP_PROPERTY,
	MENU_BAR_MAIN_WINDOW_PROPERTY,
	MENU_BAR_NUM_PROPERTIES
};
static GParamSpec* menu_bar_properties[MENU_BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
typedef enum  {
	BACKGROUND_DRAW_FLAGS_NONE = 1 << 0,
	BACKGROUND_DRAW_FLAGS_GRID = 1 << 1,
	BACKGROUND_DRAW_FLAGS_SPAN = 1 << 2
} BackgroundDrawFlags;

#define BACKGROUND_TYPE_DRAW_FLAGS (background_draw_flags_get_type ())
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _MenuBarQueryUpowerDeviceData MenuBarQueryUpowerDeviceData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
typedef enum  {
	SHUTDOWN_DIALOG_TYPE_LOGOUT,
	SHUTDOWN_DIALOG_TYPE_SHUTDOWN,
	SHUTDOWN_DIALOG_TYPE_RESTART
} ShutdownDialogType;

#define TYPE_SHUTDOWN_DIALOG_TYPE (shutdown_dialog_type_get_type ())
#define _fclose0(var) ((var == NULL) ? NULL : (var = (fclose (var), NULL)))

#define TYPE_SLICK_GREETER (slick_greeter_get_type ())
#define SLICK_GREETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SLICK_GREETER, SlickGreeter))
#define SLICK_GREETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SLICK_GREETER, SlickGreeterClass))
#define IS_SLICK_GREETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SLICK_GREETER))
#define IS_SLICK_GREETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SLICK_GREETER))
#define SLICK_GREETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SLICK_GREETER, SlickGreeterClass))

typedef struct _SlickGreeter SlickGreeter;
typedef struct _SlickGreeterClass SlickGreeterClass;
typedef struct _SlickGreeterPrivate SlickGreeterPrivate;

struct _UPowerDaemonIface {
	GTypeInterface parent_iface;
	char** (*enumerate_devices) (UPowerDaemon* self, gint* result_length1, GError** error);
	gchar* (*get_daemon_version) (UPowerDaemon* self);
	gboolean (*get_on_battery) (UPowerDaemon* self);
	gboolean (*get_on_low_battery) (UPowerDaemon* self);
	gboolean (*get_lid_is_present) (UPowerDaemon* self);
	gboolean (*get_lid_is_closed) (UPowerDaemon* self);
};

struct _UPowerDeviceIface {
	GTypeInterface parent_iface;
	guint (*get_Type) (UPowerDevice* self);
	gboolean (*get_power_supply) (UPowerDevice* self);
	gboolean (*get_online) (UPowerDevice* self);
	gboolean (*get_is_present) (UPowerDevice* self);
	guint (*get_state) (UPowerDevice* self);
	gboolean (*get_is_rechargeable) (UPowerDevice* self);
	gdouble (*get_capacity) (UPowerDevice* self);
	gint64 (*get_time_to_empty) (UPowerDevice* self);
	gint64 (*get_time_to_full) (UPowerDevice* self);
	gdouble (*get_energy) (UPowerDevice* self);
	gdouble (*get_energy_empty) (UPowerDevice* self);
	gdouble (*get_energy_full) (UPowerDevice* self);
	gdouble (*get_energy_full_design) (UPowerDevice* self);
	gdouble (*get_energy_rate) (UPowerDevice* self);
	gdouble (*get_percentage) (UPowerDevice* self);
	gdouble (*get_voltage) (UPowerDevice* self);
	guint (*get_technology) (UPowerDevice* self);
	gchar* (*get_vendor) (UPowerDevice* self);
	gchar* (*get_model) (UPowerDevice* self);
	gchar* (*get_serial) (UPowerDevice* self);
};

struct _MenuBar {
	GtkMenuBar parent_instance;
	MenuBarPrivate * priv;
};

struct _MenuBarClass {
	GtkMenuBarClass parent_class;
};

struct _MenuBarPrivate {
	Background* _background;
	gboolean _high_contrast;
	GtkWindow* _keyboard_window;
	GtkAccelGroup* _accel_group;
	MainWindow* _main_window;
	gchar* default_theme_name;
	gchar* clock_format;
	GtkCheckMenuItem* high_contrast_item;
	GPid keyboard_pid;
	GPid reader_pid;
	GtkCheckMenuItem* onscreen_keyboard_item;
	GtkLabel* clock_label;
	UPowerDaemon* upowerd;
	GtkMenuItem* power_menu_item;
	GtkLabel* power_label;
	GtkImage* power_icon;
	cairo_surface_t* bg_surface;
};

struct _MenuBarQueryUpowerDeviceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	MenuBar* self;
	char* dev_path;
	UPowerDevice* dev;
	UPowerDevice* _tmp0_;
	UPowerDevice* _tmp1_;
	UPowerDevice* _tmp2_;
	GError* io;
	GError* _tmp3_;
	const gchar* _tmp4_;
	guint type;
	UPowerDevice* _tmp5_;
	guint _tmp6_;
	guint _tmp7_;
	gboolean _tmp8_;
	UPowerDevice* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	UPowerDevice* _tmp12_;
	GError* _inner_error0_;
};

struct _Block2Data {
	int _ref_count_;
	MenuBar* self;
	GtkMenuItem* item;
	GtkLabel* label;
};

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	LightDMLayout* layout;
};

struct _SlickGreeter {
	GTypeInstance parent_instance;
	volatile int ref_count;
	SlickGreeterPrivate * priv;
	gboolean test_mode;
	gboolean orca_needs_kick;
};

struct _SlickGreeterClass {
	GTypeClass parent_class;
	void (*finalize) (SlickGreeter *self);
};

static gint MenuBar_private_offset;
static gpointer menu_bar_parent_class = NULL;
VALA_EXTERN SlickGreeter* slick_greeter_singleton;

VALA_EXTERN GType upower_daemon_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint upower_daemon_register_object (void* object,
                                     GDBusConnection* connection,
                                     const gchar* path,
                                     GError** error);
VALA_EXTERN GType upower_daemon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UPowerDaemon, g_object_unref)
VALA_EXTERN char** upower_daemon_enumerate_devices (UPowerDaemon* self,
                                        gint* result_length1,
                                        GError** error);
VALA_EXTERN gchar* upower_daemon_get_daemon_version (UPowerDaemon* self);
VALA_EXTERN gboolean upower_daemon_get_on_battery (UPowerDaemon* self);
VALA_EXTERN gboolean upower_daemon_get_on_low_battery (UPowerDaemon* self);
VALA_EXTERN gboolean upower_daemon_get_lid_is_present (UPowerDaemon* self);
VALA_EXTERN gboolean upower_daemon_get_lid_is_closed (UPowerDaemon* self);
static GType upower_daemon_get_type_once (void);
static void upower_daemon_proxy_g_signal (GDBusProxy* proxy,
                                   const gchar* sender_name,
                                   const gchar* signal_name,
                                   GVariant* parameters);
static void _dbus_handle_upower_daemon_device_added (UPowerDaemon* self,
                                              GVariant* parameters);
static void _dbus_handle_upower_daemon_device_removed (UPowerDaemon* self,
                                                GVariant* parameters);
static void _dbus_handle_upower_daemon_device_changed (UPowerDaemon* self,
                                                GVariant* parameters);
static void _dbus_handle_upower_daemon_changed (UPowerDaemon* self,
                                         GVariant* parameters);
static void _dbus_handle_upower_daemon_sleeping (UPowerDaemon* self,
                                          GVariant* parameters);
static void _dbus_handle_upower_daemon_resuming (UPowerDaemon* self,
                                          GVariant* parameters);
static char** upower_daemon_proxy_enumerate_devices (UPowerDaemon* self,
                                              gint* result_length1,
                                              GError** error);
static gchar* upower_daemon_dbus_proxy_get_daemon_version (UPowerDaemon* self);
static gboolean upower_daemon_dbus_proxy_get_on_battery (UPowerDaemon* self);
static gboolean upower_daemon_dbus_proxy_get_on_low_battery (UPowerDaemon* self);
static gboolean upower_daemon_dbus_proxy_get_lid_is_present (UPowerDaemon* self);
static gboolean upower_daemon_dbus_proxy_get_lid_is_closed (UPowerDaemon* self);
static void upower_daemon_proxy_upower_daemon_interface_init (UPowerDaemonIface* iface);
static void _dbus_upower_daemon_enumerate_devices (UPowerDaemon* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void upower_daemon_dbus_interface_method_call (GDBusConnection* connection,
                                               const gchar* sender,
                                               const gchar* object_path,
                                               const gchar* interface_name,
                                               const gchar* method_name,
                                               GVariant* parameters,
                                               GDBusMethodInvocation* invocation,
                                               gpointer user_data);
static GVariant* upower_daemon_dbus_interface_get_property (GDBusConnection* connection,
                                                     const gchar* sender,
                                                     const gchar* object_path,
                                                     const gchar* interface_name,
                                                     const gchar* property_name,
                                                     GError** error,
                                                     gpointer user_data);
static GVariant* _dbus_upower_daemon_get_daemon_version (UPowerDaemon* self);
static GVariant* _dbus_upower_daemon_get_on_battery (UPowerDaemon* self);
static GVariant* _dbus_upower_daemon_get_on_low_battery (UPowerDaemon* self);
static GVariant* _dbus_upower_daemon_get_lid_is_present (UPowerDaemon* self);
static GVariant* _dbus_upower_daemon_get_lid_is_closed (UPowerDaemon* self);
static gboolean upower_daemon_dbus_interface_set_property (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* property_name,
                                                    GVariant* value,
                                                    GError** error,
                                                    gpointer user_data);
static void _dbus_upower_daemon_device_added (GObject* _sender,
                                       const char* device,
                                       gpointer* _data);
static void _dbus_upower_daemon_device_removed (GObject* _sender,
                                         const char* device,
                                         gpointer* _data);
static void _dbus_upower_daemon_device_changed (GObject* _sender,
                                         const char* device,
                                         gpointer* _data);
static void _dbus_upower_daemon_changed (GObject* _sender,
                                  gpointer* _data);
static void _dbus_upower_daemon_sleeping (GObject* _sender,
                                   gpointer* _data);
static void _dbus_upower_daemon_resuming (GObject* _sender,
                                   gpointer* _data);
static void _upower_daemon_unregister_object (gpointer user_data);
VALA_EXTERN GType upower_device_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UPowerDevice, g_object_unref)
VALA_EXTERN GType upower_device_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint upower_device_register_object (void* object,
                                     GDBusConnection* connection,
                                     const gchar* path,
                                     GError** error);
VALA_EXTERN guint upower_device_get_Type (UPowerDevice* self);
VALA_EXTERN gboolean upower_device_get_power_supply (UPowerDevice* self);
VALA_EXTERN gboolean upower_device_get_online (UPowerDevice* self);
VALA_EXTERN gboolean upower_device_get_is_present (UPowerDevice* self);
VALA_EXTERN guint upower_device_get_state (UPowerDevice* self);
VALA_EXTERN gboolean upower_device_get_is_rechargeable (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_capacity (UPowerDevice* self);
VALA_EXTERN gint64 upower_device_get_time_to_empty (UPowerDevice* self);
VALA_EXTERN gint64 upower_device_get_time_to_full (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_energy (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_energy_empty (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_energy_full (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_energy_full_design (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_energy_rate (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_percentage (UPowerDevice* self);
VALA_EXTERN gdouble upower_device_get_voltage (UPowerDevice* self);
VALA_EXTERN guint upower_device_get_technology (UPowerDevice* self);
VALA_EXTERN gchar* upower_device_get_vendor (UPowerDevice* self);
VALA_EXTERN gchar* upower_device_get_model (UPowerDevice* self);
VALA_EXTERN gchar* upower_device_get_serial (UPowerDevice* self);
static GType upower_device_get_type_once (void);
static void upower_device_proxy_g_signal (GDBusProxy* proxy,
                                   const gchar* sender_name,
                                   const gchar* signal_name,
                                   GVariant* parameters);
static void _dbus_handle_upower_device_changed (UPowerDevice* self,
                                         GVariant* parameters);
static guint upower_device_dbus_proxy_get_Type (UPowerDevice* self);
static gboolean upower_device_dbus_proxy_get_power_supply (UPowerDevice* self);
static gboolean upower_device_dbus_proxy_get_online (UPowerDevice* self);
static gboolean upower_device_dbus_proxy_get_is_present (UPowerDevice* self);
static guint upower_device_dbus_proxy_get_state (UPowerDevice* self);
static gboolean upower_device_dbus_proxy_get_is_rechargeable (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_capacity (UPowerDevice* self);
static gint64 upower_device_dbus_proxy_get_time_to_empty (UPowerDevice* self);
static gint64 upower_device_dbus_proxy_get_time_to_full (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_energy (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_energy_empty (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_energy_full (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_energy_full_design (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_energy_rate (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_percentage (UPowerDevice* self);
static gdouble upower_device_dbus_proxy_get_voltage (UPowerDevice* self);
static guint upower_device_dbus_proxy_get_technology (UPowerDevice* self);
static gchar* upower_device_dbus_proxy_get_vendor (UPowerDevice* self);
static gchar* upower_device_dbus_proxy_get_model (UPowerDevice* self);
static gchar* upower_device_dbus_proxy_get_serial (UPowerDevice* self);
static void upower_device_proxy_upower_device_interface_init (UPowerDeviceIface* iface);
static void upower_device_dbus_interface_method_call (GDBusConnection* connection,
                                               const gchar* sender,
                                               const gchar* object_path,
                                               const gchar* interface_name,
                                               const gchar* method_name,
                                               GVariant* parameters,
                                               GDBusMethodInvocation* invocation,
                                               gpointer user_data);
static GVariant* upower_device_dbus_interface_get_property (GDBusConnection* connection,
                                                     const gchar* sender,
                                                     const gchar* object_path,
                                                     const gchar* interface_name,
                                                     const gchar* property_name,
                                                     GError** error,
                                                     gpointer user_data);
static GVariant* _dbus_upower_device_get_Type (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_power_supply (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_online (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_is_present (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_state (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_is_rechargeable (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_capacity (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_time_to_empty (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_time_to_full (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_energy (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_energy_empty (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_energy_full (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_energy_full_design (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_energy_rate (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_percentage (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_voltage (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_technology (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_vendor (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_model (UPowerDevice* self);
static GVariant* _dbus_upower_device_get_serial (UPowerDevice* self);
static gboolean upower_device_dbus_interface_set_property (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* property_name,
                                                    GVariant* value,
                                                    GError** error,
                                                    gpointer user_data);
static void _dbus_upower_device_changed (GObject* _sender,
                                  gpointer* _data);
static void _upower_device_unregister_object (gpointer user_data);
VALA_EXTERN GType menu_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MenuBar, g_object_unref)
VALA_EXTERN GType background_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Background, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
VALA_EXTERN MenuBar* menu_bar_new (Background* bg,
                       GtkAccelGroup* ag,
                       MainWindow* mw);
VALA_EXTERN MenuBar* menu_bar_construct (GType object_type,
                             Background* bg,
                             GtkAccelGroup* ag,
                             MainWindow* mw);
static gboolean menu_bar_real_draw (GtkWidget* base,
                             cairo_t* c);
VALA_EXTERN Background* menu_bar_get_background (MenuBar* self);
VALA_EXTERN GType background_draw_flags_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void background_draw_full (Background* self,
                           cairo_t* c,
                           BackgroundDrawFlags flags);
VALA_EXTERN void cairo_utils_exponential_blur_surface (cairo_surface_t* surface,
                                           gint radius);
static void menu_bar_rebuild_background (MenuBar* self);
VALA_EXTERN void menu_bar_set_keyboard_state (MenuBar* self);
VALA_EXTERN gboolean ug_settings_get_boolean (const gchar* key);
static void menu_bar_on_sleeping (MenuBar* self);
static void menu_bar_on_resuming (MenuBar* self);
static gboolean menu_bar_query_upower_daemon (MenuBar* self);
static void menu_bar_on_changed (MenuBar* self);
static void menu_bar_on_power_device_added (MenuBar* self,
                                     const char* device);
static void menu_bar_query_upower_device (MenuBar* self,
                                   const char* dev_path,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
static void menu_bar_query_upower_device_finish (MenuBar* self,
                                          GAsyncResult* _res_);
static void menu_bar_on_power_device_changed (MenuBar* self,
                                       const char* device);
static void menu_bar_query_upower_device_data_free (gpointer _data);
static gboolean menu_bar_query_upower_device_co (MenuBarQueryUpowerDeviceData* _data_);
static void menu_bar_update_power (MenuBar* self,
                            UPowerDevice* device);
static void menu_bar_on_power_device_removed (MenuBar* self,
                                       const char* device);
static gboolean menu_bar_update_clock (MenuBar* self);
static void menu_bar_close_pid (MenuBar* self,
                         GPid* pid);
VALA_EXTERN void menu_bar_cleanup (MenuBar* self);
static void menu_bar_real_get_preferred_height (GtkWidget* base,
                                         gint* min,
                                         gint* nat);
static void menu_bar_real_size_allocate (GtkWidget* base,
                                  GtkAllocation* allocation);
static GtkMenuItem* menu_bar_make_a11y_item (MenuBar* self);
static void menu_bar_keyboard_toggled_cb (MenuBar* self,
                                   GtkCheckMenuItem* item);
static void _menu_bar_keyboard_toggled_cb_gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender,
                                                                gpointer self);
static void menu_bar_high_contrast_toggled_cb (MenuBar* self,
                                        GtkCheckMenuItem* item);
static void _menu_bar_high_contrast_toggled_cb_gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender,
                                                                     gpointer self);
VALA_EXTERN GtkAccelGroup* menu_bar_get_accel_group (MenuBar* self);
static void menu_bar_screen_reader_toggled_cb (MenuBar* self,
                                        GtkCheckMenuItem* item);
static void _menu_bar_screen_reader_toggled_cb_gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender,
                                                                     gpointer self);
static GtkMenuItem* menu_bar_make_session_item (MenuBar* self);
static void ___lambda6_ (MenuBar* self);
static void ____lambda6__gtk_menu_item_activate (GtkMenuItem* _sender,
                                          gpointer self);
static void ___lambda7_ (MenuBar* self);
static void ____lambda7__gtk_menu_item_activate (GtkMenuItem* _sender,
                                          gpointer self);
static void menu_bar_shutdown_cb (MenuBar* self,
                           GtkMenuItem* item);
static void _menu_bar_shutdown_cb_gtk_menu_item_activate (GtkMenuItem* _sender,
                                                   gpointer self);
static GtkMenuItem* menu_bar_make_keyboard_item (MenuBar* self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void ____lambda21_ (Block3Data* _data3_);
static void _____lambda21__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static void __lambda22_ (Block2Data* _data2_);
static void ___lambda22__gdk_keymap_state_changed (GdkKeymap* _sender,
                                            gpointer self);
VALA_EXTERN MainWindow* menu_bar_get_main_window (MenuBar* self);
VALA_EXTERN GType shutdown_dialog_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void main_window_show_shutdown_dialog (MainWindow* self,
                                       ShutdownDialogType type);
VALA_EXTERN gboolean ug_settings_set_boolean (const gchar* key,
                                  gboolean value);
VALA_EXTERN GtkWindow* menu_bar_get_keyboard_window (MenuBar* self);
VALA_EXTERN gchar* ug_settings_get_string (const gchar* key);
static void menu_bar_set_keyboard_window (MenuBar* self,
                                   GtkWindow* value);
static void menu_bar_set_high_contrast (MenuBar* self,
                                 gboolean value);
VALA_EXTERN gboolean menu_bar_get_high_contrast (MenuBar* self);
VALA_EXTERN gpointer slick_greeter_ref (gpointer instance);
VALA_EXTERN void slick_greeter_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_slick_greeter (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags);
VALA_EXTERN void value_set_slick_greeter (GValue* value,
                              gpointer v_object);
VALA_EXTERN void value_take_slick_greeter (GValue* value,
                               gpointer v_object);
VALA_EXTERN gpointer value_get_slick_greeter (const GValue* value);
VALA_EXTERN GType slick_greeter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SlickGreeter, slick_greeter_unref)
static gboolean ____lambda5_ (MenuBar* self);
static gboolean _____lambda5__gsource_func (gpointer self);
static void menu_bar_set_background (MenuBar* self,
                              Background* value);
static void menu_bar_set_accel_group (MenuBar* self,
                               GtkAccelGroup* value);
static void menu_bar_set_main_window (MenuBar* self,
                               MainWindow* value);
static GObject * menu_bar_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties);
static void _menu_bar_rebuild_background_g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self);
static gboolean _menu_bar_update_clock_gsource_func (gpointer self);
static void _menu_bar_on_power_device_added_upower_daemon_device_added (UPowerDaemon* _sender,
                                                                 const char* device,
                                                                 gpointer self);
static void _menu_bar_on_power_device_removed_upower_daemon_device_removed (UPowerDaemon* _sender,
                                                                     const char* device,
                                                                     gpointer self);
static void _menu_bar_on_power_device_changed_upower_daemon_device_changed (UPowerDaemon* _sender,
                                                                     const char* device,
                                                                     gpointer self);
static void _menu_bar_on_changed_upower_daemon_changed (UPowerDaemon* _sender,
                                                 gpointer self);
static void _menu_bar_on_sleeping_upower_daemon_sleeping (UPowerDaemon* _sender,
                                                   gpointer self);
static void _menu_bar_on_resuming_upower_daemon_resuming (UPowerDaemon* _sender,
                                                   gpointer self);
static gboolean _menu_bar_query_upower_daemon_gsource_func (gpointer self);
static void _menu_bar_cleanup_slick_greeter_starting_session (SlickGreeter* _sender,
                                                       gpointer self);
static void menu_bar_finalize (GObject * obj);
static GType menu_bar_get_type_once (void);
static void _vala_menu_bar_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec);
static void _vala_menu_bar_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _upower_daemon_dbus_arg_info_enumerate_devices_result = {-1, "result", "ao", NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_enumerate_devices_in[] = {NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_enumerate_devices_out[] = {&_upower_daemon_dbus_arg_info_enumerate_devices_result, NULL};
static const GDBusMethodInfo _upower_daemon_dbus_method_info_enumerate_devices = {-1, "EnumerateDevices", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_enumerate_devices_in), (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_enumerate_devices_out), NULL};
static const GDBusMethodInfo * const _upower_daemon_dbus_method_info[] = {&_upower_daemon_dbus_method_info_enumerate_devices, NULL};
static const GDBusArgInfo _upower_daemon_dbus_arg_info_device_added_device = {-1, "device", "o", NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_device_added[] = {&_upower_daemon_dbus_arg_info_device_added_device, NULL};
static const GDBusSignalInfo _upower_daemon_dbus_signal_info_device_added = {-1, "DeviceAdded", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_device_added), NULL};
static const GDBusArgInfo _upower_daemon_dbus_arg_info_device_removed_device = {-1, "device", "o", NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_device_removed[] = {&_upower_daemon_dbus_arg_info_device_removed_device, NULL};
static const GDBusSignalInfo _upower_daemon_dbus_signal_info_device_removed = {-1, "DeviceRemoved", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_device_removed), NULL};
static const GDBusArgInfo _upower_daemon_dbus_arg_info_device_changed_device = {-1, "device", "o", NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_device_changed[] = {&_upower_daemon_dbus_arg_info_device_changed_device, NULL};
static const GDBusSignalInfo _upower_daemon_dbus_signal_info_device_changed = {-1, "DeviceChanged", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_device_changed), NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_changed[] = {NULL};
static const GDBusSignalInfo _upower_daemon_dbus_signal_info_changed = {-1, "Changed", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_changed), NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_sleeping[] = {NULL};
static const GDBusSignalInfo _upower_daemon_dbus_signal_info_sleeping = {-1, "Sleeping", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_sleeping), NULL};
static const GDBusArgInfo * const _upower_daemon_dbus_arg_info_resuming[] = {NULL};
static const GDBusSignalInfo _upower_daemon_dbus_signal_info_resuming = {-1, "Resuming", (GDBusArgInfo **) (&_upower_daemon_dbus_arg_info_resuming), NULL};
static const GDBusSignalInfo * const _upower_daemon_dbus_signal_info[] = {&_upower_daemon_dbus_signal_info_device_added, &_upower_daemon_dbus_signal_info_device_removed, &_upower_daemon_dbus_signal_info_device_changed, &_upower_daemon_dbus_signal_info_changed, &_upower_daemon_dbus_signal_info_sleeping, &_upower_daemon_dbus_signal_info_resuming, NULL};
static const GDBusPropertyInfo _upower_daemon_dbus_property_info_daemon_version = {-1, "DaemonVersion", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_daemon_dbus_property_info_on_battery = {-1, "OnBattery", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_daemon_dbus_property_info_on_low_battery = {-1, "OnLowBattery", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_daemon_dbus_property_info_lid_is_present = {-1, "LidIsPresent", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_daemon_dbus_property_info_lid_is_closed = {-1, "LidIsClosed", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _upower_daemon_dbus_property_info[] = {&_upower_daemon_dbus_property_info_daemon_version, &_upower_daemon_dbus_property_info_on_battery, &_upower_daemon_dbus_property_info_on_low_battery, &_upower_daemon_dbus_property_info_lid_is_present, &_upower_daemon_dbus_property_info_lid_is_closed, NULL};
static const GDBusInterfaceInfo _upower_daemon_dbus_interface_info = {-1, "org.freedesktop.UPower", (GDBusMethodInfo **) (&_upower_daemon_dbus_method_info), (GDBusSignalInfo **) (&_upower_daemon_dbus_signal_info), (GDBusPropertyInfo **) (&_upower_daemon_dbus_property_info), NULL};
static const GDBusInterfaceVTable _upower_daemon_dbus_interface_vtable = {upower_daemon_dbus_interface_method_call, upower_daemon_dbus_interface_get_property, upower_daemon_dbus_interface_set_property};
static const GDBusMethodInfo * const _upower_device_dbus_method_info[] = {NULL};
static const GDBusArgInfo * const _upower_device_dbus_arg_info_changed[] = {NULL};
static const GDBusSignalInfo _upower_device_dbus_signal_info_changed = {-1, "Changed", (GDBusArgInfo **) (&_upower_device_dbus_arg_info_changed), NULL};
static const GDBusSignalInfo * const _upower_device_dbus_signal_info[] = {&_upower_device_dbus_signal_info_changed, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_Type = {-1, "Type", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_power_supply = {-1, "PowerSupply", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_online = {-1, "Online", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_is_present = {-1, "IsPresent", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_state = {-1, "State", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_is_rechargeable = {-1, "IsRechargeable", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_capacity = {-1, "Capacity", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_time_to_empty = {-1, "TimeToEmpty", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_time_to_full = {-1, "TimeToFull", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_energy = {-1, "Energy", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_energy_empty = {-1, "EnergyEmpty", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_energy_full = {-1, "EnergyFull", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_energy_full_design = {-1, "EnergyFullDesign", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_energy_rate = {-1, "EnergyRate", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_percentage = {-1, "Percentage", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_voltage = {-1, "Voltage", "d", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_technology = {-1, "Technology", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_vendor = {-1, "Vendor", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_model = {-1, "Model", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _upower_device_dbus_property_info_serial = {-1, "Serial", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _upower_device_dbus_property_info[] = {&_upower_device_dbus_property_info_Type, &_upower_device_dbus_property_info_power_supply, &_upower_device_dbus_property_info_online, &_upower_device_dbus_property_info_is_present, &_upower_device_dbus_property_info_state, &_upower_device_dbus_property_info_is_rechargeable, &_upower_device_dbus_property_info_capacity, &_upower_device_dbus_property_info_time_to_empty, &_upower_device_dbus_property_info_time_to_full, &_upower_device_dbus_property_info_energy, &_upower_device_dbus_property_info_energy_empty, &_upower_device_dbus_property_info_energy_full, &_upower_device_dbus_property_info_energy_full_design, &_upower_device_dbus_property_info_energy_rate, &_upower_device_dbus_property_info_percentage, &_upower_device_dbus_property_info_voltage, &_upower_device_dbus_property_info_technology, &_upower_device_dbus_property_info_vendor, &_upower_device_dbus_property_info_model, &_upower_device_dbus_property_info_serial, NULL};
static const GDBusInterfaceInfo _upower_device_dbus_interface_info = {-1, "org.freedesktop.UPower.Device", (GDBusMethodInfo **) (&_upower_device_dbus_method_info), (GDBusSignalInfo **) (&_upower_device_dbus_signal_info), (GDBusPropertyInfo **) (&_upower_device_dbus_property_info), NULL};
static const GDBusInterfaceVTable _upower_device_dbus_interface_vtable = {upower_device_dbus_interface_method_call, upower_device_dbus_interface_get_property, upower_device_dbus_interface_set_property};

char**
upower_daemon_enumerate_devices (UPowerDaemon* self,
                                 gint* result_length1,
                                 GError** error)
{
	UPowerDaemonIface* _iface_;
#line 31 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 31 "../src/menubar.vala"
	_iface_ = UPOWER_DAEMON_GET_INTERFACE (self);
#line 31 "../src/menubar.vala"
	if (_iface_->enumerate_devices) {
#line 31 "../src/menubar.vala"
		return _iface_->enumerate_devices (self, result_length1, error);
#line 748 "menubar.c"
	}
#line 31 "../src/menubar.vala"
	return NULL;
#line 752 "menubar.c"
}

gchar*
upower_daemon_get_daemon_version (UPowerDaemon* self)
{
	UPowerDaemonIface* _iface_;
#line 33 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 33 "../src/menubar.vala"
	_iface_ = UPOWER_DAEMON_GET_INTERFACE (self);
#line 33 "../src/menubar.vala"
	if (_iface_->get_daemon_version) {
#line 33 "../src/menubar.vala"
		return _iface_->get_daemon_version (self);
#line 767 "menubar.c"
	}
#line 33 "../src/menubar.vala"
	return NULL;
#line 771 "menubar.c"
}

gboolean
upower_daemon_get_on_battery (UPowerDaemon* self)
{
	UPowerDaemonIface* _iface_;
#line 36 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 36 "../src/menubar.vala"
	_iface_ = UPOWER_DAEMON_GET_INTERFACE (self);
#line 36 "../src/menubar.vala"
	if (_iface_->get_on_battery) {
#line 36 "../src/menubar.vala"
		return _iface_->get_on_battery (self);
#line 786 "menubar.c"
	}
#line 36 "../src/menubar.vala"
	return FALSE;
#line 790 "menubar.c"
}

gboolean
upower_daemon_get_on_low_battery (UPowerDaemon* self)
{
	UPowerDaemonIface* _iface_;
#line 37 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 37 "../src/menubar.vala"
	_iface_ = UPOWER_DAEMON_GET_INTERFACE (self);
#line 37 "../src/menubar.vala"
	if (_iface_->get_on_low_battery) {
#line 37 "../src/menubar.vala"
		return _iface_->get_on_low_battery (self);
#line 805 "menubar.c"
	}
#line 37 "../src/menubar.vala"
	return FALSE;
#line 809 "menubar.c"
}

gboolean
upower_daemon_get_lid_is_present (UPowerDaemon* self)
{
	UPowerDaemonIface* _iface_;
#line 38 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 38 "../src/menubar.vala"
	_iface_ = UPOWER_DAEMON_GET_INTERFACE (self);
#line 38 "../src/menubar.vala"
	if (_iface_->get_lid_is_present) {
#line 38 "../src/menubar.vala"
		return _iface_->get_lid_is_present (self);
#line 824 "menubar.c"
	}
#line 38 "../src/menubar.vala"
	return FALSE;
#line 828 "menubar.c"
}

gboolean
upower_daemon_get_lid_is_closed (UPowerDaemon* self)
{
	UPowerDaemonIface* _iface_;
#line 39 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 39 "../src/menubar.vala"
	_iface_ = UPOWER_DAEMON_GET_INTERFACE (self);
#line 39 "../src/menubar.vala"
	if (_iface_->get_lid_is_closed) {
#line 39 "../src/menubar.vala"
		return _iface_->get_lid_is_closed (self);
#line 843 "menubar.c"
	}
#line 39 "../src/menubar.vala"
	return FALSE;
#line 847 "menubar.c"
}

static void
upower_daemon_default_init (UPowerDaemonIface * iface,
                            gpointer iface_data)
{
#line 24 "../src/menubar.vala"
	upower_daemon_signals[UPOWER_DAEMON_DEVICE_ADDED_SIGNAL] = g_signal_new ("device-added", UPOWER_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
#line 24 "../src/menubar.vala"
	upower_daemon_signals[UPOWER_DAEMON_DEVICE_REMOVED_SIGNAL] = g_signal_new ("device-removed", UPOWER_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
#line 24 "../src/menubar.vala"
	upower_daemon_signals[UPOWER_DAEMON_DEVICE_CHANGED_SIGNAL] = g_signal_new ("device-changed", UPOWER_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
#line 24 "../src/menubar.vala"
	upower_daemon_signals[UPOWER_DAEMON_CHANGED_SIGNAL] = g_signal_new ("changed", UPOWER_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 24 "../src/menubar.vala"
	upower_daemon_signals[UPOWER_DAEMON_SLEEPING_SIGNAL] = g_signal_new ("sleeping", UPOWER_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 24 "../src/menubar.vala"
	upower_daemon_signals[UPOWER_DAEMON_RESUMING_SIGNAL] = g_signal_new ("resuming", UPOWER_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 866 "menubar.c"
}

static GType
upower_daemon_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UPowerDaemonIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) upower_daemon_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType upower_daemon_type_id;
	upower_daemon_type_id = g_type_register_static (G_TYPE_INTERFACE, "UPowerDaemon", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (upower_daemon_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (upower_daemon_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) upower_daemon_proxy_get_type);
	g_type_set_qdata (upower_daemon_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.UPower");
	g_type_set_qdata (upower_daemon_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_upower_daemon_dbus_interface_info));
	g_type_set_qdata (upower_daemon_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) upower_daemon_register_object);
	return upower_daemon_type_id;
}

GType
upower_daemon_get_type (void)
{
	static volatile gsize upower_daemon_type_id__once = 0;
	if (g_once_init_enter (&upower_daemon_type_id__once)) {
		GType upower_daemon_type_id;
		upower_daemon_type_id = upower_daemon_get_type_once ();
		g_once_init_leave (&upower_daemon_type_id__once, upower_daemon_type_id);
	}
	return upower_daemon_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (UPowerDaemonProxy, upower_daemon_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (UPOWER_TYPE_DAEMON, upower_daemon_proxy_upower_daemon_interface_init) )
static void
upower_daemon_proxy_class_init (UPowerDaemonProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = upower_daemon_proxy_g_signal;
}

static void
_dbus_handle_upower_daemon_device_added (UPowerDaemon* self,
                                         GVariant* parameters)
{
	GVariantIter _arguments_iter;
	char* device = NULL;
	GVariant* _tmp1_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	device = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	g_signal_emit_by_name (self, "device-added", device);
	_g_free0 (device);
}

static void
_dbus_handle_upower_daemon_device_removed (UPowerDaemon* self,
                                           GVariant* parameters)
{
	GVariantIter _arguments_iter;
	char* device = NULL;
	GVariant* _tmp2_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	device = g_variant_dup_string (_tmp2_, NULL);
	g_variant_unref (_tmp2_);
	g_signal_emit_by_name (self, "device-removed", device);
	_g_free0 (device);
}

static void
_dbus_handle_upower_daemon_device_changed (UPowerDaemon* self,
                                           GVariant* parameters)
{
	GVariantIter _arguments_iter;
	char* device = NULL;
	GVariant* _tmp3_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	device = g_variant_dup_string (_tmp3_, NULL);
	g_variant_unref (_tmp3_);
	g_signal_emit_by_name (self, "device-changed", device);
	_g_free0 (device);
}

static void
_dbus_handle_upower_daemon_changed (UPowerDaemon* self,
                                    GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "changed");
}

static void
_dbus_handle_upower_daemon_sleeping (UPowerDaemon* self,
                                     GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "sleeping");
}

static void
_dbus_handle_upower_daemon_resuming (UPowerDaemon* self,
                                     GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "resuming");
}

static void
upower_daemon_proxy_g_signal (GDBusProxy* proxy,
                              const gchar* sender_name,
                              const gchar* signal_name,
                              GVariant* parameters)
{
	if (strcmp (signal_name, "DeviceAdded") == 0) {
		_dbus_handle_upower_daemon_device_added ((UPowerDaemon*) proxy, parameters);
	} else if (strcmp (signal_name, "DeviceRemoved") == 0) {
		_dbus_handle_upower_daemon_device_removed ((UPowerDaemon*) proxy, parameters);
	} else if (strcmp (signal_name, "DeviceChanged") == 0) {
		_dbus_handle_upower_daemon_device_changed ((UPowerDaemon*) proxy, parameters);
	} else if (strcmp (signal_name, "Changed") == 0) {
		_dbus_handle_upower_daemon_changed ((UPowerDaemon*) proxy, parameters);
	} else if (strcmp (signal_name, "Sleeping") == 0) {
		_dbus_handle_upower_daemon_sleeping ((UPowerDaemon*) proxy, parameters);
	} else if (strcmp (signal_name, "Resuming") == 0) {
		_dbus_handle_upower_daemon_resuming ((UPowerDaemon*) proxy, parameters);
	}
}

static void
upower_daemon_proxy_init (UPowerDaemonProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_upower_daemon_dbus_interface_info));
}

static char**
upower_daemon_proxy_enumerate_devices (UPowerDaemon* self,
                                       gint* result_length1,
                                       GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	char** _result = NULL;
	gint _result_length1;
	GVariant* _tmp4_;
	char** _tmp5_;
	gint _tmp5__length;
	gint _tmp5__size;
	gint _tmp5__length1;
	GVariantIter _tmp6_;
	GVariant* _tmp7_;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.UPower", "EnumerateDevices");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_result_length1 = 0;
	_tmp4_ = g_variant_iter_next_value (&_reply_iter);
	_tmp5_ = g_new (char*, 5);
	_tmp5__length = 0;
	_tmp5__size = 4;
	_tmp5__length1 = 0;
	g_variant_iter_init (&_tmp6_, _tmp4_);
	for (; (_tmp7_ = g_variant_iter_next_value (&_tmp6_)) != NULL; _tmp5__length1++) {
		if (_tmp5__size == _tmp5__length) {
			_tmp5__size = 2 * _tmp5__size;
			_tmp5_ = g_renew (char*, _tmp5_, _tmp5__size + 1);
		}
		_tmp5_[_tmp5__length++] = g_variant_dup_string (_tmp7_, NULL);
		g_variant_unref (_tmp7_);
	}
	_result_length1 = _tmp5__length1;
	_tmp5_[_tmp5__length] = NULL;
	_result = _tmp5_;
	g_variant_unref (_tmp4_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static gchar*
upower_daemon_dbus_proxy_get_daemon_version (UPowerDaemon* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "DaemonVersion");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("DaemonVersion"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_daemon_dbus_proxy_get_on_battery (UPowerDaemon* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "OnBattery");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("OnBattery"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp8_ = FALSE;
			return _tmp8_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_daemon_dbus_proxy_get_on_low_battery (UPowerDaemon* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "OnLowBattery");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("OnLowBattery"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp9_ = FALSE;
			return _tmp9_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_daemon_dbus_proxy_get_lid_is_present (UPowerDaemon* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "LidIsPresent");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("LidIsPresent"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp10_ = FALSE;
			return _tmp10_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_daemon_dbus_proxy_get_lid_is_closed (UPowerDaemon* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "LidIsClosed");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("LidIsClosed"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp11_ = FALSE;
			return _tmp11_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
upower_daemon_proxy_upower_daemon_interface_init (UPowerDaemonIface* iface)
{
	iface->enumerate_devices = upower_daemon_proxy_enumerate_devices;
	iface->get_daemon_version = upower_daemon_dbus_proxy_get_daemon_version;
	iface->get_on_battery = upower_daemon_dbus_proxy_get_on_battery;
	iface->get_on_low_battery = upower_daemon_dbus_proxy_get_on_low_battery;
	iface->get_lid_is_present = upower_daemon_dbus_proxy_get_lid_is_present;
	iface->get_lid_is_closed = upower_daemon_dbus_proxy_get_lid_is_closed;
}

static void
_dbus_upower_daemon_enumerate_devices (UPowerDaemon* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	char** result;
	gint result_length1 = 0;
	char** _tmp12_;
	GVariantBuilder _tmp13_;
	gint _tmp14_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = upower_daemon_enumerate_devices (self, &result_length1, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp12_ = result;
	g_variant_builder_init (&_tmp13_, G_VARIANT_TYPE ("ao"));
	for (_tmp14_ = 0; _tmp14_ < result_length1; _tmp14_++) {
		g_variant_builder_add_value (&_tmp13_, g_variant_new_object_path (*_tmp12_));
		_tmp12_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp13_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
upower_daemon_dbus_interface_method_call (GDBusConnection* connection,
                                          const gchar* sender,
                                          const gchar* object_path,
                                          const gchar* interface_name,
                                          const gchar* method_name,
                                          GVariant* parameters,
                                          GDBusMethodInvocation* invocation,
                                          gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "EnumerateDevices") == 0) {
		_dbus_upower_daemon_enumerate_devices (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_upower_daemon_get_daemon_version (UPowerDaemon* self)
{
	gchar* result;
	GVariant* _reply;
	result = upower_daemon_get_daemon_version (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_upower_daemon_get_on_battery (UPowerDaemon* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_daemon_get_on_battery (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_daemon_get_on_low_battery (UPowerDaemon* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_daemon_get_on_low_battery (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_daemon_get_lid_is_present (UPowerDaemon* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_daemon_get_lid_is_present (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_daemon_get_lid_is_closed (UPowerDaemon* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_daemon_get_lid_is_closed (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
upower_daemon_dbus_interface_get_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GError** error,
                                           gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "DaemonVersion") == 0) {
		return _dbus_upower_daemon_get_daemon_version (object);
	} else if (strcmp (property_name, "OnBattery") == 0) {
		return _dbus_upower_daemon_get_on_battery (object);
	} else if (strcmp (property_name, "OnLowBattery") == 0) {
		return _dbus_upower_daemon_get_on_low_battery (object);
	} else if (strcmp (property_name, "LidIsPresent") == 0) {
		return _dbus_upower_daemon_get_lid_is_present (object);
	} else if (strcmp (property_name, "LidIsClosed") == 0) {
		return _dbus_upower_daemon_get_lid_is_closed (object);
	}
	return NULL;
}

static gboolean
upower_daemon_dbus_interface_set_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GVariant* value,
                                           GError** error,
                                           gpointer user_data)
{
	return FALSE;
}

static void
_dbus_upower_daemon_device_added (GObject* _sender,
                                  const char* device,
                                  gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (device));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower", "DeviceAdded", _arguments, NULL);
}

static void
_dbus_upower_daemon_device_removed (GObject* _sender,
                                    const char* device,
                                    gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (device));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower", "DeviceRemoved", _arguments, NULL);
}

static void
_dbus_upower_daemon_device_changed (GObject* _sender,
                                    const char* device,
                                    gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (device));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower", "DeviceChanged", _arguments, NULL);
}

static void
_dbus_upower_daemon_changed (GObject* _sender,
                             gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower", "Changed", _arguments, NULL);
}

static void
_dbus_upower_daemon_sleeping (GObject* _sender,
                              gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower", "Sleeping", _arguments, NULL);
}

static void
_dbus_upower_daemon_resuming (GObject* _sender,
                              gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower", "Resuming", _arguments, NULL);
}

guint
upower_daemon_register_object (gpointer object,
                               GDBusConnection* connection,
                               const gchar* path,
                               GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_upower_daemon_dbus_interface_info), &_upower_daemon_dbus_interface_vtable, data, _upower_daemon_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "device-added", (GCallback) _dbus_upower_daemon_device_added, data);
	g_signal_connect (object, "device-removed", (GCallback) _dbus_upower_daemon_device_removed, data);
	g_signal_connect (object, "device-changed", (GCallback) _dbus_upower_daemon_device_changed, data);
	g_signal_connect (object, "changed", (GCallback) _dbus_upower_daemon_changed, data);
	g_signal_connect (object, "sleeping", (GCallback) _dbus_upower_daemon_sleeping, data);
	g_signal_connect (object, "resuming", (GCallback) _dbus_upower_daemon_resuming, data);
	return result;
}

static void
_upower_daemon_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_daemon_device_added, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_daemon_device_removed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_daemon_device_changed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_daemon_changed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_daemon_sleeping, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_daemon_resuming, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

guint
upower_device_get_Type (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 53 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, 0U);
#line 53 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 53 "../src/menubar.vala"
	if (_iface_->get_Type) {
#line 53 "../src/menubar.vala"
		return _iface_->get_Type (self);
#line 1507 "menubar.c"
	}
#line 53 "../src/menubar.vala"
	return 0U;
#line 1511 "menubar.c"
}

gboolean
upower_device_get_power_supply (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 54 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 54 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 54 "../src/menubar.vala"
	if (_iface_->get_power_supply) {
#line 54 "../src/menubar.vala"
		return _iface_->get_power_supply (self);
#line 1526 "menubar.c"
	}
#line 54 "../src/menubar.vala"
	return FALSE;
#line 1530 "menubar.c"
}

gboolean
upower_device_get_online (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 55 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 55 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 55 "../src/menubar.vala"
	if (_iface_->get_online) {
#line 55 "../src/menubar.vala"
		return _iface_->get_online (self);
#line 1545 "menubar.c"
	}
#line 55 "../src/menubar.vala"
	return FALSE;
#line 1549 "menubar.c"
}

gboolean
upower_device_get_is_present (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 56 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 56 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 56 "../src/menubar.vala"
	if (_iface_->get_is_present) {
#line 56 "../src/menubar.vala"
		return _iface_->get_is_present (self);
#line 1564 "menubar.c"
	}
#line 56 "../src/menubar.vala"
	return FALSE;
#line 1568 "menubar.c"
}

guint
upower_device_get_state (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 57 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, 0U);
#line 57 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 57 "../src/menubar.vala"
	if (_iface_->get_state) {
#line 57 "../src/menubar.vala"
		return _iface_->get_state (self);
#line 1583 "menubar.c"
	}
#line 57 "../src/menubar.vala"
	return 0U;
#line 1587 "menubar.c"
}

gboolean
upower_device_get_is_rechargeable (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 58 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 58 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 58 "../src/menubar.vala"
	if (_iface_->get_is_rechargeable) {
#line 58 "../src/menubar.vala"
		return _iface_->get_is_rechargeable (self);
#line 1602 "menubar.c"
	}
#line 58 "../src/menubar.vala"
	return FALSE;
#line 1606 "menubar.c"
}

gdouble
upower_device_get_capacity (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 59 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 59 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 59 "../src/menubar.vala"
	if (_iface_->get_capacity) {
#line 59 "../src/menubar.vala"
		return _iface_->get_capacity (self);
#line 1621 "menubar.c"
	}
#line 59 "../src/menubar.vala"
	return -1.0;
#line 1625 "menubar.c"
}

gint64
upower_device_get_time_to_empty (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 60 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1LL);
#line 60 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 60 "../src/menubar.vala"
	if (_iface_->get_time_to_empty) {
#line 60 "../src/menubar.vala"
		return _iface_->get_time_to_empty (self);
#line 1640 "menubar.c"
	}
#line 60 "../src/menubar.vala"
	return -1LL;
#line 1644 "menubar.c"
}

gint64
upower_device_get_time_to_full (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 61 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1LL);
#line 61 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 61 "../src/menubar.vala"
	if (_iface_->get_time_to_full) {
#line 61 "../src/menubar.vala"
		return _iface_->get_time_to_full (self);
#line 1659 "menubar.c"
	}
#line 61 "../src/menubar.vala"
	return -1LL;
#line 1663 "menubar.c"
}

gdouble
upower_device_get_energy (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 62 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 62 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 62 "../src/menubar.vala"
	if (_iface_->get_energy) {
#line 62 "../src/menubar.vala"
		return _iface_->get_energy (self);
#line 1678 "menubar.c"
	}
#line 62 "../src/menubar.vala"
	return -1.0;
#line 1682 "menubar.c"
}

gdouble
upower_device_get_energy_empty (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 63 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 63 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 63 "../src/menubar.vala"
	if (_iface_->get_energy_empty) {
#line 63 "../src/menubar.vala"
		return _iface_->get_energy_empty (self);
#line 1697 "menubar.c"
	}
#line 63 "../src/menubar.vala"
	return -1.0;
#line 1701 "menubar.c"
}

gdouble
upower_device_get_energy_full (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 64 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 64 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 64 "../src/menubar.vala"
	if (_iface_->get_energy_full) {
#line 64 "../src/menubar.vala"
		return _iface_->get_energy_full (self);
#line 1716 "menubar.c"
	}
#line 64 "../src/menubar.vala"
	return -1.0;
#line 1720 "menubar.c"
}

gdouble
upower_device_get_energy_full_design (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 65 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 65 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 65 "../src/menubar.vala"
	if (_iface_->get_energy_full_design) {
#line 65 "../src/menubar.vala"
		return _iface_->get_energy_full_design (self);
#line 1735 "menubar.c"
	}
#line 65 "../src/menubar.vala"
	return -1.0;
#line 1739 "menubar.c"
}

gdouble
upower_device_get_energy_rate (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 66 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 66 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 66 "../src/menubar.vala"
	if (_iface_->get_energy_rate) {
#line 66 "../src/menubar.vala"
		return _iface_->get_energy_rate (self);
#line 1754 "menubar.c"
	}
#line 66 "../src/menubar.vala"
	return -1.0;
#line 1758 "menubar.c"
}

gdouble
upower_device_get_percentage (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 67 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 67 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 67 "../src/menubar.vala"
	if (_iface_->get_percentage) {
#line 67 "../src/menubar.vala"
		return _iface_->get_percentage (self);
#line 1773 "menubar.c"
	}
#line 67 "../src/menubar.vala"
	return -1.0;
#line 1777 "menubar.c"
}

gdouble
upower_device_get_voltage (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 68 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 68 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 68 "../src/menubar.vala"
	if (_iface_->get_voltage) {
#line 68 "../src/menubar.vala"
		return _iface_->get_voltage (self);
#line 1792 "menubar.c"
	}
#line 68 "../src/menubar.vala"
	return -1.0;
#line 1796 "menubar.c"
}

guint
upower_device_get_technology (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 69 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, 0U);
#line 69 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 69 "../src/menubar.vala"
	if (_iface_->get_technology) {
#line 69 "../src/menubar.vala"
		return _iface_->get_technology (self);
#line 1811 "menubar.c"
	}
#line 69 "../src/menubar.vala"
	return 0U;
#line 1815 "menubar.c"
}

gchar*
upower_device_get_vendor (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 70 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 70 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 70 "../src/menubar.vala"
	if (_iface_->get_vendor) {
#line 70 "../src/menubar.vala"
		return _iface_->get_vendor (self);
#line 1830 "menubar.c"
	}
#line 70 "../src/menubar.vala"
	return NULL;
#line 1834 "menubar.c"
}

gchar*
upower_device_get_model (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 71 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 71 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 71 "../src/menubar.vala"
	if (_iface_->get_model) {
#line 71 "../src/menubar.vala"
		return _iface_->get_model (self);
#line 1849 "menubar.c"
	}
#line 71 "../src/menubar.vala"
	return NULL;
#line 1853 "menubar.c"
}

gchar*
upower_device_get_serial (UPowerDevice* self)
{
	UPowerDeviceIface* _iface_;
#line 72 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 72 "../src/menubar.vala"
	_iface_ = UPOWER_DEVICE_GET_INTERFACE (self);
#line 72 "../src/menubar.vala"
	if (_iface_->get_serial) {
#line 72 "../src/menubar.vala"
		return _iface_->get_serial (self);
#line 1868 "menubar.c"
	}
#line 72 "../src/menubar.vala"
	return NULL;
#line 1872 "menubar.c"
}

static void
upower_device_default_init (UPowerDeviceIface * iface,
                            gpointer iface_data)
{
#line 50 "../src/menubar.vala"
	upower_device_signals[UPOWER_DEVICE_CHANGED_SIGNAL] = g_signal_new ("changed", UPOWER_TYPE_DEVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 1881 "menubar.c"
}

static GType
upower_device_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UPowerDeviceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) upower_device_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType upower_device_type_id;
	upower_device_type_id = g_type_register_static (G_TYPE_INTERFACE, "UPowerDevice", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (upower_device_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (upower_device_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) upower_device_proxy_get_type);
	g_type_set_qdata (upower_device_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.UPower.Device");
	g_type_set_qdata (upower_device_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_upower_device_dbus_interface_info));
	g_type_set_qdata (upower_device_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) upower_device_register_object);
	return upower_device_type_id;
}

GType
upower_device_get_type (void)
{
	static volatile gsize upower_device_type_id__once = 0;
	if (g_once_init_enter (&upower_device_type_id__once)) {
		GType upower_device_type_id;
		upower_device_type_id = upower_device_get_type_once ();
		g_once_init_leave (&upower_device_type_id__once, upower_device_type_id);
	}
	return upower_device_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (UPowerDeviceProxy, upower_device_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (UPOWER_TYPE_DEVICE, upower_device_proxy_upower_device_interface_init) )
static void
upower_device_proxy_class_init (UPowerDeviceProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = upower_device_proxy_g_signal;
}

static void
_dbus_handle_upower_device_changed (UPowerDevice* self,
                                    GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "changed");
}

static void
upower_device_proxy_g_signal (GDBusProxy* proxy,
                              const gchar* sender_name,
                              const gchar* signal_name,
                              GVariant* parameters)
{
	if (strcmp (signal_name, "Changed") == 0) {
		_dbus_handle_upower_device_changed ((UPowerDevice*) proxy, parameters);
	}
}

static void
upower_device_proxy_init (UPowerDeviceProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_upower_device_dbus_interface_info));
}

static guint
upower_device_dbus_proxy_get_Type (UPowerDevice* self)
{
	GVariant *_inner_reply;
	guint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Type");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Type"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			guint _tmp15_ = 0U;
			return _tmp15_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_uint32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_device_dbus_proxy_get_power_supply (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "PowerSupply");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("PowerSupply"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp16_ = FALSE;
			return _tmp16_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_device_dbus_proxy_get_online (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Online");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Online"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp17_ = FALSE;
			return _tmp17_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_device_dbus_proxy_get_is_present (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "IsPresent");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("IsPresent"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp18_ = FALSE;
			return _tmp18_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static guint
upower_device_dbus_proxy_get_state (UPowerDevice* self)
{
	GVariant *_inner_reply;
	guint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "State");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("State"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			guint _tmp19_ = 0U;
			return _tmp19_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_uint32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
upower_device_dbus_proxy_get_is_rechargeable (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "IsRechargeable");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("IsRechargeable"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp20_ = FALSE;
			return _tmp20_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_capacity (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Capacity");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Capacity"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp21_ = 0.0;
			return _tmp21_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gint64
upower_device_dbus_proxy_get_time_to_empty (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gint64 _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "TimeToEmpty");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("TimeToEmpty"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gint64 _tmp22_ = 0LL;
			return _tmp22_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_int64 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gint64
upower_device_dbus_proxy_get_time_to_full (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gint64 _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "TimeToFull");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("TimeToFull"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gint64 _tmp23_ = 0LL;
			return _tmp23_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_int64 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_energy (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Energy");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Energy"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp24_ = 0.0;
			return _tmp24_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_energy_empty (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "EnergyEmpty");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("EnergyEmpty"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp25_ = 0.0;
			return _tmp25_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_energy_full (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "EnergyFull");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("EnergyFull"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp26_ = 0.0;
			return _tmp26_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_energy_full_design (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "EnergyFullDesign");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("EnergyFullDesign"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp27_ = 0.0;
			return _tmp27_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_energy_rate (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "EnergyRate");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("EnergyRate"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp28_ = 0.0;
			return _tmp28_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_percentage (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Percentage");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Percentage"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp29_ = 0.0;
			return _tmp29_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gdouble
upower_device_dbus_proxy_get_voltage (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gdouble _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Voltage");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Voltage"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gdouble _tmp30_ = 0.0;
			return _tmp30_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_double (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static guint
upower_device_dbus_proxy_get_technology (UPowerDevice* self)
{
	GVariant *_inner_reply;
	guint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Technology");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Technology"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			guint _tmp31_ = 0U;
			return _tmp31_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_uint32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
upower_device_dbus_proxy_get_vendor (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Vendor");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Vendor"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
upower_device_dbus_proxy_get_model (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Model");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Model"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
upower_device_dbus_proxy_get_serial (UPowerDevice* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Serial");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower.Device"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Serial"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
upower_device_proxy_upower_device_interface_init (UPowerDeviceIface* iface)
{
	iface->get_Type = upower_device_dbus_proxy_get_Type;
	iface->get_power_supply = upower_device_dbus_proxy_get_power_supply;
	iface->get_online = upower_device_dbus_proxy_get_online;
	iface->get_is_present = upower_device_dbus_proxy_get_is_present;
	iface->get_state = upower_device_dbus_proxy_get_state;
	iface->get_is_rechargeable = upower_device_dbus_proxy_get_is_rechargeable;
	iface->get_capacity = upower_device_dbus_proxy_get_capacity;
	iface->get_time_to_empty = upower_device_dbus_proxy_get_time_to_empty;
	iface->get_time_to_full = upower_device_dbus_proxy_get_time_to_full;
	iface->get_energy = upower_device_dbus_proxy_get_energy;
	iface->get_energy_empty = upower_device_dbus_proxy_get_energy_empty;
	iface->get_energy_full = upower_device_dbus_proxy_get_energy_full;
	iface->get_energy_full_design = upower_device_dbus_proxy_get_energy_full_design;
	iface->get_energy_rate = upower_device_dbus_proxy_get_energy_rate;
	iface->get_percentage = upower_device_dbus_proxy_get_percentage;
	iface->get_voltage = upower_device_dbus_proxy_get_voltage;
	iface->get_technology = upower_device_dbus_proxy_get_technology;
	iface->get_vendor = upower_device_dbus_proxy_get_vendor;
	iface->get_model = upower_device_dbus_proxy_get_model;
	iface->get_serial = upower_device_dbus_proxy_get_serial;
}

static void
upower_device_dbus_interface_method_call (GDBusConnection* connection,
                                          const gchar* sender,
                                          const gchar* object_path,
                                          const gchar* interface_name,
                                          const gchar* method_name,
                                          GVariant* parameters,
                                          GDBusMethodInvocation* invocation,
                                          gpointer user_data)
{
	g_object_unref (invocation);
}

static GVariant*
_dbus_upower_device_get_Type (UPowerDevice* self)
{
	guint result;
	GVariant* _reply;
	result = upower_device_get_Type (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_power_supply (UPowerDevice* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_device_get_power_supply (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_online (UPowerDevice* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_device_get_online (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_is_present (UPowerDevice* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_device_get_is_present (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_state (UPowerDevice* self)
{
	guint result;
	GVariant* _reply;
	result = upower_device_get_state (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_is_rechargeable (UPowerDevice* self)
{
	gboolean result;
	GVariant* _reply;
	result = upower_device_get_is_rechargeable (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_capacity (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_capacity (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_time_to_empty (UPowerDevice* self)
{
	gint64 result;
	GVariant* _reply;
	result = upower_device_get_time_to_empty (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_time_to_full (UPowerDevice* self)
{
	gint64 result;
	GVariant* _reply;
	result = upower_device_get_time_to_full (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_energy (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_energy (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_energy_empty (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_energy_empty (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_energy_full (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_energy_full (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_energy_full_design (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_energy_full_design (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_energy_rate (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_energy_rate (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_percentage (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_percentage (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_voltage (UPowerDevice* self)
{
	gdouble result;
	GVariant* _reply;
	result = upower_device_get_voltage (self);
	_reply = g_variant_new_double (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_technology (UPowerDevice* self)
{
	guint result;
	GVariant* _reply;
	result = upower_device_get_technology (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_vendor (UPowerDevice* self)
{
	gchar* result;
	GVariant* _reply;
	result = upower_device_get_vendor (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_model (UPowerDevice* self)
{
	gchar* result;
	GVariant* _reply;
	result = upower_device_get_model (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_upower_device_get_serial (UPowerDevice* self)
{
	gchar* result;
	GVariant* _reply;
	result = upower_device_get_serial (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
upower_device_dbus_interface_get_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GError** error,
                                           gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Type") == 0) {
		return _dbus_upower_device_get_Type (object);
	} else if (strcmp (property_name, "PowerSupply") == 0) {
		return _dbus_upower_device_get_power_supply (object);
	} else if (strcmp (property_name, "Online") == 0) {
		return _dbus_upower_device_get_online (object);
	} else if (strcmp (property_name, "IsPresent") == 0) {
		return _dbus_upower_device_get_is_present (object);
	} else if (strcmp (property_name, "State") == 0) {
		return _dbus_upower_device_get_state (object);
	} else if (strcmp (property_name, "IsRechargeable") == 0) {
		return _dbus_upower_device_get_is_rechargeable (object);
	} else if (strcmp (property_name, "Capacity") == 0) {
		return _dbus_upower_device_get_capacity (object);
	} else if (strcmp (property_name, "TimeToEmpty") == 0) {
		return _dbus_upower_device_get_time_to_empty (object);
	} else if (strcmp (property_name, "TimeToFull") == 0) {
		return _dbus_upower_device_get_time_to_full (object);
	} else if (strcmp (property_name, "Energy") == 0) {
		return _dbus_upower_device_get_energy (object);
	} else if (strcmp (property_name, "EnergyEmpty") == 0) {
		return _dbus_upower_device_get_energy_empty (object);
	} else if (strcmp (property_name, "EnergyFull") == 0) {
		return _dbus_upower_device_get_energy_full (object);
	} else if (strcmp (property_name, "EnergyFullDesign") == 0) {
		return _dbus_upower_device_get_energy_full_design (object);
	} else if (strcmp (property_name, "EnergyRate") == 0) {
		return _dbus_upower_device_get_energy_rate (object);
	} else if (strcmp (property_name, "Percentage") == 0) {
		return _dbus_upower_device_get_percentage (object);
	} else if (strcmp (property_name, "Voltage") == 0) {
		return _dbus_upower_device_get_voltage (object);
	} else if (strcmp (property_name, "Technology") == 0) {
		return _dbus_upower_device_get_technology (object);
	} else if (strcmp (property_name, "Vendor") == 0) {
		return _dbus_upower_device_get_vendor (object);
	} else if (strcmp (property_name, "Model") == 0) {
		return _dbus_upower_device_get_model (object);
	} else if (strcmp (property_name, "Serial") == 0) {
		return _dbus_upower_device_get_serial (object);
	}
	return NULL;
}

static gboolean
upower_device_dbus_interface_set_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GVariant* value,
                                           GError** error,
                                           gpointer user_data)
{
	return FALSE;
}

static void
_dbus_upower_device_changed (GObject* _sender,
                             gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.UPower.Device", "Changed", _arguments, NULL);
}

guint
upower_device_register_object (gpointer object,
                               GDBusConnection* connection,
                               const gchar* path,
                               GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_upower_device_dbus_interface_info), &_upower_device_dbus_interface_vtable, data, _upower_device_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "changed", (GCallback) _dbus_upower_device_changed, data);
	return result;
}

static void
_upower_device_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_upower_device_changed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
menu_bar_get_instance_private (MenuBar* self)
{
	return G_STRUCT_MEMBER_P (self, MenuBar_private_offset);
}

MenuBar*
menu_bar_construct (GType object_type,
                    Background* bg,
                    GtkAccelGroup* ag,
                    MainWindow* mw)
{
	MenuBar * self = NULL;
#line 88 "../src/menubar.vala"
	g_return_val_if_fail (bg != NULL, NULL);
#line 88 "../src/menubar.vala"
	g_return_val_if_fail (ag != NULL, NULL);
#line 88 "../src/menubar.vala"
	g_return_val_if_fail (mw != NULL, NULL);
#line 90 "../src/menubar.vala"
	self = (MenuBar*) g_object_new (object_type, "background", bg, "accel-group", ag, "main-window", mw, NULL);
#line 88 "../src/menubar.vala"
	return self;
#line 2861 "menubar.c"
}

MenuBar*
menu_bar_new (Background* bg,
              GtkAccelGroup* ag,
              MainWindow* mw)
{
#line 88 "../src/menubar.vala"
	return menu_bar_construct (TYPE_MENU_BAR, bg, ag, mw);
#line 2871 "menubar.c"
}

static gboolean
menu_bar_real_draw (GtkWidget* base,
                    cairo_t* c)
{
	MenuBar * self;
	gint width = 0;
	gint height = 0;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	cairo_surface_t* _tmp2_;
	cairo_surface_t* _tmp22_;
	GList* _tmp24_;
	GError* _inner_error0_ = NULL;
	gboolean result;
#line 93 "../src/menubar.vala"
	self = (MenuBar*) base;
#line 93 "../src/menubar.vala"
	g_return_val_if_fail (c != NULL, FALSE);
#line 95 "../src/menubar.vala"
	width = gtk_widget_get_allocated_width ((GtkWidget*) self);
#line 96 "../src/menubar.vala"
	height = gtk_widget_get_allocated_height ((GtkWidget*) self);
#line 99 "../src/menubar.vala"
	_tmp2_ = self->priv->bg_surface;
#line 99 "../src/menubar.vala"
	if (_tmp2_ == NULL) {
#line 99 "../src/menubar.vala"
		_tmp1_ = TRUE;
#line 2902 "menubar.c"
	} else {
		cairo_surface_t* _tmp3_;
#line 99 "../src/menubar.vala"
		_tmp3_ = self->priv->bg_surface;
#line 99 "../src/menubar.vala"
		_tmp1_ = cairo_image_surface_get_width (_tmp3_) != width;
#line 2909 "menubar.c"
	}
#line 99 "../src/menubar.vala"
	if (_tmp1_) {
#line 99 "../src/menubar.vala"
		_tmp0_ = TRUE;
#line 2915 "menubar.c"
	} else {
		cairo_surface_t* _tmp4_;
#line 99 "../src/menubar.vala"
		_tmp4_ = self->priv->bg_surface;
#line 99 "../src/menubar.vala"
		_tmp0_ = cairo_image_surface_get_height (_tmp4_) != height;
#line 2922 "menubar.c"
	}
#line 99 "../src/menubar.vala"
	if (_tmp0_) {
#line 2926 "menubar.c"
		gboolean _tmp5_ = FALSE;
#line 101 "../src/menubar.vala"
		if (width > 0) {
#line 101 "../src/menubar.vala"
			_tmp5_ = height > 0;
#line 2932 "menubar.c"
		} else {
#line 101 "../src/menubar.vala"
			_tmp5_ = FALSE;
#line 2936 "menubar.c"
		}
#line 101 "../src/menubar.vala"
		if (_tmp5_) {
#line 2940 "menubar.c"
			{
				cairo_surface_t* _tmp6_;
				cairo_t* bg_cr = NULL;
				cairo_surface_t* _tmp7_;
				cairo_t* _tmp8_;
				Background* _tmp9_;
				cairo_surface_t* _tmp18_;
#line 105 "../src/menubar.vala"
				_tmp6_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
#line 105 "../src/menubar.vala"
				_cairo_surface_destroy0 (self->priv->bg_surface);
#line 105 "../src/menubar.vala"
				self->priv->bg_surface = _tmp6_;
#line 106 "../src/menubar.vala"
				_tmp7_ = self->priv->bg_surface;
#line 106 "../src/menubar.vala"
				_tmp8_ = cairo_create (_tmp7_);
#line 106 "../src/menubar.vala"
				bg_cr = _tmp8_;
#line 109 "../src/menubar.vala"
				_tmp9_ = self->priv->_background;
#line 109 "../src/menubar.vala"
				if (_tmp9_ != NULL) {
#line 2964 "menubar.c"
					gint x = 0;
					gint y = 0;
					Background* _tmp10_;
					gint _tmp11_ = 0;
					gint _tmp12_ = 0;
					cairo_t* _tmp13_;
					cairo_t* _tmp14_;
					Background* _tmp15_;
					cairo_t* _tmp16_;
					cairo_t* _tmp17_;
#line 112 "../src/menubar.vala"
					_tmp10_ = self->priv->_background;
#line 112 "../src/menubar.vala"
					gtk_widget_translate_coordinates ((GtkWidget*) _tmp10_, (GtkWidget*) self, 0, 0, &_tmp11_, &_tmp12_);
#line 112 "../src/menubar.vala"
					x = _tmp11_;
#line 112 "../src/menubar.vala"
					y = _tmp12_;
#line 113 "../src/menubar.vala"
					_tmp13_ = bg_cr;
#line 113 "../src/menubar.vala"
					cairo_save (_tmp13_);
#line 114 "../src/menubar.vala"
					_tmp14_ = bg_cr;
#line 114 "../src/menubar.vala"
					cairo_translate (_tmp14_, (gdouble) x, (gdouble) y);
#line 115 "../src/menubar.vala"
					_tmp15_ = self->priv->_background;
#line 115 "../src/menubar.vala"
					_tmp16_ = bg_cr;
#line 115 "../src/menubar.vala"
					background_draw_full (_tmp15_, _tmp16_, BACKGROUND_DRAW_FLAGS_NONE);
#line 116 "../src/menubar.vala"
					_tmp17_ = bg_cr;
#line 116 "../src/menubar.vala"
					cairo_restore (_tmp17_);
#line 3001 "menubar.c"
				}
#line 120 "../src/menubar.vala"
				_tmp18_ = self->priv->bg_surface;
#line 120 "../src/menubar.vala"
				cairo_utils_exponential_blur_surface (_tmp18_, MENU_BAR_BLUR_RADIUS);
#line 103 "../src/menubar.vala"
				_cairo_destroy0 (bg_cr);
#line 3009 "menubar.c"
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* e = NULL;
				GError* _tmp19_;
				const gchar* _tmp20_;
#line 103 "../src/menubar.vala"
				e = _inner_error0_;
#line 103 "../src/menubar.vala"
				_inner_error0_ = NULL;
#line 124 "../src/menubar.vala"
				_tmp19_ = e;
#line 124 "../src/menubar.vala"
				_tmp20_ = _tmp19_->message;
#line 124 "../src/menubar.vala"
				g_warning ("menubar.vala:124: Failed to create background surface: %s", _tmp20_);
#line 125 "../src/menubar.vala"
				_cairo_surface_destroy0 (self->priv->bg_surface);
#line 125 "../src/menubar.vala"
				self->priv->bg_surface = NULL;
#line 103 "../src/menubar.vala"
				_g_error_free0 (e);
#line 3033 "menubar.c"
			}
			__finally0:
#line 103 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 3038 "menubar.c"
				gboolean _tmp21_ = FALSE;
#line 103 "../src/menubar.vala"
				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);
#line 103 "../src/menubar.vala"
				g_clear_error (&_inner_error0_);
#line 103 "../src/menubar.vala"
				return _tmp21_;
#line 3046 "menubar.c"
			}
		}
	}
#line 131 "../src/menubar.vala"
	_tmp22_ = self->priv->bg_surface;
#line 131 "../src/menubar.vala"
	if (_tmp22_ != NULL) {
#line 3054 "menubar.c"
		cairo_surface_t* _tmp23_;
#line 133 "../src/menubar.vala"
		_tmp23_ = self->priv->bg_surface;
#line 133 "../src/menubar.vala"
		cairo_set_source_surface (c, _tmp23_, (gdouble) 0, (gdouble) 0);
#line 134 "../src/menubar.vala"
		cairo_paint (c);
#line 3062 "menubar.c"
	}
#line 137 "../src/menubar.vala"
	cairo_set_source_rgb (c, 0.1, 0.1, 0.1);
#line 138 "../src/menubar.vala"
	cairo_paint_with_alpha (c, 0.55);
#line 140 "../src/menubar.vala"
	_tmp24_ = gtk_container_get_children ((GtkContainer*) self);
#line 3070 "menubar.c"
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
#line 140 "../src/menubar.vala"
		child_collection = _tmp24_;
#line 140 "../src/menubar.vala"
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
#line 3078 "menubar.c"
			GtkWidget* child = NULL;
#line 140 "../src/menubar.vala"
			child = (GtkWidget*) child_it->data;
#line 3082 "menubar.c"
			{
				GtkWidget* _tmp25_;
#line 142 "../src/menubar.vala"
				_tmp25_ = child;
#line 142 "../src/menubar.vala"
				gtk_container_propagate_draw ((GtkContainer*) self, _tmp25_, c);
#line 3089 "menubar.c"
			}
		}
#line 140 "../src/menubar.vala"
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
#line 3094 "menubar.c"
	}
#line 145 "../src/menubar.vala"
	result = FALSE;
#line 145 "../src/menubar.vala"
	return result;
#line 3100 "menubar.c"
}

static void
menu_bar_rebuild_background (MenuBar* self)
{
#line 148 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 150 "../src/menubar.vala"
	_cairo_surface_destroy0 (self->priv->bg_surface);
#line 150 "../src/menubar.vala"
	self->priv->bg_surface = NULL;
#line 151 "../src/menubar.vala"
	gtk_widget_queue_draw ((GtkWidget*) self);
#line 3114 "menubar.c"
}

void
menu_bar_set_keyboard_state (MenuBar* self)
{
	GtkCheckMenuItem* _tmp0_;
#line 158 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 160 "../src/menubar.vala"
	_tmp0_ = self->priv->onscreen_keyboard_item;
#line 160 "../src/menubar.vala"
	gtk_check_menu_item_set_active (_tmp0_, ug_settings_get_boolean (UG_SETTINGS_KEY_ONSCREEN_KEYBOARD));
#line 3127 "menubar.c"
}

static void
menu_bar_on_sleeping (MenuBar* self)
{
#line 291 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 3135 "menubar.c"
}

static void
menu_bar_on_resuming (MenuBar* self)
{
#line 295 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 297 "../src/menubar.vala"
	menu_bar_query_upower_daemon (self);
#line 3145 "menubar.c"
}

static void
menu_bar_on_changed (MenuBar* self)
{
#line 300 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 302 "../src/menubar.vala"
	menu_bar_query_upower_daemon (self);
#line 3155 "menubar.c"
}

static void
menu_bar_on_power_device_added (MenuBar* self,
                                const char* device)
{
#line 305 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 305 "../src/menubar.vala"
	g_return_if_fail (device != NULL);
#line 307 "../src/menubar.vala"
	menu_bar_query_upower_device (self, device, NULL, NULL);
#line 3168 "menubar.c"
}

static void
menu_bar_on_power_device_changed (MenuBar* self,
                                  const char* device)
{
#line 310 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 310 "../src/menubar.vala"
	g_return_if_fail (device != NULL);
#line 312 "../src/menubar.vala"
	menu_bar_query_upower_device (self, device, NULL, NULL);
#line 3181 "menubar.c"
}

static gboolean
menu_bar_query_upower_daemon (MenuBar* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
#line 315 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 3191 "menubar.c"
	{
		UPowerDaemon* _tmp0_;
		gboolean _tmp1_;
		gboolean _tmp2_;
#line 318 "../src/menubar.vala"
		_tmp0_ = self->priv->upowerd;
#line 318 "../src/menubar.vala"
		_tmp1_ = upower_daemon_get_on_battery (_tmp0_);
#line 318 "../src/menubar.vala"
		_tmp2_ = _tmp1_;
#line 318 "../src/menubar.vala"
		if (_tmp2_ == TRUE) {
#line 3204 "menubar.c"
			char** _tmp3_ = NULL;
			UPowerDaemon* _tmp4_;
			gint _tmp5_ = 0;
			char** _tmp6_;
			gint _tmp3__length1;
			gint __tmp3__size_;
#line 319 "../src/menubar.vala"
			_tmp4_ = self->priv->upowerd;
#line 319 "../src/menubar.vala"
			_tmp6_ = upower_daemon_enumerate_devices (_tmp4_, &_tmp5_, &_inner_error0_);
#line 319 "../src/menubar.vala"
			_tmp3_ = _tmp6_;
#line 319 "../src/menubar.vala"
			_tmp3__length1 = _tmp5_;
#line 319 "../src/menubar.vala"
			__tmp3__size_ = _tmp3__length1;
#line 319 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 3223 "menubar.c"
				goto __catch0_g_error;
			}
			{
				char** o_collection = NULL;
				gint o_collection_length1 = 0;
				gint _o_collection_size_ = 0;
				gint o_it = 0;
#line 319 "../src/menubar.vala"
				o_collection = _tmp3_;
#line 319 "../src/menubar.vala"
				o_collection_length1 = _tmp3__length1;
#line 319 "../src/menubar.vala"
				for (o_it = 0; o_it < o_collection_length1; o_it = o_it + 1) {
#line 3237 "menubar.c"
					char* _tmp7_;
					char* o = NULL;
#line 319 "../src/menubar.vala"
					_tmp7_ = g_strdup (o_collection[o_it]);
#line 319 "../src/menubar.vala"
					o = _tmp7_;
#line 3244 "menubar.c"
					{
						const char* _tmp8_;
#line 320 "../src/menubar.vala"
						_tmp8_ = o;
#line 320 "../src/menubar.vala"
						menu_bar_query_upower_device (self, _tmp8_, NULL, NULL);
#line 319 "../src/menubar.vala"
						_g_free0 (o);
#line 3253 "menubar.c"
					}
				}
			}
#line 318 "../src/menubar.vala"
			_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
#line 3259 "menubar.c"
		} else {
			GtkMenuItem* _tmp9_;
#line 324 "../src/menubar.vala"
			_tmp9_ = self->priv->power_menu_item;
#line 324 "../src/menubar.vala"
			gtk_widget_hide ((GtkWidget*) _tmp9_);
#line 3266 "menubar.c"
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
#line 317 "../src/menubar.vala"
		e = _inner_error0_;
#line 317 "../src/menubar.vala"
		_inner_error0_ = NULL;
#line 328 "../src/menubar.vala"
		_tmp10_ = e;
#line 328 "../src/menubar.vala"
		_tmp11_ = _tmp10_->message;
#line 328 "../src/menubar.vala"
		g_warning ("menubar.vala:328: Error while querying upower daemon: %s", _tmp11_);
#line 317 "../src/menubar.vala"
		_g_error_free0 (e);
#line 3287 "menubar.c"
	}
	__finally0:
#line 317 "../src/menubar.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 3292 "menubar.c"
		gboolean _tmp12_ = FALSE;
#line 317 "../src/menubar.vala"
		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);
#line 317 "../src/menubar.vala"
		g_clear_error (&_inner_error0_);
#line 317 "../src/menubar.vala"
		return _tmp12_;
#line 3300 "menubar.c"
	}
#line 330 "../src/menubar.vala"
	result = TRUE;
#line 330 "../src/menubar.vala"
	return result;
#line 3306 "menubar.c"
}

static void
menu_bar_query_upower_device_data_free (gpointer _data)
{
	MenuBarQueryUpowerDeviceData* _data_;
	_data_ = _data;
#line 78 "../src/menubar.vala"
	_g_free0 (_data_->dev_path);
#line 78 "../src/menubar.vala"
	_g_object_unref0 (_data_->self);
#line 78 "../src/menubar.vala"
	g_slice_free (MenuBarQueryUpowerDeviceData, _data_);
#line 3320 "menubar.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 78 "../src/menubar.vala"
	return self ? g_object_ref (self) : NULL;
#line 3328 "menubar.c"
}

static void
menu_bar_query_upower_device (MenuBar* self,
                              const char* dev_path,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	MenuBarQueryUpowerDeviceData* _data_;
	MenuBar* _tmp0_;
	char* _tmp1_;
#line 78 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 78 "../src/menubar.vala"
	g_return_if_fail (dev_path != NULL);
#line 78 "../src/menubar.vala"
	_data_ = g_slice_new0 (MenuBarQueryUpowerDeviceData);
#line 78 "../src/menubar.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 78 "../src/menubar.vala"
	g_task_set_task_data (_data_->_async_result, _data_, menu_bar_query_upower_device_data_free);
#line 78 "../src/menubar.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 78 "../src/menubar.vala"
	_data_->self = _tmp0_;
#line 78 "../src/menubar.vala"
	_tmp1_ = g_strdup (dev_path);
#line 78 "../src/menubar.vala"
	_g_free0 (_data_->dev_path);
#line 78 "../src/menubar.vala"
	_data_->dev_path = _tmp1_;
#line 78 "../src/menubar.vala"
	menu_bar_query_upower_device_co (_data_);
#line 3362 "menubar.c"
}

static void
menu_bar_query_upower_device_finish (MenuBar* self,
                                     GAsyncResult* _res_)
{
	MenuBarQueryUpowerDeviceData* _data_;
#line 78 "../src/menubar.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 3372 "menubar.c"
}

static gboolean
menu_bar_query_upower_device_co (MenuBarQueryUpowerDeviceData* _data_)
{
#line 333 "../src/menubar.vala"
	switch (_data_->_state_) {
#line 333 "../src/menubar.vala"
		case 0:
#line 3382 "menubar.c"
		goto _state_0;
		default:
#line 333 "../src/menubar.vala"
		g_assert_not_reached ();
#line 3387 "menubar.c"
	}
	_state_0:
	{
#line 339 "../src/menubar.vala"
		_data_->_tmp1_ = (UPowerDevice*) g_initable_new (UPOWER_TYPE_DEVICE_PROXY, NULL, &_data_->_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.UPower", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", (const gchar*) _data_->dev_path, "g-interface-name", "org.freedesktop.UPower.Device", NULL);
#line 339 "../src/menubar.vala"
		_data_->_tmp0_ = (UPowerDevice*) _data_->_tmp1_;
#line 339 "../src/menubar.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 339 "../src/menubar.vala"
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
#line 3399 "menubar.c"
				goto __catch0_g_io_error;
			}
#line 339 "../src/menubar.vala"
			_g_object_unref0 (_data_->dev);
#line 339 "../src/menubar.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 339 "../src/menubar.vala"
			g_clear_error (&_data_->_inner_error0_);
#line 339 "../src/menubar.vala"
			g_object_unref (_data_->_async_result);
#line 339 "../src/menubar.vala"
			return FALSE;
#line 3412 "menubar.c"
		}
#line 339 "../src/menubar.vala"
		_data_->_tmp2_ = _data_->_tmp0_;
#line 339 "../src/menubar.vala"
		_data_->_tmp0_ = NULL;
#line 339 "../src/menubar.vala"
		_g_object_unref0 (_data_->dev);
#line 339 "../src/menubar.vala"
		_data_->dev = _data_->_tmp2_;
#line 338 "../src/menubar.vala"
		_g_object_unref0 (_data_->_tmp0_);
#line 3424 "menubar.c"
	}
	goto __finally0;
	__catch0_g_io_error:
	{
#line 338 "../src/menubar.vala"
		_data_->io = _data_->_inner_error0_;
#line 338 "../src/menubar.vala"
		_data_->_inner_error0_ = NULL;
#line 341 "../src/menubar.vala"
		_data_->_tmp3_ = _data_->io;
#line 341 "../src/menubar.vala"
		_data_->_tmp4_ = _data_->_tmp3_->message;
#line 341 "../src/menubar.vala"
		g_warning ("menubar.vala:341: Could not connect to UPower/Device: %s", _data_->_tmp4_);
#line 342 "../src/menubar.vala"
		_g_error_free0 (_data_->io);
#line 342 "../src/menubar.vala"
		_g_object_unref0 (_data_->dev);
#line 342 "../src/menubar.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 342 "../src/menubar.vala"
		if (_data_->_state_ != 0) {
#line 342 "../src/menubar.vala"
			while (!g_task_get_completed (_data_->_async_result)) {
#line 342 "../src/menubar.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 3451 "menubar.c"
			}
		}
#line 342 "../src/menubar.vala"
		g_object_unref (_data_->_async_result);
#line 342 "../src/menubar.vala"
		return FALSE;
#line 3458 "menubar.c"
	}
	__finally0:
#line 338 "../src/menubar.vala"
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 338 "../src/menubar.vala"
		_g_object_unref0 (_data_->dev);
#line 338 "../src/menubar.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 338 "../src/menubar.vala"
		g_clear_error (&_data_->_inner_error0_);
#line 338 "../src/menubar.vala"
		g_object_unref (_data_->_async_result);
#line 338 "../src/menubar.vala"
		return FALSE;
#line 3473 "menubar.c"
	}
#line 346 "../src/menubar.vala"
	_data_->_tmp5_ = _data_->dev;
#line 346 "../src/menubar.vala"
	_data_->_tmp6_ = upower_device_get_Type (_data_->_tmp5_);
#line 346 "../src/menubar.vala"
	_data_->_tmp7_ = _data_->_tmp6_;
#line 346 "../src/menubar.vala"
	_data_->type = _data_->_tmp7_;
#line 347 "../src/menubar.vala"
	if (_data_->type == ((guint) 1)) {
#line 3485 "menubar.c"
	} else {
#line 348 "../src/menubar.vala"
		if (_data_->type == ((guint) 2)) {
#line 348 "../src/menubar.vala"
			_data_->_tmp9_ = _data_->dev;
#line 348 "../src/menubar.vala"
			_data_->_tmp10_ = upower_device_get_is_present (_data_->_tmp9_);
#line 348 "../src/menubar.vala"
			_data_->_tmp11_ = _data_->_tmp10_;
#line 348 "../src/menubar.vala"
			_data_->_tmp8_ = _data_->_tmp11_ == TRUE;
#line 3497 "menubar.c"
		} else {
#line 348 "../src/menubar.vala"
			_data_->_tmp8_ = FALSE;
#line 3501 "menubar.c"
		}
#line 348 "../src/menubar.vala"
		if (_data_->_tmp8_) {
#line 349 "../src/menubar.vala"
			_data_->_tmp12_ = _data_->dev;
#line 349 "../src/menubar.vala"
			menu_bar_update_power (_data_->self, _data_->_tmp12_);
#line 3509 "menubar.c"
		} else {
#line 350 "../src/menubar.vala"
			if (_data_->type == ((guint) 3)) {
#line 3513 "menubar.c"
			} else {
#line 351 "../src/menubar.vala"
				if (_data_->type == ((guint) 5)) {
#line 3517 "menubar.c"
				} else {
#line 352 "../src/menubar.vala"
					if (_data_->type == ((guint) 6)) {
#line 3521 "menubar.c"
					} else {
#line 353 "../src/menubar.vala"
						if (_data_->type == ((guint) 7)) {
#line 3525 "menubar.c"
						} else {
#line 354 "../src/menubar.vala"
							if (_data_->type == ((guint) 8)) {
#line 3529 "menubar.c"
							}
						}
					}
				}
			}
		}
	}
#line 333 "../src/menubar.vala"
	_g_object_unref0 (_data_->dev);
#line 333 "../src/menubar.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 333 "../src/menubar.vala"
	if (_data_->_state_ != 0) {
#line 333 "../src/menubar.vala"
		while (!g_task_get_completed (_data_->_async_result)) {
#line 333 "../src/menubar.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 3547 "menubar.c"
		}
	}
#line 333 "../src/menubar.vala"
	g_object_unref (_data_->_async_result);
#line 333 "../src/menubar.vala"
	return FALSE;
#line 3554 "menubar.c"
}

static void
menu_bar_on_power_device_removed (MenuBar* self,
                                  const char* device)
{
#line 358 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 358 "../src/menubar.vala"
	g_return_if_fail (device != NULL);
#line 360 "../src/menubar.vala"
	menu_bar_query_upower_daemon (self);
#line 3567 "menubar.c"
}

static gchar*
double_to_string (gdouble self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint _tmp1__length1;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
#line 997 "glib-2.0.vapi"
	_tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
#line 997 "glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 997 "glib-2.0.vapi"
	_tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE;
#line 997 "glib-2.0.vapi"
	_tmp2_ = g_ascii_dtostr (_tmp1_, (gint) G_ASCII_DTOSTR_BUF_SIZE, self);
#line 997 "glib-2.0.vapi"
	_tmp3_ = g_strdup (_tmp2_);
#line 997 "glib-2.0.vapi"
	_tmp4_ = _tmp3_;
#line 997 "glib-2.0.vapi"
	_tmp1_ = (g_free (_tmp1_), NULL);
#line 997 "glib-2.0.vapi"
	result = _tmp4_;
#line 997 "glib-2.0.vapi"
	return result;
#line 3598 "menubar.c"
}

static void
menu_bar_update_power (MenuBar* self,
                       UPowerDevice* device)
{
#line 363 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 365 "../src/menubar.vala"
	if (device == NULL) {
#line 3609 "menubar.c"
		GtkMenuItem* _tmp0_;
#line 366 "../src/menubar.vala"
		_tmp0_ = self->priv->power_menu_item;
#line 366 "../src/menubar.vala"
		gtk_widget_hide ((GtkWidget*) _tmp0_);
#line 3615 "menubar.c"
	} else {
		gchar* str = NULL;
		gdouble _tmp1_;
		gdouble _tmp2_;
		gchar* _tmp3_;
		gchar* percentage_string = NULL;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		GtkLabel* _tmp6_;
		const gchar* _tmp7_;
		GtkMenuItem* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* icon = NULL;
		gchar* _tmp14_;
		gdouble _tmp15_;
		gdouble _tmp16_;
		gdouble _tmp18_;
		gdouble _tmp19_;
		gdouble _tmp21_;
		gdouble _tmp22_;
		GtkImage* _tmp24_;
		const gchar* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		GtkMenuItem* _tmp28_;
#line 369 "../src/menubar.vala"
		_tmp1_ = upower_device_get_percentage (device);
#line 369 "../src/menubar.vala"
		_tmp2_ = _tmp1_;
#line 369 "../src/menubar.vala"
		_tmp3_ = double_to_string (round (_tmp2_));
#line 369 "../src/menubar.vala"
		str = _tmp3_;
#line 370 "../src/menubar.vala"
		_tmp4_ = str;
#line 370 "../src/menubar.vala"
		_tmp5_ = g_strconcat (_tmp4_, "%", NULL);
#line 370 "../src/menubar.vala"
		percentage_string = _tmp5_;
#line 371 "../src/menubar.vala"
		_tmp6_ = self->priv->power_label;
#line 371 "../src/menubar.vala"
		_tmp7_ = percentage_string;
#line 371 "../src/menubar.vala"
		gtk_label_set_label (_tmp6_, _tmp7_);
#line 372 "../src/menubar.vala"
		_tmp8_ = self->priv->power_menu_item;
#line 372 "../src/menubar.vala"
		_tmp9_ = g_strconcat (_ ("Power:"), " ", NULL);
#line 372 "../src/menubar.vala"
		_tmp10_ = _tmp9_;
#line 372 "../src/menubar.vala"
		_tmp11_ = percentage_string;
#line 372 "../src/menubar.vala"
		_tmp12_ = g_strconcat (_tmp10_, _tmp11_, NULL);
#line 372 "../src/menubar.vala"
		_tmp13_ = _tmp12_;
#line 372 "../src/menubar.vala"
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _tmp13_);
#line 372 "../src/menubar.vala"
		_g_free0 (_tmp13_);
#line 372 "../src/menubar.vala"
		_g_free0 (_tmp10_);
#line 373 "../src/menubar.vala"
		_tmp14_ = g_strdup ("battery.svg");
#line 373 "../src/menubar.vala"
		icon = _tmp14_;
#line 374 "../src/menubar.vala"
		_tmp15_ = upower_device_get_percentage (device);
#line 374 "../src/menubar.vala"
		_tmp16_ = _tmp15_;
#line 374 "../src/menubar.vala"
		if (_tmp16_ <= 50.0) {
#line 3693 "menubar.c"
			gchar* _tmp17_;
#line 375 "../src/menubar.vala"
			_tmp17_ = g_strdup ("battery_50.svg");
#line 375 "../src/menubar.vala"
			_g_free0 (icon);
#line 375 "../src/menubar.vala"
			icon = _tmp17_;
#line 3701 "menubar.c"
		}
#line 377 "../src/menubar.vala"
		_tmp18_ = upower_device_get_percentage (device);
#line 377 "../src/menubar.vala"
		_tmp19_ = _tmp18_;
#line 377 "../src/menubar.vala"
		if (_tmp19_ <= 25.0) {
#line 3709 "menubar.c"
			gchar* _tmp20_;
#line 378 "../src/menubar.vala"
			_tmp20_ = g_strdup ("battery_25.svg");
#line 378 "../src/menubar.vala"
			_g_free0 (icon);
#line 378 "../src/menubar.vala"
			icon = _tmp20_;
#line 3717 "menubar.c"
		}
#line 380 "../src/menubar.vala"
		_tmp21_ = upower_device_get_percentage (device);
#line 380 "../src/menubar.vala"
		_tmp22_ = _tmp21_;
#line 380 "../src/menubar.vala"
		if (_tmp22_ <= 10.0) {
#line 3725 "menubar.c"
			gchar* _tmp23_;
#line 381 "../src/menubar.vala"
			_tmp23_ = g_strdup ("battery_10.svg");
#line 381 "../src/menubar.vala"
			_g_free0 (icon);
#line 381 "../src/menubar.vala"
			icon = _tmp23_;
#line 3733 "menubar.c"
		}
#line 383 "../src/menubar.vala"
		_tmp24_ = self->priv->power_icon;
#line 383 "../src/menubar.vala"
		_tmp25_ = icon;
#line 383 "../src/menubar.vala"
		_tmp26_ = g_build_filename (PKGDATADIR, _tmp25_, NULL);
#line 383 "../src/menubar.vala"
		_tmp27_ = _tmp26_;
#line 383 "../src/menubar.vala"
		gtk_image_set_from_file (_tmp24_, _tmp27_);
#line 383 "../src/menubar.vala"
		_g_free0 (_tmp27_);
#line 384 "../src/menubar.vala"
		_tmp28_ = self->priv->power_menu_item;
#line 384 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp28_);
#line 365 "../src/menubar.vala"
		_g_free0 (icon);
#line 365 "../src/menubar.vala"
		_g_free0 (percentage_string);
#line 365 "../src/menubar.vala"
		_g_free0 (str);
#line 3757 "menubar.c"
	}
}

static gboolean
menu_bar_update_clock (MenuBar* self)
{
	GDateTime* current_time = NULL;
	GDateTime* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GtkLabel* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean result;
#line 388 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 390 "../src/menubar.vala"
	_tmp0_ = g_date_time_new_now_local ();
#line 390 "../src/menubar.vala"
	current_time = _tmp0_;
#line 391 "../src/menubar.vala"
	_tmp1_ = self->priv->clock_label;
#line 391 "../src/menubar.vala"
	_tmp2_ = self->priv->clock_format;
#line 391 "../src/menubar.vala"
	_tmp3_ = g_date_time_format (current_time, _tmp2_);
#line 391 "../src/menubar.vala"
	_tmp4_ = _tmp3_;
#line 391 "../src/menubar.vala"
	gtk_label_set_label (_tmp1_, _tmp4_);
#line 391 "../src/menubar.vala"
	_g_free0 (_tmp4_);
#line 392 "../src/menubar.vala"
	_tmp5_ = self->priv->clock_label;
#line 392 "../src/menubar.vala"
	_tmp6_ = g_date_time_format (current_time, "%x");
#line 392 "../src/menubar.vala"
	_tmp7_ = _tmp6_;
#line 392 "../src/menubar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp5_, _tmp7_);
#line 392 "../src/menubar.vala"
	_g_free0 (_tmp7_);
#line 393 "../src/menubar.vala"
	result = TRUE;
#line 393 "../src/menubar.vala"
	_g_date_time_unref0 (current_time);
#line 393 "../src/menubar.vala"
	return result;
#line 3808 "menubar.c"
}

static void
menu_bar_close_pid (MenuBar* self,
                    GPid* pid)
{
#line 396 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 398 "../src/menubar.vala"
	if ((*pid) > ((GPid) 0)) {
#line 3819 "menubar.c"
		gint status = 0;
		gint _tmp0_ = 0;
#line 400 "../src/menubar.vala"
		kill ((pid_t) (*pid), (gint) SIGTERM);
#line 402 "../src/menubar.vala"
		waitpid ((pid_t) (*pid), &_tmp0_, 0);
#line 402 "../src/menubar.vala"
		status = _tmp0_;
#line 403 "../src/menubar.vala"
		*pid = (GPid) 0;
#line 3830 "menubar.c"
	}
}

void
menu_bar_cleanup (MenuBar* self)
{
	cairo_surface_t* _tmp0_;
#line 407 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 409 "../src/menubar.vala"
	menu_bar_close_pid (self, &self->priv->keyboard_pid);
#line 410 "../src/menubar.vala"
	menu_bar_close_pid (self, &self->priv->reader_pid);
#line 413 "../src/menubar.vala"
	_tmp0_ = self->priv->bg_surface;
#line 413 "../src/menubar.vala"
	if (_tmp0_ != NULL) {
#line 3848 "menubar.c"
		cairo_surface_t* _tmp1_;
#line 415 "../src/menubar.vala"
		_tmp1_ = self->priv->bg_surface;
#line 415 "../src/menubar.vala"
		cairo_surface_finish (_tmp1_);
#line 416 "../src/menubar.vala"
		_cairo_surface_destroy0 (self->priv->bg_surface);
#line 416 "../src/menubar.vala"
		self->priv->bg_surface = NULL;
#line 3858 "menubar.c"
	}
}

static void
menu_bar_real_get_preferred_height (GtkWidget* base,
                                    gint* min,
                                    gint* nat)
{
	MenuBar * self;
	gint _vala_min = 0;
	gint _vala_nat = 0;
#line 420 "../src/menubar.vala"
	self = (MenuBar*) base;
#line 422 "../src/menubar.vala"
	_vala_min = MENU_BAR_HEIGHT;
#line 423 "../src/menubar.vala"
	_vala_nat = MENU_BAR_HEIGHT;
#line 420 "../src/menubar.vala"
	if (min) {
#line 420 "../src/menubar.vala"
		*min = _vala_min;
#line 3880 "menubar.c"
	}
#line 420 "../src/menubar.vala"
	if (nat) {
#line 420 "../src/menubar.vala"
		*nat = _vala_nat;
#line 3886 "menubar.c"
	}
}

static void
menu_bar_real_size_allocate (GtkWidget* base,
                             GtkAllocation* allocation)
{
	MenuBar * self;
	GtkAllocation _tmp0_;
#line 426 "../src/menubar.vala"
	self = (MenuBar*) base;
#line 426 "../src/menubar.vala"
	g_return_if_fail (allocation != NULL);
#line 428 "../src/menubar.vala"
	_tmp0_ = *allocation;
#line 428 "../src/menubar.vala"
	GTK_WIDGET_CLASS (menu_bar_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_menu_bar_get_type (), GtkMenuBar), &_tmp0_);
#line 431 "../src/menubar.vala"
	menu_bar_rebuild_background (self);
#line 3906 "menubar.c"
}

static void
_menu_bar_keyboard_toggled_cb_gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender,
                                                           gpointer self)
{
#line 447 "../src/menubar.vala"
	menu_bar_keyboard_toggled_cb ((MenuBar*) self, _sender);
#line 3915 "menubar.c"
}

static void
_menu_bar_high_contrast_toggled_cb_gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender,
                                                                gpointer self)
{
#line 452 "../src/menubar.vala"
	menu_bar_high_contrast_toggled_cb ((MenuBar*) self, _sender);
#line 3924 "menubar.c"
}

static void
_menu_bar_screen_reader_toggled_cb_gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender,
                                                                gpointer self)
{
#line 458 "../src/menubar.vala"
	menu_bar_screen_reader_toggled_cb ((MenuBar*) self, _sender);
#line 3933 "menubar.c"
}

static GtkMenuItem*
menu_bar_make_a11y_item (MenuBar* self)
{
	GtkMenuItem* a11y_item = NULL;
	GtkMenuItem* _tmp0_;
	GtkBox* hbox = NULL;
	GtkBox* _tmp1_;
	GtkImage* image = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GtkImage* _tmp4_;
	GtkImage* _tmp5_;
	GtkMenu* _tmp6_;
	GtkMenu* _tmp7_;
	GtkCheckMenuItem* _tmp8_;
	GtkCheckMenuItem* _tmp9_;
	GtkCheckMenuItem* _tmp10_;
	GtkMenu* submenu = NULL;
	GtkMenu* _tmp11_;
	GtkMenu* _tmp12_;
	GtkCheckMenuItem* _tmp13_;
	GtkCheckMenuItem* _tmp14_;
	GtkCheckMenuItem* _tmp15_;
	GtkCheckMenuItem* _tmp16_;
	GtkAccelGroup* _tmp17_;
	GtkCheckMenuItem* _tmp18_;
	GtkCheckMenuItem* _tmp19_;
	GtkCheckMenuItem* _tmp20_;
	GtkCheckMenuItem* item = NULL;
	GtkCheckMenuItem* _tmp21_;
	GtkAccelGroup* _tmp22_;
	GtkMenuItem* result;
#line 434 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 436 "../src/menubar.vala"
	_tmp0_ = (GtkMenuItem*) gtk_menu_item_new ();
#line 436 "../src/menubar.vala"
	g_object_ref_sink (_tmp0_);
#line 436 "../src/menubar.vala"
	a11y_item = _tmp0_;
#line 437 "../src/menubar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) a11y_item, _ ("Accessibility"));
#line 438 "../src/menubar.vala"
	_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
#line 438 "../src/menubar.vala"
	g_object_ref_sink (_tmp1_);
#line 438 "../src/menubar.vala"
	hbox = _tmp1_;
#line 439 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) hbox);
#line 440 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) a11y_item, (GtkWidget*) hbox);
#line 441 "../src/menubar.vala"
	_tmp2_ = g_build_filename (PKGDATADIR, "a11y.svg", NULL);
#line 441 "../src/menubar.vala"
	_tmp3_ = _tmp2_;
#line 441 "../src/menubar.vala"
	_tmp4_ = (GtkImage*) gtk_image_new_from_file (_tmp3_);
#line 441 "../src/menubar.vala"
	g_object_ref_sink (_tmp4_);
#line 441 "../src/menubar.vala"
	_tmp5_ = _tmp4_;
#line 441 "../src/menubar.vala"
	_g_free0 (_tmp3_);
#line 441 "../src/menubar.vala"
	image = _tmp5_;
#line 442 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) image);
#line 443 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) hbox, (GtkWidget*) image);
#line 444 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) a11y_item);
#line 445 "../src/menubar.vala"
	_tmp6_ = (GtkMenu*) gtk_menu_new ();
#line 445 "../src/menubar.vala"
	g_object_ref_sink (_tmp6_);
#line 445 "../src/menubar.vala"
	_tmp7_ = _tmp6_;
#line 445 "../src/menubar.vala"
	gtk_menu_item_set_submenu (a11y_item, _tmp7_);
#line 445 "../src/menubar.vala"
	_g_object_unref0 (_tmp7_);
#line 446 "../src/menubar.vala"
	_tmp8_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_ ("Onscreen keyboard"));
#line 446 "../src/menubar.vala"
	g_object_ref_sink (_tmp8_);
#line 446 "../src/menubar.vala"
	_g_object_unref0 (self->priv->onscreen_keyboard_item);
#line 446 "../src/menubar.vala"
	self->priv->onscreen_keyboard_item = _tmp8_;
#line 447 "../src/menubar.vala"
	_tmp9_ = self->priv->onscreen_keyboard_item;
#line 447 "../src/menubar.vala"
	g_signal_connect_object (_tmp9_, "toggled", (GCallback) _menu_bar_keyboard_toggled_cb_gtk_check_menu_item_toggled, self, 0);
#line 448 "../src/menubar.vala"
	_tmp10_ = self->priv->onscreen_keyboard_item;
#line 448 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp10_);
#line 449 "../src/menubar.vala"
	_tmp11_ = gtk_menu_item_get_submenu (a11y_item);
#line 449 "../src/menubar.vala"
	_tmp12_ = _tmp11_;
#line 449 "../src/menubar.vala"
	submenu = _tmp12_;
#line 450 "../src/menubar.vala"
	_tmp13_ = self->priv->onscreen_keyboard_item;
#line 450 "../src/menubar.vala"
	gtk_menu_shell_append ((GtkMenuShell*) submenu, (GtkMenuItem*) _tmp13_);
#line 451 "../src/menubar.vala"
	_tmp14_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_ ("High Contrast"));
#line 451 "../src/menubar.vala"
	g_object_ref_sink (_tmp14_);
#line 451 "../src/menubar.vala"
	_g_object_unref0 (self->priv->high_contrast_item);
#line 451 "../src/menubar.vala"
	self->priv->high_contrast_item = _tmp14_;
#line 452 "../src/menubar.vala"
	_tmp15_ = self->priv->high_contrast_item;
#line 452 "../src/menubar.vala"
	g_signal_connect_object (_tmp15_, "toggled", (GCallback) _menu_bar_high_contrast_toggled_cb_gtk_check_menu_item_toggled, self, 0);
#line 453 "../src/menubar.vala"
	_tmp16_ = self->priv->high_contrast_item;
#line 453 "../src/menubar.vala"
	_tmp17_ = self->priv->_accel_group;
#line 453 "../src/menubar.vala"
	gtk_widget_add_accelerator ((GtkWidget*) _tmp16_, "activate", _tmp17_, GDK_KEY_h, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
#line 454 "../src/menubar.vala"
	_tmp18_ = self->priv->high_contrast_item;
#line 454 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp18_);
#line 455 "../src/menubar.vala"
	_tmp19_ = self->priv->high_contrast_item;
#line 455 "../src/menubar.vala"
	gtk_menu_shell_append ((GtkMenuShell*) submenu, (GtkMenuItem*) _tmp19_);
#line 456 "../src/menubar.vala"
	_tmp20_ = self->priv->high_contrast_item;
#line 456 "../src/menubar.vala"
	gtk_check_menu_item_set_active (_tmp20_, ug_settings_get_boolean (UG_SETTINGS_KEY_HIGH_CONTRAST));
#line 457 "../src/menubar.vala"
	_tmp21_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_ ("Screen Reader"));
#line 457 "../src/menubar.vala"
	g_object_ref_sink (_tmp21_);
#line 457 "../src/menubar.vala"
	item = _tmp21_;
#line 458 "../src/menubar.vala"
	g_signal_connect_object (item, "toggled", (GCallback) _menu_bar_screen_reader_toggled_cb_gtk_check_menu_item_toggled, self, 0);
#line 459 "../src/menubar.vala"
	_tmp22_ = self->priv->_accel_group;
#line 459 "../src/menubar.vala"
	gtk_widget_add_accelerator ((GtkWidget*) item, "activate", _tmp22_, GDK_KEY_s, GDK_SUPER_MASK | GDK_MOD1_MASK, GTK_ACCEL_VISIBLE);
#line 460 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) item);
#line 461 "../src/menubar.vala"
	gtk_menu_shell_append ((GtkMenuShell*) submenu, (GtkMenuItem*) item);
#line 462 "../src/menubar.vala"
	gtk_check_menu_item_set_active (item, ug_settings_get_boolean (UG_SETTINGS_KEY_SCREEN_READER));
#line 463 "../src/menubar.vala"
	result = a11y_item;
#line 463 "../src/menubar.vala"
	_g_object_unref0 (item);
#line 463 "../src/menubar.vala"
	_g_object_unref0 (image);
#line 463 "../src/menubar.vala"
	_g_object_unref0 (hbox);
#line 463 "../src/menubar.vala"
	return result;
#line 4102 "menubar.c"
}

static void
___lambda6_ (MenuBar* self)
{
	GError* _inner_error0_ = NULL;
	{
#line 489 "../src/menubar.vala"
		lightdm_suspend (&_inner_error0_);
#line 489 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 4114 "menubar.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
#line 487 "../src/menubar.vala"
		e = _inner_error0_;
#line 487 "../src/menubar.vala"
		_inner_error0_ = NULL;
#line 493 "../src/menubar.vala"
		_tmp0_ = e;
#line 493 "../src/menubar.vala"
		_tmp1_ = _tmp0_->message;
#line 493 "../src/menubar.vala"
		g_warning ("menubar.vala:493: Failed to suspend: %s", _tmp1_);
#line 487 "../src/menubar.vala"
		_g_error_free0 (e);
#line 4136 "menubar.c"
	}
	__finally0:
#line 487 "../src/menubar.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 487 "../src/menubar.vala"
		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);
#line 487 "../src/menubar.vala"
		g_clear_error (&_inner_error0_);
#line 487 "../src/menubar.vala"
		return;
#line 4147 "menubar.c"
	}
}

static void
____lambda6__gtk_menu_item_activate (GtkMenuItem* _sender,
                                     gpointer self)
{
#line 485 "../src/menubar.vala"
	___lambda6_ ((MenuBar*) self);
#line 4157 "menubar.c"
}

static void
___lambda7_ (MenuBar* self)
{
	GError* _inner_error0_ = NULL;
	{
#line 507 "../src/menubar.vala"
		lightdm_hibernate (&_inner_error0_);
#line 507 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 4169 "menubar.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
#line 505 "../src/menubar.vala"
		e = _inner_error0_;
#line 505 "../src/menubar.vala"
		_inner_error0_ = NULL;
#line 511 "../src/menubar.vala"
		_tmp0_ = e;
#line 511 "../src/menubar.vala"
		_tmp1_ = _tmp0_->message;
#line 511 "../src/menubar.vala"
		g_warning ("menubar.vala:511: Failed to hibernate: %s", _tmp1_);
#line 505 "../src/menubar.vala"
		_g_error_free0 (e);
#line 4191 "menubar.c"
	}
	__finally0:
#line 505 "../src/menubar.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 505 "../src/menubar.vala"
		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);
#line 505 "../src/menubar.vala"
		g_clear_error (&_inner_error0_);
#line 505 "../src/menubar.vala"
		return;
#line 4202 "menubar.c"
	}
}

static void
____lambda7__gtk_menu_item_activate (GtkMenuItem* _sender,
                                     gpointer self)
{
#line 503 "../src/menubar.vala"
	___lambda7_ ((MenuBar*) self);
#line 4212 "menubar.c"
}

static void
_menu_bar_shutdown_cb_gtk_menu_item_activate (GtkMenuItem* _sender,
                                              gpointer self)
{
#line 517 "../src/menubar.vala"
	menu_bar_shutdown_cb ((MenuBar*) self, _sender);
#line 4221 "menubar.c"
}

static GtkMenuItem*
menu_bar_make_session_item (MenuBar* self)
{
	GtkMenuItem* item = NULL;
	GtkMenuItem* _tmp0_;
	GtkMenuItem* _tmp1_;
	GtkBox* hbox = NULL;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkMenuItem* _tmp4_;
	GtkBox* _tmp5_;
	GtkImage* image = NULL;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GtkImage* _tmp8_;
	GtkImage* _tmp9_;
	GtkImage* _tmp10_;
	GtkBox* _tmp11_;
	GtkImage* _tmp12_;
	GtkMenuItem* _tmp13_;
	GtkMenuItem* _tmp14_;
	GtkMenu* _tmp15_;
	GtkMenu* _tmp16_;
	GtkMenu* submenu = NULL;
	GtkMenuItem* _tmp17_;
	GtkMenu* _tmp18_;
	GtkMenu* _tmp19_;
	GtkMenuItem* menu_item = NULL;
	GtkMenuItem* _tmp30_;
	GtkMenu* _tmp31_;
	GtkMenuItem* result;
#line 466 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 468 "../src/menubar.vala"
	_tmp0_ = (GtkMenuItem*) gtk_menu_item_new ();
#line 468 "../src/menubar.vala"
	g_object_ref_sink (_tmp0_);
#line 468 "../src/menubar.vala"
	item = _tmp0_;
#line 469 "../src/menubar.vala"
	_tmp1_ = item;
#line 469 "../src/menubar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp1_, _ ("Quit..."));
#line 470 "../src/menubar.vala"
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
#line 470 "../src/menubar.vala"
	g_object_ref_sink (_tmp2_);
#line 470 "../src/menubar.vala"
	hbox = _tmp2_;
#line 471 "../src/menubar.vala"
	_tmp3_ = hbox;
#line 471 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp3_);
#line 472 "../src/menubar.vala"
	_tmp4_ = item;
#line 472 "../src/menubar.vala"
	_tmp5_ = hbox;
#line 472 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) _tmp4_, (GtkWidget*) _tmp5_);
#line 473 "../src/menubar.vala"
	_tmp6_ = g_build_filename (PKGDATADIR, "shutdown.svg", NULL);
#line 473 "../src/menubar.vala"
	_tmp7_ = _tmp6_;
#line 473 "../src/menubar.vala"
	_tmp8_ = (GtkImage*) gtk_image_new_from_file (_tmp7_);
#line 473 "../src/menubar.vala"
	g_object_ref_sink (_tmp8_);
#line 473 "../src/menubar.vala"
	_tmp9_ = _tmp8_;
#line 473 "../src/menubar.vala"
	_g_free0 (_tmp7_);
#line 473 "../src/menubar.vala"
	image = _tmp9_;
#line 474 "../src/menubar.vala"
	_tmp10_ = image;
#line 474 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp10_);
#line 475 "../src/menubar.vala"
	_tmp11_ = hbox;
#line 475 "../src/menubar.vala"
	_tmp12_ = image;
#line 475 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp12_);
#line 476 "../src/menubar.vala"
	_tmp13_ = item;
#line 476 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp13_);
#line 477 "../src/menubar.vala"
	_tmp14_ = item;
#line 477 "../src/menubar.vala"
	_tmp15_ = (GtkMenu*) gtk_menu_new ();
#line 477 "../src/menubar.vala"
	g_object_ref_sink (_tmp15_);
#line 477 "../src/menubar.vala"
	_tmp16_ = _tmp15_;
#line 477 "../src/menubar.vala"
	gtk_menu_item_set_submenu (_tmp14_, _tmp16_);
#line 477 "../src/menubar.vala"
	_g_object_unref0 (_tmp16_);
#line 478 "../src/menubar.vala"
	_tmp17_ = item;
#line 478 "../src/menubar.vala"
	_tmp18_ = gtk_menu_item_get_submenu (_tmp17_);
#line 478 "../src/menubar.vala"
	_tmp19_ = _tmp18_;
#line 478 "../src/menubar.vala"
	submenu = _tmp19_;
#line 480 "../src/menubar.vala"
	if (lightdm_get_can_suspend ()) {
#line 4333 "menubar.c"
		GtkMenuItem* menu_item = NULL;
		GtkMenuItem* _tmp20_;
		GtkMenuItem* _tmp21_;
		GtkMenu* _tmp22_;
		GtkMenuItem* _tmp23_;
		GtkMenuItem* _tmp24_;
#line 482 "../src/menubar.vala"
		_tmp20_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("Suspend"));
#line 482 "../src/menubar.vala"
		g_object_ref_sink (_tmp20_);
#line 482 "../src/menubar.vala"
		menu_item = _tmp20_;
#line 483 "../src/menubar.vala"
		_tmp21_ = menu_item;
#line 483 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp21_);
#line 484 "../src/menubar.vala"
		_tmp22_ = submenu;
#line 484 "../src/menubar.vala"
		_tmp23_ = menu_item;
#line 484 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) _tmp22_, _tmp23_);
#line 485 "../src/menubar.vala"
		_tmp24_ = menu_item;
#line 485 "../src/menubar.vala"
		g_signal_connect_object (_tmp24_, "activate", (GCallback) ____lambda6__gtk_menu_item_activate, self, 0);
#line 480 "../src/menubar.vala"
		_g_object_unref0 (menu_item);
#line 4362 "menubar.c"
	}
#line 498 "../src/menubar.vala"
	if (lightdm_get_can_hibernate ()) {
#line 4366 "menubar.c"
		GtkMenuItem* menu_item = NULL;
		GtkMenuItem* _tmp25_;
		GtkMenuItem* _tmp26_;
		GtkMenu* _tmp27_;
		GtkMenuItem* _tmp28_;
		GtkMenuItem* _tmp29_;
#line 500 "../src/menubar.vala"
		_tmp25_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("Hibernate"));
#line 500 "../src/menubar.vala"
		g_object_ref_sink (_tmp25_);
#line 500 "../src/menubar.vala"
		menu_item = _tmp25_;
#line 501 "../src/menubar.vala"
		_tmp26_ = menu_item;
#line 501 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp26_);
#line 502 "../src/menubar.vala"
		_tmp27_ = submenu;
#line 502 "../src/menubar.vala"
		_tmp28_ = menu_item;
#line 502 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) _tmp27_, _tmp28_);
#line 503 "../src/menubar.vala"
		_tmp29_ = menu_item;
#line 503 "../src/menubar.vala"
		g_signal_connect_object (_tmp29_, "activate", (GCallback) ____lambda7__gtk_menu_item_activate, self, 0);
#line 498 "../src/menubar.vala"
		_g_object_unref0 (menu_item);
#line 4395 "menubar.c"
	}
#line 516 "../src/menubar.vala"
	_tmp30_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("Quit..."));
#line 516 "../src/menubar.vala"
	g_object_ref_sink (_tmp30_);
#line 516 "../src/menubar.vala"
	menu_item = _tmp30_;
#line 517 "../src/menubar.vala"
	g_signal_connect_object (menu_item, "activate", (GCallback) _menu_bar_shutdown_cb_gtk_menu_item_activate, self, 0);
#line 518 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) menu_item);
#line 519 "../src/menubar.vala"
	_tmp31_ = submenu;
#line 519 "../src/menubar.vala"
	gtk_menu_shell_append ((GtkMenuShell*) _tmp31_, menu_item);
#line 521 "../src/menubar.vala"
	result = item;
#line 521 "../src/menubar.vala"
	_g_object_unref0 (menu_item);
#line 521 "../src/menubar.vala"
	_g_object_unref0 (image);
#line 521 "../src/menubar.vala"
	_g_object_unref0 (hbox);
#line 521 "../src/menubar.vala"
	return result;
#line 4421 "menubar.c"
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
#line 524 "../src/menubar.vala"
	g_atomic_int_inc (&_data2_->_ref_count_);
#line 524 "../src/menubar.vala"
	return _data2_;
#line 4431 "menubar.c"
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
#line 524 "../src/menubar.vala"
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
#line 4441 "menubar.c"
		MenuBar* self;
#line 524 "../src/menubar.vala"
		self = _data2_->self;
#line 524 "../src/menubar.vala"
		_g_object_unref0 (_data2_->label);
#line 524 "../src/menubar.vala"
		_g_object_unref0 (_data2_->item);
#line 524 "../src/menubar.vala"
		_g_object_unref0 (self);
#line 524 "../src/menubar.vala"
		g_slice_free (Block2Data, _data2_);
#line 4453 "menubar.c"
	}
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
#line 1584 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1584 "glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1585 "glib-2.0.vapi"
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
#line 1585 "glib-2.0.vapi"
	result = _tmp0_ != NULL;
#line 1585 "glib-2.0.vapi"
	return result;
#line 4473 "menubar.c"
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
#line 1588 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1588 "glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1588 "glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 1589 "glib-2.0.vapi"
	if ((*((gchar*) self)) == '\0') {
#line 1589 "glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 4495 "menubar.c"
	} else {
#line 1589 "glib-2.0.vapi"
		_tmp1_ = (*((gchar*) old)) == '\0';
#line 4499 "menubar.c"
	}
#line 1589 "glib-2.0.vapi"
	if (_tmp1_) {
#line 1589 "glib-2.0.vapi"
		_tmp0_ = TRUE;
#line 4505 "menubar.c"
	} else {
#line 1589 "glib-2.0.vapi"
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
#line 4509 "menubar.c"
	}
#line 1589 "glib-2.0.vapi"
	if (_tmp0_) {
#line 4513 "menubar.c"
		gchar* _tmp2_;
#line 1590 "glib-2.0.vapi"
		_tmp2_ = g_strdup (self);
#line 1590 "glib-2.0.vapi"
		result = _tmp2_;
#line 1590 "glib-2.0.vapi"
		return result;
#line 4521 "menubar.c"
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
#line 1593 "glib-2.0.vapi"
		_tmp3_ = g_regex_escape_string (old, -1);
#line 1593 "glib-2.0.vapi"
		_tmp4_ = _tmp3_;
#line 1593 "glib-2.0.vapi"
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
#line 1593 "glib-2.0.vapi"
		_tmp6_ = _tmp5_;
#line 1593 "glib-2.0.vapi"
		_g_free0 (_tmp4_);
#line 1593 "glib-2.0.vapi"
		regex = _tmp6_;
#line 1593 "glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 1593 "glib-2.0.vapi"
			if (_inner_error0_->domain == G_REGEX_ERROR) {
#line 4549 "menubar.c"
				goto __catch0_g_regex_error;
			}
#line 1593 "glib-2.0.vapi"
			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);
#line 1593 "glib-2.0.vapi"
			g_clear_error (&_inner_error0_);
#line 1593 "glib-2.0.vapi"
			return NULL;
#line 4558 "menubar.c"
		}
#line 1594 "glib-2.0.vapi"
		_tmp8_ = regex;
#line 1594 "glib-2.0.vapi"
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
#line 1594 "glib-2.0.vapi"
		_tmp7_ = _tmp9_;
#line 1594 "glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 1594 "glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1594 "glib-2.0.vapi"
			if (_inner_error0_->domain == G_REGEX_ERROR) {
#line 4572 "menubar.c"
				goto __catch0_g_regex_error;
			}
#line 1594 "glib-2.0.vapi"
			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);
#line 1594 "glib-2.0.vapi"
			g_clear_error (&_inner_error0_);
#line 1594 "glib-2.0.vapi"
			return NULL;
#line 4581 "menubar.c"
		}
#line 1594 "glib-2.0.vapi"
		_tmp10_ = _tmp7_;
#line 1594 "glib-2.0.vapi"
		_tmp7_ = NULL;
#line 1594 "glib-2.0.vapi"
		result = _tmp10_;
#line 1594 "glib-2.0.vapi"
		_g_free0 (_tmp7_);
#line 1594 "glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1594 "glib-2.0.vapi"
		return result;
#line 4595 "menubar.c"
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
#line 1592 "glib-2.0.vapi"
		g_clear_error (&_inner_error0_);
#line 1596 "glib-2.0.vapi"
		g_assert_not_reached ();
#line 4604 "menubar.c"
	}
	__finally0:
#line 1592 "glib-2.0.vapi"
	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);
#line 1592 "glib-2.0.vapi"
	g_clear_error (&_inner_error0_);
#line 1592 "glib-2.0.vapi"
	return NULL;
#line 4613 "menubar.c"
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
#line 1413 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1414 "glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1414 "glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1415 "glib-2.0.vapi"
	g_strstrip (_result_);
#line 1416 "glib-2.0.vapi"
	result = _result_;
#line 1416 "glib-2.0.vapi"
	return result;
#line 4634 "menubar.c"
}

static void
_g_free0_ (gpointer var)
{
#line 554 "../src/menubar.vala"
	var = (g_free (var), NULL);
#line 4642 "menubar.c"
}

static inline void
_g_list_free__g_free0_ (GList* self)
{
#line 554 "../src/menubar.vala"
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
#line 4650 "menubar.c"
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
#line 577 "../src/menubar.vala"
	g_atomic_int_inc (&_data3_->_ref_count_);
#line 577 "../src/menubar.vala"
	return _data3_;
#line 4660 "menubar.c"
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
#line 577 "../src/menubar.vala"
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
#line 4670 "menubar.c"
		MenuBar* self;
#line 577 "../src/menubar.vala"
		self = _data3_->_data2_->self;
#line 577 "../src/menubar.vala"
		_g_object_unref0 (_data3_->layout);
#line 577 "../src/menubar.vala"
		block2_data_unref (_data3_->_data2_);
#line 577 "../src/menubar.vala"
		_data3_->_data2_ = NULL;
#line 577 "../src/menubar.vala"
		g_slice_free (Block3Data, _data3_);
#line 4682 "menubar.c"
	}
}

static void
____lambda21_ (Block3Data* _data3_)
{
	Block2Data* _data2_;
	MenuBar* self;
	LightDMLayout* _tmp0_;
	GtkLabel* _tmp1_;
	LightDMLayout* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkMenuItem* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	LightDMLayout* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
#line 579 "../src/menubar.vala"
	_data2_ = _data3_->_data2_;
#line 579 "../src/menubar.vala"
	self = _data2_->self;
#line 581 "../src/menubar.vala"
	_tmp0_ = _data3_->layout;
#line 581 "../src/menubar.vala"
	lightdm_set_layout (_tmp0_);
#line 582 "../src/menubar.vala"
	_tmp1_ = _data2_->label;
#line 582 "../src/menubar.vala"
	_tmp2_ = _data3_->layout;
#line 582 "../src/menubar.vala"
	_tmp3_ = lightdm_layout_get_name (_tmp2_);
#line 582 "../src/menubar.vala"
	_tmp4_ = _tmp3_;
#line 582 "../src/menubar.vala"
	gtk_label_set_label (_tmp1_, _tmp4_);
#line 583 "../src/menubar.vala"
	_tmp5_ = _data2_->item;
#line 583 "../src/menubar.vala"
	_tmp6_ = g_strconcat (_ ("Keyboard layout:"), " ", NULL);
#line 583 "../src/menubar.vala"
	_tmp7_ = _tmp6_;
#line 583 "../src/menubar.vala"
	_tmp8_ = _data3_->layout;
#line 583 "../src/menubar.vala"
	_tmp9_ = lightdm_layout_get_description (_tmp8_);
#line 583 "../src/menubar.vala"
	_tmp10_ = _tmp9_;
#line 583 "../src/menubar.vala"
	_tmp11_ = g_strconcat (_tmp7_, _tmp10_, NULL);
#line 583 "../src/menubar.vala"
	_tmp12_ = _tmp11_;
#line 583 "../src/menubar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp5_, _tmp12_);
#line 583 "../src/menubar.vala"
	_g_free0 (_tmp12_);
#line 583 "../src/menubar.vala"
	_g_free0 (_tmp7_);
#line 4744 "menubar.c"
}

static void
_____lambda21__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
#line 579 "../src/menubar.vala"
	____lambda21_ (self);
#line 4753 "menubar.c"
}

static void
__lambda22_ (Block2Data* _data2_)
{
	MenuBar* self;
	LightDMLayout* new_layout = NULL;
	LightDMLayout* _tmp0_;
	LightDMLayout* _tmp1_;
	GtkLabel* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkMenuItem* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
#line 602 "../src/menubar.vala"
	self = _data2_->self;
#line 604 "../src/menubar.vala"
	_tmp0_ = lightdm_get_layout ();
#line 604 "../src/menubar.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 604 "../src/menubar.vala"
	new_layout = _tmp1_;
#line 605 "../src/menubar.vala"
	_tmp2_ = _data2_->label;
#line 605 "../src/menubar.vala"
	_tmp3_ = lightdm_layout_get_name (new_layout);
#line 605 "../src/menubar.vala"
	_tmp4_ = _tmp3_;
#line 605 "../src/menubar.vala"
	gtk_label_set_label (_tmp2_, _tmp4_);
#line 606 "../src/menubar.vala"
	_tmp5_ = _data2_->item;
#line 606 "../src/menubar.vala"
	_tmp6_ = g_strconcat (_ ("Keyboard layout:"), " ", NULL);
#line 606 "../src/menubar.vala"
	_tmp7_ = _tmp6_;
#line 606 "../src/menubar.vala"
	_tmp8_ = lightdm_layout_get_description (new_layout);
#line 606 "../src/menubar.vala"
	_tmp9_ = _tmp8_;
#line 606 "../src/menubar.vala"
	_tmp10_ = g_strconcat (_tmp7_, _tmp9_, NULL);
#line 606 "../src/menubar.vala"
	_tmp11_ = _tmp10_;
#line 606 "../src/menubar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp5_, _tmp11_);
#line 606 "../src/menubar.vala"
	_g_free0 (_tmp11_);
#line 606 "../src/menubar.vala"
	_g_free0 (_tmp7_);
#line 602 "../src/menubar.vala"
	_g_object_unref0 (new_layout);
#line 4811 "menubar.c"
}

static void
___lambda22__gdk_keymap_state_changed (GdkKeymap* _sender,
                                       gpointer self)
{
#line 602 "../src/menubar.vala"
	__lambda22_ (self);
#line 4820 "menubar.c"
}

static GtkMenuItem*
menu_bar_make_keyboard_item (MenuBar* self)
{
	Block2Data* _data2_;
	GtkMenuItem* _tmp0_;
	GtkBox* hbox = NULL;
	GtkBox* _tmp1_;
	GtkBox* _tmp2_;
	GtkMenuItem* _tmp3_;
	GtkBox* _tmp4_;
	GtkImage* image = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkImage* _tmp7_;
	GtkImage* _tmp8_;
	GtkImage* _tmp9_;
	GtkBox* _tmp10_;
	GtkImage* _tmp11_;
	GtkBox* _tmp12_;
	GtkLabel* _tmp13_;
	GtkLabel* _tmp14_;
	LightDMLayout* current_layout = NULL;
	LightDMLayout* _tmp15_;
	LightDMLayout* _tmp16_;
	LightDMLayout* _tmp17_;
	GdkRGBA keyboard_fg = {0};
	GtkLabel* _tmp30_;
	GtkStyleContext* _tmp31_;
	GdkRGBA _tmp32_ = {0};
	GtkLabel* _tmp33_;
	GdkRGBA _tmp34_;
	GtkLabel* _tmp35_;
	GtkBox* _tmp36_;
	GtkLabel* _tmp37_;
	GtkMenuItem* _tmp38_;
	GtkMenu* system_menu = NULL;
	GtkMenu* _tmp39_;
	GtkMenu* all_menu = NULL;
	GtkMenu* _tmp40_;
	GList* default_layouts = NULL;
	GFile* file = NULL;
	GFile* _tmp41_;
	GFile* _tmp42_;
	GList* _tmp75_;
	GtkMenuItem* _tmp108_;
	GtkMenu* _tmp109_;
	GtkMenuItem* menu_item = NULL;
	GtkMenuItem* _tmp110_;
	GtkMenu* _tmp111_;
	GtkMenu* _tmp112_;
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp113_;
	GdkDisplay* _tmp114_;
	GdkKeymap* keymap = NULL;
	GdkKeymap* _tmp115_;
	GdkKeymap* _tmp116_;
	GtkMenuItem* _tmp117_;
	GtkMenuItem* _tmp118_;
	GError* _inner_error0_ = NULL;
	GtkMenuItem* result;
#line 524 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 524 "../src/menubar.vala"
	_data2_ = g_slice_new0 (Block2Data);
#line 524 "../src/menubar.vala"
	_data2_->_ref_count_ = 1;
#line 524 "../src/menubar.vala"
	_data2_->self = g_object_ref (self);
#line 526 "../src/menubar.vala"
	_tmp0_ = (GtkMenuItem*) gtk_menu_item_new ();
#line 526 "../src/menubar.vala"
	g_object_ref_sink (_tmp0_);
#line 526 "../src/menubar.vala"
	_data2_->item = _tmp0_;
#line 527 "../src/menubar.vala"
	_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
#line 527 "../src/menubar.vala"
	g_object_ref_sink (_tmp1_);
#line 527 "../src/menubar.vala"
	hbox = _tmp1_;
#line 528 "../src/menubar.vala"
	_tmp2_ = hbox;
#line 528 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp2_);
#line 529 "../src/menubar.vala"
	_tmp3_ = _data2_->item;
#line 529 "../src/menubar.vala"
	_tmp4_ = hbox;
#line 529 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) _tmp3_, (GtkWidget*) _tmp4_);
#line 530 "../src/menubar.vala"
	_tmp5_ = g_build_filename (PKGDATADIR, "keyboard.svg", NULL);
#line 530 "../src/menubar.vala"
	_tmp6_ = _tmp5_;
#line 530 "../src/menubar.vala"
	_tmp7_ = (GtkImage*) gtk_image_new_from_file (_tmp6_);
#line 530 "../src/menubar.vala"
	g_object_ref_sink (_tmp7_);
#line 530 "../src/menubar.vala"
	_tmp8_ = _tmp7_;
#line 530 "../src/menubar.vala"
	_g_free0 (_tmp6_);
#line 530 "../src/menubar.vala"
	image = _tmp8_;
#line 531 "../src/menubar.vala"
	_tmp9_ = image;
#line 531 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp9_);
#line 532 "../src/menubar.vala"
	_tmp10_ = hbox;
#line 532 "../src/menubar.vala"
	_tmp11_ = image;
#line 532 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) _tmp11_);
#line 533 "../src/menubar.vala"
	_tmp12_ = hbox;
#line 533 "../src/menubar.vala"
	gtk_box_set_spacing (_tmp12_, 6);
#line 534 "../src/menubar.vala"
	_tmp13_ = (GtkLabel*) gtk_label_new ("");
#line 534 "../src/menubar.vala"
	g_object_ref_sink (_tmp13_);
#line 534 "../src/menubar.vala"
	_data2_->label = _tmp13_;
#line 535 "../src/menubar.vala"
	_tmp14_ = _data2_->label;
#line 535 "../src/menubar.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _tmp14_, FALSE);
#line 536 "../src/menubar.vala"
	_tmp15_ = lightdm_get_layout ();
#line 536 "../src/menubar.vala"
	_tmp16_ = _g_object_ref0 (_tmp15_);
#line 536 "../src/menubar.vala"
	current_layout = _tmp16_;
#line 537 "../src/menubar.vala"
	_tmp17_ = current_layout;
#line 537 "../src/menubar.vala"
	if (_tmp17_ != NULL) {
#line 4961 "menubar.c"
		GtkLabel* _tmp18_;
		LightDMLayout* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		GtkMenuItem* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		LightDMLayout* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
#line 538 "../src/menubar.vala"
		_tmp18_ = _data2_->label;
#line 538 "../src/menubar.vala"
		_tmp19_ = current_layout;
#line 538 "../src/menubar.vala"
		_tmp20_ = lightdm_layout_get_name (_tmp19_);
#line 538 "../src/menubar.vala"
		_tmp21_ = _tmp20_;
#line 538 "../src/menubar.vala"
		gtk_label_set_label (_tmp18_, _tmp21_);
#line 539 "../src/menubar.vala"
		_tmp22_ = _data2_->item;
#line 539 "../src/menubar.vala"
		_tmp23_ = g_strconcat (_ ("Keyboard layout:"), " ", NULL);
#line 539 "../src/menubar.vala"
		_tmp24_ = _tmp23_;
#line 539 "../src/menubar.vala"
		_tmp25_ = current_layout;
#line 539 "../src/menubar.vala"
		_tmp26_ = lightdm_layout_get_description (_tmp25_);
#line 539 "../src/menubar.vala"
		_tmp27_ = _tmp26_;
#line 539 "../src/menubar.vala"
		_tmp28_ = g_strconcat (_tmp24_, _tmp27_, NULL);
#line 539 "../src/menubar.vala"
		_tmp29_ = _tmp28_;
#line 539 "../src/menubar.vala"
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp22_, _tmp29_);
#line 539 "../src/menubar.vala"
		_g_free0 (_tmp29_);
#line 539 "../src/menubar.vala"
		_g_free0 (_tmp24_);
#line 5006 "menubar.c"
	}
#line 541 "../src/menubar.vala"
	_tmp30_ = _data2_->label;
#line 541 "../src/menubar.vala"
	_tmp31_ = gtk_widget_get_style_context ((GtkWidget*) _tmp30_);
#line 541 "../src/menubar.vala"
	gtk_style_context_get_color (_tmp31_, GTK_STATE_FLAG_NORMAL, &_tmp32_);
#line 541 "../src/menubar.vala"
	keyboard_fg = _tmp32_;
#line 542 "../src/menubar.vala"
	_tmp33_ = _data2_->label;
#line 542 "../src/menubar.vala"
	_tmp34_ = keyboard_fg;
#line 542 "../src/menubar.vala"
	gtk_widget_override_color ((GtkWidget*) _tmp33_, GTK_STATE_FLAG_INSENSITIVE, &_tmp34_);
#line 543 "../src/menubar.vala"
	_tmp35_ = _data2_->label;
#line 543 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp35_);
#line 544 "../src/menubar.vala"
	_tmp36_ = hbox;
#line 544 "../src/menubar.vala"
	_tmp37_ = _data2_->label;
#line 544 "../src/menubar.vala"
	gtk_container_add ((GtkContainer*) _tmp36_, (GtkWidget*) _tmp37_);
#line 545 "../src/menubar.vala"
	_tmp38_ = _data2_->item;
#line 545 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) _tmp38_);
#line 547 "../src/menubar.vala"
	_tmp39_ = (GtkMenu*) gtk_menu_new ();
#line 547 "../src/menubar.vala"
	g_object_ref_sink (_tmp39_);
#line 547 "../src/menubar.vala"
	system_menu = _tmp39_;
#line 548 "../src/menubar.vala"
	_tmp40_ = (GtkMenu*) gtk_menu_new ();
#line 548 "../src/menubar.vala"
	g_object_ref_sink (_tmp40_);
#line 548 "../src/menubar.vala"
	all_menu = _tmp40_;
#line 551 "../src/menubar.vala"
	default_layouts = NULL;
#line 552 "../src/menubar.vala"
	_tmp41_ = g_file_new_for_path ("/etc/default/keyboard");
#line 552 "../src/menubar.vala"
	file = _tmp41_;
#line 553 "../src/menubar.vala"
	_tmp42_ = file;
#line 553 "../src/menubar.vala"
	if (g_file_query_exists (_tmp42_, NULL)) {
#line 5058 "menubar.c"
		{
			GFileInputStream* _tmp43_ = NULL;
			GFile* _tmp44_;
			GFileInputStream* _tmp45_;
			GDataInputStream* dis = NULL;
			GDataInputStream* _tmp46_;
			gchar* line = NULL;
#line 555 "../src/menubar.vala"
			_tmp44_ = file;
#line 555 "../src/menubar.vala"
			_tmp45_ = g_file_read (_tmp44_, NULL, &_inner_error0_);
#line 555 "../src/menubar.vala"
			_tmp43_ = _tmp45_;
#line 555 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 5074 "menubar.c"
				goto __catch0_g_error;
			}
#line 555 "../src/menubar.vala"
			_tmp46_ = g_data_input_stream_new ((GInputStream*) _tmp43_);
#line 555 "../src/menubar.vala"
			dis = _tmp46_;
#line 557 "../src/menubar.vala"
			while (TRUE) {
#line 5083 "menubar.c"
				gchar* _tmp47_ = NULL;
				GDataInputStream* _tmp48_;
				gchar* _tmp49_;
				gchar* _tmp50_;
				const gchar* _tmp51_;
				const gchar* _tmp52_;
#line 557 "../src/menubar.vala"
				_tmp48_ = dis;
#line 557 "../src/menubar.vala"
				_tmp49_ = g_data_input_stream_read_line (_tmp48_, NULL, NULL, &_inner_error0_);
#line 557 "../src/menubar.vala"
				_tmp47_ = _tmp49_;
#line 557 "../src/menubar.vala"
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 557 "../src/menubar.vala"
					_g_free0 (line);
#line 557 "../src/menubar.vala"
					_g_object_unref0 (dis);
#line 557 "../src/menubar.vala"
					_g_object_unref0 (_tmp43_);
#line 5104 "menubar.c"
					goto __catch0_g_error;
				}
#line 557 "../src/menubar.vala"
				_tmp50_ = _tmp47_;
#line 557 "../src/menubar.vala"
				_tmp47_ = NULL;
#line 557 "../src/menubar.vala"
				_g_free0 (line);
#line 557 "../src/menubar.vala"
				line = _tmp50_;
#line 557 "../src/menubar.vala"
				_tmp51_ = line;
#line 557 "../src/menubar.vala"
				if (!(_tmp51_ != NULL)) {
#line 557 "../src/menubar.vala"
					_g_free0 (_tmp47_);
#line 557 "../src/menubar.vala"
					break;
#line 5123 "menubar.c"
				}
#line 558 "../src/menubar.vala"
				_tmp52_ = line;
#line 558 "../src/menubar.vala"
				if (string_contains (_tmp52_, "XKBLAYOUT")) {
#line 5129 "menubar.c"
					gchar* line_layouts = NULL;
					const gchar* _tmp53_;
					gchar** _tmp54_;
					gchar** _tmp55_;
					gchar** _tmp56_;
					gint _tmp56__length1;
					const gchar* _tmp57_;
					gchar* _tmp58_;
					gchar* _tmp59_;
					const gchar* _tmp60_;
					gchar* _tmp61_;
					const gchar* _tmp62_;
					gchar* _tmp63_;
					const gchar* _tmp64_;
#line 559 "../src/menubar.vala"
					_tmp53_ = line;
#line 559 "../src/menubar.vala"
					_tmp55_ = _tmp54_ = g_strsplit (_tmp53_, "=", 0);
#line 559 "../src/menubar.vala"
					_tmp56_ = _tmp55_;
#line 559 "../src/menubar.vala"
					_tmp56__length1 = _vala_array_length (_tmp54_);
#line 559 "../src/menubar.vala"
					_tmp57_ = _tmp56_[1];
#line 559 "../src/menubar.vala"
					_tmp58_ = g_strdup (_tmp57_);
#line 559 "../src/menubar.vala"
					_tmp59_ = _tmp58_;
#line 559 "../src/menubar.vala"
					_tmp56_ = (_vala_array_free (_tmp56_, _tmp56__length1, (GDestroyNotify) g_free), NULL);
#line 559 "../src/menubar.vala"
					line_layouts = _tmp59_;
#line 560 "../src/menubar.vala"
					_tmp60_ = line_layouts;
#line 560 "../src/menubar.vala"
					_tmp61_ = string_replace (_tmp60_, "'", "");
#line 560 "../src/menubar.vala"
					_g_free0 (line_layouts);
#line 560 "../src/menubar.vala"
					line_layouts = _tmp61_;
#line 561 "../src/menubar.vala"
					_tmp62_ = line_layouts;
#line 561 "../src/menubar.vala"
					_tmp63_ = string_replace (_tmp62_, "\"", "");
#line 561 "../src/menubar.vala"
					_g_free0 (line_layouts);
#line 561 "../src/menubar.vala"
					line_layouts = _tmp63_;
#line 562 "../src/menubar.vala"
					_tmp64_ = line_layouts;
#line 562 "../src/menubar.vala"
					if (string_contains (_tmp64_, ",")) {
#line 5182 "menubar.c"
						const gchar* _tmp65_;
						gchar** _tmp66_;
						gchar** _tmp67_;
#line 563 "../src/menubar.vala"
						_tmp65_ = line_layouts;
#line 563 "../src/menubar.vala"
						_tmp67_ = _tmp66_ = g_strsplit (_tmp65_, ",", 0);
#line 5190 "menubar.c"
						{
							gchar** element_collection = NULL;
							gint element_collection_length1 = 0;
							gint _element_collection_size_ = 0;
							gint element_it = 0;
#line 563 "../src/menubar.vala"
							element_collection = _tmp67_;
#line 563 "../src/menubar.vala"
							element_collection_length1 = _vala_array_length (_tmp66_);
#line 563 "../src/menubar.vala"
							for (element_it = 0; element_it < element_collection_length1; element_it = element_it + 1) {
#line 5202 "menubar.c"
								gchar* _tmp68_;
								gchar* element = NULL;
#line 563 "../src/menubar.vala"
								_tmp68_ = g_strdup (element_collection[element_it]);
#line 563 "../src/menubar.vala"
								element = _tmp68_;
#line 5209 "menubar.c"
								{
									const gchar* _tmp69_;
									gchar* _tmp70_;
									const gchar* _tmp71_;
									gchar* _tmp72_;
#line 564 "../src/menubar.vala"
									_tmp69_ = element;
#line 564 "../src/menubar.vala"
									_tmp70_ = string_strip (_tmp69_);
#line 564 "../src/menubar.vala"
									_g_free0 (element);
#line 564 "../src/menubar.vala"
									element = _tmp70_;
#line 565 "../src/menubar.vala"
									_tmp71_ = element;
#line 565 "../src/menubar.vala"
									_tmp72_ = g_strdup (_tmp71_);
#line 565 "../src/menubar.vala"
									default_layouts = g_list_append (default_layouts, _tmp72_);
#line 563 "../src/menubar.vala"
									_g_free0 (element);
#line 5231 "menubar.c"
								}
							}
#line 563 "../src/menubar.vala"
							element_collection = (_vala_array_free (element_collection, element_collection_length1, (GDestroyNotify) g_free), NULL);
#line 5236 "menubar.c"
						}
					}
#line 568 "../src/menubar.vala"
					_g_free0 (line_layouts);
#line 568 "../src/menubar.vala"
					_g_free0 (_tmp47_);
#line 568 "../src/menubar.vala"
					break;
#line 5245 "menubar.c"
				}
#line 557 "../src/menubar.vala"
				_g_free0 (_tmp47_);
#line 5249 "menubar.c"
			}
#line 554 "../src/menubar.vala"
			_g_free0 (line);
#line 554 "../src/menubar.vala"
			_g_object_unref0 (dis);
#line 554 "../src/menubar.vala"
			_g_object_unref0 (_tmp43_);
#line 5257 "menubar.c"
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp73_;
			const gchar* _tmp74_;
#line 554 "../src/menubar.vala"
			e = _inner_error0_;
#line 554 "../src/menubar.vala"
			_inner_error0_ = NULL;
#line 572 "../src/menubar.vala"
			_tmp73_ = e;
#line 572 "../src/menubar.vala"
			_tmp74_ = _tmp73_->message;
#line 572 "../src/menubar.vala"
			g_warning ("menubar.vala:572: %s", _tmp74_);
#line 554 "../src/menubar.vala"
			_g_error_free0 (e);
#line 5277 "menubar.c"
		}
		__finally0:
#line 554 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 554 "../src/menubar.vala"
			_g_object_unref0 (file);
#line 554 "../src/menubar.vala"
			(default_layouts == NULL) ? NULL : (default_layouts = (_g_list_free__g_free0_ (default_layouts), NULL));
#line 554 "../src/menubar.vala"
			_g_object_unref0 (all_menu);
#line 554 "../src/menubar.vala"
			_g_object_unref0 (system_menu);
#line 554 "../src/menubar.vala"
			_g_object_unref0 (current_layout);
#line 554 "../src/menubar.vala"
			_g_object_unref0 (image);
#line 554 "../src/menubar.vala"
			_g_object_unref0 (hbox);
#line 554 "../src/menubar.vala"
			block2_data_unref (_data2_);
#line 554 "../src/menubar.vala"
			_data2_ = NULL;
#line 554 "../src/menubar.vala"
			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);
#line 554 "../src/menubar.vala"
			g_clear_error (&_inner_error0_);
#line 554 "../src/menubar.vala"
			return NULL;
#line 5306 "menubar.c"
		}
	}
#line 577 "../src/menubar.vala"
	_tmp75_ = lightdm_get_layouts ();
#line 5311 "menubar.c"
	{
		GList* layout_collection = NULL;
		GList* layout_it = NULL;
#line 577 "../src/menubar.vala"
		layout_collection = _tmp75_;
#line 577 "../src/menubar.vala"
		for (layout_it = layout_collection; layout_it != NULL; layout_it = layout_it->next) {
#line 5319 "menubar.c"
			LightDMLayout* _tmp76_;
			LightDMLayout* layout = NULL;
#line 577 "../src/menubar.vala"
			_tmp76_ = _g_object_ref0 ((LightDMLayout*) layout_it->data);
#line 577 "../src/menubar.vala"
			layout = _tmp76_;
#line 5326 "menubar.c"
			{
				Block3Data* _data3_;
				GtkMenuItem* menu_item = NULL;
				LightDMLayout* _tmp77_;
				const gchar* _tmp78_;
				const gchar* _tmp79_;
				gchar* _tmp80_;
				gchar* _tmp81_;
				LightDMLayout* _tmp82_;
				const gchar* _tmp83_;
				const gchar* _tmp84_;
				gchar* _tmp85_;
				gchar* _tmp86_;
				GtkMenuItem* _tmp87_;
				GtkMenuItem* _tmp88_;
				GtkMenuItem* _tmp89_;
				gboolean _tmp90_ = FALSE;
				LightDMLayout* _tmp91_;
				const gchar* _tmp92_;
				const gchar* _tmp93_;
				LightDMLayout* _tmp94_;
				const gchar* _tmp95_;
				const gchar* _tmp96_;
				GtkMenuItem* _tmp107_;
#line 577 "../src/menubar.vala"
				_data3_ = g_slice_new0 (Block3Data);
#line 577 "../src/menubar.vala"
				_data3_->_ref_count_ = 1;
#line 577 "../src/menubar.vala"
				_data3_->_data2_ = block2_data_ref (_data2_);
#line 577 "../src/menubar.vala"
				_data3_->layout = layout;
#line 578 "../src/menubar.vala"
				_tmp77_ = _data3_->layout;
#line 578 "../src/menubar.vala"
				_tmp78_ = lightdm_layout_get_name (_tmp77_);
#line 578 "../src/menubar.vala"
				_tmp79_ = _tmp78_;
#line 578 "../src/menubar.vala"
				_tmp80_ = g_strconcat (_tmp79_, " - ", NULL);
#line 578 "../src/menubar.vala"
				_tmp81_ = _tmp80_;
#line 578 "../src/menubar.vala"
				_tmp82_ = _data3_->layout;
#line 578 "../src/menubar.vala"
				_tmp83_ = lightdm_layout_get_description (_tmp82_);
#line 578 "../src/menubar.vala"
				_tmp84_ = _tmp83_;
#line 578 "../src/menubar.vala"
				_tmp85_ = g_strconcat (_tmp81_, _tmp84_, NULL);
#line 578 "../src/menubar.vala"
				_tmp86_ = _tmp85_;
#line 578 "../src/menubar.vala"
				_tmp87_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp86_);
#line 578 "../src/menubar.vala"
				g_object_ref_sink (_tmp87_);
#line 578 "../src/menubar.vala"
				_tmp88_ = _tmp87_;
#line 578 "../src/menubar.vala"
				_g_free0 (_tmp86_);
#line 578 "../src/menubar.vala"
				_g_free0 (_tmp81_);
#line 578 "../src/menubar.vala"
				menu_item = _tmp88_;
#line 579 "../src/menubar.vala"
				_tmp89_ = menu_item;
#line 579 "../src/menubar.vala"
				g_signal_connect_data (_tmp89_, "activate", (GCallback) _____lambda21__gtk_menu_item_activate, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
#line 585 "../src/menubar.vala"
				_tmp91_ = _data3_->layout;
#line 585 "../src/menubar.vala"
				_tmp92_ = lightdm_layout_get_name (_tmp91_);
#line 585 "../src/menubar.vala"
				_tmp93_ = _tmp92_;
#line 585 "../src/menubar.vala"
				_tmp94_ = current_layout;
#line 585 "../src/menubar.vala"
				_tmp95_ = lightdm_layout_get_name (_tmp94_);
#line 585 "../src/menubar.vala"
				_tmp96_ = _tmp95_;
#line 585 "../src/menubar.vala"
				if (g_strcmp0 (_tmp93_, _tmp96_) == 0) {
#line 585 "../src/menubar.vala"
					_tmp90_ = TRUE;
#line 5411 "menubar.c"
				} else {
					GList* _tmp97_;
					LightDMLayout* _tmp98_;
					const gchar* _tmp99_;
					const gchar* _tmp100_;
					GCompareFunc _tmp101_;
					GList* _tmp102_;
#line 585 "../src/menubar.vala"
					_tmp97_ = default_layouts;
#line 585 "../src/menubar.vala"
					_tmp98_ = _data3_->layout;
#line 585 "../src/menubar.vala"
					_tmp99_ = lightdm_layout_get_name (_tmp98_);
#line 585 "../src/menubar.vala"
					_tmp100_ = _tmp99_;
#line 585 "../src/menubar.vala"
					_tmp101_ = ((GCompareFunc) g_strcmp0);
#line 585 "../src/menubar.vala"
					_tmp102_ = g_list_find_custom (_tmp97_, _tmp100_, _tmp101_);
#line 585 "../src/menubar.vala"
					_tmp90_ = _tmp102_ != NULL;
#line 5433 "menubar.c"
				}
#line 585 "../src/menubar.vala"
				if (_tmp90_) {
#line 5437 "menubar.c"
					GtkMenu* _tmp103_;
					GtkMenuItem* _tmp104_;
#line 586 "../src/menubar.vala"
					_tmp103_ = system_menu;
#line 586 "../src/menubar.vala"
					_tmp104_ = menu_item;
#line 586 "../src/menubar.vala"
					gtk_menu_shell_append ((GtkMenuShell*) _tmp103_, _tmp104_);
#line 5446 "menubar.c"
				} else {
					GtkMenu* _tmp105_;
					GtkMenuItem* _tmp106_;
#line 589 "../src/menubar.vala"
					_tmp105_ = all_menu;
#line 589 "../src/menubar.vala"
					_tmp106_ = menu_item;
#line 589 "../src/menubar.vala"
					gtk_menu_shell_append ((GtkMenuShell*) _tmp105_, _tmp106_);
#line 5456 "menubar.c"
				}
#line 591 "../src/menubar.vala"
				_tmp107_ = menu_item;
#line 591 "../src/menubar.vala"
				gtk_widget_show ((GtkWidget*) _tmp107_);
#line 577 "../src/menubar.vala"
				_g_object_unref0 (menu_item);
#line 577 "../src/menubar.vala"
				block3_data_unref (_data3_);
#line 577 "../src/menubar.vala"
				_data3_ = NULL;
#line 5468 "menubar.c"
			}
		}
	}
#line 594 "../src/menubar.vala"
	_tmp108_ = _data2_->item;
#line 594 "../src/menubar.vala"
	_tmp109_ = system_menu;
#line 594 "../src/menubar.vala"
	gtk_menu_item_set_submenu (_tmp108_, _tmp109_);
#line 595 "../src/menubar.vala"
	_tmp110_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("More layouts..."));
#line 595 "../src/menubar.vala"
	g_object_ref_sink (_tmp110_);
#line 595 "../src/menubar.vala"
	menu_item = _tmp110_;
#line 596 "../src/menubar.vala"
	_tmp111_ = system_menu;
#line 596 "../src/menubar.vala"
	gtk_menu_shell_append ((GtkMenuShell*) _tmp111_, menu_item);
#line 597 "../src/menubar.vala"
	_tmp112_ = all_menu;
#line 597 "../src/menubar.vala"
	gtk_menu_item_set_submenu (menu_item, _tmp112_);
#line 598 "../src/menubar.vala"
	gtk_widget_show ((GtkWidget*) menu_item);
#line 600 "../src/menubar.vala"
	_tmp113_ = gtk_widget_get_display ((GtkWidget*) self);
#line 600 "../src/menubar.vala"
	_tmp114_ = _g_object_ref0 (_tmp113_);
#line 600 "../src/menubar.vala"
	display = _tmp114_;
#line 601 "../src/menubar.vala"
	_tmp115_ = gdk_keymap_get_for_display (display);
#line 601 "../src/menubar.vala"
	_tmp116_ = _g_object_ref0 (_tmp115_);
#line 601 "../src/menubar.vala"
	keymap = _tmp116_;
#line 602 "../src/menubar.vala"
	g_signal_connect_data (keymap, "state-changed", (GCallback) ___lambda22__gdk_keymap_state_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
#line 609 "../src/menubar.vala"
	_tmp117_ = _data2_->item;
#line 609 "../src/menubar.vala"
	_tmp118_ = _g_object_ref0 (_tmp117_);
#line 609 "../src/menubar.vala"
	result = _tmp118_;
#line 609 "../src/menubar.vala"
	_g_object_unref0 (keymap);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (display);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (menu_item);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (file);
#line 609 "../src/menubar.vala"
	(default_layouts == NULL) ? NULL : (default_layouts = (_g_list_free__g_free0_ (default_layouts), NULL));
#line 609 "../src/menubar.vala"
	_g_object_unref0 (all_menu);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (system_menu);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (current_layout);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (image);
#line 609 "../src/menubar.vala"
	_g_object_unref0 (hbox);
#line 609 "../src/menubar.vala"
	block2_data_unref (_data2_);
#line 609 "../src/menubar.vala"
	_data2_ = NULL;
#line 609 "../src/menubar.vala"
	return result;
#line 5540 "menubar.c"
}

static void
menu_bar_shutdown_cb (MenuBar* self,
                      GtkMenuItem* item)
{
	MainWindow* _tmp0_;
#line 612 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 612 "../src/menubar.vala"
	g_return_if_fail (item != NULL);
#line 614 "../src/menubar.vala"
	_tmp0_ = self->priv->_main_window;
#line 614 "../src/menubar.vala"
	if (_tmp0_ != NULL) {
#line 5556 "menubar.c"
		MainWindow* _tmp1_;
#line 615 "../src/menubar.vala"
		_tmp1_ = self->priv->_main_window;
#line 615 "../src/menubar.vala"
		main_window_show_shutdown_dialog (_tmp1_, SHUTDOWN_DIALOG_TYPE_RESTART);
#line 5562 "menubar.c"
	}
}

static void
menu_bar_keyboard_toggled_cb (MenuBar* self,
                              GtkCheckMenuItem* item)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp47_;
	gboolean _tmp48_;
	gboolean _tmp49_;
	GError* _inner_error0_ = NULL;
#line 619 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 619 "../src/menubar.vala"
	g_return_if_fail (item != NULL);
#line 627 "../src/menubar.vala"
	_tmp0_ = gtk_check_menu_item_get_active (item);
#line 627 "../src/menubar.vala"
	_tmp1_ = _tmp0_;
#line 627 "../src/menubar.vala"
	ug_settings_set_boolean (UG_SETTINGS_KEY_ONSCREEN_KEYBOARD, _tmp1_);
#line 629 "../src/menubar.vala"
	_tmp2_ = self->priv->_keyboard_window;
#line 629 "../src/menubar.vala"
	if (_tmp2_ == NULL) {
#line 5591 "menubar.c"
		gint id = 0;
		GtkSocket* keyboard_socket = NULL;
		GtkSocket* _tmp24_;
		GtkSocket* _tmp25_;
		GtkWindow* _tmp26_;
		GtkWindow* _tmp27_;
		GtkWindow* _tmp28_;
		GtkWindow* _tmp29_;
		GtkWindow* _tmp30_;
		GtkSocket* _tmp31_;
		GtkSocket* _tmp32_;
		GdkDisplay* display = NULL;
		GdkDisplay* _tmp33_;
		GdkDisplay* _tmp34_;
		GdkMonitor* monitor = NULL;
		GdkDisplay* _tmp35_;
		GdkWindow* _tmp36_;
		GdkMonitor* _tmp37_;
		GdkMonitor* _tmp38_;
		GdkRectangle geom = {0};
		GdkMonitor* _tmp39_;
		GdkRectangle _tmp40_ = {0};
		GtkWindow* _tmp41_;
		GdkRectangle _tmp42_;
		GdkRectangle _tmp43_;
		GdkRectangle _tmp44_;
		GtkWindow* _tmp45_;
		GdkRectangle _tmp46_;
#line 631 "../src/menubar.vala"
		id = 0;
#line 5622 "menubar.c"
		{
			gchar** argv = NULL;
			gint argv_length1 = 0;
			gint _argv_size_ = 0;
			gchar* cmd = NULL;
			gint onboard_stdout_fd = 0;
			gchar* layout = NULL;
			gchar* _tmp3_;
			GFile* file = NULL;
			const gchar* _tmp4_;
			GFile* _tmp5_;
			GFile* _tmp6_;
			const gchar* _tmp10_;
			gchar** _tmp11_ = NULL;
			gint _tmp12_ = 0;
			gchar** _tmp13_;
			gint _tmp13__length1;
			GPid _tmp14_ = 0;
			gint _tmp15_ = 0;
			FILE* f = NULL;
			FILE* _tmp16_;
			gchar* stdout_text = NULL;
			gchar* _tmp17_;
			gint stdout_text_length1;
			gint _stdout_text_size_;
			FILE* _tmp18_;
			gchar* _tmp19_;
			gint _tmp19__length1;
			const gchar* _tmp20_;
#line 638 "../src/menubar.vala"
			_tmp3_ = ug_settings_get_string (UG_SETTINGS_KEY_ONSCREEN_KEYBOARD_LAYOUT);
#line 638 "../src/menubar.vala"
			layout = _tmp3_;
#line 639 "../src/menubar.vala"
			_tmp4_ = layout;
#line 639 "../src/menubar.vala"
			_tmp5_ = g_file_new_for_path (_tmp4_);
#line 639 "../src/menubar.vala"
			file = _tmp5_;
#line 640 "../src/menubar.vala"
			_tmp6_ = file;
#line 640 "../src/menubar.vala"
			if (g_file_query_exists (_tmp6_, NULL)) {
#line 5666 "menubar.c"
				const gchar* _tmp7_;
				gchar* _tmp8_;
#line 641 "../src/menubar.vala"
				_tmp7_ = layout;
#line 641 "../src/menubar.vala"
				_tmp8_ = g_strdup_printf ("onboard --xid --layout='%s'", _tmp7_);
#line 641 "../src/menubar.vala"
				_g_free0 (cmd);
#line 641 "../src/menubar.vala"
				cmd = _tmp8_;
#line 5677 "menubar.c"
			} else {
				gchar* _tmp9_;
#line 644 "../src/menubar.vala"
				_tmp9_ = g_strdup ("onboard --xid");
#line 644 "../src/menubar.vala"
				_g_free0 (cmd);
#line 644 "../src/menubar.vala"
				cmd = _tmp9_;
#line 5686 "menubar.c"
			}
#line 646 "../src/menubar.vala"
			_tmp10_ = cmd;
#line 646 "../src/menubar.vala"
			g_shell_parse_argv (_tmp10_, &_tmp12_, &_tmp11_, &_inner_error0_);
#line 646 "../src/menubar.vala"
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 646 "../src/menubar.vala"
			argv = _tmp11_;
#line 646 "../src/menubar.vala"
			argv_length1 = _tmp12_;
#line 646 "../src/menubar.vala"
			_argv_size_ = argv_length1;
#line 646 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 646 "../src/menubar.vala"
				_g_object_unref0 (file);
#line 646 "../src/menubar.vala"
				_g_free0 (layout);
#line 646 "../src/menubar.vala"
				_g_free0 (cmd);
#line 646 "../src/menubar.vala"
				argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 5710 "menubar.c"
				goto __catch0_g_error;
			}
#line 647 "../src/menubar.vala"
			_tmp13_ = argv;
#line 647 "../src/menubar.vala"
			_tmp13__length1 = argv_length1;
#line 647 "../src/menubar.vala"
			g_spawn_async_with_pipes (NULL, _tmp13_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &_tmp14_, NULL, &_tmp15_, NULL, &_inner_error0_);
#line 647 "../src/menubar.vala"
			self->priv->keyboard_pid = _tmp14_;
#line 647 "../src/menubar.vala"
			onboard_stdout_fd = _tmp15_;
#line 647 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 647 "../src/menubar.vala"
				_g_object_unref0 (file);
#line 647 "../src/menubar.vala"
				_g_free0 (layout);
#line 647 "../src/menubar.vala"
				_g_free0 (cmd);
#line 647 "../src/menubar.vala"
				argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 5733 "menubar.c"
				goto __catch0_g_error;
			}
#line 656 "../src/menubar.vala"
			_tmp16_ = fdopen (onboard_stdout_fd, "r");
#line 656 "../src/menubar.vala"
			f = _tmp16_;
#line 657 "../src/menubar.vala"
			_tmp17_ = g_new0 (gchar, 1024);
#line 657 "../src/menubar.vala"
			stdout_text = _tmp17_;
#line 657 "../src/menubar.vala"
			stdout_text_length1 = 1024;
#line 657 "../src/menubar.vala"
			_stdout_text_size_ = stdout_text_length1;
#line 658 "../src/menubar.vala"
			_tmp18_ = f;
#line 658 "../src/menubar.vala"
			_tmp19_ = stdout_text;
#line 658 "../src/menubar.vala"
			_tmp19__length1 = stdout_text_length1;
#line 658 "../src/menubar.vala"
			_tmp20_ = fgets (_tmp19_, (gint) _tmp19__length1, _tmp18_);
#line 658 "../src/menubar.vala"
			if (_tmp20_ != NULL) {
#line 5758 "menubar.c"
				gchar* _tmp21_;
				gint _tmp21__length1;
#line 659 "../src/menubar.vala"
				_tmp21_ = stdout_text;
#line 659 "../src/menubar.vala"
				_tmp21__length1 = stdout_text_length1;
#line 659 "../src/menubar.vala"
				id = atoi ((const gchar*) _tmp21_);
#line 5767 "menubar.c"
			}
#line 633 "../src/menubar.vala"
			stdout_text = (g_free (stdout_text), NULL);
#line 633 "../src/menubar.vala"
			_fclose0 (f);
#line 633 "../src/menubar.vala"
			_g_object_unref0 (file);
#line 633 "../src/menubar.vala"
			_g_free0 (layout);
#line 633 "../src/menubar.vala"
			_g_free0 (cmd);
#line 633 "../src/menubar.vala"
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 5781 "menubar.c"
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp22_;
			const gchar* _tmp23_;
#line 633 "../src/menubar.vala"
			e = _inner_error0_;
#line 633 "../src/menubar.vala"
			_inner_error0_ = NULL;
#line 664 "../src/menubar.vala"
			_tmp22_ = e;
#line 664 "../src/menubar.vala"
			_tmp23_ = _tmp22_->message;
#line 664 "../src/menubar.vala"
			g_warning ("menubar.vala:664: Error setting up keyboard: %s", _tmp23_);
#line 665 "../src/menubar.vala"
			_g_error_free0 (e);
#line 665 "../src/menubar.vala"
			return;
#line 5803 "menubar.c"
		}
		__finally0:
#line 633 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 633 "../src/menubar.vala"
			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);
#line 633 "../src/menubar.vala"
			g_clear_error (&_inner_error0_);
#line 633 "../src/menubar.vala"
			return;
#line 5814 "menubar.c"
		}
#line 668 "../src/menubar.vala"
		_tmp24_ = (GtkSocket*) gtk_socket_new ();
#line 668 "../src/menubar.vala"
		g_object_ref_sink (_tmp24_);
#line 668 "../src/menubar.vala"
		keyboard_socket = _tmp24_;
#line 669 "../src/menubar.vala"
		_tmp25_ = keyboard_socket;
#line 669 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp25_);
#line 670 "../src/menubar.vala"
		_tmp26_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
#line 670 "../src/menubar.vala"
		g_object_ref_sink (_tmp26_);
#line 670 "../src/menubar.vala"
		_tmp27_ = _tmp26_;
#line 670 "../src/menubar.vala"
		menu_bar_set_keyboard_window (self, _tmp27_);
#line 670 "../src/menubar.vala"
		_g_object_unref0 (_tmp27_);
#line 671 "../src/menubar.vala"
		_tmp28_ = self->priv->_keyboard_window;
#line 671 "../src/menubar.vala"
		gtk_window_set_accept_focus (_tmp28_, FALSE);
#line 672 "../src/menubar.vala"
		_tmp29_ = self->priv->_keyboard_window;
#line 672 "../src/menubar.vala"
		gtk_window_set_focus_on_map (_tmp29_, FALSE);
#line 673 "../src/menubar.vala"
		_tmp30_ = self->priv->_keyboard_window;
#line 673 "../src/menubar.vala"
		_tmp31_ = keyboard_socket;
#line 673 "../src/menubar.vala"
		gtk_container_add ((GtkContainer*) _tmp30_, (GtkWidget*) _tmp31_);
#line 674 "../src/menubar.vala"
		_tmp32_ = keyboard_socket;
#line 674 "../src/menubar.vala"
		gtk_socket_add_id (_tmp32_, (Window) id);
#line 677 "../src/menubar.vala"
		_tmp33_ = gtk_widget_get_display ((GtkWidget*) self);
#line 677 "../src/menubar.vala"
		_tmp34_ = _g_object_ref0 (_tmp33_);
#line 677 "../src/menubar.vala"
		display = _tmp34_;
#line 678 "../src/menubar.vala"
		_tmp35_ = display;
#line 678 "../src/menubar.vala"
		_tmp36_ = gtk_widget_get_window ((GtkWidget*) self);
#line 678 "../src/menubar.vala"
		_tmp37_ = gdk_display_get_monitor_at_window (_tmp35_, _tmp36_);
#line 678 "../src/menubar.vala"
		_tmp38_ = _g_object_ref0 (_tmp37_);
#line 678 "../src/menubar.vala"
		monitor = _tmp38_;
#line 680 "../src/menubar.vala"
		_tmp39_ = monitor;
#line 680 "../src/menubar.vala"
		gdk_monitor_get_geometry (_tmp39_, &_tmp40_);
#line 680 "../src/menubar.vala"
		geom = _tmp40_;
#line 681 "../src/menubar.vala"
		_tmp41_ = self->priv->_keyboard_window;
#line 681 "../src/menubar.vala"
		_tmp42_ = geom;
#line 681 "../src/menubar.vala"
		_tmp43_ = geom;
#line 681 "../src/menubar.vala"
		_tmp44_ = geom;
#line 681 "../src/menubar.vala"
		gtk_window_move (_tmp41_, _tmp42_.x, (_tmp43_.y + _tmp44_.height) - 250);
#line 682 "../src/menubar.vala"
		_tmp45_ = self->priv->_keyboard_window;
#line 682 "../src/menubar.vala"
		_tmp46_ = geom;
#line 682 "../src/menubar.vala"
		gtk_window_resize (_tmp45_, _tmp46_.width, 250);
#line 629 "../src/menubar.vala"
		_g_object_unref0 (monitor);
#line 629 "../src/menubar.vala"
		_g_object_unref0 (display);
#line 629 "../src/menubar.vala"
		_g_object_unref0 (keyboard_socket);
#line 5898 "menubar.c"
	}
#line 685 "../src/menubar.vala"
	_tmp47_ = self->priv->_keyboard_window;
#line 685 "../src/menubar.vala"
	_tmp48_ = gtk_check_menu_item_get_active (item);
#line 685 "../src/menubar.vala"
	_tmp49_ = _tmp48_;
#line 685 "../src/menubar.vala"
	gtk_widget_set_visible ((GtkWidget*) _tmp47_, _tmp49_);
#line 5908 "menubar.c"
}

static void
menu_bar_high_contrast_toggled_cb (MenuBar* self,
                                   GtkCheckMenuItem* item)
{
	GtkSettings* settings = NULL;
	GtkSettings* _tmp0_;
	GtkSettings* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
#line 688 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 688 "../src/menubar.vala"
	g_return_if_fail (item != NULL);
#line 690 "../src/menubar.vala"
	_tmp0_ = gtk_settings_get_default ();
#line 690 "../src/menubar.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 690 "../src/menubar.vala"
	settings = _tmp1_;
#line 691 "../src/menubar.vala"
	_tmp2_ = gtk_check_menu_item_get_active (item);
#line 691 "../src/menubar.vala"
	_tmp3_ = _tmp2_;
#line 691 "../src/menubar.vala"
	if (_tmp3_) {
#line 5939 "menubar.c"
		GtkSettings* _tmp4_;
#line 692 "../src/menubar.vala"
		_tmp4_ = settings;
#line 692 "../src/menubar.vala"
		g_object_set ((GObject*) _tmp4_, "gtk-theme-name", "HighContrast", NULL);
#line 5945 "menubar.c"
	} else {
		GtkSettings* _tmp5_;
		const gchar* _tmp6_;
#line 694 "../src/menubar.vala"
		_tmp5_ = settings;
#line 694 "../src/menubar.vala"
		_tmp6_ = self->priv->default_theme_name;
#line 694 "../src/menubar.vala"
		g_object_set ((GObject*) _tmp5_, "gtk-theme-name", _tmp6_, NULL);
#line 5955 "menubar.c"
	}
#line 695 "../src/menubar.vala"
	_tmp7_ = gtk_check_menu_item_get_active (item);
#line 695 "../src/menubar.vala"
	_tmp8_ = _tmp7_;
#line 695 "../src/menubar.vala"
	menu_bar_set_high_contrast (self, _tmp8_);
#line 696 "../src/menubar.vala"
	_tmp9_ = self->priv->_high_contrast;
#line 696 "../src/menubar.vala"
	ug_settings_set_boolean (UG_SETTINGS_KEY_HIGH_CONTRAST, _tmp9_);
#line 688 "../src/menubar.vala"
	_g_object_unref0 (settings);
#line 5969 "menubar.c"
}

static gboolean
____lambda5_ (MenuBar* self)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	AtkObject* _tmp2_;
	gboolean result;
#line 729 "../src/menubar.vala"
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
#line 729 "../src/menubar.vala"
	_tmp1_ = gtk_window_get_focus (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL);
#line 729 "../src/menubar.vala"
	_tmp2_ = gtk_widget_get_accessible (_tmp1_);
#line 729 "../src/menubar.vala"
	g_signal_emit_by_name (_tmp2_, "focus-event", TRUE, NULL);
#line 730 "../src/menubar.vala"
	result = FALSE;
#line 730 "../src/menubar.vala"
	return result;
#line 5991 "menubar.c"
}

static gboolean
_____lambda5__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda5_ ((MenuBar*) self);
#line 728 "../src/menubar.vala"
	return result;
#line 6001 "menubar.c"
}

static void
menu_bar_screen_reader_toggled_cb (MenuBar* self,
                                   GtkCheckMenuItem* item)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GError* _inner_error0_ = NULL;
#line 699 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 699 "../src/menubar.vala"
	g_return_if_fail (item != NULL);
#line 701 "../src/menubar.vala"
	_tmp0_ = gtk_check_menu_item_get_active (item);
#line 701 "../src/menubar.vala"
	_tmp1_ = _tmp0_;
#line 701 "../src/menubar.vala"
	ug_settings_set_boolean (UG_SETTINGS_KEY_SCREEN_READER, _tmp1_);
#line 703 "../src/menubar.vala"
	_tmp2_ = gtk_check_menu_item_get_active (item);
#line 703 "../src/menubar.vala"
	_tmp3_ = _tmp2_;
#line 703 "../src/menubar.vala"
	if (_tmp3_) {
#line 6029 "menubar.c"
		{
			gchar** argv = NULL;
			gint argv_length1 = 0;
			gint _argv_size_ = 0;
			gchar** _tmp4_ = NULL;
			gint _tmp5_ = 0;
			gchar** _tmp6_;
			gint _tmp6__length1;
			GPid _tmp7_ = 0;
			SlickGreeter* _tmp8_;
#line 708 "../src/menubar.vala"
			g_shell_parse_argv ("orca --replace", &_tmp5_, &_tmp4_, &_inner_error0_);
#line 708 "../src/menubar.vala"
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 708 "../src/menubar.vala"
			argv = _tmp4_;
#line 708 "../src/menubar.vala"
			argv_length1 = _tmp5_;
#line 708 "../src/menubar.vala"
			_argv_size_ = argv_length1;
#line 708 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 708 "../src/menubar.vala"
				argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 6054 "menubar.c"
				goto __catch0_g_error;
			}
#line 709 "../src/menubar.vala"
			_tmp6_ = argv;
#line 709 "../src/menubar.vala"
			_tmp6__length1 = argv_length1;
#line 709 "../src/menubar.vala"
			g_spawn_async (NULL, _tmp6_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &_tmp7_, &_inner_error0_);
#line 709 "../src/menubar.vala"
			self->priv->reader_pid = _tmp7_;
#line 709 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 709 "../src/menubar.vala"
				argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 6069 "menubar.c"
				goto __catch0_g_error;
			}
#line 727 "../src/menubar.vala"
			_tmp8_ = slick_greeter_singleton;
#line 727 "../src/menubar.vala"
			_tmp8_->orca_needs_kick = TRUE;
#line 728 "../src/menubar.vala"
			g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, _____lambda5__gsource_func, g_object_ref (self), g_object_unref);
#line 705 "../src/menubar.vala"
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 6080 "menubar.c"
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp9_;
			const gchar* _tmp10_;
#line 705 "../src/menubar.vala"
			e = _inner_error0_;
#line 705 "../src/menubar.vala"
			_inner_error0_ = NULL;
#line 735 "../src/menubar.vala"
			_tmp9_ = e;
#line 735 "../src/menubar.vala"
			_tmp10_ = _tmp9_->message;
#line 735 "../src/menubar.vala"
			g_warning ("menubar.vala:735: Failed to run Orca: %s", _tmp10_);
#line 705 "../src/menubar.vala"
			_g_error_free0 (e);
#line 6100 "menubar.c"
		}
		__finally0:
#line 705 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 705 "../src/menubar.vala"
			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);
#line 705 "../src/menubar.vala"
			g_clear_error (&_inner_error0_);
#line 705 "../src/menubar.vala"
			return;
#line 6111 "menubar.c"
		}
	} else {
#line 739 "../src/menubar.vala"
		menu_bar_close_pid (self, &self->priv->reader_pid);
#line 6116 "menubar.c"
	}
}

Background*
menu_bar_get_background (MenuBar* self)
{
	Background* result;
	Background* _tmp0_;
#line 80 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 80 "../src/menubar.vala"
	_tmp0_ = self->priv->_background;
#line 80 "../src/menubar.vala"
	result = _tmp0_;
#line 80 "../src/menubar.vala"
	return result;
#line 6133 "menubar.c"
}

static void
menu_bar_set_background (MenuBar* self,
                         Background* value)
{
	Background* old_value;
#line 80 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 80 "../src/menubar.vala"
	old_value = menu_bar_get_background (self);
#line 80 "../src/menubar.vala"
	if (old_value != value) {
#line 6147 "menubar.c"
		Background* _tmp0_;
#line 80 "../src/menubar.vala"
		_tmp0_ = _g_object_ref0 (value);
#line 80 "../src/menubar.vala"
		_g_object_unref0 (self->priv->_background);
#line 80 "../src/menubar.vala"
		self->priv->_background = _tmp0_;
#line 80 "../src/menubar.vala"
		g_object_notify_by_pspec ((GObject *) self, menu_bar_properties[MENU_BAR_BACKGROUND_PROPERTY]);
#line 6157 "menubar.c"
	}
}

gboolean
menu_bar_get_high_contrast (MenuBar* self)
{
	gboolean result;
#line 81 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 81 "../src/menubar.vala"
	result = self->priv->_high_contrast;
#line 81 "../src/menubar.vala"
	return result;
#line 6171 "menubar.c"
}

static void
menu_bar_set_high_contrast (MenuBar* self,
                            gboolean value)
{
	gboolean old_value;
#line 81 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 81 "../src/menubar.vala"
	old_value = menu_bar_get_high_contrast (self);
#line 81 "../src/menubar.vala"
	if (old_value != value) {
#line 81 "../src/menubar.vala"
		self->priv->_high_contrast = value;
#line 81 "../src/menubar.vala"
		g_object_notify_by_pspec ((GObject *) self, menu_bar_properties[MENU_BAR_HIGH_CONTRAST_PROPERTY]);
#line 6189 "menubar.c"
	}
}

GtkWindow*
menu_bar_get_keyboard_window (MenuBar* self)
{
	GtkWindow* result;
	GtkWindow* _tmp0_;
#line 82 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 82 "../src/menubar.vala"
	_tmp0_ = self->priv->_keyboard_window;
#line 82 "../src/menubar.vala"
	result = _tmp0_;
#line 82 "../src/menubar.vala"
	return result;
#line 6206 "menubar.c"
}

static void
menu_bar_set_keyboard_window (MenuBar* self,
                              GtkWindow* value)
{
	GtkWindow* old_value;
#line 82 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 82 "../src/menubar.vala"
	old_value = menu_bar_get_keyboard_window (self);
#line 82 "../src/menubar.vala"
	if (old_value != value) {
#line 6220 "menubar.c"
		GtkWindow* _tmp0_;
#line 82 "../src/menubar.vala"
		_tmp0_ = _g_object_ref0 (value);
#line 82 "../src/menubar.vala"
		_g_object_unref0 (self->priv->_keyboard_window);
#line 82 "../src/menubar.vala"
		self->priv->_keyboard_window = _tmp0_;
#line 82 "../src/menubar.vala"
		g_object_notify_by_pspec ((GObject *) self, menu_bar_properties[MENU_BAR_KEYBOARD_WINDOW_PROPERTY]);
#line 6230 "menubar.c"
	}
}

GtkAccelGroup*
menu_bar_get_accel_group (MenuBar* self)
{
	GtkAccelGroup* result;
	GtkAccelGroup* _tmp0_;
#line 83 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 83 "../src/menubar.vala"
	_tmp0_ = self->priv->_accel_group;
#line 83 "../src/menubar.vala"
	result = _tmp0_;
#line 83 "../src/menubar.vala"
	return result;
#line 6247 "menubar.c"
}

static void
menu_bar_set_accel_group (MenuBar* self,
                          GtkAccelGroup* value)
{
	GtkAccelGroup* old_value;
#line 83 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 83 "../src/menubar.vala"
	old_value = menu_bar_get_accel_group (self);
#line 83 "../src/menubar.vala"
	if (old_value != value) {
#line 6261 "menubar.c"
		GtkAccelGroup* _tmp0_;
#line 83 "../src/menubar.vala"
		_tmp0_ = _g_object_ref0 (value);
#line 83 "../src/menubar.vala"
		_g_object_unref0 (self->priv->_accel_group);
#line 83 "../src/menubar.vala"
		self->priv->_accel_group = _tmp0_;
#line 83 "../src/menubar.vala"
		g_object_notify_by_pspec ((GObject *) self, menu_bar_properties[MENU_BAR_ACCEL_GROUP_PROPERTY]);
#line 6271 "menubar.c"
	}
}

MainWindow*
menu_bar_get_main_window (MenuBar* self)
{
	MainWindow* result;
	MainWindow* _tmp0_;
#line 84 "../src/menubar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 84 "../src/menubar.vala"
	_tmp0_ = self->priv->_main_window;
#line 84 "../src/menubar.vala"
	result = _tmp0_;
#line 84 "../src/menubar.vala"
	return result;
#line 6288 "menubar.c"
}

static void
menu_bar_set_main_window (MenuBar* self,
                          MainWindow* value)
{
	MainWindow* old_value;
#line 84 "../src/menubar.vala"
	g_return_if_fail (self != NULL);
#line 84 "../src/menubar.vala"
	old_value = menu_bar_get_main_window (self);
#line 84 "../src/menubar.vala"
	if (old_value != value) {
#line 6302 "menubar.c"
		MainWindow* _tmp0_;
#line 84 "../src/menubar.vala"
		_tmp0_ = _g_object_ref0 (value);
#line 84 "../src/menubar.vala"
		_g_object_unref0 (self->priv->_main_window);
#line 84 "../src/menubar.vala"
		self->priv->_main_window = _tmp0_;
#line 84 "../src/menubar.vala"
		g_object_notify_by_pspec ((GObject *) self, menu_bar_properties[MENU_BAR_MAIN_WINDOW_PROPERTY]);
#line 6312 "menubar.c"
	}
}

static void
_menu_bar_rebuild_background_g_object_notify (GObject* _sender,
                                              GParamSpec* pspec,
                                              gpointer self)
{
#line 188 "../src/menubar.vala"
	menu_bar_rebuild_background ((MenuBar*) self);
#line 6323 "menubar.c"
}

static gboolean
_menu_bar_update_clock_gsource_func (gpointer self)
{
	gboolean result;
	result = menu_bar_update_clock ((MenuBar*) self);
#line 211 "../src/menubar.vala"
	return result;
#line 6333 "menubar.c"
}

static void
_menu_bar_on_power_device_added_upower_daemon_device_added (UPowerDaemon* _sender,
                                                            const char* device,
                                                            gpointer self)
{
#line 236 "../src/menubar.vala"
	menu_bar_on_power_device_added ((MenuBar*) self, device);
#line 6343 "menubar.c"
}

static void
_menu_bar_on_power_device_removed_upower_daemon_device_removed (UPowerDaemon* _sender,
                                                                const char* device,
                                                                gpointer self)
{
#line 237 "../src/menubar.vala"
	menu_bar_on_power_device_removed ((MenuBar*) self, device);
#line 6353 "menubar.c"
}

static void
_menu_bar_on_power_device_changed_upower_daemon_device_changed (UPowerDaemon* _sender,
                                                                const char* device,
                                                                gpointer self)
{
#line 238 "../src/menubar.vala"
	menu_bar_on_power_device_changed ((MenuBar*) self, device);
#line 6363 "menubar.c"
}

static void
_menu_bar_on_changed_upower_daemon_changed (UPowerDaemon* _sender,
                                            gpointer self)
{
#line 239 "../src/menubar.vala"
	menu_bar_on_changed ((MenuBar*) self);
#line 6372 "menubar.c"
}

static void
_menu_bar_on_sleeping_upower_daemon_sleeping (UPowerDaemon* _sender,
                                              gpointer self)
{
#line 240 "../src/menubar.vala"
	menu_bar_on_sleeping ((MenuBar*) self);
#line 6381 "menubar.c"
}

static void
_menu_bar_on_resuming_upower_daemon_resuming (UPowerDaemon* _sender,
                                              gpointer self)
{
#line 241 "../src/menubar.vala"
	menu_bar_on_resuming ((MenuBar*) self);
#line 6390 "menubar.c"
}

static gboolean
_menu_bar_query_upower_daemon_gsource_func (gpointer self)
{
	gboolean result;
	result = menu_bar_query_upower_daemon ((MenuBar*) self);
#line 243 "../src/menubar.vala"
	return result;
#line 6400 "menubar.c"
}

static void
_menu_bar_cleanup_slick_greeter_starting_session (SlickGreeter* _sender,
                                                  gpointer self)
{
#line 288 "../src/menubar.vala"
	menu_bar_cleanup ((MenuBar*) self);
#line 6409 "menubar.c"
}

static GObject *
menu_bar_constructor (GType type,
                      guint n_construct_properties,
                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	MenuBar * self;
	GtkSettings* _tmp0_;
	gchar* _tmp1_ = NULL;
	Background* _tmp2_;
	SlickGreeter* _tmp82_;
	GError* _inner_error0_ = NULL;
#line 179 "../src/menubar.vala"
	parent_class = G_OBJECT_CLASS (menu_bar_parent_class);
#line 179 "../src/menubar.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 179 "../src/menubar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MENU_BAR, MenuBar);
#line 181 "../src/menubar.vala"
	_tmp0_ = gtk_settings_get_default ();
#line 181 "../src/menubar.vala"
	g_object_get ((GObject*) _tmp0_, "gtk-theme-name", &_tmp1_, NULL);
#line 181 "../src/menubar.vala"
	_g_free0 (self->priv->default_theme_name);
#line 181 "../src/menubar.vala"
	self->priv->default_theme_name = _tmp1_;
#line 183 "../src/menubar.vala"
	gtk_menu_bar_set_pack_direction ((GtkMenuBar*) self, GTK_PACK_DIRECTION_RTL);
#line 186 "../src/menubar.vala"
	_tmp2_ = self->priv->_background;
#line 186 "../src/menubar.vala"
	if (_tmp2_ != NULL) {
#line 6445 "menubar.c"
		Background* _tmp3_;
		Background* _tmp4_;
#line 188 "../src/menubar.vala"
		_tmp3_ = self->priv->_background;
#line 188 "../src/menubar.vala"
		g_signal_connect_object ((GObject*) _tmp3_, "notify::alpha", (GCallback) _menu_bar_rebuild_background_g_object_notify, self, 0);
#line 189 "../src/menubar.vala"
		_tmp4_ = self->priv->_background;
#line 189 "../src/menubar.vala"
		g_signal_connect_object ((GObject*) _tmp4_, "notify::average-color", (GCallback) _menu_bar_rebuild_background_g_object_notify, self, 0);
#line 6456 "menubar.c"
	}
#line 192 "../src/menubar.vala"
	if (ug_settings_get_boolean (UG_SETTINGS_KEY_SHOW_QUIT)) {
#line 6460 "menubar.c"
		GtkMenuItem* session_menu = NULL;
		GtkMenuItem* _tmp5_;
		GtkMenuItem* _tmp6_;
#line 194 "../src/menubar.vala"
		_tmp5_ = menu_bar_make_session_item (self);
#line 194 "../src/menubar.vala"
		session_menu = _tmp5_;
#line 195 "../src/menubar.vala"
		_tmp6_ = session_menu;
#line 195 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) self, _tmp6_);
#line 192 "../src/menubar.vala"
		_g_object_unref0 (session_menu);
#line 6474 "menubar.c"
	}
#line 198 "../src/menubar.vala"
	if (ug_settings_get_boolean (UG_SETTINGS_KEY_SHOW_CLOCK)) {
#line 6478 "menubar.c"
		GtkLabel* _tmp7_;
		GdkRGBA clock_fg = {0};
		GtkLabel* _tmp8_;
		GtkStyleContext* _tmp9_;
		GdkRGBA _tmp10_ = {0};
		GtkLabel* _tmp11_;
		GdkRGBA _tmp12_;
		GtkLabel* _tmp13_;
		GtkMenuItem* item = NULL;
		GtkMenuItem* _tmp14_;
		GtkMenuItem* _tmp15_;
		GtkLabel* _tmp16_;
		GtkMenuItem* _tmp17_;
		GtkMenuItem* _tmp18_;
		GtkMenuItem* _tmp19_;
		gchar* _tmp20_;
#line 200 "../src/menubar.vala"
		_tmp7_ = (GtkLabel*) gtk_label_new ("");
#line 200 "../src/menubar.vala"
		g_object_ref_sink (_tmp7_);
#line 200 "../src/menubar.vala"
		_g_object_unref0 (self->priv->clock_label);
#line 200 "../src/menubar.vala"
		self->priv->clock_label = _tmp7_;
#line 201 "../src/menubar.vala"
		_tmp8_ = self->priv->clock_label;
#line 201 "../src/menubar.vala"
		_tmp9_ = gtk_widget_get_style_context ((GtkWidget*) _tmp8_);
#line 201 "../src/menubar.vala"
		gtk_style_context_get_color (_tmp9_, GTK_STATE_FLAG_NORMAL, &_tmp10_);
#line 201 "../src/menubar.vala"
		clock_fg = _tmp10_;
#line 202 "../src/menubar.vala"
		_tmp11_ = self->priv->clock_label;
#line 202 "../src/menubar.vala"
		_tmp12_ = clock_fg;
#line 202 "../src/menubar.vala"
		gtk_widget_override_color ((GtkWidget*) _tmp11_, GTK_STATE_FLAG_INSENSITIVE, &_tmp12_);
#line 203 "../src/menubar.vala"
		_tmp13_ = self->priv->clock_label;
#line 203 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp13_);
#line 204 "../src/menubar.vala"
		_tmp14_ = (GtkMenuItem*) gtk_menu_item_new ();
#line 204 "../src/menubar.vala"
		g_object_ref_sink (_tmp14_);
#line 204 "../src/menubar.vala"
		item = _tmp14_;
#line 205 "../src/menubar.vala"
		_tmp15_ = item;
#line 205 "../src/menubar.vala"
		_tmp16_ = self->priv->clock_label;
#line 205 "../src/menubar.vala"
		gtk_container_add ((GtkContainer*) _tmp15_, (GtkWidget*) _tmp16_);
#line 206 "../src/menubar.vala"
		_tmp17_ = item;
#line 206 "../src/menubar.vala"
		gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, FALSE);
#line 207 "../src/menubar.vala"
		_tmp18_ = item;
#line 207 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp18_);
#line 208 "../src/menubar.vala"
		_tmp19_ = item;
#line 208 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) self, _tmp19_);
#line 209 "../src/menubar.vala"
		_tmp20_ = ug_settings_get_string (UG_SETTINGS_KEY_CLOCK_FORMAT);
#line 209 "../src/menubar.vala"
		_g_free0 (self->priv->clock_format);
#line 209 "../src/menubar.vala"
		self->priv->clock_format = _tmp20_;
#line 210 "../src/menubar.vala"
		menu_bar_update_clock (self);
#line 211 "../src/menubar.vala"
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1000, _menu_bar_update_clock_gsource_func, g_object_ref (self), g_object_unref);
#line 198 "../src/menubar.vala"
		_g_object_unref0 (item);
#line 6557 "menubar.c"
	}
#line 214 "../src/menubar.vala"
	if (ug_settings_get_boolean (UG_SETTINGS_KEY_SHOW_POWER)) {
#line 6561 "menubar.c"
		GtkMenuItem* _tmp21_;
		GtkBox* hbox = NULL;
		GtkBox* _tmp22_;
		GtkBox* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		GtkImage* _tmp26_;
		GtkImage* _tmp27_;
		GtkBox* _tmp28_;
		GtkImage* _tmp29_;
		GtkBox* _tmp30_;
		GtkLabel* _tmp31_;
		GtkLabel* _tmp32_;
		GdkRGBA power_fg = {0};
		GtkLabel* _tmp33_;
		GtkStyleContext* _tmp34_;
		GdkRGBA _tmp35_ = {0};
		GtkLabel* _tmp36_;
		GdkRGBA _tmp37_;
		GtkLabel* _tmp38_;
		GtkBox* _tmp39_;
		GtkLabel* _tmp40_;
		GtkMenuItem* _tmp41_;
		GtkBox* _tmp42_;
		GtkMenuItem* _tmp43_;
		GtkMenuItem* _tmp44_;
#line 216 "../src/menubar.vala"
		_tmp21_ = (GtkMenuItem*) gtk_menu_item_new ();
#line 216 "../src/menubar.vala"
		g_object_ref_sink (_tmp21_);
#line 216 "../src/menubar.vala"
		_g_object_unref0 (self->priv->power_menu_item);
#line 216 "../src/menubar.vala"
		self->priv->power_menu_item = _tmp21_;
#line 217 "../src/menubar.vala"
		_tmp22_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
#line 217 "../src/menubar.vala"
		g_object_ref_sink (_tmp22_);
#line 217 "../src/menubar.vala"
		hbox = _tmp22_;
#line 218 "../src/menubar.vala"
		_tmp23_ = hbox;
#line 218 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp23_);
#line 219 "../src/menubar.vala"
		_tmp24_ = g_build_filename (PKGDATADIR, "battery.svg", NULL);
#line 219 "../src/menubar.vala"
		_tmp25_ = _tmp24_;
#line 219 "../src/menubar.vala"
		_tmp26_ = (GtkImage*) gtk_image_new_from_file (_tmp25_);
#line 219 "../src/menubar.vala"
		g_object_ref_sink (_tmp26_);
#line 219 "../src/menubar.vala"
		_g_object_unref0 (self->priv->power_icon);
#line 219 "../src/menubar.vala"
		self->priv->power_icon = _tmp26_;
#line 219 "../src/menubar.vala"
		_g_free0 (_tmp25_);
#line 220 "../src/menubar.vala"
		_tmp27_ = self->priv->power_icon;
#line 220 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp27_);
#line 221 "../src/menubar.vala"
		_tmp28_ = hbox;
#line 221 "../src/menubar.vala"
		_tmp29_ = self->priv->power_icon;
#line 221 "../src/menubar.vala"
		gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
#line 222 "../src/menubar.vala"
		_tmp30_ = hbox;
#line 222 "../src/menubar.vala"
		gtk_box_set_spacing (_tmp30_, 6);
#line 223 "../src/menubar.vala"
		_tmp31_ = (GtkLabel*) gtk_label_new ("");
#line 223 "../src/menubar.vala"
		g_object_ref_sink (_tmp31_);
#line 223 "../src/menubar.vala"
		_g_object_unref0 (self->priv->power_label);
#line 223 "../src/menubar.vala"
		self->priv->power_label = _tmp31_;
#line 224 "../src/menubar.vala"
		_tmp32_ = self->priv->power_label;
#line 224 "../src/menubar.vala"
		gtk_widget_set_sensitive ((GtkWidget*) _tmp32_, FALSE);
#line 225 "../src/menubar.vala"
		_tmp33_ = self->priv->power_label;
#line 225 "../src/menubar.vala"
		_tmp34_ = gtk_widget_get_style_context ((GtkWidget*) _tmp33_);
#line 225 "../src/menubar.vala"
		gtk_style_context_get_color (_tmp34_, GTK_STATE_FLAG_NORMAL, &_tmp35_);
#line 225 "../src/menubar.vala"
		power_fg = _tmp35_;
#line 226 "../src/menubar.vala"
		_tmp36_ = self->priv->power_label;
#line 226 "../src/menubar.vala"
		_tmp37_ = power_fg;
#line 226 "../src/menubar.vala"
		gtk_widget_override_color ((GtkWidget*) _tmp36_, GTK_STATE_FLAG_INSENSITIVE, &_tmp37_);
#line 227 "../src/menubar.vala"
		_tmp38_ = self->priv->power_label;
#line 227 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp38_);
#line 228 "../src/menubar.vala"
		_tmp39_ = hbox;
#line 228 "../src/menubar.vala"
		_tmp40_ = self->priv->power_label;
#line 228 "../src/menubar.vala"
		gtk_container_add ((GtkContainer*) _tmp39_, (GtkWidget*) _tmp40_);
#line 229 "../src/menubar.vala"
		_tmp41_ = self->priv->power_menu_item;
#line 229 "../src/menubar.vala"
		_tmp42_ = hbox;
#line 229 "../src/menubar.vala"
		gtk_container_add ((GtkContainer*) _tmp41_, (GtkWidget*) _tmp42_);
#line 230 "../src/menubar.vala"
		_tmp43_ = self->priv->power_menu_item;
#line 230 "../src/menubar.vala"
		gtk_widget_hide ((GtkWidget*) _tmp43_);
#line 231 "../src/menubar.vala"
		_tmp44_ = self->priv->power_menu_item;
#line 231 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) self, _tmp44_);
#line 6684 "menubar.c"
		{
			UPowerDaemon* _tmp45_ = NULL;
			UPowerDaemon* _tmp46_;
			UPowerDaemon* _tmp47_;
			UPowerDaemon* _tmp48_;
			UPowerDaemon* _tmp49_;
			UPowerDaemon* _tmp50_;
			UPowerDaemon* _tmp51_;
			UPowerDaemon* _tmp52_;
			UPowerDaemon* _tmp53_;
#line 235 "../src/menubar.vala"
			_tmp46_ = (UPowerDaemon*) g_initable_new (UPOWER_TYPE_DAEMON_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.UPower", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", "/org/freedesktop/UPower", "g-interface-name", "org.freedesktop.UPower", NULL);
#line 235 "../src/menubar.vala"
			_tmp45_ = (UPowerDaemon*) _tmp46_;
#line 235 "../src/menubar.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 235 "../src/menubar.vala"
				if (_inner_error0_->domain == G_IO_ERROR) {
#line 6703 "menubar.c"
					goto __catch0_g_io_error;
				}
#line 235 "../src/menubar.vala"
				_g_object_unref0 (hbox);
#line 235 "../src/menubar.vala"
				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);
#line 235 "../src/menubar.vala"
				g_clear_error (&_inner_error0_);
#line 6712 "menubar.c"
			}
#line 235 "../src/menubar.vala"
			_tmp47_ = _tmp45_;
#line 235 "../src/menubar.vala"
			_tmp45_ = NULL;
#line 235 "../src/menubar.vala"
			_g_object_unref0 (self->priv->upowerd);
#line 235 "../src/menubar.vala"
			self->priv->upowerd = _tmp47_;
#line 236 "../src/menubar.vala"
			_tmp48_ = self->priv->upowerd;
#line 236 "../src/menubar.vala"
			g_signal_connect_object (_tmp48_, "device-added", (GCallback) _menu_bar_on_power_device_added_upower_daemon_device_added, self, 0);
#line 237 "../src/menubar.vala"
			_tmp49_ = self->priv->upowerd;
#line 237 "../src/menubar.vala"
			g_signal_connect_object (_tmp49_, "device-removed", (GCallback) _menu_bar_on_power_device_removed_upower_daemon_device_removed, self, 0);
#line 238 "../src/menubar.vala"
			_tmp50_ = self->priv->upowerd;
#line 238 "../src/menubar.vala"
			g_signal_connect_object (_tmp50_, "device-changed", (GCallback) _menu_bar_on_power_device_changed_upower_daemon_device_changed, self, 0);
#line 239 "../src/menubar.vala"
			_tmp51_ = self->priv->upowerd;
#line 239 "../src/menubar.vala"
			g_signal_connect_object (_tmp51_, "changed", (GCallback) _menu_bar_on_changed_upower_daemon_changed, self, 0);
#line 240 "../src/menubar.vala"
			_tmp52_ = self->priv->upowerd;
#line 240 "../src/menubar.vala"
			g_signal_connect_object (_tmp52_, "sleeping", (GCallback) _menu_bar_on_sleeping_upower_daemon_sleeping, self, 0);
#line 241 "../src/menubar.vala"
			_tmp53_ = self->priv->upowerd;
#line 241 "../src/menubar.vala"
			g_signal_connect_object (_tmp53_, "resuming", (GCallback) _menu_bar_on_resuming_upower_daemon_resuming, self, 0);
#line 242 "../src/menubar.vala"
			menu_bar_query_upower_daemon (self);
#line 243 "../src/menubar.vala"
			g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 60000, _menu_bar_query_upower_daemon_gsource_func, g_object_ref (self), g_object_unref);
#line 233 "../src/menubar.vala"
			_g_object_unref0 (_tmp45_);
#line 6752 "menubar.c"
		}
		goto __finally0;
		__catch0_g_io_error:
		{
			GError* e = NULL;
			GError* _tmp54_;
			const gchar* _tmp55_;
#line 233 "../src/menubar.vala"
			e = _inner_error0_;
#line 233 "../src/menubar.vala"
			_inner_error0_ = NULL;
#line 246 "../src/menubar.vala"
			_tmp54_ = e;
#line 246 "../src/menubar.vala"
			_tmp55_ = _tmp54_->message;
#line 246 "../src/menubar.vala"
			g_warning ("menubar.vala:246: Could not connect to Upower: %s", _tmp55_);
#line 233 "../src/menubar.vala"
			_g_error_free0 (e);
#line 6772 "menubar.c"
		}
		__finally0:
#line 233 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 233 "../src/menubar.vala"
			_g_object_unref0 (hbox);
#line 233 "../src/menubar.vala"
			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);
#line 233 "../src/menubar.vala"
			g_clear_error (&_inner_error0_);
#line 6783 "menubar.c"
		}
#line 214 "../src/menubar.vala"
		_g_object_unref0 (hbox);
#line 6787 "menubar.c"
	}
#line 250 "../src/menubar.vala"
	if (ug_settings_get_boolean (UG_SETTINGS_KEY_SHOW_KEYBOARD)) {
#line 6791 "menubar.c"
		GtkMenuItem* keyboard_menu = NULL;
		GtkMenuItem* _tmp56_;
		GtkMenuItem* _tmp57_;
#line 252 "../src/menubar.vala"
		_tmp56_ = menu_bar_make_keyboard_item (self);
#line 252 "../src/menubar.vala"
		keyboard_menu = _tmp56_;
#line 253 "../src/menubar.vala"
		_tmp57_ = keyboard_menu;
#line 253 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) self, _tmp57_);
#line 250 "../src/menubar.vala"
		_g_object_unref0 (keyboard_menu);
#line 6805 "menubar.c"
	}
#line 256 "../src/menubar.vala"
	if (ug_settings_get_boolean (UG_SETTINGS_KEY_SHOW_A11Y)) {
#line 6809 "menubar.c"
		GtkMenuItem* a11y_item = NULL;
		GtkMenuItem* _tmp58_;
		GtkMenuItem* _tmp59_;
#line 258 "../src/menubar.vala"
		_tmp58_ = menu_bar_make_a11y_item (self);
#line 258 "../src/menubar.vala"
		a11y_item = _tmp58_;
#line 259 "../src/menubar.vala"
		_tmp59_ = a11y_item;
#line 259 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) self, _tmp59_);
#line 256 "../src/menubar.vala"
		_g_object_unref0 (a11y_item);
#line 6823 "menubar.c"
	}
#line 262 "../src/menubar.vala"
	if (ug_settings_get_boolean (UG_SETTINGS_KEY_SHOW_HOSTNAME)) {
#line 6827 "menubar.c"
		GtkLabel* label = NULL;
		struct utsname _tmp60_ = {0};
		const gchar* _tmp61_;
		GtkLabel* _tmp62_;
		GdkRGBA hostname_fg = {0};
		GtkLabel* _tmp63_;
		GtkStyleContext* _tmp64_;
		GdkRGBA _tmp65_ = {0};
		GtkLabel* _tmp66_;
		GdkRGBA _tmp67_;
		GtkLabel* _tmp68_;
		GtkMenuItem* hostname_item = NULL;
		GtkMenuItem* _tmp69_;
		GtkMenuItem* _tmp70_;
		GtkLabel* _tmp71_;
		GtkMenuItem* _tmp72_;
		GtkMenuItem* _tmp73_;
		GtkMenuItem* _tmp74_;
		GtkMenuItem* _tmp75_;
#line 264 "../src/menubar.vala"
		uname (&_tmp60_);
#line 264 "../src/menubar.vala"
		_tmp61_ = _tmp60_.nodename;
#line 264 "../src/menubar.vala"
		_tmp62_ = (GtkLabel*) gtk_label_new (_tmp61_);
#line 264 "../src/menubar.vala"
		g_object_ref_sink (_tmp62_);
#line 264 "../src/menubar.vala"
		label = _tmp62_;
#line 265 "../src/menubar.vala"
		_tmp63_ = label;
#line 265 "../src/menubar.vala"
		_tmp64_ = gtk_widget_get_style_context ((GtkWidget*) _tmp63_);
#line 265 "../src/menubar.vala"
		gtk_style_context_get_color (_tmp64_, GTK_STATE_FLAG_NORMAL, &_tmp65_);
#line 265 "../src/menubar.vala"
		hostname_fg = _tmp65_;
#line 266 "../src/menubar.vala"
		_tmp66_ = label;
#line 266 "../src/menubar.vala"
		_tmp67_ = hostname_fg;
#line 266 "../src/menubar.vala"
		gtk_widget_override_color ((GtkWidget*) _tmp66_, GTK_STATE_FLAG_INSENSITIVE, &_tmp67_);
#line 267 "../src/menubar.vala"
		_tmp68_ = label;
#line 267 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp68_);
#line 268 "../src/menubar.vala"
		_tmp69_ = (GtkMenuItem*) gtk_menu_item_new ();
#line 268 "../src/menubar.vala"
		g_object_ref_sink (_tmp69_);
#line 268 "../src/menubar.vala"
		hostname_item = _tmp69_;
#line 269 "../src/menubar.vala"
		_tmp70_ = hostname_item;
#line 269 "../src/menubar.vala"
		_tmp71_ = label;
#line 269 "../src/menubar.vala"
		gtk_container_add ((GtkContainer*) _tmp70_, (GtkWidget*) _tmp71_);
#line 270 "../src/menubar.vala"
		_tmp72_ = hostname_item;
#line 270 "../src/menubar.vala"
		gtk_widget_set_sensitive ((GtkWidget*) _tmp72_, FALSE);
#line 271 "../src/menubar.vala"
		_tmp73_ = hostname_item;
#line 271 "../src/menubar.vala"
		gtk_menu_item_set_right_justified (_tmp73_, TRUE);
#line 272 "../src/menubar.vala"
		_tmp74_ = hostname_item;
#line 272 "../src/menubar.vala"
		gtk_widget_show ((GtkWidget*) _tmp74_);
#line 273 "../src/menubar.vala"
		_tmp75_ = hostname_item;
#line 273 "../src/menubar.vala"
		gtk_menu_shell_append ((GtkMenuShell*) self, _tmp75_);
#line 262 "../src/menubar.vala"
		_g_object_unref0 (hostname_item);
#line 262 "../src/menubar.vala"
		_g_object_unref0 (label);
#line 6907 "menubar.c"
	}
	{
		GtkCssProvider* style = NULL;
		GtkCssProvider* _tmp76_;
		GtkCssProvider* _tmp77_;
		GtkStyleContext* _tmp78_;
		GtkCssProvider* _tmp79_;
#line 279 "../src/menubar.vala"
		_tmp76_ = gtk_css_provider_new ();
#line 279 "../src/menubar.vala"
		style = _tmp76_;
#line 280 "../src/menubar.vala"
		_tmp77_ = style;
#line 280 "../src/menubar.vala"
		gtk_css_provider_load_from_data (_tmp77_, "* {-GtkWidget-window-dragging: false;}", (gssize) -1, &_inner_error0_);
#line 280 "../src/menubar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 280 "../src/menubar.vala"
			_g_object_unref0 (style);
#line 6927 "menubar.c"
			goto __catch1_g_error;
		}
#line 281 "../src/menubar.vala"
		_tmp78_ = gtk_widget_get_style_context ((GtkWidget*) self);
#line 281 "../src/menubar.vala"
		_tmp79_ = style;
#line 281 "../src/menubar.vala"
		gtk_style_context_add_provider (_tmp78_, (GtkStyleProvider*) _tmp79_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
#line 277 "../src/menubar.vala"
		_g_object_unref0 (style);
#line 6938 "menubar.c"
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp80_;
		const gchar* _tmp81_;
#line 277 "../src/menubar.vala"
		e = _inner_error0_;
#line 277 "../src/menubar.vala"
		_inner_error0_ = NULL;
#line 285 "../src/menubar.vala"
		_tmp80_ = e;
#line 285 "../src/menubar.vala"
		_tmp81_ = _tmp80_->message;
#line 285 "../src/menubar.vala"
		g_debug ("menubar.vala:285: Internal error loading menubar style: %s", _tmp81_);
#line 277 "../src/menubar.vala"
		_g_error_free0 (e);
#line 6958 "menubar.c"
	}
	__finally1:
#line 277 "../src/menubar.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 277 "../src/menubar.vala"
		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);
#line 277 "../src/menubar.vala"
		g_clear_error (&_inner_error0_);
#line 6967 "menubar.c"
	}
#line 288 "../src/menubar.vala"
	_tmp82_ = slick_greeter_singleton;
#line 288 "../src/menubar.vala"
	g_signal_connect_object (_tmp82_, "starting-session", (GCallback) _menu_bar_cleanup_slick_greeter_starting_session, self, 0);
#line 179 "../src/menubar.vala"
	return obj;
#line 6975 "menubar.c"
}

static void
menu_bar_class_init (MenuBarClass * klass,
                     gpointer klass_data)
{
#line 78 "../src/menubar.vala"
	menu_bar_parent_class = g_type_class_peek_parent (klass);
#line 78 "../src/menubar.vala"
	g_type_class_adjust_private_offset (klass, &MenuBar_private_offset);
#line 78 "../src/menubar.vala"
	((GtkWidgetClass *) klass)->draw = (gboolean (*) (GtkWidget*, cairo_t*)) menu_bar_real_draw;
#line 78 "../src/menubar.vala"
	((GtkWidgetClass *) klass)->get_preferred_height = (void (*) (GtkWidget*, gint*, gint*)) menu_bar_real_get_preferred_height;
#line 78 "../src/menubar.vala"
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, GtkAllocation*)) menu_bar_real_size_allocate;
#line 78 "../src/menubar.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_menu_bar_get_property;
#line 78 "../src/menubar.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_menu_bar_set_property;
#line 78 "../src/menubar.vala"
	G_OBJECT_CLASS (klass)->constructor = menu_bar_constructor;
#line 78 "../src/menubar.vala"
	G_OBJECT_CLASS (klass)->finalize = menu_bar_finalize;
#line 78 "../src/menubar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MENU_BAR_BACKGROUND_PROPERTY, menu_bar_properties[MENU_BAR_BACKGROUND_PROPERTY] = g_param_spec_object ("background", "background", "background", TYPE_BACKGROUND, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 78 "../src/menubar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MENU_BAR_HIGH_CONTRAST_PROPERTY, menu_bar_properties[MENU_BAR_HIGH_CONTRAST_PROPERTY] = g_param_spec_boolean ("high-contrast", "high-contrast", "high-contrast", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
#line 78 "../src/menubar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MENU_BAR_KEYBOARD_WINDOW_PROPERTY, menu_bar_properties[MENU_BAR_KEYBOARD_WINDOW_PROPERTY] = g_param_spec_object ("keyboard-window", "keyboard-window", "keyboard-window", gtk_window_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
#line 78 "../src/menubar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MENU_BAR_ACCEL_GROUP_PROPERTY, menu_bar_properties[MENU_BAR_ACCEL_GROUP_PROPERTY] = g_param_spec_object ("accel-group", "accel-group", "accel-group", gtk_accel_group_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 78 "../src/menubar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MENU_BAR_MAIN_WINDOW_PROPERTY, menu_bar_properties[MENU_BAR_MAIN_WINDOW_PROPERTY] = g_param_spec_object ("main-window", "main-window", "main-window", TYPE_MAIN_WINDOW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 7010 "menubar.c"
}

static void
menu_bar_instance_init (MenuBar * self,
                        gpointer klass)
{
#line 78 "../src/menubar.vala"
	self->priv = menu_bar_get_instance_private (self);
#line 80 "../src/menubar.vala"
	self->priv->_background = NULL;
#line 81 "../src/menubar.vala"
	self->priv->_high_contrast = FALSE;
#line 82 "../src/menubar.vala"
	self->priv->_keyboard_window = NULL;
#line 84 "../src/menubar.vala"
	self->priv->_main_window = NULL;
#line 166 "../src/menubar.vala"
	self->priv->keyboard_pid = (GPid) 0;
#line 167 "../src/menubar.vala"
	self->priv->reader_pid = (GPid) 0;
#line 175 "../src/menubar.vala"
	self->priv->bg_surface = NULL;
#line 7033 "menubar.c"
}

static void
menu_bar_finalize (GObject * obj)
{
	MenuBar * self;
#line 78 "../src/menubar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MENU_BAR, MenuBar);
#line 80 "../src/menubar.vala"
	_g_object_unref0 (self->priv->_background);
#line 82 "../src/menubar.vala"
	_g_object_unref0 (self->priv->_keyboard_window);
#line 83 "../src/menubar.vala"
	_g_object_unref0 (self->priv->_accel_group);
#line 84 "../src/menubar.vala"
	_g_object_unref0 (self->priv->_main_window);
#line 163 "../src/menubar.vala"
	_g_free0 (self->priv->default_theme_name);
#line 164 "../src/menubar.vala"
	_g_free0 (self->priv->clock_format);
#line 165 "../src/menubar.vala"
	_g_object_unref0 (self->priv->high_contrast_item);
#line 168 "../src/menubar.vala"
	_g_object_unref0 (self->priv->onscreen_keyboard_item);
#line 169 "../src/menubar.vala"
	_g_object_unref0 (self->priv->clock_label);
#line 170 "../src/menubar.vala"
	_g_object_unref0 (self->priv->upowerd);
#line 171 "../src/menubar.vala"
	_g_object_unref0 (self->priv->power_menu_item);
#line 172 "../src/menubar.vala"
	_g_object_unref0 (self->priv->power_label);
#line 173 "../src/menubar.vala"
	_g_object_unref0 (self->priv->power_icon);
#line 175 "../src/menubar.vala"
	_cairo_surface_destroy0 (self->priv->bg_surface);
#line 78 "../src/menubar.vala"
	G_OBJECT_CLASS (menu_bar_parent_class)->finalize (obj);
#line 7072 "menubar.c"
}

static GType
menu_bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MenuBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) menu_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MenuBar), 0, (GInstanceInitFunc) menu_bar_instance_init, NULL };
	GType menu_bar_type_id;
	menu_bar_type_id = g_type_register_static (gtk_menu_bar_get_type (), "MenuBar", &g_define_type_info, 0);
	MenuBar_private_offset = g_type_add_instance_private (menu_bar_type_id, sizeof (MenuBarPrivate));
	return menu_bar_type_id;
}

GType
menu_bar_get_type (void)
{
	static volatile gsize menu_bar_type_id__once = 0;
	if (g_once_init_enter (&menu_bar_type_id__once)) {
		GType menu_bar_type_id;
		menu_bar_type_id = menu_bar_get_type_once ();
		g_once_init_leave (&menu_bar_type_id__once, menu_bar_type_id);
	}
	return menu_bar_type_id__once;
}

static void
_vala_menu_bar_get_property (GObject * object,
                             guint property_id,
                             GValue * value,
                             GParamSpec * pspec)
{
	MenuBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MENU_BAR, MenuBar);
#line 78 "../src/menubar.vala"
	switch (property_id) {
#line 78 "../src/menubar.vala"
		case MENU_BAR_BACKGROUND_PROPERTY:
#line 78 "../src/menubar.vala"
		g_value_set_object (value, menu_bar_get_background (self));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_HIGH_CONTRAST_PROPERTY:
#line 78 "../src/menubar.vala"
		g_value_set_boolean (value, menu_bar_get_high_contrast (self));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_KEYBOARD_WINDOW_PROPERTY:
#line 78 "../src/menubar.vala"
		g_value_set_object (value, menu_bar_get_keyboard_window (self));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_ACCEL_GROUP_PROPERTY:
#line 78 "../src/menubar.vala"
		g_value_set_object (value, menu_bar_get_accel_group (self));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_MAIN_WINDOW_PROPERTY:
#line 78 "../src/menubar.vala"
		g_value_set_object (value, menu_bar_get_main_window (self));
#line 78 "../src/menubar.vala"
		break;
#line 7137 "menubar.c"
		default:
#line 78 "../src/menubar.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 78 "../src/menubar.vala"
		break;
#line 7143 "menubar.c"
	}
}

static void
_vala_menu_bar_set_property (GObject * object,
                             guint property_id,
                             const GValue * value,
                             GParamSpec * pspec)
{
	MenuBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MENU_BAR, MenuBar);
#line 78 "../src/menubar.vala"
	switch (property_id) {
#line 78 "../src/menubar.vala"
		case MENU_BAR_BACKGROUND_PROPERTY:
#line 78 "../src/menubar.vala"
		menu_bar_set_background (self, g_value_get_object (value));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_HIGH_CONTRAST_PROPERTY:
#line 78 "../src/menubar.vala"
		menu_bar_set_high_contrast (self, g_value_get_boolean (value));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_KEYBOARD_WINDOW_PROPERTY:
#line 78 "../src/menubar.vala"
		menu_bar_set_keyboard_window (self, g_value_get_object (value));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_ACCEL_GROUP_PROPERTY:
#line 78 "../src/menubar.vala"
		menu_bar_set_accel_group (self, g_value_get_object (value));
#line 78 "../src/menubar.vala"
		break;
#line 78 "../src/menubar.vala"
		case MENU_BAR_MAIN_WINDOW_PROPERTY:
#line 78 "../src/menubar.vala"
		menu_bar_set_main_window (self, g_value_get_object (value));
#line 78 "../src/menubar.vala"
		break;
#line 7187 "menubar.c"
		default:
#line 78 "../src/menubar.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 78 "../src/menubar.vala"
		break;
#line 7193 "menubar.c"
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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;
}

