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

/*
 * Copyright (c) 2026 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "ft_core.h"
#include <glib/gi18n-lib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include "ft_plugin_sni.h"
#include <gtk/gtk.h>
#include "ft_ui.h"
#include <config.h>
#include <float.h>
#include <math.h>
#include <gobject/gvaluecollector.h>

#define SNI_INDICATOR_CONTROLLER_BUS_NAME "%s.StatusNotifierItem"
#define SNI_INDICATOR_CONTROLLER_OBJECT_PATH "/StatusNotifierItem"
#define SNI_INDICATOR_CONTROLLER_MENU_OBJECT_PATH "%s/StatusNotifierMenu"
#define SNI_INDICATOR_CONTROLLER_ICON_STEPS 20U
#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

#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define SNI_TYPE_INDICATOR_ERROR (sni_indicator_error_get_type ())

#define SNI_TYPE_INDICATOR_CONTROLLER (sni_indicator_controller_get_type ())
#define SNI_INDICATOR_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SNI_TYPE_INDICATOR_CONTROLLER, SniIndicatorController))
#define SNI_INDICATOR_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SNI_TYPE_INDICATOR_CONTROLLER, SniIndicatorControllerClass))
#define SNI_IS_INDICATOR_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SNI_TYPE_INDICATOR_CONTROLLER))
#define SNI_IS_INDICATOR_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SNI_TYPE_INDICATOR_CONTROLLER))
#define SNI_INDICATOR_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SNI_TYPE_INDICATOR_CONTROLLER, SniIndicatorControllerClass))

typedef struct _SniIndicatorController SniIndicatorController;
typedef struct _SniIndicatorControllerClass SniIndicatorControllerClass;
typedef struct _SniIndicatorControllerPrivate SniIndicatorControllerPrivate;

#define SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE (sni_status_notifier_item_dbus_service_get_type ())
#define SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusService))
#define SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusServiceClass))
#define SNI_IS_STATUS_NOTIFIER_ITEM_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE))
#define SNI_IS_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE))
#define SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusServiceClass))

typedef struct _SniStatusNotifierItemDBusService SniStatusNotifierItemDBusService;
typedef struct _SniStatusNotifierItemDBusServiceClass SniStatusNotifierItemDBusServiceClass;

#define SNI_TYPE_DBUS_MENU_SERVICE (sni_dbus_menu_service_get_type ())
#define SNI_DBUS_MENU_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuService))
#define SNI_DBUS_MENU_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuServiceClass))
#define SNI_IS_DBUS_MENU_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SNI_TYPE_DBUS_MENU_SERVICE))
#define SNI_IS_DBUS_MENU_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SNI_TYPE_DBUS_MENU_SERVICE))
#define SNI_DBUS_MENU_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuServiceClass))

typedef struct _SniDBusMenuService SniDBusMenuService;
typedef struct _SniDBusMenuServiceClass SniDBusMenuServiceClass;
typedef struct _SniMenuItem SniMenuItem;
typedef struct _SniMenuItemClass SniMenuItemClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _sni_indicator_controller_unref0(var) ((var == NULL) ? NULL : (var = (sni_indicator_controller_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block4Data Block4Data;
typedef struct _SniIndicatorControllerExtractIconsData SniIndicatorControllerExtractIconsData;
typedef struct _SniDBusMenuServicePrivate SniDBusMenuServicePrivate;
typedef struct _SniIndicatorControllerExportData SniIndicatorControllerExportData;
typedef struct _Block5Data Block5Data;
typedef struct _SniParamSpecIndicatorController SniParamSpecIndicatorController;
enum  {
	SNI_INDICATOR_PROVIDER_0_PROPERTY,
	SNI_INDICATOR_PROVIDER_VISIBLE_PROPERTY,
	SNI_INDICATOR_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* sni_indicator_provider_properties[SNI_INDICATOR_PROVIDER_NUM_PROPERTIES];
typedef struct _SniIndicatorProviderCreateIndicatorControllerData SniIndicatorProviderCreateIndicatorControllerData;
typedef struct _SniIndicatorProviderInitializeData SniIndicatorProviderInitializeData;
typedef struct _SniIndicatorProviderEnableData SniIndicatorProviderEnableData;
typedef struct _SniIndicatorProviderDisableData SniIndicatorProviderDisableData;
typedef struct _SniIndicatorProviderUninitializeData SniIndicatorProviderUninitializeData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

typedef enum  {
	SNI_INDICATOR_ERROR_CONNECTION,
	SNI_INDICATOR_ERROR_HOST,
	SNI_INDICATOR_ERROR_INDICATOR,
	SNI_INDICATOR_ERROR_INDICATOR_MENU
} SniIndicatorError;
#define SNI_INDICATOR_ERROR sni_indicator_error_quark ()

struct _SniIndicatorController {
	GTypeInstance parent_instance;
	volatile int ref_count;
	SniIndicatorControllerPrivate * priv;
};

struct _SniIndicatorControllerClass {
	GTypeClass parent_class;
	void (*finalize) (SniIndicatorController *self);
};

struct _SniIndicatorControllerPrivate {
	GDBusConnection* connection;
	SniStatusNotifierWatcher* watcher_proxy;
	FtTimer* timer;
	FtSessionManager* session_manager;
	FtNotificationManager* notification_manager;
	GSettings* application_settings;
	SniIndicatorActionGroup* action_group;
	guint name_owner_id;
	SniStatusNotifierItemDBusService* service;
	guint service_id;
	SniDBusMenuService* menu_service;
	guint menu_service_id;
	SniMenuItem* primary_item;
	SniMenuItem* secondary_item;
	guint update_icon_timeout_id;
	guint update_idle_id;
	gchar* tooltip_title;
	gboolean have_icon_theme;
	gboolean have_passive_status;
	gboolean have_attention_status;
	gboolean have_activation;
	gboolean have_menu_icons;
	gboolean have_tooltips;
	gboolean have_toggles;
};

struct _Block2Data {
	int _ref_count_;
	SniIndicatorController* self;
	guint tmp_cycle_number;
	guint tmp_cycle_count;
};

struct _Block3Data {
	int _ref_count_;
	SniIndicatorController* self;
	gchar* icons_theme_path;
	GCancellable* cancellable;
	gpointer _async_data_;
};

struct _Block4Data {
	int _ref_count_;
	GHashTable* self;
	GFunc func;
	gpointer func_target;
};

struct _SniIndicatorControllerExtractIconsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorController* self;
	gchar* icons_path;
	GCancellable* cancellable;
	Block3Data* _data3_;
	gchar* _tmp0_;
	GHashTable* directories;
	GHashFunc _tmp1_;
	GEqualFunc _tmp2_;
	GHashTable* _tmp3_;
	GHashTable* sizes;
	GHashFunc _tmp4_;
	GEqualFunc _tmp5_;
	GHashTable* _tmp6_;
	const gchar** filename_collection;
	gint filename_collection_length1;
	gint _filename_collection_size_;
	gint filename_it;
	const gchar* filename;
	GFile* icon_file;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GBytes* icon_data;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	GBytes* _tmp17_;
	GBytes* _tmp18_;
	GFile* directory;
	GFile* _tmp19_;
	GFile* _tmp20_;
	gchar* directory_path;
	GFile* _tmp21_;
	gchar* _tmp22_;
	GHashTable* _tmp23_;
	const gchar* _tmp24_;
	GHashTable* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	GFile* _tmp28_;
	GFile* _tmp29_;
	gchar** filename_parts;
	const gchar* _tmp30_;
	gchar** _tmp31_;
	gchar** _tmp32_;
	gint filename_parts_length1;
	gint _filename_parts_size_;
	gchar** _tmp33_;
	gint _tmp33__length1;
	GHashTable* _tmp34_;
	gchar** _tmp35_;
	gint _tmp35__length1;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	GFile* _tmp38_;
	GBytes* _tmp39_;
	gsize _tmp40_;
	guint8* _tmp41_;
	GError* _error_;
	const gchar* _tmp42_;
	GError* _tmp43_;
	const gchar* _tmp44_;
	GError* _tmp45_;
	GError* _tmp46_;
	GHashTable* _tmp47_;
	GError* _inner_error0_;
};

struct _SniDBusMenuService {
	GObject parent_instance;
	SniDBusMenuServicePrivate * priv;
	gchar* activation_token;
};

struct _SniDBusMenuServiceClass {
	GObjectClass parent_class;
};

struct _SniIndicatorControllerExportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorController* self;
	GCancellable* cancellable;
	gchar* bus_name;
	gchar* _tmp0_;
	gchar* menu_object_path;
	GApplication* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* icons_path;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GDBusConnection* _tmp11_;
	const gchar* _tmp12_;
	SniStatusNotifierWatcher* _tmp13_;
	const gchar* _tmp14_;
	GError* _error_;
	GError* _tmp15_;
	const gchar* _tmp16_;
	GError* _tmp17_;
	SniDBusMenuService* _tmp18_;
	SniStatusNotifierItemDBusService* _tmp19_;
	GError* _inner_error0_;
};

struct _Block5Data {
	int _ref_count_;
	SniIndicatorController* self;
	guint interval;
};

struct _SniParamSpecIndicatorController {
	GParamSpec parent_instance;
};

struct _SniIndicatorProviderPrivate {
	GSettings* settings;
	GDBusConnection* connection;
	guint watcher_id;
	SniStatusNotifierWatcher* watcher_proxy;
	SniIndicatorController* indicator_controller;
	GCancellable* cancellable;
};

struct _SniIndicatorProviderCreateIndicatorControllerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorProvider* self;
	SniIndicatorController* _tmp0_;
	FtApplication* application;
	FtApplication* _tmp1_;
	FtApplication* _tmp2_;
	FtApplication* _tmp3_;
	GDBusConnection* _tmp4_;
	SniStatusNotifierWatcher* _tmp5_;
	SniIndicatorController* _tmp6_;
	SniIndicatorController* _tmp7_;
	GCancellable* _tmp8_;
	GError* _error_;
	GError* _tmp9_;
	const gchar* _tmp10_;
	FtApplication* _tmp11_;
	GError* _inner_error0_;
};

struct _SniIndicatorProviderInitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorProvider* self;
	GCancellable* cancellable;
	GApplication* _tmp0_;
	GDBusConnection* _tmp1_;
	GDBusConnection* _tmp2_;
	GDBusConnection* _tmp3_;
	GDBusConnection* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GError* _tmp7_;
	GError* _inner_error0_;
};

struct _SniIndicatorProviderEnableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorProvider* self;
	GCancellable* cancellable;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
};

struct _SniIndicatorProviderDisableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorProvider* self;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	guint _tmp4_;
};

struct _SniIndicatorProviderUninitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SniIndicatorProvider* self;
};

static gint SniIndicatorController_private_offset;
static gpointer sni_indicator_controller_parent_class = NULL;
static GType sni_indicator_controller_type_id = 0;
static gint SniIndicatorProvider_private_offset;
static gpointer sni_indicator_provider_parent_class = NULL;
static FtIndicatorProviderIface * sni_indicator_provider_ft_indicator_provider_parent_iface = NULL;
static GType sni_indicator_provider_type_id = 0;

VALA_EXTERN GVariant* sni_build_platform_data (const gchar* activation_token);
VALA_EXTERN gchar* sni_format_remaining_time (gint64 remaining);
VALA_EXTERN gchar* sni_format_tooltip_title (FtState state,
                                 guint cycle_number,
                                 guint cycle_count,
                                 gboolean is_finished);
VALA_EXTERN gchar* sni_normalize_separators (const gchar* resource_path);
VALA_EXTERN GQuark sni_indicator_error_quark (void);
VALA_EXTERN GType sni_indicator_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer sni_indicator_controller_ref (gpointer instance);
VALA_EXTERN void sni_indicator_controller_unref (gpointer instance);
VALA_EXTERN GParamSpec* sni_param_spec_indicator_controller (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags);
VALA_EXTERN void sni_value_set_indicator_controller (GValue* value,
                                         gpointer v_object);
VALA_EXTERN void sni_value_take_indicator_controller (GValue* value,
                                          gpointer v_object);
VALA_EXTERN gpointer sni_value_get_indicator_controller (const GValue* value);
GType sni_indicator_controller_register_type (GTypeModule * module);
VALA_EXTERN GType sni_indicator_controller_get_type (void) G_GNUC_CONST ;
GType sni_status_notifier_item_dbus_service_register_type (GTypeModule * module);
VALA_EXTERN GType sni_status_notifier_item_dbus_service_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint sni_status_notifier_item_dbus_service_register_object (void* object,
                                                             GDBusConnection* connection,
                                                             const gchar* path,
                                                             GError** error);
GType sni_dbus_menu_service_register_type (GTypeModule * module);
VALA_EXTERN GType sni_dbus_menu_service_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint sni_dbus_menu_service_register_object (void* object,
                                             GDBusConnection* connection,
                                             const gchar* path,
                                             GError** error);
VALA_EXTERN SniIndicatorController* sni_indicator_controller_new (GDBusConnection* connection,
                                                      SniStatusNotifierWatcher* watcher_proxy);
VALA_EXTERN SniIndicatorController* sni_indicator_controller_construct (GType object_type,
                                                            GDBusConnection* connection,
                                                            SniStatusNotifierWatcher* watcher_proxy);
VALA_EXTERN gboolean sni_capabilities_have_icon_theme (void);
VALA_EXTERN gboolean sni_capabilities_have_passive_status (void);
VALA_EXTERN gboolean sni_capabilities_have_attention_status (void);
VALA_EXTERN gboolean sni_capabilities_have_activation (void);
VALA_EXTERN gboolean sni_capabilities_have_menu_icons (void);
VALA_EXTERN gboolean sni_capabilities_have_tooltips (void);
VALA_EXTERN gboolean sni_capabilities_have_toggles (void);
static SniMenuItem* sni_indicator_controller_build_menu (SniIndicatorController* self);
static void ___lambda12_ (SniIndicatorController* self,
                   SniMenuItem* menu_item);
static void ____lambda12__gfunc (gconstpointer data,
                          gpointer self);
static void sni_indicator_controller_get_cycle_number_count (SniIndicatorController* self,
                                                      guint* cycle_number,
                                                      guint* cycle_count);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda13_ (Block2Data* _data2_,
                  FtCycle* cycle);
static void ___lambda13__gfunc (gconstpointer data,
                         gpointer self);
static void sni_indicator_controller_set_toggle_state (SniIndicatorController* self,
                                                SniMenuItem* menu_item,
                                                gboolean value);
static void sni_indicator_controller_update_menu_items (SniIndicatorController* self);
VALA_EXTERN SniMenuItem* sni_dbus_menu_service_lookup_menu_item (SniDBusMenuService* self,
                                                     const gchar* name);
VALA_EXTERN void sni_dbus_menu_service_emit_updates (SniDBusMenuService* self);
static void sni_indicator_controller_extract_icons_data_free (gpointer _data);
static void sni_indicator_controller_extract_icons (SniIndicatorController* self,
                                             const gchar* icons_path,
                                             GCancellable* cancellable,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void sni_indicator_controller_extract_icons_finish (SniIndicatorController* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean sni_indicator_controller_extract_icons_co (SniIndicatorControllerExtractIconsData* _data_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void _g_free0_ (gpointer var);
static void sni_indicator_controller_extract_icons_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void ___lambda2__gh_func (gconstpointer key,
                          gconstpointer value,
                          gpointer self);
static void __lambda14_ (Block3Data* _data3_,
                  const gchar* size);
static void ___lambda14__gfunc (gconstpointer data,
                         gpointer self);
static void sni_indicator_controller_export_menu (SniIndicatorController* self,
                                           const gchar* menu_object_path,
                                           const gchar* icons_path,
                                           GError** error);
VALA_EXTERN SniDBusMenuService* sni_dbus_menu_service_new (SniMenuItem* root,
                                               SniIndicatorActionGroup* action_group,
                                               const gchar* icon_theme_path);
VALA_EXTERN SniDBusMenuService* sni_dbus_menu_service_construct (GType object_type,
                                                     SniMenuItem* root,
                                                     SniIndicatorActionGroup* action_group,
                                                     const gchar* icon_theme_path);
static void sni_indicator_controller_export_icon (SniIndicatorController* self,
                                           const gchar* menu_object_path,
                                           const gchar* icons_path,
                                           GError** error);
VALA_EXTERN SniStatusNotifierItemDBusService* sni_status_notifier_item_dbus_service_new (const gchar* menu_object_path,
                                                                             const gchar* icon_theme_path);
VALA_EXTERN SniStatusNotifierItemDBusService* sni_status_notifier_item_dbus_service_construct (GType object_type,
                                                                                   const gchar* menu_object_path,
                                                                                   const gchar* icon_theme_path);
static void __lambda15_ (SniIndicatorController* self,
                  const gchar* token);
static void ___lambda15__sni_status_notifier_item_dbus_service_received_activation_token (SniStatusNotifierItemDBusService* _sender,
                                                                                   const gchar* token,
                                                                                   gpointer self);
static void __lambda16_ (SniIndicatorController* self,
                  const gchar* token);
static void ___lambda16__sni_status_notifier_item_dbus_service_activated (SniStatusNotifierItemDBusService* _sender,
                                                                   const gchar* token,
                                                                   gpointer self);
static void __lambda17_ (SniIndicatorController* self);
static void ___lambda17__sni_status_notifier_item_dbus_service_secondary_activated (SniStatusNotifierItemDBusService* _sender,
                                                                             gpointer self);
static void __lambda18_ (SniIndicatorController* self,
                  gint delta);
static void ___lambda18__sni_status_notifier_item_dbus_service_scrolled (SniStatusNotifierItemDBusService* _sender,
                                                                  gint delta,
                                                                  gpointer self);
static void sni_indicator_controller_update_status (SniIndicatorController* self);
static void sni_indicator_controller_update_icon (SniIndicatorController* self,
                                           gint64 timestamp);
static void sni_indicator_controller_update_tooltip (SniIndicatorController* self,
                                              gint64 timestamp);
static inline void sni_indicator_controller_invalidate_tooltip (SniIndicatorController* self);
static void sni_indicator_controller_export_data_free (gpointer _data);
VALA_EXTERN void sni_indicator_controller_export (SniIndicatorController* self,
                                      GCancellable* cancellable,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void sni_indicator_controller_export_finish (SniIndicatorController* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean sni_indicator_controller_export_co (SniIndicatorControllerExportData* _data_);
static void sni_indicator_controller_export_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void sni_indicator_controller_connect_signals (SniIndicatorController* self);
static void sni_indicator_controller_update_icon_timeout (SniIndicatorController* self);
VALA_EXTERN void sni_dbus_menu_service_emit_layout_updated (SniDBusMenuService* self);
VALA_EXTERN void sni_status_notifier_item_dbus_service_emit_new_menu (SniStatusNotifierItemDBusService* self);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_status_internal (SniStatusNotifierItemDBusService* self,
                                                                SniIndicatorStatus value,
                                                                gboolean emit_signal);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_icon_name_internal (SniStatusNotifierItemDBusService* self,
                                                                   const gchar* value,
                                                                   gboolean emit_signal);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_tooltip_internal (SniStatusNotifierItemDBusService* self,
                                                                 SniTooltip* value,
                                                                 gboolean emit_signal);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void _sni_indicator_controller_update_icon_ft_timer_tick (FtTimer* _sender,
                                                          gint64 timestamp,
                                                          gpointer self);
static gboolean sni_indicator_controller_on_update_icon_timeout (SniIndicatorController* self);
static gboolean _sni_indicator_controller_on_update_icon_timeout_gsource_func (gpointer self);
static gboolean ____lambda19_ (Block5Data* _data5_);
static gboolean _____lambda19__gsource_func (gpointer self);
static void sni_indicator_controller_update (SniIndicatorController* self,
                                      gint64 timestamp);
static void sni_indicator_controller_queue_update (SniIndicatorController* self);
static gboolean __lambda20_ (SniIndicatorController* self);
static gboolean ___lambda20__gsource_func (gpointer self);
static void sni_indicator_controller_on_timer_state_changed (SniIndicatorController* self,
                                                      const FtTimerState* current_state,
                                                      const FtTimerState* previous_state);
static void sni_indicator_controller_on_session_manager_notify_current_session (SniIndicatorController* self);
static void sni_indicator_controller_on_session_manager_notify_current_state (SniIndicatorController* self);
static void sni_indicator_controller_on_session_manager_notify_has_uniform_breaks (SniIndicatorController* self);
static void sni_indicator_controller_on_application_settings_changed (SniIndicatorController* self,
                                                               GSettings* settings,
                                                               const gchar* key);
static void _sni_indicator_controller_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                              const FtTimerState* current_state,
                                                                              const FtTimerState* previous_state,
                                                                              gpointer self);
static void _sni_indicator_controller_update_tooltip_ft_timer_tick (FtTimer* _sender,
                                                             gint64 timestamp,
                                                             gpointer self);
static void _sni_indicator_controller_on_session_manager_notify_current_session_g_object_notify (GObject* _sender,
                                                                                          GParamSpec* pspec,
                                                                                          gpointer self);
static void _sni_indicator_controller_on_session_manager_notify_current_state_g_object_notify (GObject* _sender,
                                                                                        GParamSpec* pspec,
                                                                                        gpointer self);
static void _sni_indicator_controller_on_session_manager_notify_has_uniform_breaks_g_object_notify (GObject* _sender,
                                                                                             GParamSpec* pspec,
                                                                                             gpointer self);
static void _sni_indicator_controller_on_application_settings_changed_g_settings_changed (GSettings* _sender,
                                                                                   const gchar* key,
                                                                                   gpointer self);
static void sni_indicator_controller_disconnect_signals (SniIndicatorController* self);
VALA_EXTERN void sni_indicator_controller_destroy (SniIndicatorController* self);
static void sni_indicator_controller_finalize (SniIndicatorController * obj);
static void sni_indicator_provider_update_available (SniIndicatorProvider* self);
static void sni_indicator_provider_create_indicator_controller_data_free (gpointer _data);
static void sni_indicator_provider_create_indicator_controller (SniIndicatorProvider* self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void sni_indicator_provider_create_indicator_controller_finish (SniIndicatorProvider* self,
                                                                GAsyncResult* _res_);
static gboolean sni_indicator_provider_create_indicator_controller_co (SniIndicatorProviderCreateIndicatorControllerData* _data_);
static void sni_indicator_provider_create_indicator_controller_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void sni_indicator_provider_destroy_indicator_controller (SniIndicatorProvider* self);
static void sni_indicator_provider_on_properties_changed (SniIndicatorProvider* self,
                                                   GVariant* changed_properties,
                                                   gchar** invalidated_properties,
                                                   gint invalidated_properties_length1);
static void sni_indicator_provider_on_settings_changed (SniIndicatorProvider* self,
                                                 GSettings* settings,
                                                 const gchar* key);
static void sni_indicator_provider_on_name_appeared (SniIndicatorProvider* self,
                                              GDBusConnection* connection,
                                              const gchar* name,
                                              const gchar* name_owner);
static void _sni_indicator_provider_on_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                                                      GVariant* changed_properties,
                                                                                      gchar** invalidated_properties,
                                                                                      gpointer self);
static void sni_indicator_provider_on_name_vanished (SniIndicatorProvider* self,
                                              GDBusConnection* connection,
                                              const gchar* name);
static void sni_indicator_provider_real_initialize_data_free (gpointer _data);
static void sni_indicator_provider_real_initialize (FtProvider* base,
                                             GCancellable* cancellable,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gboolean sni_indicator_provider_real_initialize_co (SniIndicatorProviderInitializeData* _data_);
static void _sni_indicator_provider_on_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                           const gchar* name,
                                                                           const gchar* name_owner,
                                                                           gpointer self);
static void _sni_indicator_provider_on_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                           const gchar* name,
                                                                           gpointer self);
static void sni_indicator_provider_real_enable_data_free (gpointer _data);
static void sni_indicator_provider_real_enable (FtProvider* base,
                                         GCancellable* cancellable,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static gboolean sni_indicator_provider_real_enable_co (SniIndicatorProviderEnableData* _data_);
static void _sni_indicator_provider_on_settings_changed_g_settings_changed (GSettings* _sender,
                                                                     const gchar* key,
                                                                     gpointer self);
static void sni_indicator_provider_enable_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void sni_indicator_provider_real_disable_data_free (gpointer _data);
static void sni_indicator_provider_real_disable (FtProvider* base,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static gboolean sni_indicator_provider_real_disable_co (SniIndicatorProviderDisableData* _data_);
static void sni_indicator_provider_real_uninitialize_data_free (gpointer _data);
static void sni_indicator_provider_real_uninitialize (FtProvider* base,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static gboolean sni_indicator_provider_real_uninitialize_co (SniIndicatorProviderUninitializeData* _data_);
static void sni_indicator_provider_finalize (GObject * obj);
static void _vala_sni_indicator_provider_get_property (GObject * object,
                                                guint property_id,
                                                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 const gchar* SNI_INDICATOR_CONTROLLER_ICONS[101] = {"16x16/status/indicator-break-000-symbolic.svg", "16x16/status/indicator-break-005-symbolic.svg", "16x16/status/indicator-break-010-symbolic.svg", "16x16/status/indicator-break-015-symbolic.svg", "16x16/status/indicator-break-020-symbolic.svg", "16x16/status/indicator-break-025-symbolic.svg", "16x16/status/indicator-break-030-symbolic.svg", "16x16/status/indicator-break-035-symbolic.svg", "16x16/status/indicator-break-040-symbolic.svg", "16x16/status/indicator-break-045-symbolic.svg", "16x16/status/indicator-break-050-symbolic.svg", "16x16/status/indicator-break-055-symbolic.svg", "16x16/status/indicator-break-060-symbolic.svg", "16x16/status/indicator-break-065-symbolic.svg", "16x16/status/indicator-break-070-symbolic.svg", "16x16/status/indicator-break-075-symbolic.svg", "16x16/status/indicator-break-080-symbolic.svg", "16x16/status/indicator-break-085-symbolic.svg", "16x16/status/indicator-break-090-symbolic.svg", "16x16/status/indicator-break-095-symbolic.svg", "16x16/status/indicator-break-100-symbolic.svg", "16x16/status/indicator-break-paused-symbolic.svg", "16x16/status/indicator-pomodoro-000-symbolic.svg", "16x16/status/indicator-pomodoro-005-symbolic.svg", "16x16/status/indicator-pomodoro-010-symbolic.svg", "16x16/status/indicator-pomodoro-015-symbolic.svg", "16x16/status/indicator-pomodoro-020-symbolic.svg", "16x16/status/indicator-pomodoro-025-symbolic.svg", "16x16/status/indicator-pomodoro-030-symbolic.svg", "16x16/status/indicator-pomodoro-035-symbolic.svg", "16x16/status/indicator-pomodoro-040-symbolic.svg", "16x16/status/indicator-pomodoro-045-symbolic.svg", "16x16/status/indicator-pomodoro-050-symbolic.svg", "16x16/status/indicator-pomodoro-055-symbolic.svg", "16x16/status/indicator-pomodoro-060-symbolic.svg", "16x16/status/indicator-pomodoro-065-symbolic.svg", "16x16/status/indicator-pomodoro-070-symbolic.svg", "16x16/status/indicator-pomodoro-075-symbolic.svg", "16x16/status/indicator-pomodoro-080-symbolic.svg", "16x16/status/indicator-pomodoro-085-symbolic.svg", "16x16/status/indicator-pomodoro-090-symbolic.svg", "16x16/status/indicator-pomodoro-095-symbolic.svg", "16x16/status/indicator-pomodoro-100-symbolic.svg", "16x16/status/indicator-pomodoro-paused-symbolic.svg", "16x16/status/indicator-stopped-symbolic.svg", "22x22/status/indicator-break-000-symbolic.svg", "22x22/status/indicator-break-005-symbolic.svg", "22x22/status/indicator-break-010-symbolic.svg", "22x22/status/indicator-break-015-symbolic.svg", "22x22/status/indicator-break-020-symbolic.svg", "22x22/status/indicator-break-025-symbolic.svg", "22x22/status/indicator-break-030-symbolic.svg", "22x22/status/indicator-break-035-symbolic.svg", "22x22/status/indicator-break-040-symbolic.svg", "22x22/status/indicator-break-045-symbolic.svg", "22x22/status/indicator-break-050-symbolic.svg", "22x22/status/indicator-break-055-symbolic.svg", "22x22/status/indicator-break-060-symbolic.svg", "22x22/status/indicator-break-065-symbolic.svg", "22x22/status/indicator-break-070-symbolic.svg", "22x22/status/indicator-break-075-symbolic.svg", "22x22/status/indicator-break-080-symbolic.svg", "22x22/status/indicator-break-085-symbolic.svg", "22x22/status/indicator-break-090-symbolic.svg", "22x22/status/indicator-break-095-symbolic.svg", "22x22/status/indicator-break-100-symbolic.svg", "22x22/status/indicator-break-paused-symbolic.svg", "22x22/status/indicator-pomodoro-000-symbolic.svg", "22x22/status/indicator-pomodoro-005-symbolic.svg", "22x22/status/indicator-pomodoro-010-symbolic.svg", "22x22/status/indicator-pomodoro-015-symbolic.svg", "22x22/status/indicator-pomodoro-020-symbolic.svg", "22x22/status/indicator-pomodoro-025-symbolic.svg", "22x22/status/indicator-pomodoro-030-symbolic.svg", "22x22/status/indicator-pomodoro-035-symbolic.svg", "22x22/status/indicator-pomodoro-040-symbolic.svg", "22x22/status/indicator-pomodoro-045-symbolic.svg", "22x22/status/indicator-pomodoro-050-symbolic.svg", "22x22/status/indicator-pomodoro-055-symbolic.svg", "22x22/status/indicator-pomodoro-060-symbolic.svg", "22x22/status/indicator-pomodoro-065-symbolic.svg", "22x22/status/indicator-pomodoro-070-symbolic.svg", "22x22/status/indicator-pomodoro-075-symbolic.svg", "22x22/status/indicator-pomodoro-080-symbolic.svg", "22x22/status/indicator-pomodoro-085-symbolic.svg", "22x22/status/indicator-pomodoro-090-symbolic.svg", "22x22/status/indicator-pomodoro-095-symbolic.svg", "22x22/status/indicator-pomodoro-100-symbolic.svg", "22x22/status/indicator-pomodoro-paused-symbolic.svg", "22x22/status/indicator-stopped-symbolic.svg", "32x32/status/indicator-passive-symbolic.svg", "scalable/actions/ornament-check-symbolic.svg", "scalable/actions/ornament-dot-checked-symbolic.svg", "scalable/actions/ornament-dot-unchecked-symbolic.svg", "scalable/actions/timer-pause-symbolic.svg", "scalable/actions/timer-reset-symbolic.svg", "scalable/actions/timer-skip-symbolic.svg", "scalable/actions/timer-skip-symbolic-rtl.svg", "scalable/actions/timer-start-symbolic.svg", "scalable/actions/timer-stop-symbolic.svg", "index.theme"};
static const gchar* SNI_INDICATOR_CONTROLLER_SCALES[1] = {"@2"};

GVariant*
sni_build_platform_data (const gchar* activation_token)
{
	GVariantBuilder* platform_data = NULL;
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GVariantBuilder* _tmp8_;
	GVariant* _tmp9_;
	GVariant* result;
	g_return_val_if_fail (activation_token != NULL, NULL);
	_tmp0_ = g_variant_type_new ("a{sv}");
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_variant_type_free0 (_tmp1_);
	platform_data = _tmp3_;
	if (activation_token != NULL) {
		_tmp4_ = g_strcmp0 (activation_token, "") != 0;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GVariantBuilder* _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		_tmp5_ = platform_data;
		_tmp6_ = g_variant_new_string (activation_token);
		g_variant_ref_sink (_tmp6_);
		_tmp7_ = _tmp6_;
		g_variant_builder_add (_tmp5_, "{sv}", "activation-token", _tmp7_, NULL);
		_g_variant_unref0 (_tmp7_);
	}
	_tmp8_ = platform_data;
	_tmp9_ = g_variant_builder_end (_tmp8_);
	g_variant_ref_sink (_tmp9_);
	result = _tmp9_;
	_g_variant_builder_unref0 (platform_data);
	return result;
}

inline gchar*
sni_format_remaining_time (gint64 remaining)
{
	guint seconds_uint = 0U;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	seconds_uint = (guint) ft_round_seconds (ft_timestamp_to_seconds (remaining));
	_tmp0_ = ft_format_time (seconds_uint);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf (_ ("%s remaining"), _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

gchar*
sni_format_tooltip_title (FtState state,
                          guint cycle_number,
                          guint cycle_count,
                          gboolean is_finished)
{
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar* _tmp11_;
	gchar* result;
	if (is_finished) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (_ ("Finished!"));
		result = _tmp0_;
		return result;
	}
	if (cycle_number > ((guint) 0)) {
		_tmp2_ = cycle_count > ((guint) 1);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gboolean _tmp3_ = FALSE;
		if (state == FT_STATE_POMODORO) {
			_tmp3_ = TRUE;
		} else {
			_tmp3_ = state == FT_STATE_SHORT_BREAK;
		}
		_tmp1_ = _tmp3_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gchar* state_label = NULL;
		gchar* _tmp4_;
		gchar* cycle_label = NULL;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp4_ = ft_state_get_label (state);
		state_label = _tmp4_;
		_tmp5_ = g_strdup_printf (_ ("%u of %u"), cycle_number, cycle_count);
		cycle_label = _tmp5_;
		_tmp6_ = state_label;
		_tmp7_ = string_to_string (_tmp6_);
		_tmp8_ = cycle_label;
		_tmp9_ = string_to_string (_tmp8_);
		_tmp10_ = g_strconcat (_tmp7_, " (", _tmp9_, ")", NULL);
		result = _tmp10_;
		_g_free0 (cycle_label);
		_g_free0 (state_label);
		return result;
	}
	_tmp11_ = ft_state_get_label (state);
	result = _tmp11_;
	return result;
}

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;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

gchar*
sni_normalize_separators (const gchar* resource_path)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (resource_path != NULL, NULL);
	_tmp0_ = string_replace (resource_path, "/", G_DIR_SEPARATOR_S);
	result = _tmp0_;
	return result;
}

GQuark
sni_indicator_error_quark (void)
{
	return g_quark_from_static_string ("sni-indicator-error-quark");
}

static GType
sni_indicator_error_get_type_once (void)
{
	static const GEnumValue values[] = {{SNI_INDICATOR_ERROR_CONNECTION, "SNI_INDICATOR_ERROR_CONNECTION", "connection"}, {SNI_INDICATOR_ERROR_HOST, "SNI_INDICATOR_ERROR_HOST", "host"}, {SNI_INDICATOR_ERROR_INDICATOR, "SNI_INDICATOR_ERROR_INDICATOR", "indicator"}, {SNI_INDICATOR_ERROR_INDICATOR_MENU, "SNI_INDICATOR_ERROR_INDICATOR_MENU", "indicator-menu"}, {0, NULL, NULL}};
	GType sni_indicator_error_type_id;
	sni_indicator_error_type_id = g_enum_register_static ("SniIndicatorError", values);
	return sni_indicator_error_type_id;
}

GType
sni_indicator_error_get_type (void)
{
	static volatile gsize sni_indicator_error_type_id__once = 0;
	if (g_once_init_enter (&sni_indicator_error_type_id__once)) {
		GType sni_indicator_error_type_id;
		sni_indicator_error_type_id = sni_indicator_error_get_type_once ();
		g_once_init_leave (&sni_indicator_error_type_id__once, sni_indicator_error_type_id);
	}
	return sni_indicator_error_type_id__once;
}

static inline gpointer
sni_indicator_controller_get_instance_private (SniIndicatorController* self)
{
	return G_STRUCT_MEMBER_P (self, SniIndicatorController_private_offset);
}

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

SniIndicatorController*
sni_indicator_controller_construct (GType object_type,
                                    GDBusConnection* connection,
                                    SniStatusNotifierWatcher* watcher_proxy)
{
	SniIndicatorController* self = NULL;
	GDBusConnection* _tmp0_;
	SniStatusNotifierWatcher* _tmp1_;
	FtTimer* _tmp2_;
	FtTimer* _tmp3_;
	FtSessionManager* _tmp4_;
	FtSessionManager* _tmp5_;
	FtNotificationManager* _tmp6_;
	GSettings* _tmp7_;
	SniIndicatorActionGroup* _tmp8_;
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (watcher_proxy != NULL, NULL);
	self = (SniIndicatorController*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (connection);
	_g_object_unref0 (self->priv->connection);
	self->priv->connection = _tmp0_;
	_tmp1_ = _g_object_ref0 (watcher_proxy);
	_g_object_unref0 (self->priv->watcher_proxy);
	self->priv->watcher_proxy = _tmp1_;
	_tmp2_ = ft_timer_get_default ();
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->timer);
	self->priv->timer = _tmp3_;
	_tmp4_ = ft_session_manager_get_default ();
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = _tmp5_;
	_tmp6_ = ft_notification_manager_new ();
	_g_object_unref0 (self->priv->notification_manager);
	self->priv->notification_manager = _tmp6_;
	_tmp7_ = g_settings_new ("io.github.focustimerhq.FocusTimer");
	_g_object_unref0 (self->priv->application_settings);
	self->priv->application_settings = _tmp7_;
	_tmp8_ = sni_indicator_action_group_new ();
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp8_;
	self->priv->have_icon_theme = sni_capabilities_have_icon_theme ();
	self->priv->have_passive_status = sni_capabilities_have_passive_status ();
	self->priv->have_attention_status = sni_capabilities_have_attention_status ();
	self->priv->have_activation = sni_capabilities_have_activation ();
	self->priv->have_menu_icons = sni_capabilities_have_menu_icons ();
	self->priv->have_tooltips = sni_capabilities_have_tooltips ();
	self->priv->have_toggles = sni_capabilities_have_toggles ();
	return self;
}

SniIndicatorController*
sni_indicator_controller_new (GDBusConnection* connection,
                              SniStatusNotifierWatcher* watcher_proxy)
{
	return sni_indicator_controller_construct (SNI_TYPE_INDICATOR_CONTROLLER, connection, watcher_proxy);
}

static void
___lambda12_ (SniIndicatorController* self,
              SniMenuItem* menu_item)
{
	g_return_if_fail (menu_item != NULL);
	sni_menu_item_set_icon_name (menu_item, "");
}

static void
____lambda12__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda12_ ((SniIndicatorController*) self, (SniMenuItem*) data);
}

static SniMenuItem*
sni_indicator_controller_build_menu (SniIndicatorController* self)
{
	gboolean is_rtl = FALSE;
	SniMenuItem* start_item = NULL;
	SniMenuItem* _tmp0_;
	SniMenuItem* _tmp1_;
	SniMenuItem* pause_item = NULL;
	SniMenuItem* _tmp2_;
	SniMenuItem* _tmp3_;
	SniMenuItem* resume_item = NULL;
	SniMenuItem* _tmp4_;
	SniMenuItem* _tmp5_;
	SniMenuItem* advance_item = NULL;
	SniMenuItem* _tmp6_;
	SniMenuItem* _tmp7_;
	SniMenuItem* stop_item = NULL;
	SniMenuItem* _tmp8_;
	SniMenuItem* _tmp9_;
	const gchar* _tmp10_ = NULL;
	SniMenuItem* skip_item = NULL;
	SniMenuItem* _tmp11_;
	SniMenuItem* _tmp12_;
	SniMenuItem* reset_item = NULL;
	SniMenuItem* _tmp13_;
	SniMenuItem* _tmp14_;
	SniMenuItem* pomodoro_item = NULL;
	GVariant* _tmp15_;
	GVariant* _tmp16_;
	SniMenuItem* _tmp17_;
	SniMenuItem* _tmp18_;
	SniMenuItem* short_break_item = NULL;
	GVariant* _tmp19_;
	GVariant* _tmp20_;
	SniMenuItem* _tmp21_;
	SniMenuItem* _tmp22_;
	SniMenuItem* long_break_item = NULL;
	GVariant* _tmp23_;
	GVariant* _tmp24_;
	SniMenuItem* _tmp25_;
	SniMenuItem* _tmp26_;
	SniMenuItem* break_item = NULL;
	GVariant* _tmp27_;
	GVariant* _tmp28_;
	SniMenuItem* _tmp29_;
	SniMenuItem* _tmp30_;
	SniMenuItem* root = NULL;
	SniMenuItem* _tmp35_;
	SniMenuItem* _tmp36_;
	SniMenuItem* _tmp37_;
	SniMenuItem* _tmp38_;
	SniMenuItem* _tmp39_;
	SniMenuItem* _tmp40_;
	SniMenuItem* _tmp41_;
	SniMenuItem* _tmp42_;
	SniMenuItem* _tmp43_;
	SniMenuItem* _tmp44_;
	SniMenuItem* _tmp45_;
	SniMenuItem* _tmp46_;
	SniMenuItem* _tmp47_;
	SniMenuItem* _tmp48_;
	SniMenuItem* _tmp49_;
	SniMenuItem* _tmp50_;
	SniMenuItem* _tmp51_;
	SniMenuItem* _tmp52_;
	SniMenuItem* _tmp53_;
	SniMenuItem* _tmp54_;
	SniMenuItem* _tmp55_;
	SniMenuItem* _tmp56_;
	SniMenuItem* _tmp57_;
	SniMenuItem* _tmp58_;
	SniMenuItem* _tmp59_;
	SniMenuItem* _tmp60_;
	SniMenuItem* _tmp61_;
	SniMenuItem* _tmp62_;
	SniMenuItem* _tmp63_;
	SniMenuItem* _tmp64_;
	SniMenuItem* _tmp65_;
	SniMenuItem* _tmp66_;
	SniMenuItem* _tmp88_;
	SniMenuItem* _tmp89_;
	SniMenuItem* _tmp90_;
	SniMenuItem* _tmp91_;
	SniMenuItem* _tmp92_;
	SniMenuItem* _tmp93_;
	SniMenuItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	is_rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
	_tmp0_ = sni_menu_item_new ("start", _ ("Start"), "timer-start-symbolic", "timer.start", NULL);
	start_item = _tmp0_;
	_tmp1_ = start_item;
	sni_menu_item_set_visible (_tmp1_, FALSE);
	_tmp2_ = sni_menu_item_new ("pause", _ ("Pause"), "timer-pause-symbolic", "timer.pause", NULL);
	pause_item = _tmp2_;
	_tmp3_ = pause_item;
	sni_menu_item_set_visible (_tmp3_, FALSE);
	_tmp4_ = sni_menu_item_new ("resume", _ ("Resume"), "timer-start-symbolic", "timer.resume", NULL);
	resume_item = _tmp4_;
	_tmp5_ = resume_item;
	sni_menu_item_set_visible (_tmp5_, FALSE);
	_tmp6_ = sni_menu_item_new ("advance", "", "timer-start-symbolic", "session-manager.advance", NULL);
	advance_item = _tmp6_;
	_tmp7_ = advance_item;
	sni_menu_item_set_visible (_tmp7_, FALSE);
	_tmp8_ = sni_menu_item_new ("stop", _ ("Stop"), "timer-stop-symbolic", "timer.reset", NULL);
	stop_item = _tmp8_;
	_tmp9_ = stop_item;
	sni_menu_item_set_visible (_tmp9_, FALSE);
	if (is_rtl) {
		_tmp10_ = "timer-skip-symbolic-rtl";
	} else {
		_tmp10_ = "timer-skip-symbolic";
	}
	_tmp11_ = sni_menu_item_new ("skip", _ ("Skip"), _tmp10_, "session-manager.advance", NULL);
	skip_item = _tmp11_;
	_tmp12_ = skip_item;
	sni_menu_item_set_visible (_tmp12_, FALSE);
	_tmp13_ = sni_menu_item_new ("reset", _ ("Reset"), "timer-reset-symbolic", "session-manager.reset", NULL);
	reset_item = _tmp13_;
	_tmp14_ = reset_item;
	sni_menu_item_set_visible (_tmp14_, FALSE);
	_tmp15_ = g_variant_new_string ("pomodoro");
	g_variant_ref_sink (_tmp15_);
	_tmp16_ = _tmp15_;
	_tmp17_ = sni_menu_item_new ("pomodoro", _ ("Pomodoro"), "", "session-manager.state", _tmp16_);
	_tmp18_ = _tmp17_;
	_g_variant_unref0 (_tmp16_);
	pomodoro_item = _tmp18_;
	_tmp19_ = g_variant_new_string ("short-break");
	g_variant_ref_sink (_tmp19_);
	_tmp20_ = _tmp19_;
	_tmp21_ = sni_menu_item_new ("short-break", _ ("Short Break"), "", "session-manager.state", _tmp20_);
	_tmp22_ = _tmp21_;
	_g_variant_unref0 (_tmp20_);
	short_break_item = _tmp22_;
	_tmp23_ = g_variant_new_string ("long-break");
	g_variant_ref_sink (_tmp23_);
	_tmp24_ = _tmp23_;
	_tmp25_ = sni_menu_item_new ("long-break", _ ("Long Break"), "", "session-manager.state", _tmp24_);
	_tmp26_ = _tmp25_;
	_g_variant_unref0 (_tmp24_);
	long_break_item = _tmp26_;
	_tmp27_ = g_variant_new_string ("break");
	g_variant_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	_tmp29_ = sni_menu_item_new ("break", _ ("Break"), "", "session-manager.state", _tmp28_);
	_tmp30_ = _tmp29_;
	_g_variant_unref0 (_tmp28_);
	break_item = _tmp30_;
	if (self->priv->have_toggles) {
		SniMenuItem* _tmp31_;
		SniMenuItem* _tmp32_;
		SniMenuItem* _tmp33_;
		SniMenuItem* _tmp34_;
		_tmp31_ = pomodoro_item;
		sni_menu_item_set_toggle_type (_tmp31_, SNI_MENU_TOGGLE_TYPE_RADIO);
		_tmp32_ = short_break_item;
		sni_menu_item_set_toggle_type (_tmp32_, SNI_MENU_TOGGLE_TYPE_RADIO);
		_tmp33_ = long_break_item;
		sni_menu_item_set_toggle_type (_tmp33_, SNI_MENU_TOGGLE_TYPE_RADIO);
		_tmp34_ = break_item;
		sni_menu_item_set_toggle_type (_tmp34_, SNI_MENU_TOGGLE_TYPE_RADIO);
	}
	_tmp35_ = sni_menu_item_new_root ();
	root = _tmp35_;
	_tmp36_ = root;
	_tmp37_ = start_item;
	sni_menu_item_append (_tmp36_, _tmp37_);
	_tmp38_ = root;
	_tmp39_ = pause_item;
	sni_menu_item_append (_tmp38_, _tmp39_);
	_tmp40_ = root;
	_tmp41_ = resume_item;
	sni_menu_item_append (_tmp40_, _tmp41_);
	_tmp42_ = root;
	_tmp43_ = advance_item;
	sni_menu_item_append (_tmp42_, _tmp43_);
	_tmp44_ = root;
	_tmp45_ = stop_item;
	sni_menu_item_append (_tmp44_, _tmp45_);
	_tmp46_ = root;
	_tmp47_ = skip_item;
	sni_menu_item_append (_tmp46_, _tmp47_);
	_tmp48_ = root;
	_tmp49_ = reset_item;
	sni_menu_item_append (_tmp48_, _tmp49_);
	_tmp50_ = root;
	_tmp51_ = sni_menu_item_new_separator ("state-separator");
	_tmp52_ = _tmp51_;
	sni_menu_item_append (_tmp50_, _tmp52_);
	_g_object_unref0 (_tmp52_);
	_tmp53_ = root;
	_tmp54_ = pomodoro_item;
	sni_menu_item_append (_tmp53_, _tmp54_);
	_tmp55_ = root;
	_tmp56_ = short_break_item;
	sni_menu_item_append (_tmp55_, _tmp56_);
	_tmp57_ = root;
	_tmp58_ = long_break_item;
	sni_menu_item_append (_tmp57_, _tmp58_);
	_tmp59_ = root;
	_tmp60_ = break_item;
	sni_menu_item_append (_tmp59_, _tmp60_);
	_tmp61_ = root;
	_tmp62_ = sni_menu_item_new_separator ("");
	_tmp63_ = _tmp62_;
	sni_menu_item_append (_tmp61_, _tmp63_);
	_g_object_unref0 (_tmp63_);
	_tmp64_ = root;
	_tmp65_ = sni_menu_item_new ("screen-overlay", _ ("Screen Overlay"), "", "app.screen-overlay", NULL);
	_tmp66_ = _tmp65_;
	sni_menu_item_append (_tmp64_, _tmp66_);
	_g_object_unref0 (_tmp66_);
	if (self->priv->have_activation) {
		SniMenuItem* _tmp67_;
		SniMenuItem* _tmp68_;
		SniMenuItem* _tmp69_;
		SniMenuItem* _tmp70_;
		GVariant* _tmp71_;
		GVariant* _tmp72_;
		SniMenuItem* _tmp73_;
		SniMenuItem* _tmp74_;
		_tmp67_ = root;
		_tmp68_ = sni_menu_item_new ("preferences", _ ("Preferences"), "", "app.preferences", NULL);
		_tmp69_ = _tmp68_;
		sni_menu_item_append (_tmp67_, _tmp69_);
		_g_object_unref0 (_tmp69_);
		_tmp70_ = root;
		_tmp71_ = g_variant_new_string ("stats");
		g_variant_ref_sink (_tmp71_);
		_tmp72_ = _tmp71_;
		_tmp73_ = sni_menu_item_new ("stats", _ ("Stats"), "", "app.window", _tmp72_);
		_tmp74_ = _tmp73_;
		sni_menu_item_append (_tmp70_, _tmp74_);
		_g_object_unref0 (_tmp74_);
		_g_variant_unref0 (_tmp72_);
	} else {
		SniMenuItem* _tmp75_;
		GVariant* _tmp76_;
		GVariant* _tmp77_;
		SniMenuItem* _tmp78_;
		SniMenuItem* _tmp79_;
		SniMenuItem* _tmp80_;
		GVariant* _tmp81_;
		GVariant* _tmp82_;
		SniMenuItem* _tmp83_;
		SniMenuItem* _tmp84_;
		SniMenuItem* _tmp85_;
		SniMenuItem* _tmp86_;
		SniMenuItem* _tmp87_;
		_tmp75_ = root;
		_tmp76_ = g_variant_new_string ("timer");
		g_variant_ref_sink (_tmp76_);
		_tmp77_ = _tmp76_;
		_tmp78_ = sni_menu_item_new ("timer", _ ("Timer"), "", "app.window", _tmp77_);
		_tmp79_ = _tmp78_;
		sni_menu_item_append (_tmp75_, _tmp79_);
		_g_object_unref0 (_tmp79_);
		_g_variant_unref0 (_tmp77_);
		_tmp80_ = root;
		_tmp81_ = g_variant_new_string ("stats");
		g_variant_ref_sink (_tmp81_);
		_tmp82_ = _tmp81_;
		_tmp83_ = sni_menu_item_new ("stats", _ ("Stats"), "", "app.window", _tmp82_);
		_tmp84_ = _tmp83_;
		sni_menu_item_append (_tmp80_, _tmp84_);
		_g_object_unref0 (_tmp84_);
		_g_variant_unref0 (_tmp82_);
		_tmp85_ = root;
		_tmp86_ = sni_menu_item_new ("preferences", _ ("Preferences"), "", "app.preferences", NULL);
		_tmp87_ = _tmp86_;
		sni_menu_item_append (_tmp85_, _tmp87_);
		_g_object_unref0 (_tmp87_);
	}
	_tmp88_ = root;
	_tmp89_ = sni_menu_item_new_separator ("");
	_tmp90_ = _tmp89_;
	sni_menu_item_append (_tmp88_, _tmp90_);
	_g_object_unref0 (_tmp90_);
	_tmp91_ = root;
	_tmp92_ = sni_menu_item_new ("quit", _ ("Quit"), "", "indicator.quit", NULL);
	_tmp93_ = _tmp92_;
	sni_menu_item_append (_tmp91_, _tmp93_);
	_g_object_unref0 (_tmp93_);
	if (!self->priv->have_menu_icons) {
		SniMenuItem* _tmp94_;
		_tmp94_ = root;
		sni_menu_item_traverse (_tmp94_, ____lambda12__gfunc, self);
	}
	result = root;
	_g_object_unref0 (break_item);
	_g_object_unref0 (long_break_item);
	_g_object_unref0 (short_break_item);
	_g_object_unref0 (pomodoro_item);
	_g_object_unref0 (reset_item);
	_g_object_unref0 (skip_item);
	_g_object_unref0 (stop_item);
	_g_object_unref0 (advance_item);
	_g_object_unref0 (resume_item);
	_g_object_unref0 (pause_item);
	_g_object_unref0 (start_item);
	return result;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		SniIndicatorController* self;
		self = _data2_->self;
		_sni_indicator_controller_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda13_ (Block2Data* _data2_,
             FtCycle* cycle)
{
	SniIndicatorController* self;
	FtTimeBlockStatus cycle_status = 0;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	guint _tmp3_;
	self = _data2_->self;
	g_return_if_fail (cycle != NULL);
	cycle_status = ft_cycle_get_status (cycle);
	if (cycle_status == FT_TIME_BLOCK_STATUS_UNCOMPLETED) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = ft_cycle_get_weight (cycle) <= 0.0;
	}
	if (_tmp0_) {
		return;
	}
	if (cycle_status == FT_TIME_BLOCK_STATUS_COMPLETED) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = cycle_status == FT_TIME_BLOCK_STATUS_IN_PROGRESS;
	}
	if (_tmp1_) {
		guint _tmp2_;
		_tmp2_ = _data2_->tmp_cycle_number;
		_data2_->tmp_cycle_number = _tmp2_ + 1;
	}
	_tmp3_ = _data2_->tmp_cycle_count;
	_data2_->tmp_cycle_count = _tmp3_ + 1;
}

static void
___lambda13__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda13_ (self, (FtCycle*) data);
}

static void
sni_indicator_controller_get_cycle_number_count (SniIndicatorController* self,
                                                 guint* cycle_number,
                                                 guint* cycle_count)
{
	guint _vala_cycle_number = 0U;
	guint _vala_cycle_count = 0U;
	Block2Data* _data2_;
	FtSession* _tmp0_ = NULL;
	FtSessionManager* _tmp1_;
	FtSession* _tmp2_;
	FtSession* _tmp3_;
	GList* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = sni_indicator_controller_ref (self);
	_data2_->tmp_cycle_number = 0U;
	_data2_->tmp_cycle_count = 0U;
	_tmp1_ = self->priv->session_manager;
	_tmp2_ = ft_session_manager_get_current_session (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	_tmp4_ = NULL;
	if (_tmp0_ != NULL) {
		GList* _tmp5_;
		_tmp5_ = ft_session_get_cycles (_tmp0_);
		(_tmp4_ == NULL) ? NULL : (_tmp4_ = (g_list_free (_tmp4_), NULL));
		_tmp4_ = _tmp5_;
	}
	g_list_foreach (_tmp4_, ___lambda13__gfunc, _data2_);
	_vala_cycle_number = _data2_->tmp_cycle_number;
	_vala_cycle_count = _data2_->tmp_cycle_count;
	(_tmp4_ == NULL) ? NULL : (_tmp4_ = (g_list_free (_tmp4_), NULL));
	if (cycle_number) {
		*cycle_number = _vala_cycle_number;
	}
	if (cycle_count) {
		*cycle_count = _vala_cycle_count;
	}
	block2_data_unref (_data2_);
	_data2_ = NULL;
}

static void
sni_indicator_controller_set_toggle_state (SniIndicatorController* self,
                                           SniMenuItem* menu_item,
                                           gboolean value)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu_item != NULL);
	if (self->priv->have_toggles) {
		sni_menu_item_set_toggle_state (menu_item, value);
	} else {
		const gchar* _tmp0_ = NULL;
		if (value) {
			_tmp0_ = "ornament-dot-checked-symbolic";
		} else {
			_tmp0_ = "ornament-dot-unchecked-symbolic";
		}
		sni_menu_item_set_icon_name (menu_item, _tmp0_);
	}
}

static void
sni_indicator_controller_update_menu_items (SniIndicatorController* self)
{
	FtState state = 0;
	FtSessionManager* _tmp0_;
	FtState _tmp1_;
	FtState _tmp2_;
	gboolean is_break = FALSE;
	gboolean is_started = FALSE;
	FtTimer* _tmp3_;
	gboolean is_paused = FALSE;
	FtTimer* _tmp4_;
	gboolean is_finished = FALSE;
	FtTimer* _tmp5_;
	gchar* primary_name = NULL;
	gchar* secondary_name = NULL;
	SniMenuItem* _tmp16_ = NULL;
	SniMenuItem* _tmp17_;
	const gchar* _tmp18_ = NULL;
	const gchar* _tmp21_;
	SniMenuItem* _tmp32_ = NULL;
	SniMenuItem* _tmp33_;
	const gchar* _tmp34_ = NULL;
	const gchar* _tmp37_;
	SniMenuItem* state_separator = NULL;
	SniDBusMenuService* _tmp45_;
	SniMenuItem* _tmp46_;
	SniMenuItem* _tmp47_;
	SniMenuItem* _tmp48_;
	SniMenuItem* pomodoro_item = NULL;
	SniDBusMenuService* _tmp49_;
	SniMenuItem* _tmp50_;
	SniMenuItem* _tmp51_;
	SniMenuItem* _tmp52_;
	SniMenuItem* _tmp53_;
	SniMenuItem* break_item = NULL;
	SniDBusMenuService* _tmp54_;
	SniMenuItem* _tmp55_;
	SniMenuItem* _tmp56_;
	gboolean _tmp57_ = FALSE;
	SniMenuItem* _tmp61_;
	SniMenuItem* _tmp62_;
	SniMenuItem* short_break_item = NULL;
	SniDBusMenuService* _tmp63_;
	SniMenuItem* _tmp64_;
	SniMenuItem* _tmp65_;
	gboolean _tmp66_ = FALSE;
	SniMenuItem* _tmp70_;
	SniMenuItem* _tmp71_;
	SniMenuItem* long_break_item = NULL;
	SniDBusMenuService* _tmp72_;
	SniMenuItem* _tmp73_;
	SniMenuItem* _tmp74_;
	gboolean _tmp75_ = FALSE;
	SniMenuItem* _tmp79_;
	SniMenuItem* _tmp80_;
	SniMenuItem* screen_overlay_item = NULL;
	SniDBusMenuService* _tmp81_;
	SniMenuItem* _tmp82_;
	SniMenuItem* _tmp83_;
	gboolean _tmp84_ = FALSE;
	SniMenuItem* _tmp85_;
	gboolean _tmp86_ = FALSE;
	SniMenuItem* _tmp88_;
	SniDBusMenuService* _tmp89_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_current_state (_tmp0_);
	_tmp2_ = _tmp1_;
	state = _tmp2_;
	is_break = ft_state_is_break (state);
	_tmp3_ = self->priv->timer;
	is_started = ft_timer_is_started (_tmp3_);
	_tmp4_ = self->priv->timer;
	is_paused = ft_timer_is_paused (_tmp4_);
	_tmp5_ = self->priv->timer;
	is_finished = ft_timer_is_finished (_tmp5_);
	primary_name = NULL;
	secondary_name = NULL;
	if (!is_started) {
		gchar* _tmp6_;
		const gchar* _tmp7_ = NULL;
		FtSessionManager* _tmp8_;
		gchar* _tmp9_;
		_tmp6_ = g_strdup ("start");
		_g_free0 (primary_name);
		primary_name = _tmp6_;
		_tmp8_ = self->priv->session_manager;
		if (ft_session_manager_can_reset (_tmp8_)) {
			_tmp7_ = "reset";
		} else {
			_tmp7_ = NULL;
		}
		_tmp9_ = g_strdup (_tmp7_);
		_g_free0 (secondary_name);
		secondary_name = _tmp9_;
	} else {
		if (is_paused) {
			gchar* _tmp10_;
			gchar* _tmp11_;
			_tmp10_ = g_strdup ("resume");
			_g_free0 (primary_name);
			primary_name = _tmp10_;
			_tmp11_ = g_strdup ("stop");
			_g_free0 (secondary_name);
			secondary_name = _tmp11_;
		} else {
			if (is_finished) {
				gchar* _tmp12_;
				gchar* _tmp13_;
				_tmp12_ = g_strdup ("advance");
				_g_free0 (primary_name);
				primary_name = _tmp12_;
				_tmp13_ = g_strdup ("stop");
				_g_free0 (secondary_name);
				secondary_name = _tmp13_;
			} else {
				gchar* _tmp14_;
				gchar* _tmp15_;
				_tmp14_ = g_strdup ("pause");
				_g_free0 (primary_name);
				primary_name = _tmp14_;
				_tmp15_ = g_strdup ("skip");
				_g_free0 (secondary_name);
				secondary_name = _tmp15_;
			}
		}
	}
	_tmp17_ = self->priv->primary_item;
	_tmp16_ = _tmp17_;
	_tmp18_ = NULL;
	if (_tmp16_ != NULL) {
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		_tmp19_ = sni_menu_item_get_name (_tmp16_);
		_tmp20_ = _tmp19_;
		_tmp18_ = _tmp20_;
	}
	_tmp21_ = primary_name;
	if (g_strcmp0 (_tmp18_, _tmp21_) != 0) {
		SniMenuItem* _tmp22_;
		const gchar* _tmp24_;
		const gchar* _tmp29_;
		_tmp22_ = self->priv->primary_item;
		if (_tmp22_ != NULL) {
			SniMenuItem* _tmp23_;
			_tmp23_ = self->priv->primary_item;
			sni_menu_item_set_visible (_tmp23_, FALSE);
		}
		_tmp24_ = primary_name;
		if (_tmp24_ != NULL) {
			SniDBusMenuService* _tmp25_;
			const gchar* _tmp26_;
			SniMenuItem* _tmp27_;
			SniMenuItem* _tmp28_;
			_tmp25_ = self->priv->menu_service;
			_tmp26_ = primary_name;
			_tmp27_ = sni_dbus_menu_service_lookup_menu_item (_tmp25_, _tmp26_);
			self->priv->primary_item = _tmp27_;
			_tmp28_ = self->priv->primary_item;
			sni_menu_item_set_visible (_tmp28_, TRUE);
		}
		_tmp29_ = primary_name;
		if (g_strcmp0 (_tmp29_, "advance") == 0) {
			const gchar* _tmp30_ = NULL;
			SniMenuItem* _tmp31_;
			if (is_break) {
				_tmp30_ = _ ("Start Pomodoro");
			} else {
				_tmp30_ = _ ("Take a Break");
			}
			_tmp31_ = self->priv->primary_item;
			sni_menu_item_set_label (_tmp31_, _tmp30_);
		}
	}
	_tmp33_ = self->priv->secondary_item;
	_tmp32_ = _tmp33_;
	_tmp34_ = NULL;
	if (_tmp32_ != NULL) {
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		_tmp35_ = sni_menu_item_get_name (_tmp32_);
		_tmp36_ = _tmp35_;
		_tmp34_ = _tmp36_;
	}
	_tmp37_ = secondary_name;
	if (g_strcmp0 (_tmp34_, _tmp37_) != 0) {
		SniMenuItem* _tmp38_;
		const gchar* _tmp40_;
		_tmp38_ = self->priv->secondary_item;
		if (_tmp38_ != NULL) {
			SniMenuItem* _tmp39_;
			_tmp39_ = self->priv->secondary_item;
			sni_menu_item_set_visible (_tmp39_, FALSE);
		}
		_tmp40_ = secondary_name;
		if (_tmp40_ != NULL) {
			SniDBusMenuService* _tmp41_;
			const gchar* _tmp42_;
			SniMenuItem* _tmp43_;
			SniMenuItem* _tmp44_;
			_tmp41_ = self->priv->menu_service;
			_tmp42_ = secondary_name;
			_tmp43_ = sni_dbus_menu_service_lookup_menu_item (_tmp41_, _tmp42_);
			self->priv->secondary_item = _tmp43_;
			_tmp44_ = self->priv->secondary_item;
			sni_menu_item_set_visible (_tmp44_, TRUE);
		}
	}
	_tmp45_ = self->priv->menu_service;
	_tmp46_ = sni_dbus_menu_service_lookup_menu_item (_tmp45_, "state-separator");
	_tmp47_ = _g_object_ref0 (_tmp46_);
	state_separator = _tmp47_;
	_tmp48_ = state_separator;
	sni_menu_item_set_visible (_tmp48_, is_started);
	_tmp49_ = self->priv->menu_service;
	_tmp50_ = sni_dbus_menu_service_lookup_menu_item (_tmp49_, "pomodoro");
	_tmp51_ = _g_object_ref0 (_tmp50_);
	pomodoro_item = _tmp51_;
	_tmp52_ = pomodoro_item;
	sni_menu_item_set_visible (_tmp52_, is_started);
	_tmp53_ = pomodoro_item;
	sni_indicator_controller_set_toggle_state (self, _tmp53_, state == FT_STATE_POMODORO);
	_tmp54_ = self->priv->menu_service;
	_tmp55_ = sni_dbus_menu_service_lookup_menu_item (_tmp54_, "break");
	_tmp56_ = _g_object_ref0 (_tmp55_);
	break_item = _tmp56_;
	if (is_started) {
		FtSessionManager* _tmp58_;
		gboolean _tmp59_;
		gboolean _tmp60_;
		_tmp58_ = self->priv->session_manager;
		_tmp59_ = ft_session_manager_get_has_uniform_breaks (_tmp58_);
		_tmp60_ = _tmp59_;
		_tmp57_ = _tmp60_;
	} else {
		_tmp57_ = FALSE;
	}
	_tmp61_ = break_item;
	sni_menu_item_set_visible (_tmp61_, _tmp57_);
	_tmp62_ = break_item;
	sni_indicator_controller_set_toggle_state (self, _tmp62_, state == FT_STATE_BREAK);
	_tmp63_ = self->priv->menu_service;
	_tmp64_ = sni_dbus_menu_service_lookup_menu_item (_tmp63_, "short-break");
	_tmp65_ = _g_object_ref0 (_tmp64_);
	short_break_item = _tmp65_;
	if (is_started) {
		SniMenuItem* _tmp67_;
		gboolean _tmp68_;
		gboolean _tmp69_;
		_tmp67_ = break_item;
		_tmp68_ = sni_menu_item_get_visible (_tmp67_);
		_tmp69_ = _tmp68_;
		_tmp66_ = !_tmp69_;
	} else {
		_tmp66_ = FALSE;
	}
	_tmp70_ = short_break_item;
	sni_menu_item_set_visible (_tmp70_, _tmp66_);
	_tmp71_ = short_break_item;
	sni_indicator_controller_set_toggle_state (self, _tmp71_, state == FT_STATE_SHORT_BREAK);
	_tmp72_ = self->priv->menu_service;
	_tmp73_ = sni_dbus_menu_service_lookup_menu_item (_tmp72_, "long-break");
	_tmp74_ = _g_object_ref0 (_tmp73_);
	long_break_item = _tmp74_;
	if (is_started) {
		SniMenuItem* _tmp76_;
		gboolean _tmp77_;
		gboolean _tmp78_;
		_tmp76_ = break_item;
		_tmp77_ = sni_menu_item_get_visible (_tmp76_);
		_tmp78_ = _tmp77_;
		_tmp75_ = !_tmp78_;
	} else {
		_tmp75_ = FALSE;
	}
	_tmp79_ = long_break_item;
	sni_menu_item_set_visible (_tmp79_, _tmp75_);
	_tmp80_ = long_break_item;
	sni_indicator_controller_set_toggle_state (self, _tmp80_, state == FT_STATE_LONG_BREAK);
	_tmp81_ = self->priv->menu_service;
	_tmp82_ = sni_dbus_menu_service_lookup_menu_item (_tmp81_, "screen-overlay");
	_tmp83_ = _g_object_ref0 (_tmp82_);
	screen_overlay_item = _tmp83_;
	if (is_break) {
		_tmp84_ = !is_finished;
	} else {
		_tmp84_ = FALSE;
	}
	_tmp85_ = screen_overlay_item;
	sni_menu_item_set_enabled (_tmp85_, _tmp84_);
	if (is_break) {
		GSettings* _tmp87_;
		_tmp87_ = self->priv->application_settings;
		_tmp86_ = g_settings_get_boolean (_tmp87_, "screen-overlay");
	} else {
		_tmp86_ = FALSE;
	}
	_tmp88_ = screen_overlay_item;
	sni_menu_item_set_visible (_tmp88_, _tmp86_);
	_tmp89_ = self->priv->menu_service;
	sni_dbus_menu_service_emit_updates (_tmp89_);
	_g_object_unref0 (screen_overlay_item);
	_g_object_unref0 (long_break_item);
	_g_object_unref0 (short_break_item);
	_g_object_unref0 (break_item);
	_g_object_unref0 (pomodoro_item);
	_g_object_unref0 (state_separator);
	_g_free0 (secondary_name);
	_g_free0 (primary_name);
}

static void
sni_indicator_controller_extract_icons_data_free (gpointer _data)
{
	SniIndicatorControllerExtractIconsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->icons_path);
	_sni_indicator_controller_unref0 (_data_->self);
	g_slice_free (SniIndicatorControllerExtractIconsData, _data_);
}

static gpointer
_sni_indicator_controller_ref0 (gpointer self)
{
	return self ? sni_indicator_controller_ref (self) : NULL;
}

static void
sni_indicator_controller_extract_icons (SniIndicatorController* self,
                                        const gchar* icons_path,
                                        GCancellable* cancellable,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	SniIndicatorControllerExtractIconsData* _data_;
	SniIndicatorController* _tmp0_;
	gchar* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (icons_path != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (SniIndicatorControllerExtractIconsData);
	_data_->_async_result = g_task_new (NULL, cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_controller_extract_icons_data_free);
	_tmp0_ = _sni_indicator_controller_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (icons_path);
	_g_free0 (_data_->icons_path);
	_data_->icons_path = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	sni_indicator_controller_extract_icons_co (_data_);
}

static void
sni_indicator_controller_extract_icons_finish (SniIndicatorController* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	SniIndicatorControllerExtractIconsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
         * Extract icon theme from gresource to cache directory.
         */
