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

/*
    Application.vala
    Copyright (C) 2010-2012 Maia Kozheva <sikon@ubuntu.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include <libnotify/notify.h>
#include <gee.h>
#include <gtk/gtk.h>
#include <stdio.h>
#include <gobject/gvaluecollector.h>

#define STEADYFLOW_COMMAND_LINE_HELP "\n" \
"Syntax: steadyflow [command [args...] [-option1=value1] [-option2=valu" \
"e2]...]\n" \
"\n" \
"Commands:\n" \
"  steadyflow add [url]  - Add a file for download. If url is omitted, " \
"populates\n" \
"                          the add dialog with the clipboard content if" \
" it is a\n" \
"                          valid URL.\n" \
"  steadyflow show       - Show the main window\n" \
"  steadyflow hide       - Hide the main window\n" \
"  steadyflow help       - Show this help screen\n" \
"  steadyflow version    - Show version information\n"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define STEADYFLOW_TYPE_APPLICATION (steadyflow_application_get_type ())
#define STEADYFLOW_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_APPLICATION, SteadyflowApplication))
#define STEADYFLOW_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_APPLICATION, SteadyflowApplicationClass))
#define STEADYFLOW_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_APPLICATION))
#define STEADYFLOW_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_APPLICATION))
#define STEADYFLOW_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_APPLICATION, SteadyflowApplicationClass))

typedef struct _SteadyflowApplication SteadyflowApplication;
typedef struct _SteadyflowApplicationClass SteadyflowApplicationClass;
typedef struct _SteadyflowApplicationPrivate SteadyflowApplicationPrivate;

#define STEADYFLOW_TYPE_IAPP_SERVICE (steadyflow_iapp_service_get_type ())
#define STEADYFLOW_IAPP_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_IAPP_SERVICE, SteadyflowIAppService))
#define STEADYFLOW_IS_IAPP_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_IAPP_SERVICE))
#define STEADYFLOW_IAPP_SERVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), STEADYFLOW_TYPE_IAPP_SERVICE, SteadyflowIAppServiceIface))

typedef struct _SteadyflowIAppService SteadyflowIAppService;
typedef struct _SteadyflowIAppServiceIface SteadyflowIAppServiceIface;

#define STEADYFLOW_TYPE_IAPP_SERVICE_PROXY (steadyflow_iapp_service_proxy_get_type ())

#define STEADYFLOW_CORE_TYPE_OPTION_PARSER (steadyflow_core_option_parser_get_type ())
#define STEADYFLOW_CORE_OPTION_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParser))
#define STEADYFLOW_CORE_OPTION_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParserClass))
#define STEADYFLOW_CORE_IS_OPTION_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_CORE_TYPE_OPTION_PARSER))
#define STEADYFLOW_CORE_IS_OPTION_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_CORE_TYPE_OPTION_PARSER))
#define STEADYFLOW_CORE_OPTION_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParserClass))

typedef struct _SteadyflowCoreOptionParser SteadyflowCoreOptionParser;
typedef struct _SteadyflowCoreOptionParserClass SteadyflowCoreOptionParserClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef void (*SteadyflowCoreOptionParserOptionCommand) (gchar** args, gint args_length1, GeeMap* kwargs, gpointer user_data);
typedef struct _Block3Data Block3Data;
#define _steadyflow_application_unref0(var) ((var == NULL) ? NULL : (var = (steadyflow_application_unref (var), NULL)))
typedef enum  {
	STEADYFLOW_SHOW_MAIN_WINDOW_DEFAULT,
	STEADYFLOW_SHOW_MAIN_WINDOW_SHOW,
	STEADYFLOW_SHOW_MAIN_WINDOW_HIDE
} SteadyflowShowMainWindow;

#define STEADYFLOW_TYPE_SHOW_MAIN_WINDOW (steadyflow_show_main_window_get_type ())
typedef void (*SteadyflowApplicationCreateServiceCallback) (gpointer user_data, GError** error);
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block4Data Block4Data;

#define STEADYFLOW_TYPE_APP_SERVICE (steadyflow_app_service_get_type ())
#define STEADYFLOW_APP_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_TYPE_APP_SERVICE, SteadyflowAppService))
#define STEADYFLOW_APP_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_TYPE_APP_SERVICE, SteadyflowAppServiceClass))
#define STEADYFLOW_IS_APP_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_TYPE_APP_SERVICE))
#define STEADYFLOW_IS_APP_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_TYPE_APP_SERVICE))
#define STEADYFLOW_APP_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_TYPE_APP_SERVICE, SteadyflowAppServiceClass))

typedef struct _SteadyflowAppService SteadyflowAppService;
typedef struct _SteadyflowAppServiceClass SteadyflowAppServiceClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SteadyflowParamSpecApplication SteadyflowParamSpecApplication;

struct _SteadyflowApplication {
	GTypeInstance parent_instance;
	volatile int ref_count;
	SteadyflowApplicationPrivate * priv;
};

struct _SteadyflowApplicationClass {
	GTypeClass parent_class;
	void (*finalize) (SteadyflowApplication *self);
};

struct _SteadyflowIAppServiceIface {
	GTypeInterface parent_iface;
	void (*add_file) (SteadyflowIAppService* self, const gchar* url, GError** error);
	void (*set_visible) (SteadyflowIAppService* self, gboolean visible, GError** error);
};

struct _SteadyflowApplicationPrivate {
	SteadyflowIAppService* service;
	SteadyflowCoreOptionParser* parser;
	gboolean is_server;
	guint service_id;
};

struct _Block3Data {
	int _ref_count_;
	SteadyflowApplication* self;
	gchar** args;
	gint args_length1;
};

struct _Block4Data {
	int _ref_count_;
	SteadyflowApplication* self;
	SteadyflowShowMainWindow show_mode;
	SteadyflowApplicationCreateServiceCallback callback;
	gpointer callback_target;
};

struct _SteadyflowParamSpecApplication {
	GParamSpec parent_instance;
};

static gint SteadyflowApplication_private_offset;
static gpointer steadyflow_application_parent_class = NULL;

VALA_EXTERN gpointer steadyflow_application_ref (gpointer instance);
VALA_EXTERN void steadyflow_application_unref (gpointer instance);
VALA_EXTERN GParamSpec* steadyflow_param_spec_application (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void steadyflow_value_set_application (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void steadyflow_value_take_application (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer steadyflow_value_get_application (const GValue* value);
VALA_EXTERN GType steadyflow_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowApplication, steadyflow_application_unref)
VALA_EXTERN GType steadyflow_iapp_service_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint steadyflow_iapp_service_register_object (void* object,
                                               GDBusConnection* connection,
                                               const gchar* path,
                                               GError** error);
VALA_EXTERN GType steadyflow_iapp_service_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowIAppService, g_object_unref)
VALA_EXTERN GType steadyflow_core_option_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowCoreOptionParser, g_object_unref)
VALA_EXTERN SteadyflowApplication* steadyflow_application_new (gchar** args,
                                                   gint args_length1);
VALA_EXTERN SteadyflowApplication* steadyflow_application_construct (GType object_type,
                                                         gchar** args,
                                                         gint args_length1);
VALA_EXTERN gboolean steadyflow_core_util_is_local_install (void);
VALA_EXTERN SteadyflowCoreOptionParser* steadyflow_core_option_parser_new (gchar** args,
                                                               gint args_length1,
                                                               gboolean remove_arg0);
VALA_EXTERN SteadyflowCoreOptionParser* steadyflow_core_option_parser_construct (GType object_type,
                                                                     gchar** args,
                                                                     gint args_length1,
                                                                     gboolean remove_arg0);
static void steadyflow_application_show_help (SteadyflowApplication* self);
static void _steadyflow_application_show_help_steadyflow_core_option_parser_unhandled_command (SteadyflowCoreOptionParser* _sender,
                                                                                        gpointer self);
VALA_EXTERN void steadyflow_core_option_parser_register_command (SteadyflowCoreOptionParser* self,
                                                     const gchar* cmd,
                                                     SteadyflowCoreOptionParserOptionCommand handler,
                                                     gpointer handler_target);
static void __lambda12_ (SteadyflowApplication* self,
                  gchar** args,
                  gint args_length1,
                  GeeMap* kwargs);
static void ___lambda12__steadyflow_core_option_parser_option_command (gchar** args,
                                                                gint args_length1,
                                                                GeeMap* kwargs,
                                                                gpointer self);
static void __lambda13_ (SteadyflowApplication* self,
                  gchar** args,
                  gint args_length1,
                  GeeMap* kwargs);
static void steadyflow_application_show_version (SteadyflowApplication* self);
static void ___lambda13__steadyflow_core_option_parser_option_command (gchar** args,
                                                                gint args_length1,
                                                                GeeMap* kwargs,
                                                                gpointer self);
static void __lambda14_ (SteadyflowApplication* self,
                  gchar** args,
                  gint args_length1,
                  GeeMap* kwargs);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
VALA_EXTERN GType steadyflow_show_main_window_get_type (void) G_GNUC_CONST ;
static void steadyflow_application_create_service (SteadyflowApplication* self,
                                            SteadyflowShowMainWindow show_mode,
                                            SteadyflowApplicationCreateServiceCallback callback,
                                            gpointer callback_target);
static void ____lambda38_ (Block3Data* _data3_,
                    GError** error);
VALA_EXTERN void steadyflow_iapp_service_add_file (SteadyflowIAppService* self,
                                       const gchar* url,
                                       GError** error);
static void _____lambda38__steadyflow_application_create_service_callback (gpointer self,
                                                                    GError** error);
static void ___lambda14__steadyflow_core_option_parser_option_command (gchar** args,
                                                                gint args_length1,
                                                                GeeMap* kwargs,
                                                                gpointer self);
static void __lambda39_ (SteadyflowApplication* self,
                  gchar** args,
                  gint args_length1,
                  GeeMap* kwargs);
static void ___lambda39__steadyflow_core_option_parser_option_command (gchar** args,
                                                                gint args_length1,
                                                                GeeMap* kwargs,
                                                                gpointer self);
static void __lambda40_ (SteadyflowApplication* self,
                  gchar** args,
                  gint args_length1,
                  GeeMap* kwargs);
static void ___lambda40__steadyflow_core_option_parser_option_command (gchar** args,
                                                                gint args_length1,
                                                                GeeMap* kwargs,
                                                                gpointer self);
static void __lambda41_ (SteadyflowApplication* self,
                  gchar** args,
                  gint args_length1,
                  GeeMap* kwargs);
static void ___lambda41__steadyflow_core_option_parser_option_command (gchar** args,
                                                                gint args_length1,
                                                                GeeMap* kwargs,
                                                                gpointer self);
VALA_EXTERN void steadyflow_application_run (SteadyflowApplication* self);
VALA_EXTERN void steadyflow_core_option_parser_run (SteadyflowCoreOptionParser* self);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void __lambda15_ (Block4Data* _data4_,
                  GDBusConnection* conn);
static void steadyflow_application_on_bus_acquired (SteadyflowApplication* self,
                                             GDBusConnection* conn);
static void ___lambda15__gbus_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self);
static void __lambda36_ (Block4Data* _data4_);
static void steadyflow_application_on_name_acquired (SteadyflowApplication* self,
                                              SteadyflowShowMainWindow show_mode,
                                              SteadyflowApplicationCreateServiceCallback callback,
                                              gpointer callback_target);
static void ___lambda36__gbus_name_acquired_callback (GDBusConnection* connection,
                                               const gchar* name,
                                               gpointer self);
static void __lambda37_ (Block4Data* _data4_,
                  GDBusConnection* conn);
static void steadyflow_application_on_name_lost (SteadyflowApplication* self,
                                          GDBusConnection* conn,
                                          SteadyflowShowMainWindow show_mode,
                                          SteadyflowApplicationCreateServiceCallback callback,
                                          gpointer callback_target);
static void ___lambda37__gbus_name_lost_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
VALA_EXTERN GType steadyflow_app_service_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowAppService, g_object_unref)
VALA_EXTERN void steadyflow_app_service_stop (SteadyflowAppService* self);
VALA_EXTERN SteadyflowAppService* steadyflow_app_service_new (void);
VALA_EXTERN SteadyflowAppService* steadyflow_app_service_construct (GType object_type);
VALA_EXTERN void steadyflow_app_service_start (SteadyflowAppService* self,
                                   SteadyflowShowMainWindow show,
                                   GError** error);
VALA_EXTERN void steadyflow_core_util_fatal_error (GError* e,
                                       const gchar* message);
VALA_EXTERN void steadyflow_iapp_service_set_visible (SteadyflowIAppService* self,
                                          gboolean visible,
                                          GError** error);
static gint steadyflow_application_main (gchar** args,
                                  gint args_length1);
static void steadyflow_application_finalize (SteadyflowApplication * obj);
static GType steadyflow_application_get_type_once (void);

static inline gpointer
steadyflow_application_get_instance_private (SteadyflowApplication* self)
{
	return G_STRUCT_MEMBER_P (self, SteadyflowApplication_private_offset);
}

static void
_steadyflow_application_show_help_steadyflow_core_option_parser_unhandled_command (SteadyflowCoreOptionParser* _sender,
                                                                                   gpointer self)
{
	steadyflow_application_show_help ((SteadyflowApplication*) self);
}

static void
__lambda12_ (SteadyflowApplication* self,
             gchar** args,
             gint args_length1,
             GeeMap* kwargs)
{
	g_return_if_fail (kwargs != NULL);
	steadyflow_application_show_help (self);
}

static void
___lambda12__steadyflow_core_option_parser_option_command (gchar** args,
                                                           gint args_length1,
                                                           GeeMap* kwargs,
                                                           gpointer self)
{
	__lambda12_ ((SteadyflowApplication*) self, args, args_length1, kwargs);
}

static void
__lambda13_ (SteadyflowApplication* self,
             gchar** args,
             gint args_length1,
             GeeMap* kwargs)
{
	g_return_if_fail (kwargs != NULL);
	steadyflow_application_show_version (self);
}

static void
___lambda13__steadyflow_core_option_parser_option_command (gchar** args,
                                                           gint args_length1,
                                                           GeeMap* kwargs,
                                                           gpointer self)
{
	__lambda13_ ((SteadyflowApplication*) self, args, args_length1, kwargs);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		SteadyflowApplication* self;
		self = _data3_->self;
		_steadyflow_application_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static void
____lambda38_ (Block3Data* _data3_,
               GError** error)
{
	SteadyflowApplication* self;
	SteadyflowIAppService* _tmp0_;
	const gchar* _tmp1_;
	GError* _inner_error0_ = NULL;
	self = _data3_->self;
	_tmp0_ = self->priv->service;
	_tmp1_ = _data3_->args[0];
	steadyflow_iapp_service_add_file (_tmp0_, _tmp1_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == G_IO_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

static void
_____lambda38__steadyflow_application_create_service_callback (gpointer self,
                                                               GError** error)
{
	____lambda38_ (self, error);
}

static void
__lambda14_ (SteadyflowApplication* self,
             gchar** args,
             gint args_length1,
             GeeMap* kwargs)
{
	Block3Data* _data3_;
	g_return_if_fail (kwargs != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = steadyflow_application_ref (self);
	_data3_->args = args;
	_data3_->args_length1 = args_length1;
	if (_data3_->args_length1 > 1) {
		steadyflow_application_show_help (self);
	} else {
		if (_data3_->args_length1 == 0) {
			steadyflow_application_create_service (self, STEADYFLOW_SHOW_MAIN_WINDOW_DEFAULT, NULL, NULL);
		} else {
			steadyflow_application_create_service (self, STEADYFLOW_SHOW_MAIN_WINDOW_DEFAULT, _____lambda38__steadyflow_application_create_service_callback, _data3_);
		}
	}
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static void
___lambda14__steadyflow_core_option_parser_option_command (gchar** args,
                                                           gint args_length1,
                                                           GeeMap* kwargs,
                                                           gpointer self)
{
	__lambda14_ ((SteadyflowApplication*) self, args, args_length1, kwargs);
}

static void
__lambda39_ (SteadyflowApplication* self,
             gchar** args,
             gint args_length1,
             GeeMap* kwargs)
{
	g_return_if_fail (kwargs != NULL);
	steadyflow_application_create_service (self, STEADYFLOW_SHOW_MAIN_WINDOW_SHOW, NULL, NULL);
}

static void
___lambda39__steadyflow_core_option_parser_option_command (gchar** args,
                                                           gint args_length1,
                                                           GeeMap* kwargs,
                                                           gpointer self)
{
	__lambda39_ ((SteadyflowApplication*) self, args, args_length1, kwargs);
}

static void
__lambda40_ (SteadyflowApplication* self,
             gchar** args,
             gint args_length1,
             GeeMap* kwargs)
{
	g_return_if_fail (kwargs != NULL);
	steadyflow_application_create_service (self, STEADYFLOW_SHOW_MAIN_WINDOW_HIDE, NULL, NULL);
}

static void
___lambda40__steadyflow_core_option_parser_option_command (gchar** args,
                                                           gint args_length1,
                                                           GeeMap* kwargs,
                                                           gpointer self)
{
	__lambda40_ ((SteadyflowApplication*) self, args, args_length1, kwargs);
}

static void
__lambda41_ (SteadyflowApplication* self,
             gchar** args,
             gint args_length1,
             GeeMap* kwargs)
{
	g_return_if_fail (kwargs != NULL);
	steadyflow_application_create_service (self, STEADYFLOW_SHOW_MAIN_WINDOW_DEFAULT, NULL, NULL);
}

static void
___lambda41__steadyflow_core_option_parser_option_command (gchar** args,
                                                           gint args_length1,
                                                           GeeMap* kwargs,
                                                           gpointer self)
{
	__lambda41_ ((SteadyflowApplication*) self, args, args_length1, kwargs);
}

SteadyflowApplication*
steadyflow_application_construct (GType object_type,
                                  gchar** args,
                                  gint args_length1)
{
	SteadyflowApplication* self = NULL;
	gchar* domain = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	SteadyflowCoreOptionParser* _tmp6_;
	SteadyflowCoreOptionParser* _tmp7_;
	SteadyflowCoreOptionParser* _tmp8_;
	SteadyflowCoreOptionParser* _tmp9_;
	SteadyflowCoreOptionParser* _tmp10_;
	SteadyflowCoreOptionParser* _tmp11_;
	SteadyflowCoreOptionParser* _tmp12_;
	SteadyflowCoreOptionParser* _tmp13_;
	self = (SteadyflowApplication*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup ("steadyflow");
	domain = _tmp0_;
	_tmp1_ = domain;
	textdomain (_tmp1_);
	if (steadyflow_core_util_is_local_install ()) {
		_tmp2_ = "bin/locale";
	} else {
		_tmp2_ = CMAKE_INSTALL_DATA_DIR "/locale";
	}
	_tmp3_ = domain;
	bindtextdomain (_tmp3_, _tmp2_);
	_tmp4_ = domain;
	bind_textdomain_codeset (_tmp4_, "UTF-8");
	_tmp5_ = domain;
	notify_init (_tmp5_);
	_tmp6_ = steadyflow_core_option_parser_new (args, args_length1, TRUE);
	_g_object_unref0 (self->priv->parser);
	self->priv->parser = _tmp6_;
	_tmp7_ = self->priv->parser;
	g_signal_connect (_tmp7_, "unhandled-command", (GCallback) _steadyflow_application_show_help_steadyflow_core_option_parser_unhandled_command, self);
	_tmp8_ = self->priv->parser;
	steadyflow_core_option_parser_register_command (_tmp8_, "help", ___lambda12__steadyflow_core_option_parser_option_command, self);
	_tmp9_ = self->priv->parser;
	steadyflow_core_option_parser_register_command (_tmp9_, "version", ___lambda13__steadyflow_core_option_parser_option_command, self);
	_tmp10_ = self->priv->parser;
	steadyflow_core_option_parser_register_command (_tmp10_, "add", ___lambda14__steadyflow_core_option_parser_option_command, self);
	_tmp11_ = self->priv->parser;
	steadyflow_core_option_parser_register_command (_tmp11_, "show", ___lambda39__steadyflow_core_option_parser_option_command, self);
	_tmp12_ = self->priv->parser;
	steadyflow_core_option_parser_register_command (_tmp12_, "hide", ___lambda40__steadyflow_core_option_parser_option_command, self);
	_tmp13_ = self->priv->parser;
	steadyflow_core_option_parser_register_command (_tmp13_, "@default", ___lambda41__steadyflow_core_option_parser_option_command, self);
	_g_free0 (domain);
	return self;
}

SteadyflowApplication*
steadyflow_application_new (gchar** args,
                            gint args_length1)
{
	return steadyflow_application_construct (STEADYFLOW_TYPE_APPLICATION, args, args_length1);
}

void
steadyflow_application_run (SteadyflowApplication* self)
{
	SteadyflowCoreOptionParser* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parser;
	steadyflow_core_option_parser_run (_tmp0_);
}

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

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

static void
__lambda15_ (Block4Data* _data4_,
             GDBusConnection* conn)
{
	SteadyflowApplication* self;
	self = _data4_->self;
	g_return_if_fail (conn != NULL);
	steadyflow_application_on_bus_acquired (self, conn);
}

static void
___lambda15__gbus_acquired_callback (GDBusConnection* connection,
                                     const gchar* name,
                                     gpointer self)
{
	__lambda15_ (self, connection);
}

static void
__lambda36_ (Block4Data* _data4_)
{
	SteadyflowApplication* self;
	self = _data4_->self;
	steadyflow_application_on_name_acquired (self, _data4_->show_mode, _data4_->callback, _data4_->callback_target);
}

static void
___lambda36__gbus_name_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self)
{
	__lambda36_ (self);
}

static void
__lambda37_ (Block4Data* _data4_,
             GDBusConnection* conn)
{
	SteadyflowApplication* self;
	self = _data4_->self;
	g_return_if_fail (conn != NULL);
	steadyflow_application_on_name_lost (self, conn, _data4_->show_mode, _data4_->callback, _data4_->callback_target);
}

static void
___lambda37__gbus_name_lost_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda37_ (self, connection);
}

static void
steadyflow_application_create_service (SteadyflowApplication* self,
                                       SteadyflowShowMainWindow show_mode,
                                       SteadyflowApplicationCreateServiceCallback callback,
                                       gpointer callback_target)
{
	Block4Data* _data4_;
	guint bus_id = 0U;
	g_return_if_fail (self != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = steadyflow_application_ref (self);
	_data4_->show_mode = show_mode;
	_data4_->callback = callback;
	_data4_->callback_target = callback_target;
	bus_id = g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "net.launchpad.steadyflow.App", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda15__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda15__gbus_acquired_callback, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref)), (GClosure*) ((___lambda36__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda36__gbus_name_acquired_callback, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref)), (GClosure*) ((___lambda37__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda37__gbus_name_lost_callback, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref)));
	gtk_main ();
	if (self->priv->is_server) {
		SteadyflowIAppService* _tmp0_;
		_tmp0_ = self->priv->service;
		steadyflow_app_service_stop (STEADYFLOW_IS_APP_SERVICE (_tmp0_) ? ((SteadyflowAppService*) _tmp0_) : NULL);
	}
	_g_object_unref0 (self->priv->service);
	self->priv->service = NULL;
	g_bus_unown_name (bus_id);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}

static void
steadyflow_application_on_bus_acquired (SteadyflowApplication* self,
                                        GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	{
		SteadyflowAppService* _tmp0_;
		guint _tmp1_ = 0U;
		SteadyflowIAppService* _tmp2_;
		guint _tmp3_;
		_tmp0_ = steadyflow_app_service_new ();
		_g_object_unref0 (self->priv->service);
		self->priv->service = (SteadyflowIAppService*) _tmp0_;
		_tmp2_ = self->priv->service;
		_tmp3_ = steadyflow_iapp_service_register_object (_tmp2_, conn, "/net/launchpad/steadyflow/app", &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		self->priv->service_id = _tmp1_;
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
steadyflow_application_on_name_acquired (SteadyflowApplication* self,
                                         SteadyflowShowMainWindow show_mode,
                                         SteadyflowApplicationCreateServiceCallback callback,
                                         gpointer callback_target)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	self->priv->is_server = TRUE;
	{
		SteadyflowIAppService* _tmp0_;
		_tmp0_ = self->priv->service;
		steadyflow_app_service_start (STEADYFLOW_IS_APP_SERVICE (_tmp0_) ? ((SteadyflowAppService*) _tmp0_) : NULL, show_mode, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (callback != NULL) {
			callback (callback_target, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		steadyflow_core_util_fatal_error (e, NULL);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
steadyflow_application_on_name_lost (SteadyflowApplication* self,
                                     GDBusConnection* conn,
                                     SteadyflowShowMainWindow show_mode,
                                     SteadyflowApplicationCreateServiceCallback callback,
                                     gpointer callback_target)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	if (self->priv->is_server) {
		return;
	}
	if (conn == NULL) {
		FILE* _tmp0_;
		_tmp0_ = stderr;
		fprintf (_tmp0_, "%s\n", _ ("Cannot connect to D-Bus. Steadyflow will exit."));
	}
	{
		SteadyflowIAppService* _tmp1_ = NULL;
		SteadyflowIAppService* _tmp2_;
		SteadyflowIAppService* _tmp3_;
		_tmp2_ = (SteadyflowIAppService*) g_initable_new (STEADYFLOW_TYPE_IAPP_SERVICE_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "net.launchpad.steadyflow.App", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/net/launchpad/steadyflow/app", "g-interface-name", "net.launchpad.steadyflow.App", NULL);
		_tmp1_ = (SteadyflowIAppService*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp3_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (self->priv->service);
		self->priv->service = _tmp3_;
		if (show_mode == STEADYFLOW_SHOW_MAIN_WINDOW_SHOW) {
			SteadyflowIAppService* _tmp4_;
			_tmp4_ = self->priv->service;
			steadyflow_iapp_service_set_visible (_tmp4_, TRUE, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (_tmp1_);
				if (_inner_error0_->domain == G_IO_ERROR) {
					goto __catch0_g_io_error;
				}
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		} else {
			if (show_mode == STEADYFLOW_SHOW_MAIN_WINDOW_HIDE) {
				SteadyflowIAppService* _tmp5_;
				_tmp5_ = self->priv->service;
				steadyflow_iapp_service_set_visible (_tmp5_, FALSE, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (_tmp1_);
					if (_inner_error0_->domain == G_IO_ERROR) {
						goto __catch0_g_io_error;
					}
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			} else {
				if (callback == NULL) {
					FILE* _tmp6_;
					_tmp6_ = stderr;
					fprintf (_tmp6_, "%s\n", _ ("Another instance of Steadyflow is already running."));
					exit (1);
				}
			}
		}
		_g_object_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		FILE* _tmp7_;
		g_clear_error (&_inner_error0_);
		_tmp7_ = stderr;
		fprintf (_tmp7_, "%s\n", _ ("Can neither create a D-Bus service nor connect to an existing instance" \
" of Steadyflow. " "Steadyflow will now exit."));
		exit (1);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	{
		if (callback != NULL) {
			callback (callback_target, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		steadyflow_core_util_fatal_error (e, NULL);
		_g_error_free0 (e);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	gtk_main_quit ();
}

static void
steadyflow_application_show_version (SteadyflowApplication* self)
{
	FILE* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = stdout;
	_tmp1_ = g_strconcat (_ ("Steadyflow version %s"), "\n", NULL);
	_tmp2_ = _tmp1_;
	fprintf (_tmp0_, _tmp2_, CMAKE_APP_VERSION);
	_g_free0 (_tmp2_);
}

static void
steadyflow_application_show_help (SteadyflowApplication* self)
{
	FILE* _tmp0_;
	g_return_if_fail (self != NULL);
	steadyflow_application_show_version (self);
	_tmp0_ = stdout;
	fprintf (_tmp0_, "%s", STEADYFLOW_COMMAND_LINE_HELP);
}

static gint
steadyflow_application_main (gchar** args,
                             gint args_length1)
{
	SteadyflowApplication* app = NULL;
	SteadyflowApplication* _tmp7_;
	gint result;
	if (steadyflow_core_util_is_local_install ()) {
		gchar* xdg_data_dirs = NULL;
		const gchar* _tmp0_;
		gchar* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp0_ = g_getenv ("XDG_DATA_DIRS");
		_tmp1_ = g_strdup (_tmp0_);
		xdg_data_dirs = _tmp1_;
		_tmp2_ = xdg_data_dirs;
		if (_tmp2_ == NULL) {
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("/usr/local/share/:/usr/share/");
			_g_free0 (xdg_data_dirs);
			xdg_data_dirs = _tmp3_;
		}
		_tmp4_ = xdg_data_dirs;
		_tmp5_ = g_strconcat ("bin/:", _tmp4_, NULL);
		_tmp6_ = _tmp5_;
		g_setenv ("XDG_DATA_DIRS", _tmp6_, TRUE);
		_g_free0 (_tmp6_);
		_g_free0 (xdg_data_dirs);
	}
	gtk_init ((gint*) (&args_length1), &args);
	_tmp7_ = steadyflow_application_new (args, args_length1);
	app = _tmp7_;
	steadyflow_application_run (app);
	result = 0;
	_steadyflow_application_unref0 (app);
	return result;
}

int
main (int argc,
      char ** argv)
{
	return steadyflow_application_main (argv, argc);
}

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

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

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

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

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

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

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

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

void
steadyflow_value_set_application (GValue* value,
                                  gpointer v_object)
{
	SteadyflowApplication * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, STEADYFLOW_TYPE_APPLICATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, STEADYFLOW_TYPE_APPLICATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		steadyflow_application_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		steadyflow_application_unref (old);
	}
}

void
steadyflow_value_take_application (GValue* value,
                                   gpointer v_object)
{
	SteadyflowApplication * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, STEADYFLOW_TYPE_APPLICATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, STEADYFLOW_TYPE_APPLICATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		steadyflow_application_unref (old);
	}
}

static void
steadyflow_application_class_init (SteadyflowApplicationClass * klass,
                                   gpointer klass_data)
{
	steadyflow_application_parent_class = g_type_class_peek_parent (klass);
	((SteadyflowApplicationClass *) klass)->finalize = steadyflow_application_finalize;
	g_type_class_adjust_private_offset (klass, &SteadyflowApplication_private_offset);
}

static void
steadyflow_application_instance_init (SteadyflowApplication * self,
                                      gpointer klass)
{
	self->priv = steadyflow_application_get_instance_private (self);
	self->priv->is_server = FALSE;
	self->ref_count = 1;
}

static void
steadyflow_application_finalize (SteadyflowApplication * obj)
{
	SteadyflowApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, STEADYFLOW_TYPE_APPLICATION, SteadyflowApplication);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->service);
	_g_object_unref0 (self->priv->parser);
}

static GType
steadyflow_application_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { steadyflow_value_application_init, steadyflow_value_application_free_value, steadyflow_value_application_copy_value, steadyflow_value_application_peek_pointer, "p", steadyflow_value_application_collect_value, "p", steadyflow_value_application_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (SteadyflowApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) steadyflow_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SteadyflowApplication), 0, (GInstanceInitFunc) steadyflow_application_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType steadyflow_application_type_id;
	steadyflow_application_type_id = g_type_register_fundamental (g_type_fundamental_next (), "SteadyflowApplication", &g_define_type_info, &g_define_type_fundamental_info, 0);
	SteadyflowApplication_private_offset = g_type_add_instance_private (steadyflow_application_type_id, sizeof (SteadyflowApplicationPrivate));
	return steadyflow_application_type_id;
}

GType
steadyflow_application_get_type (void)
{
	static volatile gsize steadyflow_application_type_id__once = 0;
	if (g_once_init_enter (&steadyflow_application_type_id__once)) {
		GType steadyflow_application_type_id;
		steadyflow_application_type_id = steadyflow_application_get_type_once ();
		g_once_init_leave (&steadyflow_application_type_id__once, steadyflow_application_type_id);
	}
	return steadyflow_application_type_id__once;
}

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

void
steadyflow_application_unref (gpointer instance)
{
	SteadyflowApplication * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		STEADYFLOW_APPLICATION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

