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

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

#include "ft_ui.h"
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include "ft_core.h"
#include <config.h>
#include <float.h>
#include <math.h>

#define FT_APPLICATION_DBUS_SERVICE_DBUS_INTERFACE_NAME "io.github.focustimerhq.FocusTimer"
#define FT_TIMER_DBUS_SERVICE_DBUS_INTERFACE_NAME "io.github.focustimerhq.FocusTimer.Timer"
#define FT_SESSION_DBUS_SERVICE_DBUS_INTERFACE_NAME "io.github.focustimerhq.FocusTimer.Session"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	FT_APPLICATION_DBUS_SERVICE_0_PROPERTY,
	FT_APPLICATION_DBUS_SERVICE_VERSION_PROPERTY,
	FT_APPLICATION_DBUS_SERVICE_SETTINGS_PROPERTY,
	FT_APPLICATION_DBUS_SERVICE_READY_PROPERTY,
	FT_APPLICATION_DBUS_SERVICE_NUM_PROPERTIES
};
static GParamSpec* ft_application_dbus_service_properties[FT_APPLICATION_DBUS_SERVICE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	FT_APPLICATION_DBUS_SERVICE_REQUEST_FOCUS_SIGNAL,
	FT_APPLICATION_DBUS_SERVICE_NUM_SIGNALS
};
static guint ft_application_dbus_service_signals[FT_APPLICATION_DBUS_SERVICE_NUM_SIGNALS] = {0};
enum  {
	FT_TIMER_DBUS_SERVICE_0_PROPERTY,
	FT_TIMER_DBUS_SERVICE_STATE_PROPERTY,
	FT_TIMER_DBUS_SERVICE_DURATION_PROPERTY,
	FT_TIMER_DBUS_SERVICE_OFFSET_PROPERTY,
	FT_TIMER_DBUS_SERVICE_STARTED_TIME_PROPERTY,
	FT_TIMER_DBUS_SERVICE_PAUSED_TIME_PROPERTY,
	FT_TIMER_DBUS_SERVICE_FINISHED_TIME_PROPERTY,
	FT_TIMER_DBUS_SERVICE_LAST_CHANGED_TIME_PROPERTY,
	FT_TIMER_DBUS_SERVICE_NUM_PROPERTIES
};
static GParamSpec* ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_NUM_PROPERTIES];
enum  {
	FT_TIMER_DBUS_SERVICE_CHANGED_SIGNAL,
	FT_TIMER_DBUS_SERVICE_TICK_SIGNAL,
	FT_TIMER_DBUS_SERVICE_FINISHED_SIGNAL,
	FT_TIMER_DBUS_SERVICE_NUM_SIGNALS
};
static guint ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_NUM_SIGNALS] = {0};
enum  {
	FT_SESSION_DBUS_SERVICE_0_PROPERTY,
	FT_SESSION_DBUS_SERVICE_CURRENT_STATE_PROPERTY,
	FT_SESSION_DBUS_SERVICE_START_TIME_PROPERTY,
	FT_SESSION_DBUS_SERVICE_END_TIME_PROPERTY,
	FT_SESSION_DBUS_SERVICE_HAS_UNIFORM_BREAKS_PROPERTY,
	FT_SESSION_DBUS_SERVICE_CAN_RESET_PROPERTY,
	FT_SESSION_DBUS_SERVICE_NUM_PROPERTIES
};
static GParamSpec* ft_session_dbus_service_properties[FT_SESSION_DBUS_SERVICE_NUM_PROPERTIES];
typedef struct _Block35Data Block35Data;
typedef struct _Block36Data Block36Data;
typedef struct _Block37Data Block37Data;
enum  {
	FT_SESSION_DBUS_SERVICE_ENTER_TIME_BLOCK_SIGNAL,
	FT_SESSION_DBUS_SERVICE_LEAVE_TIME_BLOCK_SIGNAL,
	FT_SESSION_DBUS_SERVICE_CONFIRM_ADVANCEMENT_SIGNAL,
	FT_SESSION_DBUS_SERVICE_CHANGED_SIGNAL,
	FT_SESSION_DBUS_SERVICE_NUM_SIGNALS
};
static guint ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_NUM_SIGNALS] = {0};

struct _FtApplicationDBusServicePrivate {
	GDBusConnection* connection;
	gchar* object_path;
	FtApplication* application;
	gboolean _ready;
	GSettings* _settings;
	GVariant* serialized_settings;
};

struct _FtTimerDBusServicePrivate {
	FtTimer* timer;
	FtSessionManager* session_manager;
	GDBusConnection* connection;
	gchar* object_path;
	FtState _state;
	FtTimerState timer_state;
	gint64 last_state_changed_time;
};

struct _FtSessionDBusServicePrivate {
	FtSessionManager* session_manager;
	GDBusConnection* connection;
	gchar* object_path;
	FtState _current_state;
	gint64 _start_time;
	gint64 _end_time;
	gboolean _has_uniform_breaks;
	gboolean _can_reset;
	guint changed_idle_id;
};

struct _Block35Data {
	int _ref_count_;
	FtSessionDBusService* self;
	GVariant** gaps;
	gint gaps_length1;
	gint _gaps_size_;
};

struct _Block36Data {
	int _ref_count_;
	FtSessionDBusService* self;
	GVariant** items;
	gint items_length1;
	gint _items_size_;
};

struct _Block37Data {
	int _ref_count_;
	FtSessionDBusService* self;
	GVariant** items;
	gint items_length1;
	gint _items_size_;
};

static gint FtApplicationDBusService_private_offset;
static gpointer ft_application_dbus_service_parent_class = NULL;
static gint FtTimerDBusService_private_offset;
static gpointer ft_timer_dbus_service_parent_class = NULL;
static gint FtSessionDBusService_private_offset;
static gpointer ft_session_dbus_service_parent_class = NULL;

static GVariant* ft_application_dbus_service_serialize_settings (FtApplicationDBusService* self,
                                                          GSettings* settings);
static void ft_application_dbus_service_on_settings_changed (FtApplicationDBusService* self,
                                                      GSettings* settings,
                                                      const gchar* key);
static void _ft_application_dbus_service_on_settings_changed_g_settings_changed (GSettings* _sender,
                                                                          const gchar* key,
                                                                          gpointer self);
static void ft_application_dbus_service_on_notify_ready (FtApplicationDBusService* self,
                                                  GObject* object,
                                                  GParamSpec* pspec);
static void _ft_application_dbus_service_on_notify_ready_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
static void ft_application_dbus_service_update_properties (FtApplicationDBusService* self);
static void ft_application_dbus_service_real_dispose (GObject* base);
static void ft_application_dbus_service_finalize (GObject * obj);
static GType ft_application_dbus_service_get_type_once (void);
static void _vala_ft_application_dbus_service_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _dbus_ft_application_dbus_service_show_window (FtApplicationDBusService* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation);
static void _dbus_ft_application_dbus_service_show_preferences (FtApplicationDBusService* self,
                                                         GVariant* _parameters_,
                                                         GDBusMethodInvocation* invocation);
static void _dbus_ft_application_dbus_service_quit (FtApplicationDBusService* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void ft_application_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* method_name,
                                                             GVariant* parameters,
                                                             GDBusMethodInvocation* invocation,
                                                             gpointer user_data);
static GVariant* ft_application_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                                   const gchar* sender,
                                                                   const gchar* object_path,
                                                                   const gchar* interface_name,
                                                                   const gchar* property_name,
                                                                   GError** error,
                                                                   gpointer user_data);
static GVariant* _dbus_ft_application_dbus_service_get_version (FtApplicationDBusService* self);
static GVariant* _dbus_ft_application_dbus_service_get_settings (FtApplicationDBusService* self);
static GVariant* _dbus_ft_application_dbus_service_get_ready (FtApplicationDBusService* self);
static gboolean ft_application_dbus_service_dbus_interface_set_property (GDBusConnection* connection,
                                                                  const gchar* sender,
                                                                  const gchar* object_path,
                                                                  const gchar* interface_name,
                                                                  const gchar* property_name,
                                                                  GVariant* value,
                                                                  GError** error,
                                                                  gpointer user_data);
static void _dbus_ft_application_dbus_service_request_focus (GObject* _sender,
                                                      gpointer* _data);
static void _ft_application_dbus_service_unregister_object (gpointer user_data);
static void ft_timer_dbus_service_on_timer_state_changed (FtTimerDBusService* self,
                                                   const FtTimerState* current_state,
                                                   const FtTimerState* previous_state);
static void _ft_timer_dbus_service_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                           const FtTimerState* current_state,
                                                                           const FtTimerState* previous_state,
                                                                           gpointer self);
static void ft_timer_dbus_service_on_timer_tick (FtTimerDBusService* self,
                                          gint64 timestamp);
static void _ft_timer_dbus_service_on_timer_tick_ft_timer_tick (FtTimer* _sender,
                                                         gint64 timestamp,
                                                         gpointer self);
static void ft_timer_dbus_service_on_timer_finished (FtTimerDBusService* self);
static void _ft_timer_dbus_service_on_timer_finished_ft_timer_finished (FtTimer* _sender,
                                                                 const FtTimerState* state,
                                                                 gpointer self);
static void ft_timer_dbus_service_on_session_manager_notify_current_state (FtTimerDBusService* self,
                                                                    GObject* object,
                                                                    GParamSpec* pspec);
static void _ft_timer_dbus_service_on_session_manager_notify_current_state_g_object_notify (GObject* _sender,
                                                                                     GParamSpec* pspec,
                                                                                     gpointer self);
static void ft_timer_dbus_service_update_properties (FtTimerDBusService* self);
static void ft_timer_dbus_service_real_dispose (GObject* base);
static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure,
                                          GValue * return_value,
                                          guint n_param_values,
                                          const GValue * param_values,
                                          gpointer invocation_hint,
                                          gpointer marshal_data);