static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		SniIndicatorController* self;
		self = _data3_->self;
		_g_free0 (_data3_->icons_theme_path);
		_g_object_unref0 (_data3_->cancellable);
		_sni_indicator_controller_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
sni_indicator_controller_extract_icons_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	SniIndicatorControllerExtractIconsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sni_indicator_controller_extract_icons_co (_data_);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		GHashTable* self;
		self = _data4_->self;
		_g_hash_table_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static void
__lambda2_ (Block4Data* _data4_,
            gconstpointer k,
            gconstpointer v)
{
	GHashTable* self;
	self = _data4_->self;
	_data4_->func (v, _data4_->func_target);
}

static void
___lambda2__gh_func (gconstpointer key,
                     gconstpointer value,
                     gpointer self)
{
	__lambda2_ (self, key, value);
}

static void
_vala_g_hash_set_foreach (GHashTable* self,
                          GFunc func,
                          gpointer func_target)
{
	Block4Data* _data4_;
	g_return_if_fail (self != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_hash_table_ref (self);
	_data4_->func = func;
	_data4_->func_target = func_target;
	g_hash_table_foreach ((GHashTable*) self, ___lambda2__gh_func, _data4_);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}

static void
__lambda14_ (Block3Data* _data3_,
             const gchar* size)
{
	SniIndicatorController* self;
	GError* _inner_error0_ = NULL;
	self = _data3_->self;
	g_return_if_fail (size != NULL);
	if (g_strcmp0 (size, "scalable") == 0) {
		return;
	}
	{
		const gchar** scale_collection = NULL;
		gint scale_collection_length1 = 0;
		gint _scale_collection_size_ = 0;
		gint scale_it = 0;
		scale_collection = SNI_INDICATOR_CONTROLLER_SCALES;
		scale_collection_length1 = G_N_ELEMENTS (SNI_INDICATOR_CONTROLLER_SCALES);
		for (scale_it = 0; scale_it < scale_collection_length1; scale_it = scale_it + 1) {
			const gchar* scale = NULL;
			scale = scale_collection[scale_it];
			{
				{
					GFile* scale_directory = NULL;
					const gchar* _tmp0_;
					const gchar* _tmp1_;
					gchar* _tmp2_;
					gchar* _tmp3_;
					gchar* _tmp4_;
					gchar* _tmp5_;
					GFile* _tmp6_;
					GFile* _tmp7_;
					GFile* _tmp8_;
					_tmp0_ = _data3_->icons_theme_path;
					_tmp1_ = scale;
					_tmp2_ = g_strconcat (size, _tmp1_, NULL);
					_tmp3_ = _tmp2_;
					_tmp4_ = g_build_filename (_tmp0_, _tmp3_, NULL);
					_tmp5_ = _tmp4_;
					_tmp6_ = g_file_new_for_path (_tmp5_);
					_tmp7_ = _tmp6_;
					_g_free0 (_tmp5_);
					_g_free0 (_tmp3_);
					scale_directory = _tmp7_;
					_tmp8_ = scale_directory;
					if (!g_file_query_exists (_tmp8_, NULL)) {
						GFile* _tmp9_;
						_tmp9_ = scale_directory;
						g_file_make_symbolic_link (_tmp9_, size, _data3_->cancellable, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (scale_directory);
							goto __catch0_g_error;
						}
					}
					_g_object_unref0 (scale_directory);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* _error_ = NULL;
					GError* _tmp10_;
					const gchar* _tmp11_;
					_error_ = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp10_ = _error_;
					_tmp11_ = _tmp10_->message;
					g_warning ("indicator-provider.vala:523: Failed to make symbolic link: %s", _tmp11_);
					_g_error_free0 (_error_);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
		}
	}
}

static void
___lambda14__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda14_ (self, (const gchar*) data);
}

static gboolean
sni_indicator_controller_extract_icons_co (SniIndicatorControllerExtractIconsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data3_ = g_slice_new0 (Block3Data);
	_data_->_data3_->_ref_count_ = 1;
	_data_->_data3_->self = sni_indicator_controller_ref (_data_->self);
	_g_object_unref0 (_data_->_data3_->cancellable);
	_data_->_data3_->cancellable = _data_->cancellable;
	_data_->_data3_->_async_data_ = _data_;
	if (!_data_->self->priv->have_icon_theme) {
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = g_build_filename (_data_->icons_path, "hicolor", NULL);
	_data_->_data3_->icons_theme_path = _data_->_tmp0_;
	_data_->_tmp1_ = g_str_hash;
	_data_->_tmp2_ = g_str_equal;
	_data_->_tmp3_ = g_hash_table_new_full (_data_->_tmp1_, _data_->_tmp2_, NULL, _g_free0_);
	_data_->directories = _data_->_tmp3_;
	_data_->_tmp4_ = g_str_hash;
	_data_->_tmp5_ = g_str_equal;
	_data_->_tmp6_ = g_hash_table_new_full (_data_->_tmp4_, _data_->_tmp5_, NULL, _g_free0_);
	_data_->sizes = _data_->_tmp6_;
	{
		_data_->filename_collection_length1 = 0;
		_data_->_filename_collection_size_ = 0;
		_data_->filename_collection = SNI_INDICATOR_CONTROLLER_ICONS;
		_data_->filename_collection_length1 = G_N_ELEMENTS (SNI_INDICATOR_CONTROLLER_ICONS);
		for (_data_->filename_it = 0; _data_->filename_it < _data_->filename_collection_length1; _data_->filename_it = _data_->filename_it + 1) {
			_data_->filename = _data_->filename_collection[_data_->filename_it];
			{
				if (g_cancellable_is_cancelled (_data_->_data3_->cancellable)) {
					_g_hash_table_unref0 (_data_->sizes);
					_g_hash_table_unref0 (_data_->directories);
					block3_data_unref (_data_->_data3_);
					_data_->_data3_ = NULL;
					g_task_return_pointer (_data_->_async_result, _data_, NULL);
					if (_data_->_state_ != 0) {
						while (!g_task_get_completed (_data_->_async_result)) {
							g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
						}
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				{
					_data_->_tmp7_ = _data_->_data3_->icons_theme_path;
					_data_->_tmp8_ = _data_->filename;
					_data_->_tmp9_ = sni_normalize_separators (_data_->_tmp8_);
					_data_->_tmp10_ = _data_->_tmp9_;
					_data_->_tmp11_ = g_file_new_build_filename (_data_->_tmp7_, _data_->_tmp10_, NULL);
					_data_->_tmp12_ = _data_->_tmp11_;
					_g_free0 (_data_->_tmp10_);
					_data_->icon_file = _data_->_tmp12_;
					_data_->_tmp13_ = _data_->filename;
					_data_->_tmp14_ = string_to_string (_data_->_tmp13_);
					_data_->_tmp15_ = g_strconcat ("/plugins/sni/icons/", _data_->_tmp14_, NULL);
					_data_->_tmp16_ = _data_->_tmp15_;
					_data_->_tmp17_ = g_resources_lookup_data (_data_->_tmp16_, G_RESOURCE_LOOKUP_FLAGS_NONE, &_data_->_inner_error0_);
					_data_->_tmp18_ = _data_->_tmp17_;
					_g_free0 (_data_->_tmp16_);
					_data_->icon_data = _data_->_tmp18_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_g_object_unref0 (_data_->icon_file);
						goto __catch0_g_error;
					}
					_data_->_tmp19_ = _data_->icon_file;
					_data_->_tmp20_ = g_file_get_parent (_data_->_tmp19_);
					_data_->directory = _data_->_tmp20_;
					_data_->_tmp21_ = _data_->directory;
					_data_->_tmp22_ = g_file_get_path (_data_->_tmp21_);
					_data_->directory_path = _data_->_tmp22_;
					_data_->_tmp23_ = _data_->directories;
					_data_->_tmp24_ = _data_->directory_path;
					if (!g_hash_table_contains (_data_->_tmp23_, _data_->_tmp24_)) {
						_data_->_tmp25_ = _data_->directories;
						_data_->_tmp26_ = _data_->directory_path;
						_data_->_tmp27_ = g_strdup (_data_->_tmp26_);
						g_hash_table_add (_data_->_tmp25_, _data_->_tmp27_);
						_data_->_tmp28_ = _data_->directory;
						if (!g_file_query_exists (_data_->_tmp28_, NULL)) {
							_data_->_tmp29_ = _data_->directory;
							g_file_make_directory_with_parents (_data_->_tmp29_, _data_->_data3_->cancellable, &_data_->_inner_error0_);
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
								_g_free0 (_data_->directory_path);
								_g_object_unref0 (_data_->directory);
								_g_bytes_unref0 (_data_->icon_data);
								_g_object_unref0 (_data_->icon_file);
								goto __catch0_g_error;
							}
						}
						_data_->_tmp30_ = _data_->filename;
						_data_->_tmp32_ = _data_->_tmp31_ = g_strsplit (_data_->_tmp30_, "/", 0);
						_data_->filename_parts = _data_->_tmp32_;
						_data_->filename_parts_length1 = _vala_array_length (_data_->_tmp31_);
						_data_->_filename_parts_size_ = _data_->filename_parts_length1;
						_data_->_tmp33_ = _data_->filename_parts;
						_data_->_tmp33__length1 = _data_->filename_parts_length1;
						if (_data_->_tmp33__length1 == 3) {
							_data_->_tmp34_ = _data_->sizes;
							_data_->_tmp35_ = _data_->filename_parts;
							_data_->_tmp35__length1 = _data_->filename_parts_length1;
							_data_->_tmp36_ = _data_->_tmp35_[0];
							_data_->_tmp37_ = g_strdup (_data_->_tmp36_);
							g_hash_table_add (_data_->_tmp34_, _data_->_tmp37_);
						}
						_data_->filename_parts = (_vala_array_free (_data_->filename_parts, _data_->filename_parts_length1, (GDestroyNotify) g_free), NULL);
					}
					_data_->_tmp38_ = _data_->icon_file;
					_data_->_tmp39_ = _data_->icon_data;
					_data_->_tmp40_ = 0;
					_data_->_tmp41_ = g_bytes_get_data (_data_->_tmp39_, &_data_->_tmp40_);
					_data_->_state_ = 1;
					g_file_replace_contents_async (_data_->_tmp38_, (const char*) _data_->_tmp41_, (gsize) _data_->_tmp40_, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, sni_indicator_controller_extract_icons_ready, _data_);
					return FALSE;
					_state_1:
					g_file_replace_contents_finish (_data_->_tmp38_, _data_->_res_, NULL, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_g_free0 (_data_->directory_path);
						_g_object_unref0 (_data_->directory);
						_g_bytes_unref0 (_data_->icon_data);
						_g_object_unref0 (_data_->icon_file);
						goto __catch0_g_error;
					}
					_g_free0 (_data_->directory_path);
					_g_object_unref0 (_data_->directory);
					_g_bytes_unref0 (_data_->icon_data);
					_g_object_unref0 (_data_->icon_file);
				}
				goto __finally0;
				__catch0_g_error:
				{
					_data_->_error_ = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp42_ = _data_->filename;
					_data_->_tmp43_ = _data_->_error_;
					_data_->_tmp44_ = _data_->_tmp43_->message;
					g_warning ("indicator-provider.vala:502: Failed to extract %s: %s", _data_->_tmp42_, _data_->_tmp44_);
					_data_->_tmp45_ = _data_->_error_;
					_data_->_tmp46_ = _g_error_copy0 (_data_->_tmp45_);
					_data_->_inner_error0_ = _data_->_tmp46_;
					_g_error_free0 (_data_->_error_);
					goto __finally0;
				}
				__finally0:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_hash_table_unref0 (_data_->sizes);
					_g_hash_table_unref0 (_data_->directories);
					block3_data_unref (_data_->_data3_);
					_data_->_data3_ = NULL;
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
		}
	}
	_data_->_tmp47_ = _data_->sizes;
	_vala_g_hash_set_foreach (_data_->_tmp47_, ___lambda14__gfunc, _data_->_data3_);
	_g_hash_table_unref0 (_data_->sizes);
	_g_hash_table_unref0 (_data_->directories);
	block3_data_unref (_data_->_data3_);
	_data_->_data3_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sni_indicator_controller_export_menu (SniIndicatorController* self,
                                      const gchar* menu_object_path,
                                      const gchar* icons_path,
                                      GError** error)
{
	SniMenuItem* root = NULL;
	SniMenuItem* _tmp0_;
	SniDBusMenuService* menu_service = NULL;
	SniMenuItem* _tmp1_;
	SniIndicatorActionGroup* _tmp2_;
	SniDBusMenuService* _tmp3_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu_object_path != NULL);
	g_return_if_fail (icons_path != NULL);
	_tmp0_ = sni_indicator_controller_build_menu (self);
	root = _tmp0_;
	_tmp1_ = root;
	_tmp2_ = self->priv->action_group;
	_tmp3_ = sni_dbus_menu_service_new (_tmp1_, _tmp2_, icons_path);
	menu_service = _tmp3_;
	{
		guint _tmp4_ = 0U;
		GDBusConnection* _tmp5_;
		SniDBusMenuService* _tmp6_;
		guint _tmp7_;
		SniDBusMenuService* _tmp8_;
		SniDBusMenuService* _tmp9_;
		_tmp5_ = self->priv->connection;
		_tmp6_ = menu_service;
		_tmp7_ = sni_dbus_menu_service_register_object (_tmp6_, _tmp5_, menu_object_path, &_inner_error0_);
		_tmp4_ = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		self->priv->menu_service_id = _tmp4_;
		_tmp8_ = menu_service;
		_tmp9_ = _g_object_ref0 (_tmp8_);
		_g_object_unref0 (self->priv->menu_service);
		self->priv->menu_service = _tmp9_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		GError* _tmp12_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = _error_;
		_tmp11_ = _tmp10_->message;
		_tmp12_ = g_error_new_literal (SNI_INDICATOR_ERROR, SNI_INDICATOR_ERROR_INDICATOR_MENU, _tmp11_);
		_inner_error0_ = _tmp12_;
		_g_error_free0 (_error_);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == SNI_INDICATOR_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (menu_service);
			_g_object_unref0 (root);
			return;
		} else {
			_g_object_unref0 (menu_service);
			_g_object_unref0 (root);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	sni_indicator_controller_update_menu_items (self);
	_g_object_unref0 (menu_service);
	_g_object_unref0 (root);
}

static void
__lambda15_ (SniIndicatorController* self,
             const gchar* token)
{
	SniDBusMenuService* _tmp0_;
	g_return_if_fail (token != NULL);
	_tmp0_ = self->priv->menu_service;
	if (_tmp0_ != NULL) {
		SniDBusMenuService* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->menu_service;
		_tmp2_ = g_strdup (token);
		_g_free0 (_tmp1_->activation_token);
		_tmp1_->activation_token = _tmp2_;
	}
}

static void
___lambda15__sni_status_notifier_item_dbus_service_received_activation_token (SniStatusNotifierItemDBusService* _sender,
                                                                              const gchar* token,
                                                                              gpointer self)
{
	__lambda15_ ((SniIndicatorController*) self, token);
}

static void
__lambda16_ (SniIndicatorController* self,
             const gchar* token)
{
	FtApplication* application = NULL;
	FtApplication* _tmp0_;
	FtApplication* _tmp1_;
	FtWindow* window = NULL;
	FtApplication* _tmp2_;
	gconstpointer _tmp3_;
	FtWindow* _tmp4_;
	gboolean _tmp5_ = FALSE;
	FtWindow* _tmp6_;
	g_return_if_fail (token != NULL);
	_tmp0_ = ft_application_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	application = _tmp1_;
	_tmp2_ = application;
	_tmp3_ = ft_application_get_window (_tmp2_, FT_TYPE_WINDOW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	_tmp4_ = _g_object_ref0 ((FtWindow*) _tmp3_);
	window = _tmp4_;
	_tmp6_ = window;
	if (_tmp6_ == NULL) {
		_tmp5_ = TRUE;
	} else {
		FtWindow* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp7_ = window;
		g_object_get ((GtkWindow*) _tmp7_, "is-active", &_tmp8_, NULL);
		_tmp9_ = _tmp8_;
		_tmp5_ = !_tmp9_;
	}
	if (_tmp5_) {
		SniIndicatorActionGroup* _tmp10_;
		GVariant* _tmp11_;
		GVariant* _tmp12_;
		GVariant* _tmp13_;
		GVariant* _tmp14_;
		_tmp10_ = self->priv->action_group;
		_tmp11_ = g_variant_new_string ("timer");
		g_variant_ref_sink (_tmp11_);
		_tmp12_ = _tmp11_;
		_tmp13_ = sni_build_platform_data (token);
		_tmp14_ = _tmp13_;
		g_remote_action_group_activate_action_full ((GRemoteActionGroup*) _tmp10_, "app.window", _tmp12_, _tmp14_);
		_g_variant_unref0 (_tmp14_);
		_g_variant_unref0 (_tmp12_);
	} else {
		FtWindow* _tmp15_;
		_tmp15_ = window;
		ft_window_close_to_background (_tmp15_);
	}
	_g_object_unref0 (window);
	_g_object_unref0 (application);
}

static void
___lambda16__sni_status_notifier_item_dbus_service_activated (SniStatusNotifierItemDBusService* _sender,
                                                              const gchar* token,
                                                              gpointer self)
{
	__lambda16_ ((SniIndicatorController*) self, token);
}

static void
__lambda17_ (SniIndicatorController* self)
{
	gboolean _tmp0_ = FALSE;
	if (self->priv->have_icon_theme) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->have_tooltips;
	}
	if (_tmp0_) {
		FtTimer* _tmp1_;
		_tmp1_ = self->priv->timer;
		if (!ft_timer_is_finished (_tmp1_)) {
			SniIndicatorActionGroup* _tmp2_ = NULL;
			SniIndicatorActionGroup* _tmp3_;
			_tmp3_ = self->priv->action_group;
			_tmp2_ = _tmp3_;
			if (_tmp2_ != NULL) {
				g_action_group_activate_action ((GActionGroup*) _tmp2_, "timer.start-pause-resume", NULL);
			}
		} else {
			SniIndicatorActionGroup* _tmp4_ = NULL;
			SniIndicatorActionGroup* _tmp5_;
			_tmp5_ = self->priv->action_group;
			_tmp4_ = _tmp5_;
			if (_tmp4_ != NULL) {
				g_action_group_activate_action ((GActionGroup*) _tmp4_, "session-manager.advance", NULL);
			}
		}
	}
}

static void
___lambda17__sni_status_notifier_item_dbus_service_secondary_activated (SniStatusNotifierItemDBusService* _sender,
                                                                        gpointer self)
{
	__lambda17_ ((SniIndicatorController*) self);
}

static void
__lambda18_ (SniIndicatorController* self,
             gint delta)
{
	if (self->priv->have_tooltips) {
		FtNotificationManager* _tmp0_;
		gint64 _tmp1_ = 0LL;
		FtTimer* _tmp2_;
		FtNotificationManager* _tmp3_;
		_tmp0_ = self->priv->notification_manager;
		ft_notification_manager_inhibit (_tmp0_);
		ft_context_set_event_source ("timer.extend", FT_TIMESTAMP_UNDEFINED);
		if (delta > 0) {
			_tmp1_ = FT_INTERVAL_MINUTE;
		} else {
			_tmp1_ = -FT_INTERVAL_MINUTE;
		}
		_tmp2_ = self->priv->timer;
		ft_timer_extend (_tmp2_, _tmp1_, FT_TIMESTAMP_UNDEFINED);
		_tmp3_ = self->priv->notification_manager;
		ft_notification_manager_uninhibit (_tmp3_, FALSE);
	}
}

static void
___lambda18__sni_status_notifier_item_dbus_service_scrolled (SniStatusNotifierItemDBusService* _sender,
                                                             gint delta,
                                                             gpointer self)
{
	__lambda18_ ((SniIndicatorController*) self, delta);
}

static void
sni_indicator_controller_export_icon (SniIndicatorController* self,
                                      const gchar* menu_object_path,
                                      const gchar* icons_path,
                                      GError** error)
{
	SniDBusMenuService* _tmp0_;
	SniStatusNotifierItemDBusService* service = NULL;
	SniStatusNotifierItemDBusService* _tmp1_;
	SniStatusNotifierItemDBusService* _tmp2_;
	SniStatusNotifierItemDBusService* _tmp3_;
	SniStatusNotifierItemDBusService* _tmp4_;
	SniStatusNotifierItemDBusService* _tmp5_;
	SniStatusNotifierItemDBusService* _tmp6_;
	SniStatusNotifierItemDBusService* _tmp7_;
	gint64 timestamp = 0LL;
	FtTimer* _tmp8_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu_object_path != NULL);
	g_return_if_fail (icons_path != NULL);
	_tmp0_ = self->priv->menu_service;
	_vala_return_if_fail (_tmp0_ != NULL, "this.menu_service != null");
	_tmp1_ = sni_status_notifier_item_dbus_service_new (menu_object_path, icons_path);
	service = _tmp1_;
	_tmp2_ = service;
	g_signal_connect (_tmp2_, "received-activation-token", (GCallback) ___lambda15__sni_status_notifier_item_dbus_service_received_activation_token, self);
	_tmp3_ = service;
	g_signal_connect (_tmp3_, "activated", (GCallback) ___lambda16__sni_status_notifier_item_dbus_service_activated, self);
	_tmp4_ = service;
	g_signal_connect (_tmp4_, "secondary-activated", (GCallback) ___lambda17__sni_status_notifier_item_dbus_service_secondary_activated, self);
	_tmp5_ = service;
	g_signal_connect (_tmp5_, "scrolled", (GCallback) ___lambda18__sni_status_notifier_item_dbus_service_scrolled, self);
	_tmp6_ = service;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_g_object_unref0 (self->priv->service);
	self->priv->service = _tmp7_;
	_tmp8_ = self->priv->timer;
	timestamp = ft_timer_get_current_time (_tmp8_, FT_TIMESTAMP_UNDEFINED);
	sni_indicator_controller_update_status (self);
	sni_indicator_controller_update_icon (self, timestamp);
	sni_indicator_controller_update_tooltip (self, timestamp);
	{
		guint _tmp9_ = 0U;
		GDBusConnection* _tmp10_;
		SniStatusNotifierItemDBusService* _tmp11_;
		guint _tmp12_;
		_tmp10_ = self->priv->connection;
		_tmp11_ = service;
		_tmp12_ = sni_status_notifier_item_dbus_service_register_object (_tmp11_, _tmp10_, SNI_INDICATOR_CONTROLLER_OBJECT_PATH, &_inner_error0_);
		_tmp9_ = _tmp12_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		self->priv->service_id = _tmp9_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		GError* _tmp15_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_g_object_unref0 (self->priv->service);
		self->priv->service = NULL;
		sni_indicator_controller_invalidate_tooltip (self);
		_tmp13_ = _error_;
		_tmp14_ = _tmp13_->message;
		_tmp15_ = g_error_new_literal (SNI_INDICATOR_ERROR, SNI_INDICATOR_ERROR_INDICATOR, _tmp14_);
		_inner_error0_ = _tmp15_;
		_g_error_free0 (_error_);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == SNI_INDICATOR_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (service);
			return;
		} else {
			_g_object_unref0 (service);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_g_object_unref0 (service);
}

static void
sni_indicator_controller_export_data_free (gpointer _data)
{
	SniIndicatorControllerExportData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_sni_indicator_controller_unref0 (_data_->self);
	g_slice_free (SniIndicatorControllerExportData, _data_);
}

void
sni_indicator_controller_export (SniIndicatorController* self,
                                 GCancellable* cancellable,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	SniIndicatorControllerExportData* _data_;
	SniIndicatorController* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (SniIndicatorControllerExportData);
	_data_->_async_result = g_task_new (NULL, cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_controller_export_data_free);
	_tmp0_ = _sni_indicator_controller_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	sni_indicator_controller_export_co (_data_);
}

void
sni_indicator_controller_export_finish (SniIndicatorController* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	SniIndicatorControllerExportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
sni_indicator_controller_export_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	SniIndicatorControllerExportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sni_indicator_controller_export_co (_data_);
}

static gboolean
sni_indicator_controller_export_co (SniIndicatorControllerExportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup_printf (SNI_INDICATOR_CONTROLLER_BUS_NAME, APPLICATION_ID);
	_data_->bus_name = _data_->_tmp0_;
	_data_->_tmp1_ = g_application_get_default ();
	_data_->_tmp2_ = g_application_get_dbus_object_path (_data_->_tmp1_);
	_data_->_tmp3_ = g_strdup_printf (SNI_INDICATOR_CONTROLLER_MENU_OBJECT_PATH, _data_->_tmp2_);
	_data_->menu_object_path = _data_->_tmp3_;
	_data_->_tmp4_ = g_get_user_cache_dir ();
	_data_->_tmp5_ = g_build_filename (_data_->_tmp4_, PACKAGE_NAME, "icons", NULL);
	_data_->icons_path = _data_->_tmp5_;
	{
		_data_->_tmp6_ = _data_->icons_path;
		_data_->_state_ = 1;
		sni_indicator_controller_extract_icons (_data_->self, _data_->_tmp6_, _data_->cancellable, sni_indicator_controller_export_ready, _data_);
		return FALSE;
		_state_1:
		sni_indicator_controller_extract_icons_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp7_ = _data_->menu_object_path;
		_data_->_tmp8_ = _data_->icons_path;
		sni_indicator_controller_export_menu (_data_->self, _data_->_tmp7_, _data_->_tmp8_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp9_ = _data_->menu_object_path;
		_data_->_tmp10_ = _data_->icons_path;
		sni_indicator_controller_export_icon (_data_->self, _data_->_tmp9_, _data_->_tmp10_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		sni_indicator_controller_connect_signals (_data_->self);
		sni_indicator_controller_update_icon_timeout (_data_->self);
		_data_->_tmp11_ = _data_->self->priv->connection;
		_data_->_tmp12_ = _data_->bus_name;
		_data_->self->priv->name_owner_id = g_bus_own_name_on_connection_with_closures (_data_->_tmp11_, _data_->_tmp12_, G_BUS_NAME_OWNER_FLAGS_REPLACE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_data_->_tmp13_ = _data_->self->priv->watcher_proxy;
		_data_->_tmp14_ = _data_->bus_name;
		_data_->_state_ = 2;
		sni_status_notifier_watcher_register_status_notifier_item (_data_->_tmp13_, _data_->_tmp14_, sni_indicator_controller_export_ready, _data_);
		return FALSE;
		_state_2:
		sni_status_notifier_watcher_register_status_notifier_item_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp15_ = _data_->_error_;
		_data_->_tmp16_ = _data_->_tmp15_->message;
		_data_->_tmp17_ = g_error_new_literal (SNI_INDICATOR_ERROR, SNI_INDICATOR_ERROR_INDICATOR, _data_->_tmp16_);
		_data_->_inner_error0_ = _data_->_tmp17_;
		_g_error_free0 (_data_->_error_);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == SNI_INDICATOR_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->icons_path);
			_g_free0 (_data_->menu_object_path);
			_g_free0 (_data_->bus_name);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->icons_path);
			_g_free0 (_data_->menu_object_path);
			_g_free0 (_data_->bus_name);
			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);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (!g_cancellable_is_cancelled (_data_->cancellable)) {
		_data_->_tmp18_ = _data_->self->priv->menu_service;
		sni_dbus_menu_service_emit_layout_updated (_data_->_tmp18_);
		_data_->_tmp19_ = _data_->self->priv->service;
		sni_status_notifier_item_dbus_service_emit_new_menu (_data_->_tmp19_);
	}
	_g_free0 (_data_->icons_path);
	_g_free0 (_data_->menu_object_path);
	_g_free0 (_data_->bus_name);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sni_indicator_controller_update_status (SniIndicatorController* self)
{
	SniIndicatorStatus status = 0;
	FtSessionManager* _tmp0_;
	FtState _tmp1_;
	FtState _tmp2_;
	SniStatusNotifierItemDBusService* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_current_state (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == FT_STATE_STOPPED) {
		SniIndicatorStatus _tmp3_ = 0;
		if (self->priv->have_passive_status) {
			_tmp3_ = SNI_INDICATOR_STATUS_PASSIVE;
		} else {
			_tmp3_ = SNI_INDICATOR_STATUS_ACTIVE;
		}
		status = _tmp3_;
	} else {
		gboolean _tmp4_ = FALSE;
		if (self->priv->have_attention_status) {
			gboolean _tmp5_ = FALSE;
			FtTimer* _tmp6_;
			_tmp6_ = self->priv->timer;
			if (ft_timer_is_paused (_tmp6_)) {
				_tmp5_ = TRUE;
			} else {
				FtTimer* _tmp7_;
				_tmp7_ = self->priv->timer;
				_tmp5_ = ft_timer_is_finished (_tmp7_);
			}
			_tmp4_ = _tmp5_;
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			status = SNI_INDICATOR_STATUS_NEEDS_ATTENTION;
		} else {
			status = SNI_INDICATOR_STATUS_ACTIVE;
		}
	}
	_tmp8_ = self->priv->service;
	sni_status_notifier_item_dbus_service_set_status_internal (_tmp8_, status, self->priv->service_id != ((guint) 0));
}

static void
sni_indicator_controller_update_icon (SniIndicatorController* self,
                                      gint64 timestamp)
{
	gchar* icon_name = NULL;
	gdouble progress = 0.0;
	FtTimer* _tmp0_;
	guint progress_uint = 0U;
	FtSessionManager* _tmp1_;
	FtState _tmp2_;
	FtState _tmp3_;
	SniStatusNotifierItemDBusService* _tmp16_;
	const gchar* _tmp17_;
	g_return_if_fail (self != NULL);
	if (!self->priv->have_icon_theme) {
		return;
	}
	_tmp0_ = self->priv->timer;
	progress = ft_timer_calculate_progress (_tmp0_, timestamp);
	progress_uint = ((guint) round (progress * SNI_INDICATOR_CONTROLLER_ICON_STEPS)) * (100U / SNI_INDICATOR_CONTROLLER_ICON_STEPS);
	_tmp1_ = self->priv->session_manager;
	_tmp2_ = ft_session_manager_get_current_state (_tmp1_);
	_tmp3_ = _tmp2_;
	switch (_tmp3_) {
		case FT_STATE_STOPPED:
		{
			const gchar* _tmp4_ = NULL;
			gchar* _tmp5_;
			if (self->priv->have_passive_status) {
				_tmp4_ = "indicator-passive-symbolic";
			} else {
				_tmp4_ = "indicator-stopped-symbolic";
			}
			_tmp5_ = g_strdup (_tmp4_);
			_g_free0 (icon_name);
			icon_name = _tmp5_;
			break;
		}
		case FT_STATE_POMODORO:
		{
			gchar* _tmp6_ = NULL;
			FtTimer* _tmp7_;
			gchar* _tmp10_;
			_tmp7_ = self->priv->timer;
			if (ft_timer_is_paused (_tmp7_)) {
				gchar* _tmp8_;
				_tmp8_ = g_strdup ("indicator-pomodoro-paused-symbolic");
				_g_free0 (_tmp6_);
				_tmp6_ = _tmp8_;
			} else {
				gchar* _tmp9_;
				_tmp9_ = g_strdup_printf ("indicator-pomodoro-%03u-symbolic", progress_uint);
				_g_free0 (_tmp6_);
				_tmp6_ = _tmp9_;
			}
			_tmp10_ = _tmp6_;
			_tmp6_ = NULL;
			_g_free0 (icon_name);
			icon_name = _tmp10_;
			_g_free0 (_tmp6_);
			break;
		}
		case FT_STATE_BREAK:
		case FT_STATE_SHORT_BREAK:
		case FT_STATE_LONG_BREAK:
		{
			gchar* _tmp11_ = NULL;
			FtTimer* _tmp12_;
			gchar* _tmp15_;
			_tmp12_ = self->priv->timer;
			if (ft_timer_is_paused (_tmp12_)) {
				gchar* _tmp13_;
				_tmp13_ = g_strdup ("indicator-break-paused-symbolic");
				_g_free0 (_tmp11_);
				_tmp11_ = _tmp13_;
			} else {
				gchar* _tmp14_;
				_tmp14_ = g_strdup_printf ("indicator-break-%03u-symbolic", progress_uint);
				_g_free0 (_tmp11_);
				_tmp11_ = _tmp14_;
			}
			_tmp15_ = _tmp11_;
			_tmp11_ = NULL;
			_g_free0 (icon_name);
			icon_name = _tmp15_;
			_g_free0 (_tmp11_);
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	_tmp16_ = self->priv->service;
	_tmp17_ = icon_name;
	sni_status_notifier_item_dbus_service_set_icon_name_internal (_tmp16_, _tmp17_, self->priv->service_id != ((guint) 0));
	_g_free0 (icon_name);
}

static void
sni_indicator_controller_update_tooltip (SniIndicatorController* self,
                                         gint64 timestamp)
{
	const gchar* _tmp0_;
	SniTooltip tooltip = {0};
	const gchar* _tmp8_;
	gchar* _tmp9_;
	SniTooltip _tmp10_ = {0};
	SniStatusNotifierItemDBusService* _tmp27_;
	SniTooltip _tmp28_;
	g_return_if_fail (self != NULL);
	if (!self->priv->have_tooltips) {
		return;
	}
	_tmp0_ = self->priv->tooltip_title;
	if (_tmp0_ == NULL) {
		guint cycle_number = 0U;
		guint cycle_count = 0U;
		guint _tmp1_ = 0U;
		guint _tmp2_ = 0U;
		FtSessionManager* _tmp3_;
		FtState _tmp4_;
		FtState _tmp5_;
		FtTimer* _tmp6_;
		gchar* _tmp7_;
		sni_indicator_controller_get_cycle_number_count (self, &_tmp1_, &_tmp2_);
		cycle_number = _tmp1_;
		cycle_count = _tmp2_;
		_tmp3_ = self->priv->session_manager;
		_tmp4_ = ft_session_manager_get_current_state (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->timer;
		_tmp7_ = sni_format_tooltip_title (_tmp5_, cycle_number, cycle_count, ft_timer_is_finished (_tmp6_));
		_g_free0 (self->priv->tooltip_title);
		self->priv->tooltip_title = _tmp7_;
	}
	_tmp8_ = self->priv->tooltip_title;
	_tmp9_ = g_strdup (_tmp8_);
	sni_tooltip_init (&_tmp10_);
	_g_free0 (_tmp10_.title);
	_tmp10_.title = _tmp9_;
	tooltip = _tmp10_;
	if (self->priv->have_icon_theme) {
		gchar* _tmp11_ = NULL;
		gboolean _tmp12_ = FALSE;
		FtTimer* _tmp13_;
		gint64 _tmp14_;
		gint64 _tmp15_;
		gchar* _tmp20_;
		_tmp13_ = self->priv->timer;
		_tmp14_ = ft_timer_get_duration (_tmp13_);
		_tmp15_ = _tmp14_;
		if (_tmp15_ > ((gint64) 0)) {
			FtTimer* _tmp16_;
			_tmp16_ = self->priv->timer;
			_tmp12_ = !ft_timer_is_finished (_tmp16_);
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			FtTimer* _tmp17_;
			gchar* _tmp18_;
			_tmp17_ = self->priv->timer;
			_tmp18_ = sni_format_remaining_time (ft_timer_calculate_remaining (_tmp17_, timestamp));
			_g_free0 (_tmp11_);
			_tmp11_ = _tmp18_;
		} else {
			gchar* _tmp19_;
			_tmp19_ = g_strdup ("");
			_g_free0 (_tmp11_);
			_tmp11_ = _tmp19_;
		}
		_tmp20_ = _tmp11_;
		_tmp11_ = NULL;
		_g_free0 (tooltip.description);
		tooltip.description = _tmp20_;
		_g_free0 (_tmp11_);
	} else {
		gchar* _tmp21_ = NULL;
		FtTimer* _tmp22_;
		gchar* _tmp26_;
		_tmp22_ = self->priv->timer;
		if (ft_timer_is_running (_tmp22_)) {
			FtTimer* _tmp23_;
			gchar* _tmp24_;
			_tmp23_ = self->priv->timer;
			_tmp24_ = sni_format_remaining_time (ft_timer_calculate_remaining (_tmp23_, timestamp));
			_g_free0 (_tmp21_);
			_tmp21_ = _tmp24_;
		} else {
			gchar* _tmp25_;
			_tmp25_ = g_strdup ("");
			_g_free0 (_tmp21_);
			_tmp21_ = _tmp25_;
		}
		_tmp26_ = _tmp21_;
		_tmp21_ = NULL;
		_g_free0 (tooltip.description);
		tooltip.description = _tmp26_;
		_g_free0 (_tmp21_);
	}
	_tmp27_ = self->priv->service;
	_tmp28_ = tooltip;
	sni_status_notifier_item_dbus_service_set_tooltip_internal (_tmp27_, &_tmp28_, self->priv->service_id != ((guint) 0));
	sni_tooltip_destroy (&tooltip);
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		SniIndicatorController* self;
		self = _data5_->self;
		_sni_indicator_controller_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static void
_sni_indicator_controller_update_icon_ft_timer_tick (FtTimer* _sender,
                                                     gint64 timestamp,
                                                     gpointer self)
{
	sni_indicator_controller_update_icon ((SniIndicatorController*) self, timestamp);
}

static gboolean
_sni_indicator_controller_on_update_icon_timeout_gsource_func (gpointer self)
{
	gboolean result;
	result = sni_indicator_controller_on_update_icon_timeout ((SniIndicatorController*) self);
	return result;
}

static gboolean
____lambda19_ (Block5Data* _data5_)
{
	SniIndicatorController* self;
	gboolean result;
	self = _data5_->self;
	sni_indicator_controller_on_update_icon_timeout (self);
	self->priv->update_icon_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, _data5_->interval, _sni_indicator_controller_on_update_icon_timeout_gsource_func, sni_indicator_controller_ref (self), sni_indicator_controller_unref);
	g_source_set_name_by_id (self->priv->update_icon_timeout_id, "Sni.IndicatorController.update_icon");
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
_____lambda19__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda19_ (self);
	return result;
}

static void
sni_indicator_controller_update_icon_timeout (SniIndicatorController* self)
{
	Block5Data* _data5_;
	FtTimer* _tmp0_;
	guint _tmp1_;
	gboolean _tmp2_ = FALSE;
	FtTimer* _tmp3_;
	FtTimer* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	gboolean _tmp7_ = FALSE;
	g_return_if_fail (self != NULL);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = sni_indicator_controller_ref (self);
	if (self->priv->update_icon_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->update_icon_timeout_id);
		self->priv->update_icon_timeout_id = (guint) 0;
	}
	_tmp0_ = self->priv->timer;
	g_signal_parse_name ("tick", FT_TYPE_TIMER, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _sni_indicator_controller_update_icon_ft_timer_tick, self);
	_tmp3_ = self->priv->timer;
	if (!ft_timer_is_running (_tmp3_)) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = !self->priv->have_icon_theme;
	}
	if (_tmp2_) {
		block5_data_unref (_data5_);
		_data5_ = NULL;
		return;
	}
	_tmp4_ = self->priv->timer;
	_tmp5_ = ft_timer_get_duration (_tmp4_);
	_tmp6_ = _tmp5_;
	_data5_->interval = ft_timestamp_to_milliseconds_uint (_tmp6_ / SNI_INDICATOR_CONTROLLER_ICON_STEPS);
	if (_data5_->interval < ((guint) 5000)) {
		_tmp7_ = _data5_->interval > ((guint) 0);
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		guint offset = 0U;
		FtTimer* _tmp8_;
		gint deviation = 0;
		_tmp8_ = self->priv->timer;
		offset = ft_timestamp_to_milliseconds_uint (ft_timer_calculate_elapsed (_tmp8_, FT_TIMESTAMP_UNDEFINED)) % _data5_->interval;
		deviation = MIN (((gint) _data5_->interval) - ((gint) offset), (gint) offset);
		if (deviation < 100) {
			self->priv->update_icon_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, _data5_->interval, _sni_indicator_controller_on_update_icon_timeout_gsource_func, sni_indicator_controller_ref (self), sni_indicator_controller_unref);
			g_source_set_name_by_id (self->priv->update_icon_timeout_id, "Sni.IndicatorController.update_icon");
		} else {
			self->priv->update_icon_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, _data5_->interval - offset, _____lambda19__gsource_func, block5_data_ref (_data5_), block5_data_unref);
		}
	} else {
		FtTimer* _tmp9_;
		_tmp9_ = self->priv->timer;
		g_signal_connect (_tmp9_, "tick", (GCallback) _sni_indicator_controller_update_icon_ft_timer_tick, self);
	}
	block5_data_unref (_data5_);
	_data5_ = NULL;
}

static inline void
sni_indicator_controller_invalidate_tooltip (SniIndicatorController* self)
{
	g_return_if_fail (self != NULL);
	_g_free0 (self->priv->tooltip_title);
	self->priv->tooltip_title = NULL;
}

static void
sni_indicator_controller_update (SniIndicatorController* self,
                                 gint64 timestamp)
{
	g_return_if_fail (self != NULL);
	if (self->priv->update_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->update_idle_id);
		self->priv->update_idle_id = (guint) 0;
	}
	sni_indicator_controller_update_icon (self, timestamp);
	sni_indicator_controller_update_icon_timeout (self);
	sni_indicator_controller_update_status (self);
	sni_indicator_controller_update_menu_items (self);
	sni_indicator_controller_invalidate_tooltip (self);
	sni_indicator_controller_update_tooltip (self, timestamp);
}

static gboolean
__lambda20_ (SniIndicatorController* self)
{
	gint64 timestamp = 0LL;
	FtTimer* _tmp0_;
	GSource* _tmp1_;
	gboolean result;
	_tmp0_ = self->priv->timer;
	_tmp1_ = g_main_current_source ();
	timestamp = ft_timer_get_current_time (_tmp0_, g_source_get_time (_tmp1_));
	self->priv->update_idle_id = (guint) 0;
	sni_indicator_controller_update (self, timestamp);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda20__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda20_ ((SniIndicatorController*) self);
	return result;
}

static void
sni_indicator_controller_queue_update (SniIndicatorController* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->update_idle_id != ((guint) 0)) {
		return;
	}
	self->priv->update_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda20__gsource_func, sni_indicator_controller_ref (self), sni_indicator_controller_unref);
}

static gboolean
sni_indicator_controller_on_update_icon_timeout (SniIndicatorController* self)
{
	gint64 timestamp = 0LL;
	FtTimer* _tmp0_;
	GSource* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->timer;
	_tmp1_ = g_main_current_source ();
	timestamp = ft_timer_get_current_time (_tmp0_, g_source_get_time (_tmp1_));
	sni_indicator_controller_update_icon (self, timestamp);
	result = G_SOURCE_CONTINUE;
	return result;
}

static void
sni_indicator_controller_on_timer_state_changed (SniIndicatorController* self,
                                                 const FtTimerState* current_state,
                                                 const FtTimerState* previous_state)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_state != NULL);
	g_return_if_fail (previous_state != NULL);
	_tmp0_ = self->priv->timer;
	sni_indicator_controller_update (self, ft_timer_get_last_state_changed_time (_tmp0_));
}

static void
sni_indicator_controller_on_session_manager_notify_current_session (SniIndicatorController* self)
{
	g_return_if_fail (self != NULL);
	sni_indicator_controller_queue_update (self);
}

static void
sni_indicator_controller_on_session_manager_notify_current_state (SniIndicatorController* self)
{
	g_return_if_fail (self != NULL);
	sni_indicator_controller_queue_update (self);
}

static void
sni_indicator_controller_on_session_manager_notify_has_uniform_breaks (SniIndicatorController* self)
{
	g_return_if_fail (self != NULL);
	sni_indicator_controller_queue_update (self);
}

static void
sni_indicator_controller_on_application_settings_changed (SniIndicatorController* self,
                                                          GSettings* settings,
                                                          const gchar* key)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = key;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("screen-overlay")))) {
		switch (0) {
			default:
			{
				sni_indicator_controller_update_menu_items (self);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
}

static void
_sni_indicator_controller_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                         const FtTimerState* current_state,
                                                                         const FtTimerState* previous_state,
                                                                         gpointer self)
{
	sni_indicator_controller_on_timer_state_changed ((SniIndicatorController*) self, current_state, previous_state);
}

static void
_sni_indicator_controller_update_tooltip_ft_timer_tick (FtTimer* _sender,
                                                        gint64 timestamp,
                                                        gpointer self)
{
	sni_indicator_controller_update_tooltip ((SniIndicatorController*) self, timestamp);
}

static void
_sni_indicator_controller_on_session_manager_notify_current_session_g_object_notify (GObject* _sender,
                                                                                     GParamSpec* pspec,
                                                                                     gpointer self)
{
	sni_indicator_controller_on_session_manager_notify_current_session ((SniIndicatorController*) self);
}

static void
_sni_indicator_controller_on_session_manager_notify_current_state_g_object_notify (GObject* _sender,
                                                                                   GParamSpec* pspec,
                                                                                   gpointer self)
{
	sni_indicator_controller_on_session_manager_notify_current_state ((SniIndicatorController*) self);
}

static void
_sni_indicator_controller_on_session_manager_notify_has_uniform_breaks_g_object_notify (GObject* _sender,
                                                                                        GParamSpec* pspec,
                                                                                        gpointer self)
{
	sni_indicator_controller_on_session_manager_notify_has_uniform_breaks ((SniIndicatorController*) self);
}

static void
_sni_indicator_controller_on_application_settings_changed_g_settings_changed (GSettings* _sender,
                                                                              const gchar* key,
                                                                              gpointer self)
{
	sni_indicator_controller_on_application_settings_changed ((SniIndicatorController*) self, _sender, key);
}

static void
sni_indicator_controller_connect_signals (SniIndicatorController* self)
{
	FtTimer* _tmp0_;
	FtSessionManager* _tmp2_;
	FtSessionManager* _tmp3_;
	FtSessionManager* _tmp4_;
	GSettings* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->timer;
	g_signal_connect (_tmp0_, "state-changed", (GCallback) _sni_indicator_controller_on_timer_state_changed_ft_timer_state_changed, self);
	if (self->priv->have_tooltips) {
		FtTimer* _tmp1_;
		_tmp1_ = self->priv->timer;
		g_signal_connect (_tmp1_, "tick", (GCallback) _sni_indicator_controller_update_tooltip_ft_timer_tick, self);
	}
	_tmp2_ = self->priv->session_manager;
	g_signal_connect ((GObject*) _tmp2_, "notify::current-session", (GCallback) _sni_indicator_controller_on_session_manager_notify_current_session_g_object_notify, self);
	_tmp3_ = self->priv->session_manager;
	g_signal_connect ((GObject*) _tmp3_, "notify::current-state", (GCallback) _sni_indicator_controller_on_session_manager_notify_current_state_g_object_notify, self);
	_tmp4_ = self->priv->session_manager;
	g_signal_connect ((GObject*) _tmp4_, "notify::has-uniform-breaks", (GCallback) _sni_indicator_controller_on_session_manager_notify_has_uniform_breaks_g_object_notify, self);
	_tmp5_ = self->priv->application_settings;
	g_signal_connect (_tmp5_, "changed", (GCallback) _sni_indicator_controller_on_application_settings_changed_g_settings_changed, self);
}

static void
sni_indicator_controller_disconnect_signals (SniIndicatorController* self)
{
	FtTimer* _tmp0_;
	FtSessionManager* _tmp7_;
	GSettings* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->timer;
	if (_tmp0_ != NULL) {
		FtTimer* _tmp1_;
		guint _tmp2_;
		FtTimer* _tmp3_;
		guint _tmp4_;
		FtTimer* _tmp5_;
		guint _tmp6_;
		_tmp1_ = self->priv->timer;
		g_signal_parse_name ("state-changed", FT_TYPE_TIMER, &_tmp2_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _sni_indicator_controller_on_timer_state_changed_ft_timer_state_changed, self);
		_tmp3_ = self->priv->timer;
		g_signal_parse_name ("tick", FT_TYPE_TIMER, &_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _sni_indicator_controller_update_tooltip_ft_timer_tick, self);
		_tmp5_ = self->priv->timer;
		g_signal_parse_name ("tick", FT_TYPE_TIMER, &_tmp6_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _sni_indicator_controller_update_icon_ft_timer_tick, self);
	}
	_tmp7_ = self->priv->session_manager;
	if (_tmp7_ != NULL) {
		FtSessionManager* _tmp8_;
		guint _tmp9_;
		GQuark _tmp10_;
		FtSessionManager* _tmp11_;
		guint _tmp12_;
		GQuark _tmp13_;
		FtSessionManager* _tmp14_;
		guint _tmp15_;
		GQuark _tmp16_;
		_tmp8_ = self->priv->session_manager;
		g_signal_parse_name ("notify::current-session", G_TYPE_OBJECT, &_tmp9_, &_tmp10_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp8_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, _tmp10_, NULL, (GCallback) _sni_indicator_controller_on_session_manager_notify_current_session_g_object_notify, self);
		_tmp11_ = self->priv->session_manager;
		g_signal_parse_name ("notify::current-state", G_TYPE_OBJECT, &_tmp12_, &_tmp13_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp11_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp12_, _tmp13_, NULL, (GCallback) _sni_indicator_controller_on_session_manager_notify_current_state_g_object_notify, self);
		_tmp14_ = self->priv->session_manager;
		g_signal_parse_name ("notify::has-uniform-breaks", G_TYPE_OBJECT, &_tmp15_, &_tmp16_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp14_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp15_, _tmp16_, NULL, (GCallback) _sni_indicator_controller_on_session_manager_notify_has_uniform_breaks_g_object_notify, self);
	}
	_tmp17_ = self->priv->application_settings;
	if (_tmp17_ != NULL) {
		GSettings* _tmp18_;
		guint _tmp19_;
		_tmp18_ = self->priv->application_settings;
		g_signal_parse_name ("changed", g_settings_get_type (), &_tmp19_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp18_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp19_, 0, NULL, (GCallback) _sni_indicator_controller_on_application_settings_changed_g_settings_changed, self);
	}
}

/**
         * Unexport services and cleanup.
         */
void
sni_indicator_controller_destroy (SniIndicatorController* self)
{
	g_return_if_fail (self != NULL);
	sni_indicator_controller_disconnect_signals (self);
	if (self->priv->update_icon_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->update_icon_timeout_id);
		self->priv->update_icon_timeout_id = (guint) 0;
	}
	if (self->priv->update_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->update_idle_id);
		self->priv->update_idle_id = (guint) 0;
	}
	if (self->priv->service_id != ((guint) 0)) {
		GDBusConnection* _tmp0_;
		_tmp0_ = self->priv->connection;
		g_dbus_connection_unregister_object (_tmp0_, self->priv->service_id);
		self->priv->service_id = (guint) 0;
	}
	if (self->priv->menu_service_id != ((guint) 0)) {
		GDBusConnection* _tmp1_;
		_tmp1_ = self->priv->connection;
		g_dbus_connection_unregister_object (_tmp1_, self->priv->menu_service_id);
		self->priv->menu_service_id = (guint) 0;
	}
	if (self->priv->name_owner_id != ((guint) 0)) {
		g_bus_unown_name (self->priv->name_owner_id);
		self->priv->name_owner_id = (guint) 0;
	}
}

static void
sni_value_indicator_controller_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
sni_value_indicator_controller_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		sni_indicator_controller_unref (value->data[0].v_pointer);
	}
}

static void
sni_value_indicator_controller_copy_value (const GValue* src_value,
                                           GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = sni_indicator_controller_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
sni_value_indicator_controller_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
sni_value_indicator_controller_collect_value (GValue* value,
                                              guint n_collect_values,
                                              GTypeCValue* collect_values,
                                              guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		SniIndicatorController * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = sni_indicator_controller_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
sni_value_indicator_controller_lcopy_value (const GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	SniIndicatorController ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = sni_indicator_controller_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
sni_param_spec_indicator_controller (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags)
{
	SniParamSpecIndicatorController* spec;
	g_return_val_if_fail (g_type_is_a (object_type, SNI_TYPE_INDICATOR_CONTROLLER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
sni_value_get_indicator_controller (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SNI_TYPE_INDICATOR_CONTROLLER), NULL);
	return value->data[0].v_pointer;
}

void
sni_value_set_indicator_controller (GValue* value,
                                    gpointer v_object)
{
	SniIndicatorController * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SNI_TYPE_INDICATOR_CONTROLLER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SNI_TYPE_INDICATOR_CONTROLLER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		sni_indicator_controller_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		sni_indicator_controller_unref (old);
	}
}

void
sni_value_take_indicator_controller (GValue* value,
                                     gpointer v_object)
{
	SniIndicatorController * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SNI_TYPE_INDICATOR_CONTROLLER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SNI_TYPE_INDICATOR_CONTROLLER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		sni_indicator_controller_unref (old);
	}
}

static void
sni_indicator_controller_class_init (SniIndicatorControllerClass * klass,
                                     gpointer klass_data)
{
	sni_indicator_controller_parent_class = g_type_class_peek_parent (klass);
	((SniIndicatorControllerClass *) klass)->finalize = sni_indicator_controller_finalize;
	g_type_class_adjust_private_offset (klass, &SniIndicatorController_private_offset);
}

static void
sni_indicator_controller_instance_init (SniIndicatorController * self,
                                        gpointer klass)
{
	self->priv = sni_indicator_controller_get_instance_private (self);
	self->priv->connection = NULL;
	self->priv->watcher_proxy = NULL;
	self->priv->timer = NULL;
	self->priv->session_manager = NULL;
	self->priv->notification_manager = NULL;
	self->priv->application_settings = NULL;
	self->priv->action_group = NULL;
	self->priv->name_owner_id = (guint) 0;
	self->priv->service = NULL;
	self->priv->service_id = (guint) 0;
	self->priv->menu_service = NULL;
	self->priv->menu_service_id = (guint) 0;
	self->priv->primary_item = NULL;
	self->priv->secondary_item = NULL;
	self->priv->update_icon_timeout_id = 0U;
	self->priv->update_idle_id = 0U;
	self->priv->tooltip_title = NULL;
	self->ref_count = 1;
}

static void
sni_indicator_controller_finalize (SniIndicatorController * obj)
{
	SniIndicatorController * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_INDICATOR_CONTROLLER, SniIndicatorController);
	g_signal_handlers_destroy (self);
	if (self->priv->service_id != ((guint) 0)) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = self->priv->menu_service_id != ((guint) 0);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->name_owner_id != ((guint) 0);
	}
	if (_tmp0_) {
		g_critical ("indicator-provider.vala:231: SNI D-Bus services not destroyed properly");
	}
	_g_object_unref0 (self->priv->service);
	self->priv->service = NULL;
	_g_object_unref0 (self->priv->menu_service);
	self->priv->menu_service = NULL;
	_g_object_unref0 (self->priv->watcher_proxy);
	self->priv->watcher_proxy = NULL;
	_g_object_unref0 (self->priv->connection);
	self->priv->connection = NULL;
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = NULL;
	_g_object_unref0 (self->priv->timer);
	self->priv->timer = NULL;
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = NULL;
	_g_object_unref0 (self->priv->application_settings);
	self->priv->application_settings = NULL;
	_g_object_unref0 (self->priv->notification_manager);
	self->priv->notification_manager = NULL;
	self->priv->primary_item = NULL;
	self->priv->secondary_item = NULL;
	_g_object_unref0 (self->priv->connection);
	_g_object_unref0 (self->priv->watcher_proxy);
	_g_object_unref0 (self->priv->timer);
	_g_object_unref0 (self->priv->session_manager);
	_g_object_unref0 (self->priv->notification_manager);
	_g_object_unref0 (self->priv->application_settings);
	_g_object_unref0 (self->priv->action_group);
	_g_object_unref0 (self->priv->service);
	_g_object_unref0 (self->priv->menu_service);
	_g_free0 (self->priv->tooltip_title);
}