static void ft_timer_dbus_service_finalize (GObject * obj);
static GType ft_timer_dbus_service_get_type_once (void);
static void _vala_ft_timer_dbus_service_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_ft_timer_dbus_service_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static void _dbus_ft_timer_dbus_service_is_started (FtTimerDBusService* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_is_running (FtTimerDBusService* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_is_paused (FtTimerDBusService* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_is_finished (FtTimerDBusService* self,
                                              GVariant* _parameters_,
                                              GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_get_elapsed (FtTimerDBusService* self,
                                              GVariant* _parameters_,
                                              GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_get_remaining (FtTimerDBusService* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_get_progress (FtTimerDBusService* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_start (FtTimerDBusService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_stop (FtTimerDBusService* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_pause (FtTimerDBusService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_resume (FtTimerDBusService* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_rewind (FtTimerDBusService* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_extend (FtTimerDBusService* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_skip (FtTimerDBusService* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation);
static void _dbus_ft_timer_dbus_service_reset (FtTimerDBusService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void ft_timer_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                       const gchar* sender,
                                                       const gchar* object_path,
                                                       const gchar* interface_name,
                                                       const gchar* method_name,
                                                       GVariant* parameters,
                                                       GDBusMethodInvocation* invocation,
                                                       gpointer user_data);
static GVariant* ft_timer_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* property_name,
                                                             GError** error,
                                                             gpointer user_data);
static GVariant* _dbus_ft_timer_dbus_service_get_state (FtTimerDBusService* self);
static GVariant* _dbus_ft_timer_dbus_service_get_duration (FtTimerDBusService* self);
static GVariant* _dbus_ft_timer_dbus_service_get_offset (FtTimerDBusService* self);
static GVariant* _dbus_ft_timer_dbus_service_get_started_time (FtTimerDBusService* self);
static GVariant* _dbus_ft_timer_dbus_service_get_paused_time (FtTimerDBusService* self);
static GVariant* _dbus_ft_timer_dbus_service_get_finished_time (FtTimerDBusService* self);
static GVariant* _dbus_ft_timer_dbus_service_get_last_changed_time (FtTimerDBusService* self);
static gboolean ft_timer_dbus_service_dbus_interface_set_property (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* property_name,
                                                            GVariant* value,
                                                            GError** error,
                                                            gpointer user_data);
static void _dbus_ft_timer_dbus_service_set_state (FtTimerDBusService* self,
                                            GVariant* _value);
static void _dbus_ft_timer_dbus_service_set_duration (FtTimerDBusService* self,
                                               GVariant* _value);
static void _dbus_ft_timer_dbus_service_changed (GObject* _sender,
                                          gpointer* _data);
static void _dbus_ft_timer_dbus_service_tick (GObject* _sender,
                                       gint64 timestamp,
                                       gpointer* _data);
static void _dbus_ft_timer_dbus_service_finished (GObject* _sender,
                                           gpointer* _data);
static void _ft_timer_dbus_service_unregister_object (gpointer user_data);
static void ft_session_dbus_service_on_notify_current_session (FtSessionDBusService* self,
                                                        GObject* object,
                                                        GParamSpec* pspec);
static void _ft_session_dbus_service_on_notify_current_session_g_object_notify (GObject* _sender,
                                                                         GParamSpec* pspec,
                                                                         gpointer self);
static void ft_session_dbus_service_on_notify_has_uniform_breaks (FtSessionDBusService* self,
                                                           GObject* object,
                                                           GParamSpec* pspec);
static void _ft_session_dbus_service_on_notify_has_uniform_breaks_g_object_notify (GObject* _sender,
                                                                            GParamSpec* pspec,
                                                                            gpointer self);
static void ft_session_dbus_service_on_enter_session (FtSessionDBusService* self,
                                               FtSession* session);
static void _ft_session_dbus_service_on_enter_session_ft_session_manager_enter_session (FtSessionManager* _sender,
                                                                                 FtSession* session,
                                                                                 gpointer self);
static void ft_session_dbus_service_on_leave_session (FtSessionDBusService* self,
                                               FtSession* session);
static void _ft_session_dbus_service_on_leave_session_ft_session_manager_leave_session (FtSessionManager* _sender,
                                                                                 FtSession* session,
                                                                                 gpointer self);
static void ft_session_dbus_service_on_enter_time_block (FtSessionDBusService* self,
                                                  FtTimeBlock* time_block);
static void _ft_session_dbus_service_on_enter_time_block_ft_session_manager_enter_time_block (FtSessionManager* _sender,
                                                                                       FtTimeBlock* time_block,
                                                                                       gpointer self);
static void ft_session_dbus_service_on_leave_time_block (FtSessionDBusService* self,
                                                  FtTimeBlock* time_block);
static void _ft_session_dbus_service_on_leave_time_block_ft_session_manager_leave_time_block (FtSessionManager* _sender,
                                                                                       FtTimeBlock* time_block,
                                                                                       gpointer self);
static void ft_session_dbus_service_on_confirm_advancement (FtSessionDBusService* self,
                                                     FtTimeBlock* current_time_block,
                                                     FtTimeBlock* next_time_block);
static void _ft_session_dbus_service_on_confirm_advancement_ft_session_manager_confirm_advancement (FtSessionManager* _sender,
                                                                                             FtTimeBlock* current_time_block,
                                                                                             FtTimeBlock* next_time_block,
                                                                                             gpointer self);
static void ft_session_dbus_service_update_properties (FtSessionDBusService* self);
static GVariant* ft_session_dbus_service_serialize_gap (FtSessionDBusService* self,
                                                 FtGap* gap);
static GVariant* ft_session_dbus_service_serialize_time_block (FtSessionDBusService* self,
                                                        FtTimeBlock* time_block);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void ___lambda91_ (Block35Data* _data35_,
                   FtGap* gap);
static void _vala_array_add23 (GVariant** * array,
                        gint* length,
                        gint* size,
                        GVariant* value);
static void ____lambda91__gfunc (gconstpointer data,
                          gpointer self);
static GVariant* ft_session_dbus_service_serialize_cycle (FtSessionDBusService* self,
                                                   FtCycle* cycle);
static void ft_session_dbus_service_on_current_session_changed (FtSessionDBusService* self,
                                                         FtSession* session);
static void _ft_session_dbus_service_on_current_session_changed_ft_session_changed (FtSession* _sender,
                                                                             gpointer self);
static gboolean ___lambda90_ (FtSessionDBusService* self);
static gboolean ____lambda90__gsource_func (gpointer self);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
static void ___lambda92_ (Block36Data* _data36_,
                   FtTimeBlock* time_block);
static void _vala_array_add24 (GVariant** * array,
                        gint* length,
                        gint* size,
                        GVariant* value);
static void ____lambda92__gfunc (gconstpointer data,
                          gpointer self);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static void __lambda93_ (Block37Data* _data37_,
                  FtCycle* cycle);
static void _vala_array_add25 (GVariant** * array,
                        gint* length,
                        gint* size,
                        GVariant* value);
static void ___lambda93__gfunc (gconstpointer data,
                         gpointer self);
static void ft_session_dbus_service_real_dispose (GObject* base);
static void g_cclosure_user_marshal_VOID__VARIANT_VARIANT (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data);
static void ft_session_dbus_service_finalize (GObject * obj);
static GType ft_session_dbus_service_get_type_once (void);
static void _vala_ft_session_dbus_service_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _dbus_ft_session_dbus_service_advance (FtSessionDBusService* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_advance_to_state (FtSessionDBusService* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_reset (FtSessionDBusService* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_get_current_time_block (FtSessionDBusService* self,
                                                           GVariant* _parameters_,
                                                           GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_get_current_gap (FtSessionDBusService* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_get_next_time_block (FtSessionDBusService* self,
                                                        GVariant* _parameters_,
                                                        GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_list_time_blocks (FtSessionDBusService* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation);
static void _dbus_ft_session_dbus_service_list_cycles (FtSessionDBusService* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void ft_session_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                         const gchar* sender,
                                                         const gchar* object_path,
                                                         const gchar* interface_name,
                                                         const gchar* method_name,
                                                         GVariant* parameters,
                                                         GDBusMethodInvocation* invocation,
                                                         gpointer user_data);
static GVariant* ft_session_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                               const gchar* sender,
                                                               const gchar* object_path,
                                                               const gchar* interface_name,
                                                               const gchar* property_name,
                                                               GError** error,
                                                               gpointer user_data);
static GVariant* _dbus_ft_session_dbus_service_get_current_state (FtSessionDBusService* self);
static GVariant* _dbus_ft_session_dbus_service_get_start_time (FtSessionDBusService* self);
static GVariant* _dbus_ft_session_dbus_service_get_end_time (FtSessionDBusService* self);
static GVariant* _dbus_ft_session_dbus_service_get_has_uniform_breaks (FtSessionDBusService* self);
static GVariant* _dbus_ft_session_dbus_service_get_can_reset (FtSessionDBusService* self);
static gboolean ft_session_dbus_service_dbus_interface_set_property (GDBusConnection* connection,
                                                              const gchar* sender,
                                                              const gchar* object_path,
                                                              const gchar* interface_name,
                                                              const gchar* property_name,
                                                              GVariant* value,
                                                              GError** error,
                                                              gpointer user_data);
static void _dbus_ft_session_dbus_service_enter_time_block (GObject* _sender,
                                                     GVariant* time_block,
                                                     gpointer* _data);
static void _dbus_ft_session_dbus_service_leave_time_block (GObject* _sender,
                                                     GVariant* time_block,
                                                     gpointer* _data);
static void _dbus_ft_session_dbus_service_confirm_advancement (GObject* _sender,
                                                        GVariant* current_time_block,
                                                        GVariant* next_time_block,
                                                        gpointer* _data);
static void _dbus_ft_session_dbus_service_changed (GObject* _sender,
                                            gpointer* _data);
static void _ft_session_dbus_service_unregister_object (gpointer user_data);
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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _ft_application_dbus_service_dbus_arg_info_show_window_view = {-1, "view", "s", NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_show_window_in[] = {&_ft_application_dbus_service_dbus_arg_info_show_window_view, NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_show_window_out[] = {NULL};
static const GDBusMethodInfo _ft_application_dbus_service_dbus_method_info_show_window = {-1, "ShowWindow", (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_show_window_in), (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_show_window_out), NULL};
static const GDBusArgInfo _ft_application_dbus_service_dbus_arg_info_show_preferences_view = {-1, "view", "s", NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_show_preferences_in[] = {&_ft_application_dbus_service_dbus_arg_info_show_preferences_view, NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_show_preferences_out[] = {NULL};
static const GDBusMethodInfo _ft_application_dbus_service_dbus_method_info_show_preferences = {-1, "ShowPreferences", (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_show_preferences_in), (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_show_preferences_out), NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_quit_in[] = {NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_quit_out[] = {NULL};
static const GDBusMethodInfo _ft_application_dbus_service_dbus_method_info_quit = {-1, "Quit", (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_quit_in), (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_quit_out), NULL};
static const GDBusMethodInfo * const _ft_application_dbus_service_dbus_method_info[] = {&_ft_application_dbus_service_dbus_method_info_show_window, &_ft_application_dbus_service_dbus_method_info_show_preferences, &_ft_application_dbus_service_dbus_method_info_quit, NULL};
static const GDBusArgInfo * const _ft_application_dbus_service_dbus_arg_info_request_focus[] = {NULL};
static const GDBusSignalInfo _ft_application_dbus_service_dbus_signal_info_request_focus = {-1, "RequestFocus", (GDBusArgInfo **) (&_ft_application_dbus_service_dbus_arg_info_request_focus), NULL};
static const GDBusSignalInfo * const _ft_application_dbus_service_dbus_signal_info[] = {&_ft_application_dbus_service_dbus_signal_info_request_focus, NULL};
static const GDBusPropertyInfo _ft_application_dbus_service_dbus_property_info_version = {-1, "Version", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_application_dbus_service_dbus_property_info_settings = {-1, "Settings", "a{sv}", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_application_dbus_service_dbus_property_info_ready = {-1, "Ready", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _ft_application_dbus_service_dbus_property_info[] = {&_ft_application_dbus_service_dbus_property_info_version, &_ft_application_dbus_service_dbus_property_info_settings, &_ft_application_dbus_service_dbus_property_info_ready, NULL};
static const GDBusInterfaceInfo _ft_application_dbus_service_dbus_interface_info = {-1, "io.github.focustimerhq.FocusTimer", (GDBusMethodInfo **) (&_ft_application_dbus_service_dbus_method_info), (GDBusSignalInfo **) (&_ft_application_dbus_service_dbus_signal_info), (GDBusPropertyInfo **) (&_ft_application_dbus_service_dbus_property_info), NULL};
static const GDBusInterfaceVTable _ft_application_dbus_service_dbus_interface_vtable = {ft_application_dbus_service_dbus_interface_method_call, ft_application_dbus_service_dbus_interface_get_property, ft_application_dbus_service_dbus_interface_set_property};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_is_started_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_started_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_started_out[] = {&_ft_timer_dbus_service_dbus_arg_info_is_started_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_is_started = {-1, "IsStarted", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_started_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_started_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_is_running_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_running_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_running_out[] = {&_ft_timer_dbus_service_dbus_arg_info_is_running_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_is_running = {-1, "IsRunning", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_running_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_running_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_is_paused_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_paused_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_paused_out[] = {&_ft_timer_dbus_service_dbus_arg_info_is_paused_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_is_paused = {-1, "IsPaused", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_paused_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_paused_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_is_finished_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_finished_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_is_finished_out[] = {&_ft_timer_dbus_service_dbus_arg_info_is_finished_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_is_finished = {-1, "IsFinished", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_finished_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_is_finished_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_get_elapsed_timestamp = {-1, "timestamp", "x", NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_get_elapsed_result = {-1, "result", "x", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_get_elapsed_in[] = {&_ft_timer_dbus_service_dbus_arg_info_get_elapsed_timestamp, NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_get_elapsed_out[] = {&_ft_timer_dbus_service_dbus_arg_info_get_elapsed_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_get_elapsed = {-1, "GetElapsed", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_get_elapsed_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_get_elapsed_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_get_remaining_timestamp = {-1, "timestamp", "x", NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_get_remaining_result = {-1, "result", "x", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_get_remaining_in[] = {&_ft_timer_dbus_service_dbus_arg_info_get_remaining_timestamp, NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_get_remaining_out[] = {&_ft_timer_dbus_service_dbus_arg_info_get_remaining_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_get_remaining = {-1, "GetRemaining", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_get_remaining_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_get_remaining_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_get_progress_timestamp = {-1, "timestamp", "x", NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_get_progress_result = {-1, "result", "d", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_get_progress_in[] = {&_ft_timer_dbus_service_dbus_arg_info_get_progress_timestamp, NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_get_progress_out[] = {&_ft_timer_dbus_service_dbus_arg_info_get_progress_result, NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_get_progress = {-1, "GetProgress", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_get_progress_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_get_progress_out), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_start_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_start_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_start = {-1, "Start", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_start_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_start_out), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_stop_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_stop_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_stop = {-1, "Stop", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_stop_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_stop_out), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_pause_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_pause_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_pause = {-1, "Pause", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_pause_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_pause_out), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_resume_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_resume_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_resume = {-1, "Resume", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_resume_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_resume_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_rewind_interval = {-1, "interval", "x", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_rewind_in[] = {&_ft_timer_dbus_service_dbus_arg_info_rewind_interval, NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_rewind_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_rewind = {-1, "Rewind", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_rewind_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_rewind_out), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_extend_interval = {-1, "interval", "x", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_extend_in[] = {&_ft_timer_dbus_service_dbus_arg_info_extend_interval, NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_extend_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_extend = {-1, "Extend", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_extend_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_extend_out), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_skip_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_skip_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_skip = {-1, "Skip", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_skip_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_skip_out), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_reset_in[] = {NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_reset_out[] = {NULL};
static const GDBusMethodInfo _ft_timer_dbus_service_dbus_method_info_reset = {-1, "Reset", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_reset_in), (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_reset_out), NULL};
static const GDBusMethodInfo * const _ft_timer_dbus_service_dbus_method_info[] = {&_ft_timer_dbus_service_dbus_method_info_is_started, &_ft_timer_dbus_service_dbus_method_info_is_running, &_ft_timer_dbus_service_dbus_method_info_is_paused, &_ft_timer_dbus_service_dbus_method_info_is_finished, &_ft_timer_dbus_service_dbus_method_info_get_elapsed, &_ft_timer_dbus_service_dbus_method_info_get_remaining, &_ft_timer_dbus_service_dbus_method_info_get_progress, &_ft_timer_dbus_service_dbus_method_info_start, &_ft_timer_dbus_service_dbus_method_info_stop, &_ft_timer_dbus_service_dbus_method_info_pause, &_ft_timer_dbus_service_dbus_method_info_resume, &_ft_timer_dbus_service_dbus_method_info_rewind, &_ft_timer_dbus_service_dbus_method_info_extend, &_ft_timer_dbus_service_dbus_method_info_skip, &_ft_timer_dbus_service_dbus_method_info_reset, NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_changed[] = {NULL};
static const GDBusSignalInfo _ft_timer_dbus_service_dbus_signal_info_changed = {-1, "Changed", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_changed), NULL};
static const GDBusArgInfo _ft_timer_dbus_service_dbus_arg_info_tick_timestamp = {-1, "timestamp", "x", NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_tick[] = {&_ft_timer_dbus_service_dbus_arg_info_tick_timestamp, NULL};
static const GDBusSignalInfo _ft_timer_dbus_service_dbus_signal_info_tick = {-1, "Tick", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_tick), NULL};
static const GDBusArgInfo * const _ft_timer_dbus_service_dbus_arg_info_finished[] = {NULL};
static const GDBusSignalInfo _ft_timer_dbus_service_dbus_signal_info_finished = {-1, "Finished", (GDBusArgInfo **) (&_ft_timer_dbus_service_dbus_arg_info_finished), NULL};
static const GDBusSignalInfo * const _ft_timer_dbus_service_dbus_signal_info[] = {&_ft_timer_dbus_service_dbus_signal_info_changed, &_ft_timer_dbus_service_dbus_signal_info_tick, &_ft_timer_dbus_service_dbus_signal_info_finished, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_state = {-1, "State", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_duration = {-1, "Duration", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_offset = {-1, "Offset", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_started_time = {-1, "StartedTime", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_paused_time = {-1, "PausedTime", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_finished_time = {-1, "FinishedTime", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_timer_dbus_service_dbus_property_info_last_changed_time = {-1, "LastChangedTime", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _ft_timer_dbus_service_dbus_property_info[] = {&_ft_timer_dbus_service_dbus_property_info_state, &_ft_timer_dbus_service_dbus_property_info_duration, &_ft_timer_dbus_service_dbus_property_info_offset, &_ft_timer_dbus_service_dbus_property_info_started_time, &_ft_timer_dbus_service_dbus_property_info_paused_time, &_ft_timer_dbus_service_dbus_property_info_finished_time, &_ft_timer_dbus_service_dbus_property_info_last_changed_time, NULL};
static const GDBusInterfaceInfo _ft_timer_dbus_service_dbus_interface_info = {-1, "io.github.focustimerhq.FocusTimer.Timer", (GDBusMethodInfo **) (&_ft_timer_dbus_service_dbus_method_info), (GDBusSignalInfo **) (&_ft_timer_dbus_service_dbus_signal_info), (GDBusPropertyInfo **) (&_ft_timer_dbus_service_dbus_property_info), NULL};
static const GDBusInterfaceVTable _ft_timer_dbus_service_dbus_interface_vtable = {ft_timer_dbus_service_dbus_interface_method_call, ft_timer_dbus_service_dbus_interface_get_property, ft_timer_dbus_service_dbus_interface_set_property};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_advance_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_advance_out[] = {NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_advance = {-1, "Advance", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_advance_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_advance_out), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_advance_to_state_state = {-1, "state", "s", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_advance_to_state_in[] = {&_ft_session_dbus_service_dbus_arg_info_advance_to_state_state, NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_advance_to_state_out[] = {NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_advance_to_state = {-1, "AdvanceToState", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_advance_to_state_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_advance_to_state_out), NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_reset_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_reset_out[] = {NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_reset = {-1, "Reset", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_reset_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_reset_out), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_get_current_time_block_result = {-1, "result", "a{sv}", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_get_current_time_block_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_get_current_time_block_out[] = {&_ft_session_dbus_service_dbus_arg_info_get_current_time_block_result, NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_get_current_time_block = {-1, "GetCurrentTimeBlock", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_get_current_time_block_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_get_current_time_block_out), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_get_current_gap_result = {-1, "result", "a{sv}", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_get_current_gap_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_get_current_gap_out[] = {&_ft_session_dbus_service_dbus_arg_info_get_current_gap_result, NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_get_current_gap = {-1, "GetCurrentGap", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_get_current_gap_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_get_current_gap_out), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_get_next_time_block_result = {-1, "result", "a{sv}", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_get_next_time_block_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_get_next_time_block_out[] = {&_ft_session_dbus_service_dbus_arg_info_get_next_time_block_result, NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_get_next_time_block = {-1, "GetNextTimeBlock", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_get_next_time_block_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_get_next_time_block_out), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_list_time_blocks_result = {-1, "result", "aa{sv}", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_list_time_blocks_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_list_time_blocks_out[] = {&_ft_session_dbus_service_dbus_arg_info_list_time_blocks_result, NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_list_time_blocks = {-1, "ListTimeBlocks", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_list_time_blocks_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_list_time_blocks_out), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_list_cycles_result = {-1, "result", "aa{sv}", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_list_cycles_in[] = {NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_list_cycles_out[] = {&_ft_session_dbus_service_dbus_arg_info_list_cycles_result, NULL};
static const GDBusMethodInfo _ft_session_dbus_service_dbus_method_info_list_cycles = {-1, "ListCycles", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_list_cycles_in), (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_list_cycles_out), NULL};
static const GDBusMethodInfo * const _ft_session_dbus_service_dbus_method_info[] = {&_ft_session_dbus_service_dbus_method_info_advance, &_ft_session_dbus_service_dbus_method_info_advance_to_state, &_ft_session_dbus_service_dbus_method_info_reset, &_ft_session_dbus_service_dbus_method_info_get_current_time_block, &_ft_session_dbus_service_dbus_method_info_get_current_gap, &_ft_session_dbus_service_dbus_method_info_get_next_time_block, &_ft_session_dbus_service_dbus_method_info_list_time_blocks, &_ft_session_dbus_service_dbus_method_info_list_cycles, NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_enter_time_block_time_block = {-1, "time_block", "v", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_enter_time_block[] = {&_ft_session_dbus_service_dbus_arg_info_enter_time_block_time_block, NULL};
static const GDBusSignalInfo _ft_session_dbus_service_dbus_signal_info_enter_time_block = {-1, "EnterTimeBlock", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_enter_time_block), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_leave_time_block_time_block = {-1, "time_block", "v", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_leave_time_block[] = {&_ft_session_dbus_service_dbus_arg_info_leave_time_block_time_block, NULL};
static const GDBusSignalInfo _ft_session_dbus_service_dbus_signal_info_leave_time_block = {-1, "LeaveTimeBlock", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_leave_time_block), NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_confirm_advancement_current_time_block = {-1, "current_time_block", "v", NULL};
static const GDBusArgInfo _ft_session_dbus_service_dbus_arg_info_confirm_advancement_next_time_block = {-1, "next_time_block", "v", NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_confirm_advancement[] = {&_ft_session_dbus_service_dbus_arg_info_confirm_advancement_current_time_block, &_ft_session_dbus_service_dbus_arg_info_confirm_advancement_next_time_block, NULL};
static const GDBusSignalInfo _ft_session_dbus_service_dbus_signal_info_confirm_advancement = {-1, "ConfirmAdvancement", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_confirm_advancement), NULL};
static const GDBusArgInfo * const _ft_session_dbus_service_dbus_arg_info_changed[] = {NULL};
static const GDBusSignalInfo _ft_session_dbus_service_dbus_signal_info_changed = {-1, "Changed", (GDBusArgInfo **) (&_ft_session_dbus_service_dbus_arg_info_changed), NULL};
static const GDBusSignalInfo * const _ft_session_dbus_service_dbus_signal_info[] = {&_ft_session_dbus_service_dbus_signal_info_enter_time_block, &_ft_session_dbus_service_dbus_signal_info_leave_time_block, &_ft_session_dbus_service_dbus_signal_info_confirm_advancement, &_ft_session_dbus_service_dbus_signal_info_changed, NULL};
static const GDBusPropertyInfo _ft_session_dbus_service_dbus_property_info_current_state = {-1, "CurrentState", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_session_dbus_service_dbus_property_info_start_time = {-1, "StartTime", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_session_dbus_service_dbus_property_info_end_time = {-1, "EndTime", "x", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_session_dbus_service_dbus_property_info_has_uniform_breaks = {-1, "HasUniformBreaks", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _ft_session_dbus_service_dbus_property_info_can_reset = {-1, "CanReset", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _ft_session_dbus_service_dbus_property_info[] = {&_ft_session_dbus_service_dbus_property_info_current_state, &_ft_session_dbus_service_dbus_property_info_start_time, &_ft_session_dbus_service_dbus_property_info_end_time, &_ft_session_dbus_service_dbus_property_info_has_uniform_breaks, &_ft_session_dbus_service_dbus_property_info_can_reset, NULL};
static const GDBusInterfaceInfo _ft_session_dbus_service_dbus_interface_info = {-1, "io.github.focustimerhq.FocusTimer.Session", (GDBusMethodInfo **) (&_ft_session_dbus_service_dbus_method_info), (GDBusSignalInfo **) (&_ft_session_dbus_service_dbus_signal_info), (GDBusPropertyInfo **) (&_ft_session_dbus_service_dbus_property_info), NULL};
static const GDBusInterfaceVTable _ft_session_dbus_service_dbus_interface_vtable = {ft_session_dbus_service_dbus_interface_method_call, ft_session_dbus_service_dbus_interface_get_property, ft_session_dbus_service_dbus_interface_set_property};

static inline gpointer
ft_application_dbus_service_get_instance_private (FtApplicationDBusService* self)
{
	return G_STRUCT_MEMBER_P (self, FtApplicationDBusService_private_offset);
}

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

static void
_ft_application_dbus_service_on_settings_changed_g_settings_changed (GSettings* _sender,
                                                                     const gchar* key,
                                                                     gpointer self)
{
	ft_application_dbus_service_on_settings_changed ((FtApplicationDBusService*) self, _sender, key);
}

static void
_ft_application_dbus_service_on_notify_ready_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	ft_application_dbus_service_on_notify_ready ((FtApplicationDBusService*) self, _sender, pspec);
}

FtApplicationDBusService*
ft_application_dbus_service_construct (GType object_type,
                                       GDBusConnection* connection,
                                       const gchar* object_path,
                                       FtApplication* application,
                                       GSettings* settings)
{
	FtApplicationDBusService * self = NULL;
	gchar* _tmp0_;
	FtApplication* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GVariant* _tmp5_;
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (object_path != NULL, NULL);
	g_return_val_if_fail (application != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	self = (FtApplicationDBusService*) g_object_new (object_type, NULL);
	self->priv->connection = connection;
	_tmp0_ = g_strdup (object_path);
	_g_free0 (self->priv->object_path);
	self->priv->object_path = _tmp0_;
	_tmp1_ = _g_object_ref0 (application);
	_g_object_unref0 (self->priv->application);
	self->priv->application = _tmp1_;
	_tmp2_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->priv->_settings);
	self->priv->_settings = _tmp2_;
	_tmp3_ = ft_application_get_ready (application);
	_tmp4_ = _tmp3_;
	self->priv->_ready = _tmp4_;
	_tmp5_ = ft_application_dbus_service_serialize_settings (self, settings);
	_g_variant_unref0 (self->priv->serialized_settings);
	self->priv->serialized_settings = _tmp5_;
	g_signal_connect_object (settings, "changed", (GCallback) _ft_application_dbus_service_on_settings_changed_g_settings_changed, self, 0);
	g_signal_connect_object ((GObject*) application, "notify::ready", (GCallback) _ft_application_dbus_service_on_notify_ready_g_object_notify, self, 0);
	return self;
}

FtApplicationDBusService*
ft_application_dbus_service_new (GDBusConnection* connection,
                                 const gchar* object_path,
                                 FtApplication* application,
                                 GSettings* settings)
{
	return ft_application_dbus_service_construct (FT_TYPE_APPLICATION_DBUS_SERVICE, connection, object_path, application, settings);
}

static GVariant*
ft_application_dbus_service_serialize_settings (FtApplicationDBusService* self,
                                                GSettings* settings)
{
	GVariantBuilder* builder = NULL;
	const GVariantType* _tmp0_;
	GVariantBuilder* _tmp1_;
	GSettings* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GSettings* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	GSettings* _tmp8_;
	GVariant* _tmp9_;
	GVariant* _tmp10_;
	GSettings* _tmp11_;
	GVariant* _tmp12_;
	GVariant* _tmp13_;
	GVariant* _tmp14_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	_tmp0_ = G_VARIANT_TYPE_VARDICT;
	_tmp1_ = g_variant_builder_new (_tmp0_);
	builder = _tmp1_;
	_tmp2_ = self->priv->_settings;
	_tmp3_ = g_variant_new_boolean (g_settings_get_boolean (_tmp2_, "announce-about-to-end"));
	g_variant_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	g_variant_builder_add (builder, "{sv}", "announce-about-to-end", _tmp4_, NULL);
	_g_variant_unref0 (_tmp4_);
	_tmp5_ = self->priv->_settings;
	_tmp6_ = g_variant_new_boolean (g_settings_get_boolean (_tmp5_, "screen-overlay"));
	g_variant_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	g_variant_builder_add (builder, "{sv}", "screen-overlay", _tmp7_, NULL);
	_g_variant_unref0 (_tmp7_);
	_tmp8_ = self->priv->_settings;
	_tmp9_ = g_variant_new_uint32 ((guint32) g_settings_get_uint (_tmp8_, "screen-overlay-lock-delay"));
	g_variant_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	g_variant_builder_add (builder, "{sv}", "screen-overlay-lock-delay", _tmp10_, NULL);
	_g_variant_unref0 (_tmp10_);
	_tmp11_ = self->priv->_settings;
	_tmp12_ = g_variant_new_uint32 ((guint32) g_settings_get_uint (_tmp11_, "screen-overlay-reopen-delay"));
	g_variant_ref_sink (_tmp12_);
	_tmp13_ = _tmp12_;
	g_variant_builder_add (builder, "{sv}", "screen-overlay-reopen-delay", _tmp13_, NULL);
	_g_variant_unref0 (_tmp13_);
	_tmp14_ = g_variant_builder_end (builder);
	g_variant_ref_sink (_tmp14_);
	result = _tmp14_;
	_g_variant_builder_unref0 (builder);
	return result;
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static void
ft_application_dbus_service_update_properties (FtApplicationDBusService* self)
{
	GDBusConnection* _tmp0_;
	GVariantBuilder* changed_properties = NULL;
	const GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* invalidated_properties = NULL;
	GVariantType* _tmp3_;
	GVariantType* _tmp4_;
	GVariantBuilder* _tmp5_;
	GVariantBuilder* _tmp6_;
	GVariant* serialized_settings = NULL;
	GSettings* _tmp7_;
	GVariant* _tmp8_;
	gboolean ready = FALSE;
	FtApplication* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gboolean changed = FALSE;
	gboolean _tmp12_ = FALSE;
	GVariant* _tmp13_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->connection;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = G_VARIANT_TYPE_VARDICT;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	changed_properties = _tmp2_;
	_tmp3_ = g_variant_type_new ("as");
	_tmp4_ = _tmp3_;
	_tmp5_ = g_variant_builder_new (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_variant_type_free0 (_tmp4_);
	invalidated_properties = _tmp6_;
	_tmp7_ = self->priv->_settings;
	_tmp8_ = ft_application_dbus_service_serialize_settings (self, _tmp7_);
	serialized_settings = _tmp8_;
	_tmp9_ = self->priv->application;
	_tmp10_ = ft_application_get_ready (_tmp9_);
	_tmp11_ = _tmp10_;
	ready = _tmp11_;
	changed = FALSE;
	_tmp13_ = self->priv->serialized_settings;
	if (_tmp13_ == NULL) {
		_tmp12_ = TRUE;
	} else {
		GVariant* _tmp14_;
		GVariant* _tmp15_;
		_tmp14_ = self->priv->serialized_settings;
		_tmp15_ = serialized_settings;
		_tmp12_ = !g_variant_equal (_tmp14_, _tmp15_);
	}
	if (_tmp12_) {
		GVariant* _tmp16_;
		GVariant* _tmp17_;
		GVariantBuilder* _tmp18_;
		GVariant* _tmp19_;
		_tmp16_ = serialized_settings;
		_tmp17_ = _g_variant_ref0 (_tmp16_);
		_g_variant_unref0 (self->priv->serialized_settings);
		self->priv->serialized_settings = _tmp17_;
		_tmp18_ = changed_properties;
		_tmp19_ = serialized_settings;
		g_variant_builder_add (_tmp18_, "{sv}", "Settings", _tmp19_, NULL);
		changed = TRUE;
	}
	if (self->priv->_ready != ready) {
		GVariantBuilder* _tmp20_;
		GVariant* _tmp21_;
		GVariant* _tmp22_;
		self->priv->_ready = ready;
		_tmp20_ = changed_properties;
		_tmp21_ = g_variant_new_boolean (ready);
		g_variant_ref_sink (_tmp21_);
		_tmp22_ = _tmp21_;
		g_variant_builder_add (_tmp20_, "{sv}", "Ready", _tmp22_, NULL);
		_g_variant_unref0 (_tmp22_);
		changed = TRUE;
	}
	if (changed) {
		{
			GDBusConnection* _tmp23_;
			const gchar* _tmp24_;
			GVariantBuilder* _tmp25_;
			GVariantBuilder* _tmp26_;
			GVariant* _tmp27_;
			GVariant* _tmp28_;
			_tmp23_ = self->priv->connection;
			_tmp24_ = self->priv->object_path;
			_tmp25_ = changed_properties;
			_tmp26_ = invalidated_properties;
			_tmp27_ = g_variant_new ("(sa{sv}as)", FT_APPLICATION_DBUS_SERVICE_DBUS_INTERFACE_NAME, _tmp25_, _tmp26_, NULL);
			g_variant_ref_sink (_tmp27_);
			_tmp28_ = _tmp27_;
			g_dbus_connection_emit_signal (_tmp23_, NULL, _tmp24_, "org.freedesktop.DBus.Properties", "PropertiesChanged", _tmp28_, &_inner_error0_);
			_g_variant_unref0 (_tmp28_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* _error_ = NULL;
			GError* _tmp29_;
			const gchar* _tmp30_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp29_ = _error_;
			_tmp30_ = _tmp29_->message;
			g_warning ("dbus-services.vala:120: Failed to emit PropertiesChanged signal: %s", _tmp30_);
			_g_error_free0 (_error_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_variant_unref0 (serialized_settings);
			_g_variant_builder_unref0 (invalidated_properties);
			_g_variant_builder_unref0 (changed_properties);
			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_variant_unref0 (serialized_settings);
	_g_variant_builder_unref0 (invalidated_properties);
	_g_variant_builder_unref0 (changed_properties);
}

static void
ft_application_dbus_service_on_settings_changed (FtApplicationDBusService* self,
                                                 GSettings* settings,
                                                 const gchar* key)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	ft_application_dbus_service_update_properties (self);
}

static void
ft_application_dbus_service_on_notify_ready (FtApplicationDBusService* self,
                                             GObject* object,
                                             GParamSpec* pspec)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	ft_application_dbus_service_update_properties (self);
}

void
ft_application_dbus_service_show_window (FtApplicationDBusService* self,
                                         const gchar* view,
                                         GError** error)
{
	FtApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (view != NULL);
	_tmp0_ = self->priv->application;
	ft_application_show_window (_tmp0_, ft_window_view_from_string (view));
}

void
ft_application_dbus_service_show_preferences (FtApplicationDBusService* self,
                                              const gchar* view,
                                              GError** error)
{
	FtApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (view != NULL);
	_tmp0_ = self->priv->application;
	ft_application_show_preferences (_tmp0_, view);
}

void
ft_application_dbus_service_quit (FtApplicationDBusService* self,
                                  GError** error)
{
	FtApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("application.quit", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->application;
	g_application_quit ((GApplication*) _tmp0_);
}

void
ft_application_dbus_service_emit_request_focus (FtApplicationDBusService* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, ft_application_dbus_service_signals[FT_APPLICATION_DBUS_SERVICE_REQUEST_FOCUS_SIGNAL], 0);
}

static void
ft_application_dbus_service_real_dispose (GObject* base)
{
	FtApplicationDBusService * self;
	GSettings* _tmp0_;
	self = (FtApplicationDBusService*) base;
	_tmp0_ = self->priv->_settings;
	if (_tmp0_ != NULL) {
		GSettings* _tmp1_;
		guint _tmp2_;
		_tmp1_ = self->priv->_settings;
		g_signal_parse_name ("changed", g_settings_get_type (), &_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) _ft_application_dbus_service_on_settings_changed_g_settings_changed, self);
		_g_object_unref0 (self->priv->_settings);
		self->priv->_settings = NULL;
	}
	_g_variant_unref0 (self->priv->serialized_settings);
	self->priv->serialized_settings = NULL;
	_g_object_unref0 (self->priv->application);
	self->priv->application = NULL;
	self->priv->connection = NULL;
	G_OBJECT_CLASS (ft_application_dbus_service_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

gchar*
ft_application_dbus_service_get_version (FtApplicationDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (PACKAGE_VERSION);
	result = _tmp0_;
	return result;
}

GVariant*
ft_application_dbus_service_get_settings (FtApplicationDBusService* self)
{
	GVariant* result;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->serialized_settings;
	_tmp1_ = _g_variant_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

gboolean
ft_application_dbus_service_get_ready (FtApplicationDBusService* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_ready;
	return result;
}

static void
ft_application_dbus_service_class_init (FtApplicationDBusServiceClass * klass,
                                        gpointer klass_data)
{
	ft_application_dbus_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtApplicationDBusService_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_application_dbus_service_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_application_dbus_service_get_property;
	G_OBJECT_CLASS (klass)->finalize = ft_application_dbus_service_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_APPLICATION_DBUS_SERVICE_VERSION_PROPERTY, ft_application_dbus_service_properties[FT_APPLICATION_DBUS_SERVICE_VERSION_PROPERTY] = g_param_spec_string ("version", "version", "version", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_APPLICATION_DBUS_SERVICE_SETTINGS_PROPERTY, ft_application_dbus_service_properties[FT_APPLICATION_DBUS_SERVICE_SETTINGS_PROPERTY] = g_param_spec_variant ("settings", "settings", "settings", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_APPLICATION_DBUS_SERVICE_READY_PROPERTY, ft_application_dbus_service_properties[FT_APPLICATION_DBUS_SERVICE_READY_PROPERTY] = g_param_spec_boolean ("ready", "ready", "ready", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	ft_application_dbus_service_signals[FT_APPLICATION_DBUS_SERVICE_REQUEST_FOCUS_SIGNAL] = g_signal_new ("request-focus", FT_TYPE_APPLICATION_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
ft_application_dbus_service_instance_init (FtApplicationDBusService * self,
                                           gpointer klass)
{
	self->priv = ft_application_dbus_service_get_instance_private (self);
	self->priv->_ready = FALSE;
	self->priv->serialized_settings = NULL;
}

static void
ft_application_dbus_service_finalize (GObject * obj)
{
	FtApplicationDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_APPLICATION_DBUS_SERVICE, FtApplicationDBusService);
	_g_free0 (self->priv->object_path);
	_g_object_unref0 (self->priv->application);
	_g_object_unref0 (self->priv->_settings);
	_g_variant_unref0 (self->priv->serialized_settings);
	G_OBJECT_CLASS (ft_application_dbus_service_parent_class)->finalize (obj);
}

static GType
ft_application_dbus_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtApplicationDBusServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_application_dbus_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtApplicationDBusService), 0, (GInstanceInitFunc) ft_application_dbus_service_instance_init, NULL };
	GType ft_application_dbus_service_type_id;
	ft_application_dbus_service_type_id = g_type_register_static (G_TYPE_OBJECT, "FtApplicationDBusService", &g_define_type_info, 0);
	g_type_set_qdata (ft_application_dbus_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) ft_application_dbus_service_register_object);
	FtApplicationDBusService_private_offset = g_type_add_instance_private (ft_application_dbus_service_type_id, sizeof (FtApplicationDBusServicePrivate));
	return ft_application_dbus_service_type_id;
}

GType
ft_application_dbus_service_get_type (void)
{
	static volatile gsize ft_application_dbus_service_type_id__once = 0;
	if (g_once_init_enter (&ft_application_dbus_service_type_id__once)) {
		GType ft_application_dbus_service_type_id;
		ft_application_dbus_service_type_id = ft_application_dbus_service_get_type_once ();
		g_once_init_leave (&ft_application_dbus_service_type_id__once, ft_application_dbus_service_type_id);
	}
	return ft_application_dbus_service_type_id__once;
}

static void
_vala_ft_application_dbus_service_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	FtApplicationDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_APPLICATION_DBUS_SERVICE, FtApplicationDBusService);
	switch (property_id) {
		case FT_APPLICATION_DBUS_SERVICE_VERSION_PROPERTY:
		g_value_take_string (value, ft_application_dbus_service_get_version (self));
		break;
		case FT_APPLICATION_DBUS_SERVICE_SETTINGS_PROPERTY:
		g_value_take_variant (value, ft_application_dbus_service_get_settings (self));
		break;
		case FT_APPLICATION_DBUS_SERVICE_READY_PROPERTY:
		g_value_set_boolean (value, ft_application_dbus_service_get_ready (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_ft_application_dbus_service_show_window (FtApplicationDBusService* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* view = NULL;
	GVariant* _tmp0_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	view = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	ft_application_dbus_service_show_window (self, view, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (view);
	;
}

static void
_dbus_ft_application_dbus_service_show_preferences (FtApplicationDBusService* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* view = NULL;
	GVariant* _tmp1_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	view = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	ft_application_dbus_service_show_preferences (self, view, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (view);
	;
}

static void
_dbus_ft_application_dbus_service_quit (FtApplicationDBusService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_application_dbus_service_quit (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
ft_application_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                        const gchar* sender,
                                                        const gchar* object_path,
                                                        const gchar* interface_name,
                                                        const gchar* method_name,
                                                        GVariant* parameters,
                                                        GDBusMethodInvocation* invocation,
                                                        gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "ShowWindow") == 0) {
		_dbus_ft_application_dbus_service_show_window (object, parameters, invocation);
	} else if (strcmp (method_name, "ShowPreferences") == 0) {
		_dbus_ft_application_dbus_service_show_preferences (object, parameters, invocation);
	} else if (strcmp (method_name, "Quit") == 0) {
		_dbus_ft_application_dbus_service_quit (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_ft_application_dbus_service_get_version (FtApplicationDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = ft_application_dbus_service_get_version (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_ft_application_dbus_service_get_settings (FtApplicationDBusService* self)
{
	GVariant* result;
	GVariant* _reply;
	result = ft_application_dbus_service_get_settings (self);
	_reply = result;
	return _reply;
}

static GVariant*
_dbus_ft_application_dbus_service_get_ready (FtApplicationDBusService* self)
{
	gboolean result;
	GVariant* _reply;
	result = ft_application_dbus_service_get_ready (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
ft_application_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                         const gchar* sender,
                                                         const gchar* object_path,
                                                         const gchar* interface_name,
                                                         const gchar* property_name,
                                                         GError** error,
                                                         gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Version") == 0) {
		return _dbus_ft_application_dbus_service_get_version (object);
	} else if (strcmp (property_name, "Settings") == 0) {
		return _dbus_ft_application_dbus_service_get_settings (object);
	} else if (strcmp (property_name, "Ready") == 0) {
		return _dbus_ft_application_dbus_service_get_ready (object);
	}
	return NULL;
}

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

static void
_dbus_ft_application_dbus_service_request_focus (GObject* _sender,
                                                 gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer", "RequestFocus", _arguments, NULL);
}

guint
ft_application_dbus_service_register_object (gpointer object,
                                             GDBusConnection* connection,
                                             const gchar* path,
                                             GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_ft_application_dbus_service_dbus_interface_info), &_ft_application_dbus_service_dbus_interface_vtable, data, _ft_application_dbus_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "request-focus", (GCallback) _dbus_ft_application_dbus_service_request_focus, data);
	return result;
}

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

static inline gpointer
ft_timer_dbus_service_get_instance_private (FtTimerDBusService* self)
{
	return G_STRUCT_MEMBER_P (self, FtTimerDBusService_private_offset);
}

static void
_ft_timer_dbus_service_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                      const FtTimerState* current_state,
                                                                      const FtTimerState* previous_state,
                                                                      gpointer self)
{
	ft_timer_dbus_service_on_timer_state_changed ((FtTimerDBusService*) self, current_state, previous_state);
}

static void
_ft_timer_dbus_service_on_timer_tick_ft_timer_tick (FtTimer* _sender,
                                                    gint64 timestamp,
                                                    gpointer self)
{
	ft_timer_dbus_service_on_timer_tick ((FtTimerDBusService*) self, timestamp);
}

static void
_ft_timer_dbus_service_on_timer_finished_ft_timer_finished (FtTimer* _sender,
                                                            const FtTimerState* state,
                                                            gpointer self)
{
	ft_timer_dbus_service_on_timer_finished ((FtTimerDBusService*) self);
}

static void
_ft_timer_dbus_service_on_session_manager_notify_current_state_g_object_notify (GObject* _sender,
                                                                                GParamSpec* pspec,
                                                                                gpointer self)
{
	ft_timer_dbus_service_on_session_manager_notify_current_state ((FtTimerDBusService*) self, _sender, pspec);
}

FtTimerDBusService*
ft_timer_dbus_service_construct (GType object_type,
                                 GDBusConnection* connection,
                                 const gchar* object_path,
                                 FtTimer* timer,
                                 FtSessionManager* session_manager)
{
	FtTimerDBusService * self = NULL;
	gchar* _tmp0_;
	FtTimer* _tmp1_;
	FtSessionManager* _tmp2_;
	FtTimer* _tmp3_;
	FtTimer* _tmp4_;
	FtTimer* _tmp5_;
	FtSessionManager* _tmp6_;
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (object_path != NULL, NULL);
	g_return_val_if_fail (timer != NULL, NULL);
	g_return_val_if_fail (session_manager != NULL, NULL);
	self = (FtTimerDBusService*) g_object_new (object_type, NULL);
	self->priv->connection = connection;
	_tmp0_ = g_strdup (object_path);
	_g_free0 (self->priv->object_path);
	self->priv->object_path = _tmp0_;
	_tmp1_ = _g_object_ref0 (timer);
	_g_object_unref0 (self->priv->timer);
	self->priv->timer = _tmp1_;
	_tmp2_ = _g_object_ref0 (session_manager);
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = _tmp2_;
	_tmp3_ = self->priv->timer;
	g_signal_connect_object (_tmp3_, "state-changed", (GCallback) _ft_timer_dbus_service_on_timer_state_changed_ft_timer_state_changed, self, 0);
	_tmp4_ = self->priv->timer;
	g_signal_connect_object (_tmp4_, "tick", (GCallback) _ft_timer_dbus_service_on_timer_tick_ft_timer_tick, self, 0);
	_tmp5_ = self->priv->timer;
	g_signal_connect_object (_tmp5_, "finished", (GCallback) _ft_timer_dbus_service_on_timer_finished_ft_timer_finished, self, 0);
	_tmp6_ = self->priv->session_manager;
	g_signal_connect_object ((GObject*) _tmp6_, "notify::current-state", (GCallback) _ft_timer_dbus_service_on_session_manager_notify_current_state_g_object_notify, self, 0);
	ft_timer_dbus_service_update_properties (self);
	return self;
}

FtTimerDBusService*
ft_timer_dbus_service_new (GDBusConnection* connection,
                           const gchar* object_path,
                           FtTimer* timer,
                           FtSessionManager* session_manager)
{
	return ft_timer_dbus_service_construct (FT_TYPE_TIMER_DBUS_SERVICE, connection, object_path, timer, session_manager);
}

static void
ft_timer_dbus_service_update_properties (FtTimerDBusService* self)
{
	GDBusConnection* _tmp0_;
	GVariantBuilder* changed_properties = NULL;
	const GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* invalidated_properties = NULL;
	GVariantType* _tmp3_;
	GVariantType* _tmp4_;
	GVariantBuilder* _tmp5_;
	GVariantBuilder* _tmp6_;
	FtTimerState timer_state = {0};
	FtTimer* _tmp7_;
	FtTimerState _tmp8_ = {0};
	FtTimerState _tmp9_;
	FtTimerState _tmp10_ = {0};
	gint64 last_state_changed_time = 0LL;
	FtTimer* _tmp11_;
	FtState state = 0;
	FtSessionManager* _tmp12_;
	FtState _tmp13_;
	FtState _tmp14_;
	gboolean changed = FALSE;
	FtTimerState _tmp20_;
	FtTimerState _tmp21_;
	FtTimerState _tmp26_;
	FtTimerState _tmp27_;
	FtTimerState _tmp32_;
	FtTimerState _tmp33_;
	FtTimerState _tmp38_;
	FtTimerState _tmp39_;
	FtTimerState _tmp44_;
	FtTimerState _tmp45_;
	FtTimerState _tmp53_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->connection;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = G_VARIANT_TYPE_VARDICT;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	changed_properties = _tmp2_;
	_tmp3_ = g_variant_type_new ("as");
	_tmp4_ = _tmp3_;
	_tmp5_ = g_variant_builder_new (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_variant_type_free0 (_tmp4_);
	invalidated_properties = _tmp6_;
	_tmp7_ = self->priv->timer;
	ft_timer_get_state (_tmp7_, &_tmp8_);
	_tmp9_ = _tmp8_;
	ft_timer_state_copy (&_tmp9_, &_tmp10_);
	timer_state = _tmp10_;
	_tmp11_ = self->priv->timer;
	last_state_changed_time = ft_timer_get_last_state_changed_time (_tmp11_);
	_tmp12_ = self->priv->session_manager;
	_tmp13_ = ft_session_manager_get_current_state (_tmp12_);
	_tmp14_ = _tmp13_;
	state = _tmp14_;
	changed = FALSE;
	if (state != self->priv->_state) {
		GVariantBuilder* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		GVariant* _tmp18_;
		GVariant* _tmp19_;
		_tmp15_ = changed_properties;
		_tmp16_ = ft_state_to_string (state);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_variant_new_string (_tmp17_);
		g_variant_ref_sink (_tmp18_);
		_tmp19_ = _tmp18_;
		g_variant_builder_add (_tmp15_, "{sv}", "State", _tmp19_, NULL);
		_g_variant_unref0 (_tmp19_);
		_g_free0 (_tmp17_);
		changed = TRUE;
	}
	_tmp20_ = timer_state;
	_tmp21_ = self->priv->timer_state;
	if (_tmp20_.duration != _tmp21_.duration) {
		GVariantBuilder* _tmp22_;
		FtTimerState _tmp23_;
		GVariant* _tmp24_;
		GVariant* _tmp25_;
		_tmp22_ = changed_properties;
		_tmp23_ = timer_state;
		_tmp24_ = g_variant_new_int64 (_tmp23_.duration);
		g_variant_ref_sink (_tmp24_);
		_tmp25_ = _tmp24_;
		g_variant_builder_add (_tmp22_, "{sv}", "Duration", _tmp25_, NULL);
		_g_variant_unref0 (_tmp25_);
		changed = TRUE;
	}
	_tmp26_ = timer_state;
	_tmp27_ = self->priv->timer_state;
	if (_tmp26_.offset != _tmp27_.offset) {
		GVariantBuilder* _tmp28_;
		FtTimerState _tmp29_;
		GVariant* _tmp30_;
		GVariant* _tmp31_;
		_tmp28_ = changed_properties;
		_tmp29_ = timer_state;
		_tmp30_ = g_variant_new_int64 (_tmp29_.offset);
		g_variant_ref_sink (_tmp30_);
		_tmp31_ = _tmp30_;
		g_variant_builder_add (_tmp28_, "{sv}", "Offset", _tmp31_, NULL);
		_g_variant_unref0 (_tmp31_);
		changed = TRUE;
	}
	_tmp32_ = timer_state;
	_tmp33_ = self->priv->timer_state;
	if (_tmp32_.started_time != _tmp33_.started_time) {
		GVariantBuilder* _tmp34_;
		FtTimerState _tmp35_;
		GVariant* _tmp36_;
		GVariant* _tmp37_;
		_tmp34_ = changed_properties;
		_tmp35_ = timer_state;
		_tmp36_ = g_variant_new_int64 (_tmp35_.started_time);
		g_variant_ref_sink (_tmp36_);
		_tmp37_ = _tmp36_;
		g_variant_builder_add (_tmp34_, "{sv}", "StartedTime", _tmp37_, NULL);
		_g_variant_unref0 (_tmp37_);
		changed = TRUE;
	}
	_tmp38_ = timer_state;
	_tmp39_ = self->priv->timer_state;
	if (_tmp38_.paused_time != _tmp39_.paused_time) {
		GVariantBuilder* _tmp40_;
		FtTimerState _tmp41_;
		GVariant* _tmp42_;
		GVariant* _tmp43_;
		_tmp40_ = changed_properties;
		_tmp41_ = timer_state;
		_tmp42_ = g_variant_new_int64 (_tmp41_.paused_time);
		g_variant_ref_sink (_tmp42_);
		_tmp43_ = _tmp42_;
		g_variant_builder_add (_tmp40_, "{sv}", "PausedTime", _tmp43_, NULL);
		_g_variant_unref0 (_tmp43_);
		changed = TRUE;
	}
	_tmp44_ = timer_state;
	_tmp45_ = self->priv->timer_state;
	if (_tmp44_.finished_time != _tmp45_.finished_time) {
		GVariantBuilder* _tmp46_;
		FtTimerState _tmp47_;
		GVariant* _tmp48_;
		GVariant* _tmp49_;
		_tmp46_ = changed_properties;
		_tmp47_ = timer_state;
		_tmp48_ = g_variant_new_int64 (_tmp47_.finished_time);
		g_variant_ref_sink (_tmp48_);
		_tmp49_ = _tmp48_;
		g_variant_builder_add (_tmp46_, "{sv}", "FinishedTime", _tmp49_, NULL);
		_g_variant_unref0 (_tmp49_);
		changed = TRUE;
	}
	if (last_state_changed_time != self->priv->last_state_changed_time) {
		GVariantBuilder* _tmp50_;
		GVariant* _tmp51_;
		GVariant* _tmp52_;
		_tmp50_ = changed_properties;
		_tmp51_ = g_variant_new_int64 (last_state_changed_time);
		g_variant_ref_sink (_tmp51_);
		_tmp52_ = _tmp51_;
		g_variant_builder_add (_tmp50_, "{sv}", "LastChangedTime", _tmp52_, NULL);
		_g_variant_unref0 (_tmp52_);
		changed = TRUE;
	}
	self->priv->_state = state;
	_tmp53_ = timer_state;
	self->priv->timer_state = _tmp53_;
	self->priv->last_state_changed_time = last_state_changed_time;
	if (changed) {
		{
			GDBusConnection* _tmp54_;
			const gchar* _tmp55_;
			GVariantBuilder* _tmp56_;
			GVariantBuilder* _tmp57_;
			GVariant* _tmp58_;
			GVariant* _tmp59_;
			_tmp54_ = self->priv->connection;
			_tmp55_ = self->priv->object_path;
			_tmp56_ = changed_properties;
			_tmp57_ = invalidated_properties;
			_tmp58_ = g_variant_new ("(sa{sv}as)", FT_TIMER_DBUS_SERVICE_DBUS_INTERFACE_NAME, _tmp56_, _tmp57_, NULL);
			g_variant_ref_sink (_tmp58_);
			_tmp59_ = _tmp58_;
			g_dbus_connection_emit_signal (_tmp54_, NULL, _tmp55_, "org.freedesktop.DBus.Properties", "PropertiesChanged", _tmp59_, &_inner_error0_);
			_g_variant_unref0 (_tmp59_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* _error_ = NULL;
			GError* _tmp60_;
			const gchar* _tmp61_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp60_ = _error_;
			_tmp61_ = _tmp60_->message;
			g_warning ("dbus-services.vala:354: Failed to emit PropertiesChanged signal: %s", _tmp61_);
			_g_error_free0 (_error_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_variant_builder_unref0 (invalidated_properties);
			_g_variant_builder_unref0 (changed_properties);
			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_variant_builder_unref0 (invalidated_properties);
	_g_variant_builder_unref0 (changed_properties);
}

static void
ft_timer_dbus_service_on_timer_state_changed (FtTimerDBusService* self,
                                              const FtTimerState* current_state,
                                              const FtTimerState* previous_state)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_state != NULL);
	g_return_if_fail (previous_state != NULL);
	ft_timer_dbus_service_update_properties (self);
	g_signal_emit (self, ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_CHANGED_SIGNAL], 0);
}

static void
ft_timer_dbus_service_on_timer_tick (FtTimerDBusService* self,
                                     gint64 timestamp)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_TICK_SIGNAL], 0, timestamp);
}

static void
ft_timer_dbus_service_on_timer_finished (FtTimerDBusService* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_FINISHED_SIGNAL], 0);
}

static void
ft_timer_dbus_service_on_session_manager_notify_current_state (FtTimerDBusService* self,
                                                               GObject* object,
                                                               GParamSpec* pspec)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	ft_timer_dbus_service_update_properties (self);
}

gboolean
ft_timer_dbus_service_is_started (FtTimerDBusService* self,
                                  GError** error)
{
	FtTimer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->timer;
	result = ft_timer_is_started (_tmp0_);
	return result;
}

gboolean
ft_timer_dbus_service_is_running (FtTimerDBusService* self,
                                  GError** error)
{
	FtTimer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->timer;
	result = ft_timer_is_running (_tmp0_);
	return result;
}

gboolean
ft_timer_dbus_service_is_paused (FtTimerDBusService* self,
                                 GError** error)
{
	FtTimer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->timer;
	result = ft_timer_is_paused (_tmp0_);
	return result;
}

gboolean
ft_timer_dbus_service_is_finished (FtTimerDBusService* self,
                                   GError** error)
{
	FtTimer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->timer;
	result = ft_timer_is_finished (_tmp0_);
	return result;
}

gint64
ft_timer_dbus_service_get_elapsed (FtTimerDBusService* self,
                                   gint64 timestamp,
                                   GError** error)
{
	FtTimer* _tmp0_;
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer;
	result = ft_timer_calculate_elapsed (_tmp0_, timestamp);
	return result;
}

gint64
ft_timer_dbus_service_get_remaining (FtTimerDBusService* self,
                                     gint64 timestamp,
                                     GError** error)
{
	FtTimer* _tmp0_;
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer;
	result = ft_timer_calculate_remaining (_tmp0_, timestamp);
	return result;
}

gdouble
ft_timer_dbus_service_get_progress (FtTimerDBusService* self,
                                    gint64 timestamp,
                                    GError** error)
{
	FtTimer* _tmp0_;
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = self->priv->timer;
	result = ft_timer_calculate_progress (_tmp0_, timestamp);
	return result;
}

void
ft_timer_dbus_service_start (FtTimerDBusService* self,
                             GError** error)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("timer.start", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->timer;
	ft_timer_start (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_stop (FtTimerDBusService* self,
                            GError** error)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("timer.reset", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->timer;
	ft_timer_reset (_tmp0_, (gint64) 0, NULL, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_pause (FtTimerDBusService* self,
                             GError** error)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("timer.pause", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->timer;
	ft_timer_pause (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_resume (FtTimerDBusService* self,
                              GError** error)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("timer.resume", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->timer;
	ft_timer_resume (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_rewind (FtTimerDBusService* self,
                              gint64 interval,
                              GError** error)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("timer.rewind", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->timer;
	ft_timer_rewind (_tmp0_, interval, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_extend (FtTimerDBusService* self,
                              gint64 interval,
                              GError** error)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("timer.extend", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->timer;
	ft_timer_extend (_tmp0_, interval, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_skip (FtTimerDBusService* self,
                            GError** error)
{
	FtSessionManager* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("session-manager.advance", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->session_manager;
	ft_session_manager_advance (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

void
ft_timer_dbus_service_reset (FtTimerDBusService* self,
                             GError** error)
{
	FtSessionManager* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("session-manager.reset", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->session_manager;
	ft_session_manager_reset (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_dbus_service_real_dispose (GObject* base)
{
	FtTimerDBusService * self;
	FtTimer* _tmp0_;
	guint _tmp1_;
	FtTimer* _tmp2_;
	guint _tmp3_;
	FtTimer* _tmp4_;
	guint _tmp5_;
	FtSessionManager* _tmp6_;
	guint _tmp7_;
	GQuark _tmp8_;
	self = (FtTimerDBusService*) base;
	_tmp0_ = self->priv->timer;
	g_signal_parse_name ("state-changed", 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) _ft_timer_dbus_service_on_timer_state_changed_ft_timer_state_changed, self);
	_tmp2_ = self->priv->timer;
	g_signal_parse_name ("tick", FT_TYPE_TIMER, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _ft_timer_dbus_service_on_timer_tick_ft_timer_tick, self);
	_tmp4_ = self->priv->timer;
	g_signal_parse_name ("finished", FT_TYPE_TIMER, &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _ft_timer_dbus_service_on_timer_finished_ft_timer_finished, self);
	_tmp6_ = self->priv->session_manager;
	g_signal_parse_name ("notify::current-state", G_TYPE_OBJECT, &_tmp7_, &_tmp8_, TRUE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, _tmp8_, NULL, (GCallback) _ft_timer_dbus_service_on_session_manager_notify_current_state_g_object_notify, self);
	_g_object_unref0 (self->priv->timer);
	self->priv->timer = NULL;
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = NULL;
	self->priv->connection = NULL;
	G_OBJECT_CLASS (ft_timer_dbus_service_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

gchar*
ft_timer_dbus_service_get_state (FtTimerDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = ft_state_to_string (self->priv->_state);
	result = _tmp0_;
	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;
}

void
ft_timer_dbus_service_set_state (FtTimerDBusService* self,
                                 const gchar* value)
{
	FtState state = 0;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	FtSessionManager* _tmp3_;
	g_return_if_fail (self != NULL);
	state = ft_state_from_string (value);
	_tmp0_ = string_to_string (value);
	_tmp1_ = g_strconcat ("session-manager.state:", _tmp0_, NULL);
	_tmp2_ = _tmp1_;
	ft_context_set_event_source (_tmp2_, FT_TIMESTAMP_UNDEFINED);
	_g_free0 (_tmp2_);
	_tmp3_ = self->priv->session_manager;
	ft_session_manager_advance_to_state (_tmp3_, state, FT_TIMESTAMP_UNDEFINED);
	g_object_notify_by_pspec ((GObject *) self, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_STATE_PROPERTY]);
}

gint64
ft_timer_dbus_service_get_duration (FtTimerDBusService* self)
{
	gint64 result;
	FtTimerState _tmp0_;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer_state;
	result = _tmp0_.duration;
	return result;
}

void
ft_timer_dbus_service_set_duration (FtTimerDBusService* self,
                                    gint64 value)
{
	FtTimer* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->timer;
	_tmp1_ = ft_timer_get_user_data (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		FtTimer* _tmp3_;
		_tmp3_ = self->priv->timer;
		ft_timer_set_duration (_tmp3_, value);
	}
	g_object_notify_by_pspec ((GObject *) self, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_DURATION_PROPERTY]);
}

gint64
ft_timer_dbus_service_get_offset (FtTimerDBusService* self)
{
	gint64 result;
	FtTimerState _tmp0_;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer_state;
	result = _tmp0_.offset;
	return result;
}

gint64
ft_timer_dbus_service_get_started_time (FtTimerDBusService* self)
{
	gint64 result;
	FtTimerState _tmp0_;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer_state;
	result = _tmp0_.started_time;
	return result;
}

gint64
ft_timer_dbus_service_get_paused_time (FtTimerDBusService* self)
{
	gint64 result;
	FtTimerState _tmp0_;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer_state;
	result = _tmp0_.paused_time;
	return result;
}

gint64
ft_timer_dbus_service_get_finished_time (FtTimerDBusService* self)
{
	gint64 result;
	FtTimerState _tmp0_;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->timer_state;
	result = _tmp0_.finished_time;
	return result;
}

gint64
ft_timer_dbus_service_get_last_changed_time (FtTimerDBusService* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->last_state_changed_time;
	return result;
}

static void
g_cclosure_user_marshal_VOID__INT64 (GClosure * closure,
                                     GValue * return_value,
                                     guint n_param_values,
                                     const GValue * param_values,
                                     gpointer invocation_hint,
                                     gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, gint64 arg_1, gpointer data2);
	register GMarshalFunc_VOID__INT64 callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int64 (param_values + 1), data2);
}

static void
ft_timer_dbus_service_class_init (FtTimerDBusServiceClass * klass,
                                  gpointer klass_data)
{
	ft_timer_dbus_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtTimerDBusService_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_timer_dbus_service_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_timer_dbus_service_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_timer_dbus_service_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_timer_dbus_service_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_STATE_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_STATE_PROPERTY] = g_param_spec_string ("state", "state", "state", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_DURATION_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_DURATION_PROPERTY] = g_param_spec_int64 ("duration", "duration", "duration", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_OFFSET_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_OFFSET_PROPERTY] = g_param_spec_int64 ("offset", "offset", "offset", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_STARTED_TIME_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_STARTED_TIME_PROPERTY] = g_param_spec_int64 ("started-time", "started-time", "started-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_PAUSED_TIME_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_PAUSED_TIME_PROPERTY] = g_param_spec_int64 ("paused-time", "paused-time", "paused-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_FINISHED_TIME_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_FINISHED_TIME_PROPERTY] = g_param_spec_int64 ("finished-time", "finished-time", "finished-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_DBUS_SERVICE_LAST_CHANGED_TIME_PROPERTY, ft_timer_dbus_service_properties[FT_TIMER_DBUS_SERVICE_LAST_CHANGED_TIME_PROPERTY] = g_param_spec_int64 ("last-changed-time", "last-changed-time", "last-changed-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_CHANGED_SIGNAL] = g_signal_new ("changed", FT_TYPE_TIMER_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_TICK_SIGNAL] = g_signal_new ("tick", FT_TYPE_TIMER_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT64, G_TYPE_NONE, 1, G_TYPE_INT64);
	ft_timer_dbus_service_signals[FT_TIMER_DBUS_SERVICE_FINISHED_SIGNAL] = g_signal_new ("finished", FT_TYPE_TIMER_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
ft_timer_dbus_service_instance_init (FtTimerDBusService * self,
                                     gpointer klass)
{
	self->priv = ft_timer_dbus_service_get_instance_private (self);
	self->priv->last_state_changed_time = FT_TIMESTAMP_UNDEFINED;
}

static void
ft_timer_dbus_service_finalize (GObject * obj)
{
	FtTimerDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_TIMER_DBUS_SERVICE, FtTimerDBusService);
	_g_object_unref0 (self->priv->timer);
	_g_object_unref0 (self->priv->session_manager);
	_g_free0 (self->priv->object_path);
	G_OBJECT_CLASS (ft_timer_dbus_service_parent_class)->finalize (obj);
}

/**
     * Timer service provides equivalent functionality of the timer view in the app.
     */
static GType
ft_timer_dbus_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtTimerDBusServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_timer_dbus_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtTimerDBusService), 0, (GInstanceInitFunc) ft_timer_dbus_service_instance_init, NULL };
	GType ft_timer_dbus_service_type_id;
	ft_timer_dbus_service_type_id = g_type_register_static (G_TYPE_OBJECT, "FtTimerDBusService", &g_define_type_info, 0);
	g_type_set_qdata (ft_timer_dbus_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) ft_timer_dbus_service_register_object);
	FtTimerDBusService_private_offset = g_type_add_instance_private (ft_timer_dbus_service_type_id, sizeof (FtTimerDBusServicePrivate));
	return ft_timer_dbus_service_type_id;
}

GType
ft_timer_dbus_service_get_type (void)
{
	static volatile gsize ft_timer_dbus_service_type_id__once = 0;
	if (g_once_init_enter (&ft_timer_dbus_service_type_id__once)) {
		GType ft_timer_dbus_service_type_id;
		ft_timer_dbus_service_type_id = ft_timer_dbus_service_get_type_once ();
		g_once_init_leave (&ft_timer_dbus_service_type_id__once, ft_timer_dbus_service_type_id);
	}
	return ft_timer_dbus_service_type_id__once;
}

static void
_vala_ft_timer_dbus_service_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	FtTimerDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_TIMER_DBUS_SERVICE, FtTimerDBusService);
	switch (property_id) {
		case FT_TIMER_DBUS_SERVICE_STATE_PROPERTY:
		g_value_take_string (value, ft_timer_dbus_service_get_state (self));
		break;
		case FT_TIMER_DBUS_SERVICE_DURATION_PROPERTY:
		g_value_set_int64 (value, ft_timer_dbus_service_get_duration (self));
		break;
		case FT_TIMER_DBUS_SERVICE_OFFSET_PROPERTY:
		g_value_set_int64 (value, ft_timer_dbus_service_get_offset (self));
		break;
		case FT_TIMER_DBUS_SERVICE_STARTED_TIME_PROPERTY:
		g_value_set_int64 (value, ft_timer_dbus_service_get_started_time (self));
		break;
		case FT_TIMER_DBUS_SERVICE_PAUSED_TIME_PROPERTY:
		g_value_set_int64 (value, ft_timer_dbus_service_get_paused_time (self));
		break;
		case FT_TIMER_DBUS_SERVICE_FINISHED_TIME_PROPERTY:
		g_value_set_int64 (value, ft_timer_dbus_service_get_finished_time (self));
		break;
		case FT_TIMER_DBUS_SERVICE_LAST_CHANGED_TIME_PROPERTY:
		g_value_set_int64 (value, ft_timer_dbus_service_get_last_changed_time (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_timer_dbus_service_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	FtTimerDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_TIMER_DBUS_SERVICE, FtTimerDBusService);
	switch (property_id) {
		case FT_TIMER_DBUS_SERVICE_STATE_PROPERTY:
		ft_timer_dbus_service_set_state (self, g_value_get_string (value));
		break;
		case FT_TIMER_DBUS_SERVICE_DURATION_PROPERTY:
		ft_timer_dbus_service_set_duration (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_ft_timer_dbus_service_is_started (FtTimerDBusService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_timer_dbus_service_is_started (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_is_running (FtTimerDBusService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_timer_dbus_service_is_running (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_is_paused (FtTimerDBusService* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_timer_dbus_service_is_paused (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_is_finished (FtTimerDBusService* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_timer_dbus_service_is_finished (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_get_elapsed (FtTimerDBusService* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint64 timestamp = 0LL;
	GVariant* _tmp2_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint64 result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_int64 (_tmp2_);
	g_variant_unref (_tmp2_);
	result = ft_timer_dbus_service_get_elapsed (self, timestamp, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int64 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_get_remaining (FtTimerDBusService* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint64 timestamp = 0LL;
	GVariant* _tmp3_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint64 result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_int64 (_tmp3_);
	g_variant_unref (_tmp3_);
	result = ft_timer_dbus_service_get_remaining (self, timestamp, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int64 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_get_progress (FtTimerDBusService* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint64 timestamp = 0LL;
	GVariant* _tmp4_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gdouble result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_int64 (_tmp4_);
	g_variant_unref (_tmp4_);
	result = ft_timer_dbus_service_get_progress (self, timestamp, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_double (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_start (FtTimerDBusService* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_timer_dbus_service_start (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_stop (FtTimerDBusService* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_timer_dbus_service_stop (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_pause (FtTimerDBusService* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_timer_dbus_service_pause (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_resume (FtTimerDBusService* self,
                                    GVariant* _parameters_,
                                    GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_timer_dbus_service_resume (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_rewind (FtTimerDBusService* self,
                                    GVariant* _parameters_,
                                    GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint64 interval = 0LL;
	GVariant* _tmp5_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	interval = g_variant_get_int64 (_tmp5_);
	g_variant_unref (_tmp5_);
	ft_timer_dbus_service_rewind (self, interval, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_extend (FtTimerDBusService* self,
                                    GVariant* _parameters_,
                                    GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint64 interval = 0LL;
	GVariant* _tmp6_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	interval = g_variant_get_int64 (_tmp6_);
	g_variant_unref (_tmp6_);
	ft_timer_dbus_service_extend (self, interval, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_skip (FtTimerDBusService* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_timer_dbus_service_skip (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_timer_dbus_service_reset (FtTimerDBusService* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_timer_dbus_service_reset (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
ft_timer_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                  const gchar* sender,
                                                  const gchar* object_path,
                                                  const gchar* interface_name,
                                                  const gchar* method_name,
                                                  GVariant* parameters,
                                                  GDBusMethodInvocation* invocation,
                                                  gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "IsStarted") == 0) {
		_dbus_ft_timer_dbus_service_is_started (object, parameters, invocation);
	} else if (strcmp (method_name, "IsRunning") == 0) {
		_dbus_ft_timer_dbus_service_is_running (object, parameters, invocation);
	} else if (strcmp (method_name, "IsPaused") == 0) {
		_dbus_ft_timer_dbus_service_is_paused (object, parameters, invocation);
	} else if (strcmp (method_name, "IsFinished") == 0) {
		_dbus_ft_timer_dbus_service_is_finished (object, parameters, invocation);
	} else if (strcmp (method_name, "GetElapsed") == 0) {
		_dbus_ft_timer_dbus_service_get_elapsed (object, parameters, invocation);
	} else if (strcmp (method_name, "GetRemaining") == 0) {
		_dbus_ft_timer_dbus_service_get_remaining (object, parameters, invocation);
	} else if (strcmp (method_name, "GetProgress") == 0) {
		_dbus_ft_timer_dbus_service_get_progress (object, parameters, invocation);
	} else if (strcmp (method_name, "Start") == 0) {
		_dbus_ft_timer_dbus_service_start (object, parameters, invocation);
	} else if (strcmp (method_name, "Stop") == 0) {
		_dbus_ft_timer_dbus_service_stop (object, parameters, invocation);
	} else if (strcmp (method_name, "Pause") == 0) {
		_dbus_ft_timer_dbus_service_pause (object, parameters, invocation);
	} else if (strcmp (method_name, "Resume") == 0) {
		_dbus_ft_timer_dbus_service_resume (object, parameters, invocation);
	} else if (strcmp (method_name, "Rewind") == 0) {
		_dbus_ft_timer_dbus_service_rewind (object, parameters, invocation);
	} else if (strcmp (method_name, "Extend") == 0) {
		_dbus_ft_timer_dbus_service_extend (object, parameters, invocation);
	} else if (strcmp (method_name, "Skip") == 0) {
		_dbus_ft_timer_dbus_service_skip (object, parameters, invocation);
	} else if (strcmp (method_name, "Reset") == 0) {
		_dbus_ft_timer_dbus_service_reset (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_ft_timer_dbus_service_get_state (FtTimerDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_state (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_ft_timer_dbus_service_get_duration (FtTimerDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_duration (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_timer_dbus_service_get_offset (FtTimerDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_offset (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_timer_dbus_service_get_started_time (FtTimerDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_started_time (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_timer_dbus_service_get_paused_time (FtTimerDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_paused_time (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_timer_dbus_service_get_finished_time (FtTimerDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_finished_time (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_timer_dbus_service_get_last_changed_time (FtTimerDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_timer_dbus_service_get_last_changed_time (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
ft_timer_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                   const gchar* sender,
                                                   const gchar* object_path,
                                                   const gchar* interface_name,
                                                   const gchar* property_name,
                                                   GError** error,
                                                   gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "State") == 0) {
		return _dbus_ft_timer_dbus_service_get_state (object);
	} else if (strcmp (property_name, "Duration") == 0) {
		return _dbus_ft_timer_dbus_service_get_duration (object);
	} else if (strcmp (property_name, "Offset") == 0) {
		return _dbus_ft_timer_dbus_service_get_offset (object);
	} else if (strcmp (property_name, "StartedTime") == 0) {
		return _dbus_ft_timer_dbus_service_get_started_time (object);
	} else if (strcmp (property_name, "PausedTime") == 0) {
		return _dbus_ft_timer_dbus_service_get_paused_time (object);
	} else if (strcmp (property_name, "FinishedTime") == 0) {
		return _dbus_ft_timer_dbus_service_get_finished_time (object);
	} else if (strcmp (property_name, "LastChangedTime") == 0) {
		return _dbus_ft_timer_dbus_service_get_last_changed_time (object);
	}
	return NULL;
}

static void
_dbus_ft_timer_dbus_service_set_state (FtTimerDBusService* self,
                                       GVariant* _value)
{
	gchar* value = NULL;
	value = g_variant_dup_string (_value, NULL);
	ft_timer_dbus_service_set_state (self, value);
	_g_free0 (value);
}

static void
_dbus_ft_timer_dbus_service_set_duration (FtTimerDBusService* self,
                                          GVariant* _value)
{
	gint64 value = 0LL;
	value = g_variant_get_int64 (_value);
	ft_timer_dbus_service_set_duration (self, value);
}

static gboolean
ft_timer_dbus_service_dbus_interface_set_property (GDBusConnection* connection,
                                                   const gchar* sender,
                                                   const gchar* object_path,
                                                   const gchar* interface_name,
                                                   const gchar* property_name,
                                                   GVariant* value,
                                                   GError** error,
                                                   gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "State") == 0) {
		_dbus_ft_timer_dbus_service_set_state (object, value);
		return TRUE;
	} else if (strcmp (property_name, "Duration") == 0) {
		_dbus_ft_timer_dbus_service_set_duration (object, value);
		return TRUE;
	}
	return FALSE;
}

static void
_dbus_ft_timer_dbus_service_changed (GObject* _sender,
                                     gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Timer", "Changed", _arguments, NULL);
}

static void
_dbus_ft_timer_dbus_service_tick (GObject* _sender,
                                  gint64 timestamp,
                                  gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int64 (timestamp));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Timer", "Tick", _arguments, NULL);
}

static void
_dbus_ft_timer_dbus_service_finished (GObject* _sender,
                                      gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Timer", "Finished", _arguments, NULL);
}

guint
ft_timer_dbus_service_register_object (gpointer object,
                                       GDBusConnection* connection,
                                       const gchar* path,
                                       GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_ft_timer_dbus_service_dbus_interface_info), &_ft_timer_dbus_service_dbus_interface_vtable, data, _ft_timer_dbus_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "changed", (GCallback) _dbus_ft_timer_dbus_service_changed, data);
	g_signal_connect (object, "tick", (GCallback) _dbus_ft_timer_dbus_service_tick, data);
	g_signal_connect (object, "finished", (GCallback) _dbus_ft_timer_dbus_service_finished, data);
	return result;
}

static void
_ft_timer_dbus_service_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_timer_dbus_service_changed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_timer_dbus_service_tick, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_timer_dbus_service_finished, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
ft_session_dbus_service_get_instance_private (FtSessionDBusService* self)
{
	return G_STRUCT_MEMBER_P (self, FtSessionDBusService_private_offset);
}

static void
_ft_session_dbus_service_on_notify_current_session_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self)
{
	ft_session_dbus_service_on_notify_current_session ((FtSessionDBusService*) self, _sender, pspec);
}

static void
_ft_session_dbus_service_on_notify_has_uniform_breaks_g_object_notify (GObject* _sender,
                                                                       GParamSpec* pspec,
                                                                       gpointer self)
{
	ft_session_dbus_service_on_notify_has_uniform_breaks ((FtSessionDBusService*) self, _sender, pspec);
}

static void
_ft_session_dbus_service_on_enter_session_ft_session_manager_enter_session (FtSessionManager* _sender,
                                                                            FtSession* session,
                                                                            gpointer self)
{
	ft_session_dbus_service_on_enter_session ((FtSessionDBusService*) self, session);
}

static void
_ft_session_dbus_service_on_leave_session_ft_session_manager_leave_session (FtSessionManager* _sender,
                                                                            FtSession* session,
                                                                            gpointer self)
{
	ft_session_dbus_service_on_leave_session ((FtSessionDBusService*) self, session);
}

static void
_ft_session_dbus_service_on_enter_time_block_ft_session_manager_enter_time_block (FtSessionManager* _sender,
                                                                                  FtTimeBlock* time_block,
                                                                                  gpointer self)
{
	ft_session_dbus_service_on_enter_time_block ((FtSessionDBusService*) self, time_block);
}

static void
_ft_session_dbus_service_on_leave_time_block_ft_session_manager_leave_time_block (FtSessionManager* _sender,
                                                                                  FtTimeBlock* time_block,
                                                                                  gpointer self)
{
	ft_session_dbus_service_on_leave_time_block ((FtSessionDBusService*) self, time_block);
}

static void
_ft_session_dbus_service_on_confirm_advancement_ft_session_manager_confirm_advancement (FtSessionManager* _sender,
                                                                                        FtTimeBlock* current_time_block,
                                                                                        FtTimeBlock* next_time_block,
                                                                                        gpointer self)
{
	ft_session_dbus_service_on_confirm_advancement ((FtSessionDBusService*) self, current_time_block, next_time_block);
}

FtSessionDBusService*
ft_session_dbus_service_construct (GType object_type,
                                   GDBusConnection* connection,
                                   const gchar* object_path,
                                   FtSessionManager* session_manager)
{
	FtSessionDBusService * self = NULL;
	gchar* _tmp0_;
	FtSessionManager* _tmp1_;
	FtSessionManager* _tmp2_;
	FtSessionManager* _tmp3_;
	FtSessionManager* _tmp4_;
	FtSessionManager* _tmp5_;
	FtSessionManager* _tmp6_;
	FtSessionManager* _tmp7_;
	FtSessionManager* _tmp8_;
	FtSession* _tmp9_;
	FtSession* _tmp10_;
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (object_path != NULL, NULL);
	g_return_val_if_fail (session_manager != NULL, NULL);
	self = (FtSessionDBusService*) g_object_new (object_type, NULL);
	self->priv->connection = connection;
	_tmp0_ = g_strdup (object_path);
	_g_free0 (self->priv->object_path);
	self->priv->object_path = _tmp0_;
	_tmp1_ = _g_object_ref0 (session_manager);
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = _tmp1_;
	_tmp2_ = self->priv->session_manager;
	g_signal_connect_object ((GObject*) _tmp2_, "notify::current-session", (GCallback) _ft_session_dbus_service_on_notify_current_session_g_object_notify, self, 0);
	_tmp3_ = self->priv->session_manager;
	g_signal_connect_object ((GObject*) _tmp3_, "notify::has-uniform-breaks", (GCallback) _ft_session_dbus_service_on_notify_has_uniform_breaks_g_object_notify, self, 0);
	_tmp4_ = self->priv->session_manager;
	g_signal_connect_object (_tmp4_, "enter-session", (GCallback) _ft_session_dbus_service_on_enter_session_ft_session_manager_enter_session, self, 0);
	_tmp5_ = self->priv->session_manager;
	g_signal_connect_object (_tmp5_, "leave-session", (GCallback) _ft_session_dbus_service_on_leave_session_ft_session_manager_leave_session, self, 0);
	_tmp6_ = self->priv->session_manager;
	g_signal_connect_object (_tmp6_, "enter-time-block", (GCallback) _ft_session_dbus_service_on_enter_time_block_ft_session_manager_enter_time_block, self, 0);
	_tmp7_ = self->priv->session_manager;
	g_signal_connect_object (_tmp7_, "leave-time-block", (GCallback) _ft_session_dbus_service_on_leave_time_block_ft_session_manager_leave_time_block, self, 0);
	_tmp8_ = self->priv->session_manager;
	g_signal_connect_object (_tmp8_, "confirm-advancement", (GCallback) _ft_session_dbus_service_on_confirm_advancement_ft_session_manager_confirm_advancement, self, 0);
	_tmp9_ = ft_session_manager_get_current_session (session_manager);
	_tmp10_ = _tmp9_;
	if (_tmp10_ != NULL) {
		FtSession* _tmp11_;
		FtSession* _tmp12_;
		_tmp11_ = ft_session_manager_get_current_session (session_manager);
		_tmp12_ = _tmp11_;
		ft_session_dbus_service_on_enter_session (self, _tmp12_);
	}
	ft_session_dbus_service_update_properties (self);
	return self;
}

FtSessionDBusService*
ft_session_dbus_service_new (GDBusConnection* connection,
                             const gchar* object_path,
                             FtSessionManager* session_manager)
{
	return ft_session_dbus_service_construct (FT_TYPE_SESSION_DBUS_SERVICE, connection, object_path, session_manager);
}

static void
ft_session_dbus_service_update_properties (FtSessionDBusService* self)
{
	GDBusConnection* _tmp0_;
	GVariantBuilder* changed_properties = NULL;
	const GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* invalidated_properties = NULL;
	GVariantType* _tmp3_;
	GVariantType* _tmp4_;
	GVariantBuilder* _tmp5_;
	GVariantBuilder* _tmp6_;
	FtSession* current_session = NULL;
	FtSessionManager* _tmp7_;
	FtSession* _tmp8_;
	FtSession* _tmp9_;
	FtSession* _tmp10_;
	FtState current_state = 0;
	FtSessionManager* _tmp11_;
	FtState _tmp12_;
	FtState _tmp13_;
	gint64 _tmp14_ = 0LL;
	FtSession* _tmp15_;
	gint64 start_time = 0LL;
	gint64 _tmp19_ = 0LL;
	FtSession* _tmp20_;
	gint64 end_time = 0LL;
	gboolean has_uniform_breaks = FALSE;
	FtSessionManager* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	gboolean can_reset = FALSE;
	FtSessionManager* _tmp27_;
	gboolean changed = FALSE;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->connection;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = G_VARIANT_TYPE_VARDICT;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	changed_properties = _tmp2_;
	_tmp3_ = g_variant_type_new ("as");
	_tmp4_ = _tmp3_;
	_tmp5_ = g_variant_builder_new (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_variant_type_free0 (_tmp4_);
	invalidated_properties = _tmp6_;
	_tmp7_ = self->priv->session_manager;
	_tmp8_ = ft_session_manager_get_current_session (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	current_session = _tmp10_;
	_tmp11_ = self->priv->session_manager;
	_tmp12_ = ft_session_manager_get_current_state (_tmp11_);
	_tmp13_ = _tmp12_;
	current_state = _tmp13_;
	_tmp15_ = current_session;
	if (_tmp15_ != NULL) {
		FtSession* _tmp16_;
		gint64 _tmp17_;
		gint64 _tmp18_;
		_tmp16_ = current_session;
		_tmp17_ = ft_session_get_start_time (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp14_ = _tmp18_;
	} else {
		_tmp14_ = FT_TIMESTAMP_UNDEFINED;
	}
	start_time = _tmp14_;
	_tmp20_ = current_session;
	if (_tmp20_ != NULL) {
		FtSession* _tmp21_;
		gint64 _tmp22_;
		gint64 _tmp23_;
		_tmp21_ = current_session;
		_tmp22_ = ft_session_get_end_time (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp19_ = _tmp23_;
	} else {
		_tmp19_ = FT_TIMESTAMP_UNDEFINED;
	}
	end_time = _tmp19_;
	_tmp24_ = self->priv->session_manager;
	_tmp25_ = ft_session_manager_get_has_uniform_breaks (_tmp24_);
	_tmp26_ = _tmp25_;
	has_uniform_breaks = _tmp26_;
	_tmp27_ = self->priv->session_manager;
	can_reset = ft_session_manager_can_reset (_tmp27_);
	changed = FALSE;
	if (self->priv->_current_state != current_state) {
		GVariantBuilder* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		GVariant* _tmp31_;
		GVariant* _tmp32_;
		self->priv->_current_state = current_state;
		_tmp28_ = changed_properties;
		_tmp29_ = ft_state_to_string (current_state);
		_tmp30_ = _tmp29_;
		_tmp31_ = g_variant_new_string (_tmp30_);
		g_variant_ref_sink (_tmp31_);
		_tmp32_ = _tmp31_;
		g_variant_builder_add (_tmp28_, "{sv}", "CurrentState", _tmp32_, NULL);
		_g_variant_unref0 (_tmp32_);
		_g_free0 (_tmp30_);
		changed = TRUE;
	}
	if (self->priv->_start_time != start_time) {
		GVariantBuilder* _tmp33_;
		GVariant* _tmp34_;
		GVariant* _tmp35_;
		self->priv->_start_time = start_time;
		_tmp33_ = changed_properties;
		_tmp34_ = g_variant_new_int64 (start_time);
		g_variant_ref_sink (_tmp34_);
		_tmp35_ = _tmp34_;
		g_variant_builder_add (_tmp33_, "{sv}", "StartTime", _tmp35_, NULL);
		_g_variant_unref0 (_tmp35_);
		changed = TRUE;
	}
	if (self->priv->_end_time != end_time) {
		GVariantBuilder* _tmp36_;
		GVariant* _tmp37_;
		GVariant* _tmp38_;
		self->priv->_end_time = end_time;
		_tmp36_ = changed_properties;
		_tmp37_ = g_variant_new_int64 (end_time);
		g_variant_ref_sink (_tmp37_);
		_tmp38_ = _tmp37_;
		g_variant_builder_add (_tmp36_, "{sv}", "EndTime", _tmp38_, NULL);
		_g_variant_unref0 (_tmp38_);
		changed = TRUE;
	}
	if (self->priv->_has_uniform_breaks != has_uniform_breaks) {
		GVariantBuilder* _tmp39_;
		GVariant* _tmp40_;
		GVariant* _tmp41_;
		self->priv->_has_uniform_breaks = has_uniform_breaks;
		_tmp39_ = changed_properties;
		_tmp40_ = g_variant_new_boolean (has_uniform_breaks);
		g_variant_ref_sink (_tmp40_);
		_tmp41_ = _tmp40_;
		g_variant_builder_add (_tmp39_, "{sv}", "HasUniformBreaks", _tmp41_, NULL);
		_g_variant_unref0 (_tmp41_);
		changed = TRUE;
	}
	if (self->priv->_can_reset != can_reset) {
		GVariantBuilder* _tmp42_;
		GVariant* _tmp43_;
		GVariant* _tmp44_;
		self->priv->_can_reset = can_reset;
		_tmp42_ = changed_properties;
		_tmp43_ = g_variant_new_boolean (can_reset);
		g_variant_ref_sink (_tmp43_);
		_tmp44_ = _tmp43_;
		g_variant_builder_add (_tmp42_, "{sv}", "CanReset", _tmp44_, NULL);
		_g_variant_unref0 (_tmp44_);
		changed = TRUE;
	}
	if (changed) {
		{
			GDBusConnection* _tmp45_;
			const gchar* _tmp46_;
			GVariantBuilder* _tmp47_;
			GVariantBuilder* _tmp48_;
			GVariant* _tmp49_;
			GVariant* _tmp50_;
			_tmp45_ = self->priv->connection;
			_tmp46_ = self->priv->object_path;
			_tmp47_ = changed_properties;
			_tmp48_ = invalidated_properties;
			_tmp49_ = g_variant_new ("(sa{sv}as)", FT_SESSION_DBUS_SERVICE_DBUS_INTERFACE_NAME, _tmp47_, _tmp48_, NULL);
			g_variant_ref_sink (_tmp49_);
			_tmp50_ = _tmp49_;
			g_dbus_connection_emit_signal (_tmp45_, NULL, _tmp46_, "org.freedesktop.DBus.Properties", "PropertiesChanged", _tmp50_, &_inner_error0_);
			_g_variant_unref0 (_tmp50_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* _error_ = NULL;
			GError* _tmp51_;
			const gchar* _tmp52_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp51_ = _error_;
			_tmp52_ = _tmp51_->message;
			g_warning ("dbus-services.vala:648: Failed to emit PropertiesChanged signal: %s", _tmp52_);
			_g_error_free0 (_error_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (current_session);
			_g_variant_builder_unref0 (invalidated_properties);
			_g_variant_builder_unref0 (changed_properties);
			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 (current_session);
	_g_variant_builder_unref0 (invalidated_properties);
	_g_variant_builder_unref0 (changed_properties);
}

static GVariant*
ft_session_dbus_service_serialize_gap (FtSessionDBusService* self,
                                       FtGap* gap)
{
	GVariantBuilder* builder = NULL;
	const GVariantType* _tmp0_;
	GVariantBuilder* _tmp1_;
	GVariantBuilder* _tmp12_;
	GVariant* _tmp13_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = G_VARIANT_TYPE_VARDICT;
	_tmp1_ = g_variant_builder_new (_tmp0_);
	builder = _tmp1_;
	if (gap != NULL) {
		GVariantBuilder* _tmp2_;
		gint64 _tmp3_;
		gint64 _tmp4_;
		GVariant* _tmp5_;
		GVariant* _tmp6_;
		GVariantBuilder* _tmp7_;
		gint64 _tmp8_;
		gint64 _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		_tmp2_ = builder;
		_tmp3_ = ft_schedulable_get_start_time ((FtSchedulable*) gap);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_variant_new_int64 (_tmp4_);
		g_variant_ref_sink (_tmp5_);
		_tmp6_ = _tmp5_;
		g_variant_builder_add (_tmp2_, "{sv}", "start_time", _tmp6_, NULL);
		_g_variant_unref0 (_tmp6_);
		_tmp7_ = builder;
		_tmp8_ = ft_schedulable_get_end_time ((FtSchedulable*) gap);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_variant_new_int64 (_tmp9_);
		g_variant_ref_sink (_tmp10_);
		_tmp11_ = _tmp10_;
		g_variant_builder_add (_tmp7_, "{sv}", "end_time", _tmp11_, NULL);
		_g_variant_unref0 (_tmp11_);
	}
	_tmp12_ = builder;
	_tmp13_ = g_variant_builder_end (_tmp12_);
	g_variant_ref_sink (_tmp13_);
	result = _tmp13_;
	_g_variant_builder_unref0 (builder);
	return result;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		FtSessionDBusService* self;
		self = _data35_->self;
		_data35_->gaps = (_vala_array_free (_data35_->gaps, _data35_->gaps_length1, (GDestroyNotify) g_variant_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
_vala_array_add23 (GVariant** * array,
                   gint* length,
                   gint* size,
                   GVariant* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GVariant*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
___lambda91_ (Block35Data* _data35_,
              FtGap* gap)
{
	FtSessionDBusService* self;
	GVariant* _tmp0_;
	self = _data35_->self;
	g_return_if_fail (gap != NULL);
	_tmp0_ = ft_session_dbus_service_serialize_gap (self, gap);
	_vala_array_add23 (&_data35_->gaps, &_data35_->gaps_length1, &_data35_->_gaps_size_, _tmp0_);
}

static void
____lambda91__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda91_ (self, (FtGap*) data);
}

static GVariant*
ft_session_dbus_service_serialize_time_block (FtSessionDBusService* self,
                                              FtTimeBlock* time_block)
{
	GVariantBuilder* builder = NULL;
	const GVariantType* _tmp0_;
	GVariantBuilder* _tmp1_;
	GVariantBuilder* _tmp30_;
	GVariant* _tmp31_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = G_VARIANT_TYPE_VARDICT;
	_tmp1_ = g_variant_builder_new (_tmp0_);
	builder = _tmp1_;
	if (time_block != NULL) {
		Block35Data* _data35_;
		GVariant** _tmp2_;
		GVariantBuilder* _tmp3_;
		FtState _tmp4_;
		FtState _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		GVariant* _tmp8_;
		GVariant* _tmp9_;
		GVariantBuilder* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GVariant* _tmp13_;
		GVariant* _tmp14_;
		GVariantBuilder* _tmp15_;
		gint64 _tmp16_;
		gint64 _tmp17_;
		GVariant* _tmp18_;
		GVariant* _tmp19_;
		GVariantBuilder* _tmp20_;
		gint64 _tmp21_;
		gint64 _tmp22_;
		GVariant* _tmp23_;
		GVariant* _tmp24_;
		GVariantBuilder* _tmp25_;
		const GVariantType* _tmp26_;
		GVariant** _tmp27_;
		gint _tmp27__length1;
		GVariant* _tmp28_;
		GVariant* _tmp29_;
		_data35_ = g_slice_new0 (Block35Data);
		_data35_->_ref_count_ = 1;
		_data35_->self = g_object_ref (self);
		_tmp2_ = g_new0 (GVariant*, 0 + 1);
		_data35_->gaps = _tmp2_;
		_data35_->gaps_length1 = 0;
		_data35_->_gaps_size_ = _data35_->gaps_length1;
		ft_time_block_foreach_gap (time_block, ____lambda91__gfunc, _data35_);
		_tmp3_ = builder;
		_tmp4_ = ft_time_block_get_state (time_block);
		_tmp5_ = _tmp4_;
		_tmp6_ = ft_state_to_string (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_variant_new_string (_tmp7_);
		g_variant_ref_sink (_tmp8_);
		_tmp9_ = _tmp8_;
		g_variant_builder_add (_tmp3_, "{sv}", "state", _tmp9_, NULL);
		_g_variant_unref0 (_tmp9_);
		_g_free0 (_tmp7_);
		_tmp10_ = builder;
		_tmp11_ = ft_time_block_status_to_string (ft_time_block_get_status (time_block));
		_tmp12_ = _tmp11_;
		_tmp13_ = g_variant_new_string (_tmp12_);
		g_variant_ref_sink (_tmp13_);
		_tmp14_ = _tmp13_;
		g_variant_builder_add (_tmp10_, "{sv}", "status", _tmp14_, NULL);
		_g_variant_unref0 (_tmp14_);
		_g_free0 (_tmp12_);
		_tmp15_ = builder;
		_tmp16_ = ft_schedulable_get_start_time ((FtSchedulable*) time_block);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_variant_new_int64 (_tmp17_);
		g_variant_ref_sink (_tmp18_);
		_tmp19_ = _tmp18_;
		g_variant_builder_add (_tmp15_, "{sv}", "start_time", _tmp19_, NULL);
		_g_variant_unref0 (_tmp19_);
		_tmp20_ = builder;
		_tmp21_ = ft_schedulable_get_end_time ((FtSchedulable*) time_block);
		_tmp22_ = _tmp21_;
		_tmp23_ = g_variant_new_int64 (_tmp22_);
		g_variant_ref_sink (_tmp23_);
		_tmp24_ = _tmp23_;
		g_variant_builder_add (_tmp20_, "{sv}", "end_time", _tmp24_, NULL);
		_g_variant_unref0 (_tmp24_);
		_tmp25_ = builder;
		_tmp26_ = G_VARIANT_TYPE_VARDICT;
		_tmp27_ = _data35_->gaps;
		_tmp27__length1 = _data35_->gaps_length1;
		_tmp28_ = g_variant_new_array (_tmp26_, _tmp27_, _tmp27__length1);
		g_variant_ref_sink (_tmp28_);
		_tmp29_ = _tmp28_;
		g_variant_builder_add (_tmp25_, "{sv}", "gaps", _tmp29_, NULL);
		_g_variant_unref0 (_tmp29_);
		block35_data_unref (_data35_);
		_data35_ = NULL;
	}
	_tmp30_ = builder;
	_tmp31_ = g_variant_builder_end (_tmp30_);
	g_variant_ref_sink (_tmp31_);
	result = _tmp31_;
	_g_variant_builder_unref0 (builder);
	return result;
}

static GVariant*
ft_session_dbus_service_serialize_cycle (FtSessionDBusService* self,
                                         FtCycle* cycle)
{
	GVariantBuilder* builder = NULL;
	const GVariantType* _tmp0_;
	GVariantBuilder* _tmp1_;
	GVariantBuilder* _tmp23_;
	GVariant* _tmp24_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = G_VARIANT_TYPE_VARDICT;
	_tmp1_ = g_variant_builder_new (_tmp0_);
	builder = _tmp1_;
	if (cycle != NULL) {
		GVariantBuilder* _tmp2_;
		gint64 _tmp3_;
		gint64 _tmp4_;
		GVariant* _tmp5_;
		GVariant* _tmp6_;
		GVariantBuilder* _tmp7_;
		gint64 _tmp8_;
		gint64 _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		GVariantBuilder* _tmp12_;
		GVariant* _tmp13_;
		GVariant* _tmp14_;
		GVariantBuilder* _tmp15_;
		GVariant* _tmp16_;
		GVariant* _tmp17_;
		GVariantBuilder* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		GVariant* _tmp21_;
		GVariant* _tmp22_;
		_tmp2_ = builder;
		_tmp3_ = ft_cycle_get_start_time (cycle);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_variant_new_int64 (_tmp4_);
		g_variant_ref_sink (_tmp5_);
		_tmp6_ = _tmp5_;
		g_variant_builder_add (_tmp2_, "{sv}", "start_time", _tmp6_, NULL);
		_g_variant_unref0 (_tmp6_);
		_tmp7_ = builder;
		_tmp8_ = ft_cycle_get_end_time (cycle);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_variant_new_int64 (_tmp9_);
		g_variant_ref_sink (_tmp10_);
		_tmp11_ = _tmp10_;
		g_variant_builder_add (_tmp7_, "{sv}", "end_time", _tmp11_, NULL);
		_g_variant_unref0 (_tmp11_);
		_tmp12_ = builder;
		_tmp13_ = g_variant_new_int64 (ft_cycle_get_completion_time (cycle));
		g_variant_ref_sink (_tmp13_);
		_tmp14_ = _tmp13_;
		g_variant_builder_add (_tmp12_, "{sv}", "completion_time", _tmp14_, NULL);
		_g_variant_unref0 (_tmp14_);
		_tmp15_ = builder;
		_tmp16_ = g_variant_new_double (ft_cycle_get_weight (cycle));
		g_variant_ref_sink (_tmp16_);
		_tmp17_ = _tmp16_;
		g_variant_builder_add (_tmp15_, "{sv}", "weight", _tmp17_, NULL);
		_g_variant_unref0 (_tmp17_);
		_tmp18_ = builder;
		_tmp19_ = ft_time_block_status_to_string (ft_cycle_get_status (cycle));
		_tmp20_ = _tmp19_;
		_tmp21_ = g_variant_new_string (_tmp20_);
		g_variant_ref_sink (_tmp21_);
		_tmp22_ = _tmp21_;
		g_variant_builder_add (_tmp18_, "{sv}", "status", _tmp22_, NULL);
		_g_variant_unref0 (_tmp22_);
		_g_free0 (_tmp20_);
	}
	_tmp23_ = builder;
	_tmp24_ = g_variant_builder_end (_tmp23_);
	g_variant_ref_sink (_tmp24_);
	result = _tmp24_;
	_g_variant_builder_unref0 (builder);
	return result;
}

static void
ft_session_dbus_service_on_notify_current_session (FtSessionDBusService* self,
                                                   GObject* object,
                                                   GParamSpec* pspec)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	ft_session_dbus_service_update_properties (self);
}

static void
ft_session_dbus_service_on_notify_has_uniform_breaks (FtSessionDBusService* self,
                                                      GObject* object,
                                                      GParamSpec* pspec)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	ft_session_dbus_service_update_properties (self);
}

static void
_ft_session_dbus_service_on_current_session_changed_ft_session_changed (FtSession* _sender,
                                                                        gpointer self)
{
	ft_session_dbus_service_on_current_session_changed ((FtSessionDBusService*) self, _sender);
}

static void
ft_session_dbus_service_on_enter_session (FtSessionDBusService* self,
                                          FtSession* session)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (session != NULL);
	g_signal_connect_object (session, "changed", (GCallback) _ft_session_dbus_service_on_current_session_changed_ft_session_changed, self, G_CONNECT_AFTER);
}

static void
ft_session_dbus_service_on_leave_session (FtSessionDBusService* self,
                                          FtSession* session)
{
	guint _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (session != NULL);
	g_signal_parse_name ("changed", FT_TYPE_SESSION, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _ft_session_dbus_service_on_current_session_changed_ft_session_changed, self);
}

static void
ft_session_dbus_service_on_enter_time_block (FtSessionDBusService* self,
                                             FtTimeBlock* time_block)
{
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (time_block != NULL);
	_tmp0_ = ft_session_dbus_service_serialize_time_block (self, time_block);
	_tmp1_ = _tmp0_;
	g_signal_emit (self, ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_ENTER_TIME_BLOCK_SIGNAL], 0, _tmp1_);
	_g_variant_unref0 (_tmp1_);
}

static void
ft_session_dbus_service_on_leave_time_block (FtSessionDBusService* self,
                                             FtTimeBlock* time_block)
{
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (time_block != NULL);
	_tmp0_ = ft_session_dbus_service_serialize_time_block (self, time_block);
	_tmp1_ = _tmp0_;
	g_signal_emit (self, ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_LEAVE_TIME_BLOCK_SIGNAL], 0, _tmp1_);
	_g_variant_unref0 (_tmp1_);
}

static void
ft_session_dbus_service_on_confirm_advancement (FtSessionDBusService* self,
                                                FtTimeBlock* current_time_block,
                                                FtTimeBlock* next_time_block)
{
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_time_block != NULL);
	g_return_if_fail (next_time_block != NULL);
	_tmp0_ = ft_session_dbus_service_serialize_time_block (self, current_time_block);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_session_dbus_service_serialize_time_block (self, next_time_block);
	_tmp3_ = _tmp2_;
	g_signal_emit (self, ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_CONFIRM_ADVANCEMENT_SIGNAL], 0, _tmp1_, _tmp3_);
	_g_variant_unref0 (_tmp3_);
	_g_variant_unref0 (_tmp1_);
}

static gboolean
___lambda90_ (FtSessionDBusService* self)
{
	gboolean result;
	self->priv->changed_idle_id = (guint) 0;
	ft_session_dbus_service_update_properties (self);
	g_signal_emit (self, ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_CHANGED_SIGNAL], 0);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda90__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda90_ ((FtSessionDBusService*) self);
	return result;
}

static void
ft_session_dbus_service_on_current_session_changed (FtSessionDBusService* self,
                                                    FtSession* session)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (session != NULL);
	if (self->priv->changed_idle_id == ((guint) 0)) {
		self->priv->changed_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda90__gsource_func, g_object_ref (self), g_object_unref);
	}
}

void
ft_session_dbus_service_advance (FtSessionDBusService* self,
                                 GError** error)
{
	FtSessionManager* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("session-manager.advance", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->session_manager;
	ft_session_manager_advance (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

void
ft_session_dbus_service_advance_to_state (FtSessionDBusService* self,
                                          const gchar* state,
                                          GError** error)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	FtSessionManager* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (state != NULL);
	_tmp0_ = string_to_string (state);
	_tmp1_ = g_strconcat ("session-manager.state:", _tmp0_, NULL);
	_tmp2_ = _tmp1_;
	ft_context_set_event_source (_tmp2_, FT_TIMESTAMP_UNDEFINED);
	_g_free0 (_tmp2_);
	_tmp3_ = self->priv->session_manager;
	ft_session_manager_advance_to_state (_tmp3_, ft_state_from_string (state), FT_TIMESTAMP_UNDEFINED);
}

void
ft_session_dbus_service_reset (FtSessionDBusService* self,
                               GError** error)
{
	FtSessionManager* _tmp0_;
	g_return_if_fail (self != NULL);
	ft_context_set_event_source ("session-manager.reset", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->session_manager;
	ft_session_manager_reset (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

GVariant*
ft_session_dbus_service_get_current_time_block (FtSessionDBusService* self,
                                                GError** error)
{
	FtSessionManager* _tmp0_;
	FtTimeBlock* _tmp1_;
	FtTimeBlock* _tmp2_;
	GVariant* _tmp3_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_current_time_block (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = ft_session_dbus_service_serialize_time_block (self, _tmp2_);
	result = _tmp3_;
	return result;
}

GVariant*
ft_session_dbus_service_get_current_gap (FtSessionDBusService* self,
                                         GError** error)
{
	FtSessionManager* _tmp0_;
	FtGap* _tmp1_;
	FtGap* _tmp2_;
	GVariant* _tmp3_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_current_gap (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = ft_session_dbus_service_serialize_gap (self, _tmp2_);
	result = _tmp3_;
	return result;
}

GVariant*
ft_session_dbus_service_get_next_time_block (FtSessionDBusService* self,
                                             GError** error)
{
	FtTimeBlock* next_time_block = NULL;
	FtSessionManager* _tmp0_;
	FtTimeBlock* _tmp1_;
	FtTimeBlock* _tmp2_;
	FtTimeBlock* _tmp3_;
	GVariant* _tmp4_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_next_time_block (_tmp0_);
	next_time_block = _tmp1_;
	_tmp2_ = next_time_block;
	if (_tmp2_ == NULL) {
		g_warning ("dbus-services.vala:813: get_next_time_block() returned null");
	}
	_tmp3_ = next_time_block;
	_tmp4_ = ft_session_dbus_service_serialize_time_block (self, _tmp3_);
	result = _tmp4_;
	return result;
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		FtSessionDBusService* self;
		self = _data36_->self;
		_data36_->items = (_vala_array_free (_data36_->items, _data36_->items_length1, (GDestroyNotify) g_variant_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block36Data, _data36_);
	}
}

static void
_vala_array_add24 (GVariant** * array,
                   gint* length,
                   gint* size,
                   GVariant* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GVariant*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
___lambda92_ (Block36Data* _data36_,
              FtTimeBlock* time_block)
{
	FtSessionDBusService* self;
	GVariant* _tmp0_;
	self = _data36_->self;
	g_return_if_fail (time_block != NULL);
	_tmp0_ = ft_session_dbus_service_serialize_time_block (self, time_block);
	_vala_array_add24 (&_data36_->items, &_data36_->items_length1, &_data36_->_items_size_, _tmp0_);
}

static void
____lambda92__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda92_ (self, (FtTimeBlock*) data);
}

GVariant*
ft_session_dbus_service_list_time_blocks (FtSessionDBusService* self,
                                          GError** error)
{
	Block36Data* _data36_;
	GVariant** _tmp0_;
	FtSession* _tmp1_ = NULL;
	FtSessionManager* _tmp2_;
	FtSession* _tmp3_;
	FtSession* _tmp4_;
	const GVariantType* _tmp5_;
	GVariant** _tmp6_;
	gint _tmp6__length1;
	GVariant* _tmp7_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data36_ = g_slice_new0 (Block36Data);
	_data36_->_ref_count_ = 1;
	_data36_->self = g_object_ref (self);
	_tmp0_ = g_new0 (GVariant*, 0 + 1);
	_data36_->items = _tmp0_;
	_data36_->items_length1 = 0;
	_data36_->_items_size_ = _data36_->items_length1;
	_tmp2_ = self->priv->session_manager;
	_tmp3_ = ft_session_manager_get_current_session (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_ = _tmp4_;
	if (_tmp1_ != NULL) {
		ft_session_foreach (_tmp1_, ____lambda92__gfunc, _data36_);
	}
	_tmp5_ = G_VARIANT_TYPE_VARDICT;
	_tmp6_ = _data36_->items;
	_tmp6__length1 = _data36_->items_length1;
	_tmp7_ = g_variant_new_array (_tmp5_, _tmp6_, _tmp6__length1);
	g_variant_ref_sink (_tmp7_);
	result = _tmp7_;
	block36_data_unref (_data36_);
	_data36_ = NULL;
	return result;
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		FtSessionDBusService* self;
		self = _data37_->self;
		_data37_->items = (_vala_array_free (_data37_->items, _data37_->items_length1, (GDestroyNotify) g_variant_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block37Data, _data37_);
	}
}

static void
_vala_array_add25 (GVariant** * array,
                   gint* length,
                   gint* size,
                   GVariant* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GVariant*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
__lambda93_ (Block37Data* _data37_,
             FtCycle* cycle)
{
	FtSessionDBusService* self;
	GVariant* _tmp0_;
	self = _data37_->self;
	g_return_if_fail (cycle != NULL);
	_tmp0_ = ft_session_dbus_service_serialize_cycle (self, cycle);
	_vala_array_add25 (&_data37_->items, &_data37_->items_length1, &_data37_->_items_size_, _tmp0_);
}

static void
___lambda93__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda93_ (self, (FtCycle*) data);
}

GVariant*
ft_session_dbus_service_list_cycles (FtSessionDBusService* self,
                                     GError** error)
{
	Block37Data* _data37_;
	GVariant** _tmp0_;
	FtSession* _tmp1_ = NULL;
	FtSessionManager* _tmp2_;
	FtSession* _tmp3_;
	FtSession* _tmp4_;
	GList* _tmp5_ = NULL;
	const GVariantType* _tmp7_;
	GVariant** _tmp8_;
	gint _tmp8__length1;
	GVariant* _tmp9_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data37_ = g_slice_new0 (Block37Data);
	_data37_->_ref_count_ = 1;
	_data37_->self = g_object_ref (self);
	_tmp0_ = g_new0 (GVariant*, 0 + 1);
	_data37_->items = _tmp0_;
	_data37_->items_length1 = 0;
	_data37_->_items_size_ = _data37_->items_length1;
	_tmp2_ = self->priv->session_manager;
	_tmp3_ = ft_session_manager_get_current_session (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_ = _tmp4_;
	_tmp5_ = NULL;
	if (_tmp1_ != NULL) {
		GList* _tmp6_;
		_tmp6_ = ft_session_get_cycles (_tmp1_);
		(_tmp5_ == NULL) ? NULL : (_tmp5_ = (g_list_free (_tmp5_), NULL));
		_tmp5_ = _tmp6_;
	}
	g_list_foreach (_tmp5_, ___lambda93__gfunc, _data37_);
	_tmp7_ = G_VARIANT_TYPE_VARDICT;
	_tmp8_ = _data37_->items;
	_tmp8__length1 = _data37_->items_length1;
	_tmp9_ = g_variant_new_array (_tmp7_, _tmp8_, _tmp8__length1);
	g_variant_ref_sink (_tmp9_);
	result = _tmp9_;
	(_tmp5_ == NULL) ? NULL : (_tmp5_ = (g_list_free (_tmp5_), NULL));
	block37_data_unref (_data37_);
	_data37_ = NULL;
	return result;
}

static void
ft_session_dbus_service_real_dispose (GObject* base)
{
	FtSessionDBusService * self;
	FtSessionManager* _tmp0_;
	guint _tmp1_;
	GQuark _tmp2_;
	FtSessionManager* _tmp3_;
	guint _tmp4_;
	GQuark _tmp5_;
	FtSessionManager* _tmp6_;
	guint _tmp7_;
	FtSessionManager* _tmp8_;
	guint _tmp9_;
	FtSessionManager* _tmp10_;
	guint _tmp11_;
	self = (FtSessionDBusService*) base;
	_tmp0_ = self->priv->session_manager;
	g_signal_parse_name ("notify::current-session", G_TYPE_OBJECT, &_tmp1_, &_tmp2_, TRUE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, _tmp2_, NULL, (GCallback) _ft_session_dbus_service_on_notify_has_uniform_breaks_g_object_notify, self);
	_tmp3_ = self->priv->session_manager;
	g_signal_parse_name ("notify::has-uniform-breaks", G_TYPE_OBJECT, &_tmp4_, &_tmp5_, TRUE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, _tmp5_, NULL, (GCallback) _ft_session_dbus_service_on_notify_has_uniform_breaks_g_object_notify, self);
	_tmp6_ = self->priv->session_manager;
	g_signal_parse_name ("enter-session", FT_TYPE_SESSION_MANAGER, &_tmp7_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _ft_session_dbus_service_on_enter_session_ft_session_manager_enter_session, self);
	_tmp8_ = self->priv->session_manager;
	g_signal_parse_name ("leave-session", FT_TYPE_SESSION_MANAGER, &_tmp9_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp8_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 0, NULL, (GCallback) _ft_session_dbus_service_on_leave_session_ft_session_manager_leave_session, self);
	_tmp10_ = self->priv->session_manager;
	g_signal_parse_name ("confirm-advancement", FT_TYPE_SESSION_MANAGER, &_tmp11_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp10_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp11_, 0, NULL, (GCallback) _ft_session_dbus_service_on_confirm_advancement_ft_session_manager_confirm_advancement, self);
	if (self->priv->changed_idle_id != 0U) {
		g_source_remove (self->priv->changed_idle_id);
		self->priv->changed_idle_id = 0U;
	}
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = NULL;
	self->priv->connection = NULL;
	G_OBJECT_CLASS (ft_session_dbus_service_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

gchar*
ft_session_dbus_service_get_current_state (FtSessionDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = ft_state_to_string (self->priv->_current_state);
	result = _tmp0_;
	return result;
}

gint64
ft_session_dbus_service_get_start_time (FtSessionDBusService* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_start_time;
	return result;
}

gint64
ft_session_dbus_service_get_end_time (FtSessionDBusService* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_end_time;
	return result;
}

gboolean
ft_session_dbus_service_get_has_uniform_breaks (FtSessionDBusService* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_uniform_breaks;
	return result;
}

gboolean
ft_session_dbus_service_get_can_reset (FtSessionDBusService* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_can_reset;
	return result;
}

static void
g_cclosure_user_marshal_VOID__VARIANT_VARIANT (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__VARIANT_VARIANT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__VARIANT_VARIANT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__VARIANT_VARIANT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_variant (param_values + 1), g_value_get_variant (param_values + 2), data2);
}

static void
ft_session_dbus_service_class_init (FtSessionDBusServiceClass * klass,
                                    gpointer klass_data)
{
	ft_session_dbus_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtSessionDBusService_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_session_dbus_service_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_session_dbus_service_get_property;
	G_OBJECT_CLASS (klass)->finalize = ft_session_dbus_service_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_DBUS_SERVICE_CURRENT_STATE_PROPERTY, ft_session_dbus_service_properties[FT_SESSION_DBUS_SERVICE_CURRENT_STATE_PROPERTY] = g_param_spec_string ("current-state", "current-state", "current-state", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_DBUS_SERVICE_START_TIME_PROPERTY, ft_session_dbus_service_properties[FT_SESSION_DBUS_SERVICE_START_TIME_PROPERTY] = g_param_spec_int64 ("start-time", "start-time", "start-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_DBUS_SERVICE_END_TIME_PROPERTY, ft_session_dbus_service_properties[FT_SESSION_DBUS_SERVICE_END_TIME_PROPERTY] = g_param_spec_int64 ("end-time", "end-time", "end-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_DBUS_SERVICE_HAS_UNIFORM_BREAKS_PROPERTY, ft_session_dbus_service_properties[FT_SESSION_DBUS_SERVICE_HAS_UNIFORM_BREAKS_PROPERTY] = g_param_spec_boolean ("has-uniform-breaks", "has-uniform-breaks", "has-uniform-breaks", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_DBUS_SERVICE_CAN_RESET_PROPERTY, ft_session_dbus_service_properties[FT_SESSION_DBUS_SERVICE_CAN_RESET_PROPERTY] = g_param_spec_boolean ("can-reset", "can-reset", "can-reset", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_ENTER_TIME_BLOCK_SIGNAL] = g_signal_new ("enter-time-block", FT_TYPE_SESSION_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VARIANT, G_TYPE_NONE, 1, G_TYPE_VARIANT);
	ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_LEAVE_TIME_BLOCK_SIGNAL] = g_signal_new ("leave-time-block", FT_TYPE_SESSION_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VARIANT, G_TYPE_NONE, 1, G_TYPE_VARIANT);
	ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_CONFIRM_ADVANCEMENT_SIGNAL] = g_signal_new ("confirm-advancement", FT_TYPE_SESSION_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__VARIANT_VARIANT, G_TYPE_NONE, 2, G_TYPE_VARIANT, G_TYPE_VARIANT);
	ft_session_dbus_service_signals[FT_SESSION_DBUS_SERVICE_CHANGED_SIGNAL] = g_signal_new ("changed", FT_TYPE_SESSION_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
ft_session_dbus_service_instance_init (FtSessionDBusService * self,
                                       gpointer klass)
{
	self->priv = ft_session_dbus_service_get_instance_private (self);
	self->priv->_current_state = FT_STATE_STOPPED;
	self->priv->_start_time = FT_TIMESTAMP_UNDEFINED;
	self->priv->_end_time = FT_TIMESTAMP_UNDEFINED;
	self->priv->_has_uniform_breaks = FALSE;
	self->priv->_can_reset = FALSE;
	self->priv->changed_idle_id = 0U;
}

static void
ft_session_dbus_service_finalize (GObject * obj)
{
	FtSessionDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_SESSION_DBUS_SERVICE, FtSessionDBusService);
	_g_object_unref0 (self->priv->session_manager);
	_g_free0 (self->priv->object_path);
	G_OBJECT_CLASS (ft_session_dbus_service_parent_class)->finalize (obj);
}

/**
     * Session service represents mostly `SessionManager.current_session`, but
     * also includes relevant methods/properties from `SessionManager` and scheduler.
     */
static GType
ft_session_dbus_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtSessionDBusServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_session_dbus_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtSessionDBusService), 0, (GInstanceInitFunc) ft_session_dbus_service_instance_init, NULL };
	GType ft_session_dbus_service_type_id;
	ft_session_dbus_service_type_id = g_type_register_static (G_TYPE_OBJECT, "FtSessionDBusService", &g_define_type_info, 0);
	g_type_set_qdata (ft_session_dbus_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) ft_session_dbus_service_register_object);
	FtSessionDBusService_private_offset = g_type_add_instance_private (ft_session_dbus_service_type_id, sizeof (FtSessionDBusServicePrivate));
	return ft_session_dbus_service_type_id;
}

GType
ft_session_dbus_service_get_type (void)
{
	static volatile gsize ft_session_dbus_service_type_id__once = 0;
	if (g_once_init_enter (&ft_session_dbus_service_type_id__once)) {
		GType ft_session_dbus_service_type_id;
		ft_session_dbus_service_type_id = ft_session_dbus_service_get_type_once ();
		g_once_init_leave (&ft_session_dbus_service_type_id__once, ft_session_dbus_service_type_id);
	}
	return ft_session_dbus_service_type_id__once;
}

static void
_vala_ft_session_dbus_service_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	FtSessionDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_SESSION_DBUS_SERVICE, FtSessionDBusService);
	switch (property_id) {
		case FT_SESSION_DBUS_SERVICE_CURRENT_STATE_PROPERTY:
		g_value_take_string (value, ft_session_dbus_service_get_current_state (self));
		break;
		case FT_SESSION_DBUS_SERVICE_START_TIME_PROPERTY:
		g_value_set_int64 (value, ft_session_dbus_service_get_start_time (self));
		break;
		case FT_SESSION_DBUS_SERVICE_END_TIME_PROPERTY:
		g_value_set_int64 (value, ft_session_dbus_service_get_end_time (self));
		break;
		case FT_SESSION_DBUS_SERVICE_HAS_UNIFORM_BREAKS_PROPERTY:
		g_value_set_boolean (value, ft_session_dbus_service_get_has_uniform_breaks (self));
		break;
		case FT_SESSION_DBUS_SERVICE_CAN_RESET_PROPERTY:
		g_value_set_boolean (value, ft_session_dbus_service_get_can_reset (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_ft_session_dbus_service_advance (FtSessionDBusService* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_session_dbus_service_advance (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_session_dbus_service_advance_to_state (FtSessionDBusService* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* state = NULL;
	GVariant* _tmp7_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	state = g_variant_dup_string (_tmp7_, NULL);
	g_variant_unref (_tmp7_);
	ft_session_dbus_service_advance_to_state (self, state, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (state);
	;
}

static void
_dbus_ft_session_dbus_service_reset (FtSessionDBusService* self,
                                     GVariant* _parameters_,
                                     GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	ft_session_dbus_service_reset (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_session_dbus_service_get_current_time_block (FtSessionDBusService* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_session_dbus_service_get_current_time_block (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_session_dbus_service_get_current_gap (FtSessionDBusService* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_session_dbus_service_get_current_gap (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_session_dbus_service_get_next_time_block (FtSessionDBusService* self,
                                                   GVariant* _parameters_,
                                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_session_dbus_service_get_next_time_block (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_session_dbus_service_list_time_blocks (FtSessionDBusService* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_session_dbus_service_list_time_blocks (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_ft_session_dbus_service_list_cycles (FtSessionDBusService* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = ft_session_dbus_service_list_cycles (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
ft_session_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* method_name,
                                                    GVariant* parameters,
                                                    GDBusMethodInvocation* invocation,
                                                    gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "Advance") == 0) {
		_dbus_ft_session_dbus_service_advance (object, parameters, invocation);
	} else if (strcmp (method_name, "AdvanceToState") == 0) {
		_dbus_ft_session_dbus_service_advance_to_state (object, parameters, invocation);
	} else if (strcmp (method_name, "Reset") == 0) {
		_dbus_ft_session_dbus_service_reset (object, parameters, invocation);
	} else if (strcmp (method_name, "GetCurrentTimeBlock") == 0) {
		_dbus_ft_session_dbus_service_get_current_time_block (object, parameters, invocation);
	} else if (strcmp (method_name, "GetCurrentGap") == 0) {
		_dbus_ft_session_dbus_service_get_current_gap (object, parameters, invocation);
	} else if (strcmp (method_name, "GetNextTimeBlock") == 0) {
		_dbus_ft_session_dbus_service_get_next_time_block (object, parameters, invocation);
	} else if (strcmp (method_name, "ListTimeBlocks") == 0) {
		_dbus_ft_session_dbus_service_list_time_blocks (object, parameters, invocation);
	} else if (strcmp (method_name, "ListCycles") == 0) {
		_dbus_ft_session_dbus_service_list_cycles (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_ft_session_dbus_service_get_current_state (FtSessionDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = ft_session_dbus_service_get_current_state (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_ft_session_dbus_service_get_start_time (FtSessionDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_session_dbus_service_get_start_time (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_session_dbus_service_get_end_time (FtSessionDBusService* self)
{
	gint64 result;
	GVariant* _reply;
	result = ft_session_dbus_service_get_end_time (self);
	_reply = g_variant_new_int64 (result);
	return _reply;
}

static GVariant*
_dbus_ft_session_dbus_service_get_has_uniform_breaks (FtSessionDBusService* self)
{
	gboolean result;
	GVariant* _reply;
	result = ft_session_dbus_service_get_has_uniform_breaks (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_ft_session_dbus_service_get_can_reset (FtSessionDBusService* self)
{
	gboolean result;
	GVariant* _reply;
	result = ft_session_dbus_service_get_can_reset (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
ft_session_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                     const gchar* sender,
                                                     const gchar* object_path,
                                                     const gchar* interface_name,
                                                     const gchar* property_name,
                                                     GError** error,
                                                     gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "CurrentState") == 0) {
		return _dbus_ft_session_dbus_service_get_current_state (object);
	} else if (strcmp (property_name, "StartTime") == 0) {
		return _dbus_ft_session_dbus_service_get_start_time (object);
	} else if (strcmp (property_name, "EndTime") == 0) {
		return _dbus_ft_session_dbus_service_get_end_time (object);
	} else if (strcmp (property_name, "HasUniformBreaks") == 0) {
		return _dbus_ft_session_dbus_service_get_has_uniform_breaks (object);
	} else if (strcmp (property_name, "CanReset") == 0) {
		return _dbus_ft_session_dbus_service_get_can_reset (object);
	}
	return NULL;
}

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

static void
_dbus_ft_session_dbus_service_enter_time_block (GObject* _sender,
                                                GVariant* time_block,
                                                gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (time_block));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Session", "EnterTimeBlock", _arguments, NULL);
}

static void
_dbus_ft_session_dbus_service_leave_time_block (GObject* _sender,
                                                GVariant* time_block,
                                                gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (time_block));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Session", "LeaveTimeBlock", _arguments, NULL);
}

static void
_dbus_ft_session_dbus_service_confirm_advancement (GObject* _sender,
                                                   GVariant* current_time_block,
                                                   GVariant* next_time_block,
                                                   gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (current_time_block));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (next_time_block));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Session", "ConfirmAdvancement", _arguments, NULL);
}

static void
_dbus_ft_session_dbus_service_changed (GObject* _sender,
                                       gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.github.focustimerhq.FocusTimer.Session", "Changed", _arguments, NULL);
}

guint
ft_session_dbus_service_register_object (gpointer object,
                                         GDBusConnection* connection,
                                         const gchar* path,
                                         GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_ft_session_dbus_service_dbus_interface_info), &_ft_session_dbus_service_dbus_interface_vtable, data, _ft_session_dbus_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "enter-time-block", (GCallback) _dbus_ft_session_dbus_service_enter_time_block, data);
	g_signal_connect (object, "leave-time-block", (GCallback) _dbus_ft_session_dbus_service_leave_time_block, data);
	g_signal_connect (object, "confirm-advancement", (GCallback) _dbus_ft_session_dbus_service_confirm_advancement, data);
	g_signal_connect (object, "changed", (GCallback) _dbus_ft_session_dbus_service_changed, data);
	return result;
}

static void
_ft_session_dbus_service_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_session_dbus_service_enter_time_block, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_session_dbus_service_leave_time_block, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_session_dbus_service_confirm_advancement, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_ft_session_dbus_service_changed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

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 inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