/**
     * Class for exporting and updating the indicator and its context menu
     */
GType
sni_indicator_controller_get_type (void)
{
	return sni_indicator_controller_type_id;
}

GType
sni_indicator_controller_register_type (GTypeModule * module)
{
	static const GTypeValueTable g_define_type_value_table = { sni_value_indicator_controller_init, sni_value_indicator_controller_free_value, sni_value_indicator_controller_copy_value, sni_value_indicator_controller_peek_pointer, "p", sni_value_indicator_controller_collect_value, "p", sni_value_indicator_controller_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (SniIndicatorControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sni_indicator_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SniIndicatorController), 0, (GInstanceInitFunc) sni_indicator_controller_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	sni_indicator_controller_type_id = g_type_register_fundamental (g_type_fundamental_next (), "SniIndicatorController", &g_define_type_info, &g_define_type_fundamental_info, 0);
	SniIndicatorController_private_offset = sizeof (SniIndicatorControllerPrivate);
	return sni_indicator_controller_type_id;
}

gpointer
sni_indicator_controller_ref (gpointer instance)
{
	SniIndicatorController * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
sni_indicator_controller_unref (gpointer instance)
{
	SniIndicatorController * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		SNI_INDICATOR_CONTROLLER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
sni_indicator_provider_get_instance_private (SniIndicatorProvider* self)
{
	return G_STRUCT_MEMBER_P (self, SniIndicatorProvider_private_offset);
}

static void
sni_indicator_provider_update_available (SniIndicatorProvider* self)
{
	gboolean _tmp0_ = FALSE;
	SniStatusNotifierWatcher* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->watcher_proxy;
	if (_tmp1_ != NULL) {
		SniStatusNotifierWatcher* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->watcher_proxy;
		_tmp3_ = sni_status_notifier_watcher_get_is_status_notifier_host_registered (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	ft_provider_set_available ((FtProvider*) self, _tmp0_);
}

static void
sni_indicator_provider_create_indicator_controller_data_free (gpointer _data)
{
	SniIndicatorProviderCreateIndicatorControllerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SniIndicatorProviderCreateIndicatorControllerData, _data_);
}

static void
sni_indicator_provider_create_indicator_controller (SniIndicatorProvider* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	SniIndicatorProviderCreateIndicatorControllerData* _data_;
	SniIndicatorProvider* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (SniIndicatorProviderCreateIndicatorControllerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_provider_create_indicator_controller_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	sni_indicator_provider_create_indicator_controller_co (_data_);
}

static void
sni_indicator_provider_create_indicator_controller_finish (SniIndicatorProvider* self,
                                                           GAsyncResult* _res_)
{
	SniIndicatorProviderCreateIndicatorControllerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
sni_indicator_provider_create_indicator_controller_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	SniIndicatorProviderCreateIndicatorControllerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sni_indicator_provider_create_indicator_controller_co (_data_);
}

static gboolean
sni_indicator_provider_create_indicator_controller_co (SniIndicatorProviderCreateIndicatorControllerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->indicator_controller;
	if (_data_->_tmp0_ != NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = ft_application_get_default ();
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_data_->application = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->application;
	g_application_hold ((GApplication*) _data_->_tmp3_);
	_data_->_tmp4_ = _data_->self->priv->connection;
	_data_->_tmp5_ = _data_->self->priv->watcher_proxy;
	_data_->_tmp6_ = sni_indicator_controller_new (_data_->_tmp4_, _data_->_tmp5_);
	_sni_indicator_controller_unref0 (_data_->self->priv->indicator_controller);
	_data_->self->priv->indicator_controller = _data_->_tmp6_;
	{
		_data_->_tmp7_ = _data_->self->priv->indicator_controller;
		_data_->_tmp8_ = _data_->self->priv->cancellable;
		_data_->_state_ = 1;
		sni_indicator_controller_export (_data_->_tmp7_, _data_->_tmp8_, sni_indicator_provider_create_indicator_controller_ready, _data_);
		return FALSE;
		_state_1:
		sni_indicator_controller_export_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		g_object_notify ((GObject*) _data_->self, "visible");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp9_ = _data_->_error_;
		_data_->_tmp10_ = _data_->_tmp9_->message;
		g_warning ("indicator-provider.vala:981: Failed to export SNI: %s", _data_->_tmp10_);
		sni_indicator_provider_destroy_indicator_controller (_data_->self);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->application);
		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);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->application;
	g_application_release ((GApplication*) _data_->_tmp11_);
	_g_object_unref0 (_data_->application);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sni_indicator_provider_destroy_indicator_controller (SniIndicatorProvider* self)
{
	SniIndicatorController* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->indicator_controller;
	if (_tmp0_ != NULL) {
		SniIndicatorController* _tmp1_;
		_tmp1_ = self->priv->indicator_controller;
		sni_indicator_controller_destroy (_tmp1_);
		_sni_indicator_controller_unref0 (self->priv->indicator_controller);
		self->priv->indicator_controller = NULL;
		g_object_notify ((GObject*) self, "visible");
	}
}

static void
sni_indicator_provider_on_properties_changed (SniIndicatorProvider* self,
                                              GVariant* changed_properties,
                                              gchar** invalidated_properties,
                                              gint invalidated_properties_length1)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (changed_properties != NULL);
	sni_indicator_provider_update_available (self);
}

static void
sni_indicator_provider_on_settings_changed (SniIndicatorProvider* self,
                                            GSettings* settings,
                                            const gchar* key)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = key;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("indicator")))) {
		switch (0) {
			default:
			{
				if (g_settings_get_boolean (settings, key)) {
					sni_indicator_provider_create_indicator_controller (self, NULL, NULL);
				} else {
					FtApplication* application = NULL;
					FtApplication* _tmp3_;
					FtApplication* _tmp4_;
					FtApplication* _tmp5_;
					FtWindow* main_window = NULL;
					FtApplication* _tmp6_;
					gconstpointer _tmp7_;
					FtWindow* _tmp8_;
					FtWindow* _tmp9_;
					FtApplication* _tmp11_;
					_tmp3_ = ft_application_get_default ();
					_tmp4_ = _g_object_ref0 (_tmp3_);
					application = _tmp4_;
					_tmp5_ = application;
					g_application_hold ((GApplication*) _tmp5_);
					sni_indicator_provider_destroy_indicator_controller (self);
					_tmp6_ = application;
					_tmp7_ = ft_application_get_window (_tmp6_, FT_TYPE_WINDOW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
					_tmp8_ = _g_object_ref0 ((FtWindow*) _tmp7_);
					main_window = _tmp8_;
					_tmp9_ = main_window;
					if (_tmp9_ == NULL) {
						FtApplication* _tmp10_;
						_tmp10_ = application;
						ft_application_show_window (_tmp10_, FT_WINDOW_VIEW_DEFAULT);
					}
					_tmp11_ = application;
					g_application_release ((GApplication*) _tmp11_);
					_g_object_unref0 (main_window);
					_g_object_unref0 (application);
				}
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
}

static void
_sni_indicator_provider_on_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                                                 GVariant* changed_properties,
                                                                                 gchar** invalidated_properties,
                                                                                 gpointer self)
{
	sni_indicator_provider_on_properties_changed ((SniIndicatorProvider*) self, changed_properties, invalidated_properties, _vala_array_length (invalidated_properties));
}

static void
sni_indicator_provider_on_name_appeared (SniIndicatorProvider* self,
                                         GDBusConnection* connection,
                                         const gchar* name,
                                         const gchar* name_owner)
{
	SniStatusNotifierWatcher* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (name_owner != NULL);
	_tmp0_ = self->priv->watcher_proxy;
	if (_tmp0_ != NULL) {
		return;
	}
	{
		SniStatusNotifierWatcher* _tmp1_ = NULL;
		GCancellable* _tmp2_;
		SniStatusNotifierWatcher* _tmp3_;
		SniStatusNotifierWatcher* _tmp4_;
		GDBusProxy* watcher_proxy = NULL;
		SniStatusNotifierWatcher* _tmp5_;
		GDBusProxy* _tmp6_;
		GDBusProxy* _tmp7_;
		_tmp2_ = self->priv->cancellable;
		_tmp3_ = (SniStatusNotifierWatcher*) g_initable_new (SNI_TYPE_STATUS_NOTIFIER_WATCHER_PROXY, _tmp2_, &_inner_error0_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", "org.kde.StatusNotifierWatcher", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/StatusNotifierWatcher", "g-interface-name", "org.kde.StatusNotifierWatcher", NULL);
		_tmp1_ = (SniStatusNotifierWatcher*) _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (self->priv->watcher_proxy);
		self->priv->watcher_proxy = _tmp4_;
		_tmp5_ = self->priv->watcher_proxy;
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, g_dbus_proxy_get_type (), GDBusProxy));
		watcher_proxy = _tmp6_;
		_tmp7_ = watcher_proxy;
		g_signal_connect_object (_tmp7_, "g-properties-changed", (GCallback) _sni_indicator_provider_on_properties_changed_g_dbus_proxy_g_properties_changed, self, 0);
		sni_indicator_provider_update_available (self);
		_g_object_unref0 (watcher_proxy);
		_g_object_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = _error_;
		_tmp9_ = _tmp8_->message;
		g_warning ("indicator-provider.vala:1058: Error while initializing StatusNotifierW" \
"atcher proxy: %s", _tmp9_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
sni_indicator_provider_on_name_vanished (SniIndicatorProvider* self,
                                         GDBusConnection* connection,
                                         const gchar* name)
{
	SniStatusNotifierWatcher* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->watcher_proxy;
	if (_tmp0_ != NULL) {
		GDBusProxy* watcher_proxy = NULL;
		SniStatusNotifierWatcher* _tmp1_;
		GDBusProxy* _tmp2_;
		GDBusProxy* _tmp3_;
		guint _tmp4_;
		_tmp1_ = self->priv->watcher_proxy;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, g_dbus_proxy_get_type (), GDBusProxy));
		watcher_proxy = _tmp2_;
		_tmp3_ = watcher_proxy;
		g_signal_parse_name ("g-properties-changed", g_dbus_proxy_get_type (), &_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _sni_indicator_provider_on_properties_changed_g_dbus_proxy_g_properties_changed, self);
		_g_object_unref0 (self->priv->watcher_proxy);
		self->priv->watcher_proxy = NULL;
		_g_object_unref0 (watcher_proxy);
	}
	ft_provider_set_available ((FtProvider*) self, FALSE);
	ft_provider_set_enabled ((FtProvider*) self, FALSE);
}

static void
sni_indicator_provider_real_initialize_data_free (gpointer _data)
{
	SniIndicatorProviderInitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (SniIndicatorProviderInitializeData, _data_);
}

static void
sni_indicator_provider_real_initialize (FtProvider* base,
                                        GCancellable* cancellable,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	SniIndicatorProvider * self;
	SniIndicatorProviderInitializeData* _data_;
	SniIndicatorProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (SniIndicatorProvider*) base;
	_data_ = g_slice_new0 (SniIndicatorProviderInitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_provider_real_initialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	sni_indicator_provider_real_initialize_co (_data_);
}

static void
sni_indicator_provider_initialize_finish (FtProvider* base,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	SniIndicatorProviderInitializeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
         * Mark provider as `available` when `org.kde.StatusNotifierWatcher` exists
         * and has a host registered.
         */
static void
_sni_indicator_provider_on_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                      const gchar* name,
                                                                      const gchar* name_owner,
                                                                      gpointer self)
{
	sni_indicator_provider_on_name_appeared ((SniIndicatorProvider*) self, connection, name, name_owner);
}

static void
_sni_indicator_provider_on_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                      const gchar* name,
                                                                      gpointer self)
{
	sni_indicator_provider_on_name_vanished ((SniIndicatorProvider*) self, connection, name);
}

static gboolean
sni_indicator_provider_real_initialize_co (SniIndicatorProviderInitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_application_get_default ();
	_data_->_tmp1_ = g_application_get_dbus_connection (_data_->_tmp0_);
	_data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
	_g_object_unref0 (_data_->self->priv->connection);
	_data_->self->priv->connection = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->self->priv->connection;
	_data_->_tmp3_ = _data_->_tmp4_;
	_data_->_tmp5_ = NULL;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp6_ = g_dbus_connection_get_unique_name (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp6_;
	}
	if (_data_->_tmp5_ == NULL) {
		_data_->_tmp7_ = g_error_new_literal (SNI_INDICATOR_ERROR, SNI_INDICATOR_ERROR_CONNECTION, "No connection");
		_data_->_inner_error0_ = _data_->_tmp7_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->self->priv->watcher_id == ((guint) 0)) {
		_data_->self->priv->watcher_id = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "org.kde.StatusNotifierWatcher", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_sni_indicator_provider_on_name_appeared_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _sni_indicator_provider_on_name_appeared_gbus_name_appeared_callback, g_object_ref (_data_->self), (GClosureNotify) g_object_unref)), (GClosure*) ((_sni_indicator_provider_on_name_vanished_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _sni_indicator_provider_on_name_vanished_gbus_name_vanished_callback, g_object_ref (_data_->self), (GClosureNotify) g_object_unref)));
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sni_indicator_provider_real_enable_data_free (gpointer _data)
{
	SniIndicatorProviderEnableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (SniIndicatorProviderEnableData, _data_);
}

static void
sni_indicator_provider_real_enable (FtProvider* base,
                                    GCancellable* cancellable,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	SniIndicatorProvider * self;
	SniIndicatorProviderEnableData* _data_;
	SniIndicatorProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (SniIndicatorProvider*) base;
	_data_ = g_slice_new0 (SniIndicatorProviderEnableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_provider_real_enable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	sni_indicator_provider_real_enable_co (_data_);
}

static void
sni_indicator_provider_enable_finish (FtProvider* base,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	SniIndicatorProviderEnableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
_sni_indicator_provider_on_settings_changed_g_settings_changed (GSettings* _sender,
                                                                const gchar* key,
                                                                gpointer self)
{
	sni_indicator_provider_on_settings_changed ((SniIndicatorProvider*) self, _sender, key);
}

static void
sni_indicator_provider_enable_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	SniIndicatorProviderEnableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sni_indicator_provider_real_enable_co (_data_);
}

static gboolean
sni_indicator_provider_real_enable_co (SniIndicatorProviderEnableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _g_object_ref0 (_data_->cancellable);
	_data_->_tmp0_ = _data_->_tmp1_;
	if (_data_->_tmp0_ == NULL) {
		_data_->_tmp2_ = g_cancellable_new ();
		_g_object_unref0 (_data_->_tmp0_);
		_data_->_tmp0_ = _data_->_tmp2_;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_g_object_unref0 (_data_->self->priv->cancellable);
	_data_->self->priv->cancellable = _data_->_tmp3_;
	_data_->_tmp4_ = g_settings_new ("io.github.focustimerhq.FocusTimer.plugins.sni");
	_g_object_unref0 (_data_->self->priv->settings);
	_data_->self->priv->settings = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->settings;
	g_signal_connect_object (_data_->_tmp5_, "changed", (GCallback) _sni_indicator_provider_on_settings_changed_g_settings_changed, _data_->self, 0);
	_data_->_tmp6_ = _data_->self->priv->settings;
	if (g_settings_get_boolean (_data_->_tmp6_, "indicator")) {
		_data_->_state_ = 1;
		sni_indicator_provider_create_indicator_controller (_data_->self, sni_indicator_provider_enable_ready, _data_);
		return FALSE;
		_state_1:
		sni_indicator_provider_create_indicator_controller_finish (_data_->self, _data_->_res_);
	}
	_g_object_unref0 (_data_->_tmp0_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sni_indicator_provider_real_disable_data_free (gpointer _data)
{
	SniIndicatorProviderDisableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SniIndicatorProviderDisableData, _data_);
}

static void
sni_indicator_provider_real_disable (FtProvider* base,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	SniIndicatorProvider * self;
	SniIndicatorProviderDisableData* _data_;
	SniIndicatorProvider* _tmp0_;
	self = (SniIndicatorProvider*) base;
	_data_ = g_slice_new0 (SniIndicatorProviderDisableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_provider_real_disable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	sni_indicator_provider_real_disable_co (_data_);
}

static void
sni_indicator_provider_disable_finish (FtProvider* base,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	SniIndicatorProviderDisableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
sni_indicator_provider_real_disable_co (SniIndicatorProviderDisableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->cancellable;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->cancellable;
		g_cancellable_cancel (_data_->_tmp1_);
		_g_object_unref0 (_data_->self->priv->cancellable);
		_data_->self->priv->cancellable = NULL;
	}
	_data_->_tmp2_ = _data_->self->priv->settings;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->self->priv->settings;
		g_signal_parse_name ("changed", g_settings_get_type (), &_data_->_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_data_->_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp4_, 0, NULL, (GCallback) _sni_indicator_provider_on_settings_changed_g_settings_changed, _data_->self);
		_g_object_unref0 (_data_->self->priv->settings);
		_data_->self->priv->settings = NULL;
	}
	sni_indicator_provider_destroy_indicator_controller (_data_->self);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sni_indicator_provider_real_uninitialize_data_free (gpointer _data)
{
	SniIndicatorProviderUninitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SniIndicatorProviderUninitializeData, _data_);
}

static void
sni_indicator_provider_real_uninitialize (FtProvider* base,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	SniIndicatorProvider * self;
	SniIndicatorProviderUninitializeData* _data_;
	SniIndicatorProvider* _tmp0_;
	self = (SniIndicatorProvider*) base;
	_data_ = g_slice_new0 (SniIndicatorProviderUninitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sni_indicator_provider_real_uninitialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	sni_indicator_provider_real_uninitialize_co (_data_);
}

static void
sni_indicator_provider_uninitialize_finish (FtProvider* base,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	SniIndicatorProviderUninitializeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
sni_indicator_provider_real_uninitialize_co (SniIndicatorProviderUninitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->watcher_id != ((guint) 0)) {
		g_bus_unwatch_name (_data_->self->priv->watcher_id);
		_data_->self->priv->watcher_id = (guint) 0;
	}
	_g_object_unref0 (_data_->self->priv->connection);
	_data_->self->priv->connection = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

SniIndicatorProvider*
sni_indicator_provider_construct (GType object_type)
{
	SniIndicatorProvider * self = NULL;
	self = (SniIndicatorProvider*) ft_provider_construct (object_type);
	return self;
}

SniIndicatorProvider*
sni_indicator_provider_new (void)
{
	return sni_indicator_provider_construct (SNI_TYPE_INDICATOR_PROVIDER);
}

static gboolean
sni_indicator_provider_real_get_visible (FtIndicatorProvider* base)
{
	gboolean result;
	SniIndicatorProvider* self;
	SniIndicatorController* _tmp0_;
	self = (SniIndicatorProvider*) base;
	_tmp0_ = self->priv->indicator_controller;
	result = _tmp0_ != NULL;
	return result;
}

static void
sni_indicator_provider_class_init (SniIndicatorProviderClass * klass,
                                   gpointer klass_data)
{
	sni_indicator_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SniIndicatorProvider_private_offset);
	((FtProviderClass *) klass)->initialize = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) sni_indicator_provider_real_initialize;
	((FtProviderClass *) klass)->initialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) sni_indicator_provider_initialize_finish;
	((FtProviderClass *) klass)->enable = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) sni_indicator_provider_real_enable;
	((FtProviderClass *) klass)->enable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) sni_indicator_provider_enable_finish;
	((FtProviderClass *) klass)->disable = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) sni_indicator_provider_real_disable;
	((FtProviderClass *) klass)->disable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) sni_indicator_provider_disable_finish;
	((FtProviderClass *) klass)->uninitialize = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) sni_indicator_provider_real_uninitialize;
	((FtProviderClass *) klass)->uninitialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) sni_indicator_provider_uninitialize_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_sni_indicator_provider_get_property;
	G_OBJECT_CLASS (klass)->finalize = sni_indicator_provider_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_INDICATOR_PROVIDER_VISIBLE_PROPERTY, sni_indicator_provider_properties[SNI_INDICATOR_PROVIDER_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
sni_indicator_provider_ft_indicator_provider_interface_init (FtIndicatorProviderIface * iface,
                                                             gpointer iface_data)
{
	sni_indicator_provider_ft_indicator_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_visible = sni_indicator_provider_real_get_visible;
}

static void
sni_indicator_provider_instance_init (SniIndicatorProvider * self,
                                      gpointer klass)
{
	self->priv = sni_indicator_provider_get_instance_private (self);
	self->priv->settings = NULL;
	self->priv->connection = NULL;
	self->priv->watcher_id = (guint) 0;
	self->priv->watcher_proxy = NULL;
	self->priv->indicator_controller = NULL;
	self->priv->cancellable = NULL;
}

static void
sni_indicator_provider_finalize (GObject * obj)
{
	SniIndicatorProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_INDICATOR_PROVIDER, SniIndicatorProvider);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->connection);
	_g_object_unref0 (self->priv->watcher_proxy);
	_sni_indicator_controller_unref0 (self->priv->indicator_controller);
	_g_object_unref0 (self->priv->cancellable);
	G_OBJECT_CLASS (sni_indicator_provider_parent_class)->finalize (obj);
}

GType
sni_indicator_provider_get_type (void)
{
	return sni_indicator_provider_type_id;
}

GType
sni_indicator_provider_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SniIndicatorProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sni_indicator_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SniIndicatorProvider), 0, (GInstanceInitFunc) sni_indicator_provider_instance_init, NULL };
	static const GInterfaceInfo ft_indicator_provider_info = { (GInterfaceInitFunc) sni_indicator_provider_ft_indicator_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	sni_indicator_provider_type_id = g_type_module_register_type (module, FT_TYPE_PROVIDER, "SniIndicatorProvider", &g_define_type_info, 0);
	g_type_module_add_interface (module, sni_indicator_provider_type_id, FT_TYPE_INDICATOR_PROVIDER, &ft_indicator_provider_info);
	SniIndicatorProvider_private_offset = sizeof (SniIndicatorProviderPrivate);
	return sni_indicator_provider_type_id;
}

static void
_vala_sni_indicator_provider_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	SniIndicatorProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SNI_TYPE_INDICATOR_PROVIDER, SniIndicatorProvider);
	switch (property_id) {
		case SNI_INDICATOR_PROVIDER_VISIBLE_PROPERTY:
		g_value_set_boolean (value, ft_indicator_provider_get_visible ((FtIndicatorProvider*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

