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

#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <adwaita.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>

#define DC_APPLICATION_CSS "\n" \
"            .message-bubble {\n" \
"                padding: 8px 12px;\n" \
"                border-radius: 16px;\n" \
"                min-width: 60px;\n" \
"            }\n" \
"            .message-bubble.incoming {\n" \
"                background-color: alpha(@view_fg_color, 0.08);\n" \
"                border-top-left-radius: 4px;\n" \
"            }\n" \
"            .message-bubble.outgoing {\n" \
"                background-color: alpha(@accent_bg_color, 0.5);\n" \
"                border-bottom-right-radius: 4px;\n" \
"            }\n" \
"            .message-sender {\n" \
"                font-weight: bold;\n" \
"                font-size: small;\n" \
"                color: @accent_color;\n" \
"            }\n" \
"            .message-time {\n" \
"                font-size: x-small;\n" \
"                opacity: 0.55;\n" \
"                margin-top: 2px;\n" \
"            }\n" \
"            .message-attachment { padding: 4px 0; }\n" \
"            .message-image { border-radius: 12px; margin-top: 4px; }\n" \
"            .image-viewer-overlay {\n" \
"                background-color: alpha(black, 0.75);\n" \
"            }\n" \
"            .compose-bar { border-top: none; }\n" \
"            .compose-entry { min-height: 36px; border-radius: 18px; }\n" \
"            .chat-drop-active {\n" \
"                background-color: alpha(@accent_bg_color, 0.08);\n" \
"                box-shadow: inset 0 0 0 2px alpha(@accent_bg_color, 0." \
"45);\n" \
"            }\n" \
"            .chat-row { border-radius: 8px; padding: 4px; }\n" \
"            .current-account-row {\n" \
"                background-color: alpha(@accent_bg_color, 0.10);\n" \
"                border-radius: 8px;\n" \
"            }\n" \
"            .unread-dot {\n" \
"                color: @accent_bg_color;\n" \
"                font-size: 12px;\n" \
"            }\n" \
"            .unread-dot-muted {\n" \
"                color: alpha(@view_fg_color, 0.4);\n" \
"                font-size: 12px;\n" \
"            }\n" \
"            .unread-name {\n" \
"                font-weight: 800;\n" \
"            }\n" \
"            .unread-badge {\n" \
"                background-color: @accent_bg_color;\n" \
"                color: @accent_fg_color;\n" \
"                border-radius: 10px;\n" \
"                padding: 0 6px;\n" \
"                min-width: 20px; min-height: 20px;\n" \
"                font-size: small; font-weight: bold;\n" \
"            }\n" \
"            .unread-badge-muted {\n" \
"                background-color: alpha(@view_fg_color, 0.35);\n" \
"                color: @view_bg_color;\n" \
"                border-radius: 10px;\n" \
"                padding: 0 6px;\n" \
"                min-width: 20px; min-height: 20px;\n" \
"                font-size: small; font-weight: bold;\n" \
"            }\n" \
"            .contact-request-badge {\n" \
"                background-color: @warning_bg_color;\n" \
"                color: @warning_fg_color;\n" \
"                border-radius: 10px;\n" \
"                padding: 0 6px;\n" \
"                min-width: 20px; min-height: 20px;\n" \
"                font-size: small; font-weight: bold;\n" \
"            }\n" \
"            .message-new {\n" \
"                background-color: alpha(@accent_bg_color, 0.15);\n" \
"                transition: background-color 2s ease-out;\n" \
"            }\n" \
"            .quote-block {\n" \
"                border-left: 3px solid @accent_bg_color;\n" \
"                padding: 4px 8px;\n" \
"                margin-bottom: 4px;\n" \
"                background-color: alpha(@view_fg_color, 0.05);\n" \
"                border-radius: 4px;\n" \
"            }\n" \
"            .quote-sender {\n" \
"                font-size: small;\n" \
"                font-weight: bold;\n" \
"                color: @accent_color;\n" \
"            }\n" \
"            .quote-text {\n" \
"                font-size: small;\n" \
"                opacity: 0.75;\n" \
"            }\n" \
"            .reply-bar {\n" \
"                padding: 4px 8px;\n" \
"                margin-bottom: 4px;\n" \
"                border-left: 3px solid @accent_bg_color;\n" \
"                background-color: alpha(@view_fg_color, 0.05);\n" \
"                border-radius: 4px;\n" \
"            }\n" \
"            .reply-label {\n" \
"                font-size: small;\n" \
"                opacity: 0.8;\n" \
"            }\n" \
"            .pinned-bar {\n" \
"                background-color: alpha(@accent_bg_color, 0.08);\n" \
"                border-bottom: 1px solid alpha(@view_fg_color, 0.12);\n" \
"            }\n" \
"            /* Delivery / read ticks next to the timestamp. */\n" \
"            .message-tick {\n" \
"                font-size: small;\n" \
"                opacity: 0.60;\n" \
"                margin-left: 2px;\n" \
"                letter-spacing: -3px;\n" \
"            }\n" \
"            .message-tick-read {\n" \
"                font-size: small;\n" \
"                color: @success_color;\n" \
"                opacity: 1;\n" \
"                margin-left: 2px;\n" \
"                letter-spacing: -3px;\n" \
"            }\n" \
"            .message-tick-failed {\n" \
"                font-size: small;\n" \
"                color: @error_color;\n" \
"                opacity: 1;\n" \
"                margin-left: 2px;\n" \
"            }\n" \
"            /* Floating \"disconnected\" pill over the chat area. */\n" \
"            .connection-banner {\n" \
"                background-color: alpha(@view_fg_color, 0.80);\n" \
"                color: @view_bg_color;\n" \
"                padding: 6px 14px;\n" \
"                border-radius: 18px;\n" \
"                box-shadow: 0 2px 8px alpha(@view_fg_color, 0.25);\n" \
"            }\n" \
"            .connection-banner-label {\n" \
"                font-size: small;\n" \
"            }\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 DC_TYPE_APPLICATION (dc_application_get_type ())
#define DC_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_APPLICATION, DcApplication))
#define DC_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_APPLICATION, DcApplicationClass))
#define DC_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_APPLICATION))
#define DC_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_APPLICATION))
#define DC_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_APPLICATION, DcApplicationClass))

typedef struct _DcApplication DcApplication;
typedef struct _DcApplicationClass DcApplicationClass;
typedef struct _DcApplicationPrivate DcApplicationPrivate;

#define DC_TYPE_RPC_CLIENT (dc_rpc_client_get_type ())
#define DC_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_CLIENT, DcRpcClient))
#define DC_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_CLIENT, DcRpcClientClass))
#define DC_IS_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_CLIENT))
#define DC_IS_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_CLIENT))
#define DC_RPC_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_CLIENT, DcRpcClientClass))

typedef struct _DcRpcClient DcRpcClient;
typedef struct _DcRpcClientClass DcRpcClientClass;
enum  {
	DC_APPLICATION_0_PROPERTY,
	DC_APPLICATION_RPC_PROPERTY,
	DC_APPLICATION_NUM_PROPERTIES
};
static GParamSpec* dc_application_properties[DC_APPLICATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define DC_TYPE_WINDOW (dc_window_get_type ())
#define DC_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_WINDOW, DcWindow))
#define DC_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_WINDOW, DcWindowClass))
#define DC_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_WINDOW))
#define DC_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_WINDOW))
#define DC_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_WINDOW, DcWindowClass))

typedef struct _DcWindow DcWindow;
typedef struct _DcWindowClass DcWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DcApplication {
	AdwApplication parent_instance;
	DcApplicationPrivate * priv;
};

struct _DcApplicationClass {
	AdwApplicationClass parent_class;
};

struct _DcApplicationPrivate {
	DcRpcClient* _rpc;
};

static gint DcApplication_private_offset;
static gpointer dc_application_parent_class = NULL;

void gtk_style_context_add_provider_for_display (GdkDisplay* display,
                                                 GtkStyleProvider* provider,
                                                 guint priority);
VALA_EXTERN GType dc_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcApplication, g_object_unref)
VALA_EXTERN GType dc_rpc_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcClient, g_object_unref)
VALA_EXTERN DcApplication* dc_application_new (void);
VALA_EXTERN DcApplication* dc_application_construct (GType object_type);
static void dc_application_real_activate (GApplication* base);
VALA_EXTERN DcWindow* dc_window_new (DcApplication* app);
VALA_EXTERN DcWindow* dc_window_construct (GType object_type,
                               DcApplication* app);
VALA_EXTERN GType dc_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcWindow, g_object_unref)
static void dc_application_real_startup (GApplication* base);
static void dc_application_load_css (DcApplication* self);
static void dc_application_register_icons (DcApplication* self);
VALA_EXTERN DcRpcClient* dc_application_get_rpc (DcApplication* self);
static void dc_application_set_rpc (DcApplication* self,
                             DcRpcClient* value);
static GObject * dc_application_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties);
VALA_EXTERN DcRpcClient* dc_rpc_client_new (void);
VALA_EXTERN DcRpcClient* dc_rpc_client_construct (GType object_type);
static void dc_application_finalize (GObject * obj);
static GType dc_application_get_type_once (void);
static void _vala_dc_application_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_dc_application_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
dc_application_get_instance_private (DcApplication* self)
{
	return G_STRUCT_MEMBER_P (self, DcApplication_private_offset);
}

DcApplication*
dc_application_construct (GType object_type)
{
	DcApplication * self = NULL;
	self = (DcApplication*) g_object_new (object_type, "application-id", "io.github.trufae.Parla", "flags", G_APPLICATION_FLAGS_NONE, NULL);
	return self;
}

DcApplication*
dc_application_new (void)
{
	return dc_application_construct (DC_TYPE_APPLICATION);
}

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

static void
dc_application_real_activate (GApplication* base)
{
	DcApplication * self;
	GtkWindow* window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp3_;
	GtkWindow* _tmp5_;
	self = (DcApplication*) base;
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	window = _tmp2_;
	_tmp3_ = window;
	if (_tmp3_ == NULL) {
		DcWindow* _tmp4_;
		_tmp4_ = dc_window_new (self);
		g_object_ref_sink (_tmp4_);
		_g_object_unref0 (window);
		window = (GtkWindow*) _tmp4_;
	}
	_tmp5_ = window;
	gtk_window_present (_tmp5_);
	_g_object_unref0 (window);
}

static void
dc_application_real_startup (GApplication* base)
{
	DcApplication * self;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	self = (DcApplication*) base;
	G_APPLICATION_CLASS (dc_application_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	dc_application_load_css (self);
	dc_application_register_icons (self);
	gtk_window_set_default_icon_name ("io.github.trufae.Parla");
	_tmp0_ = g_strdup ("<Control>n");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "win.new-chat", _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	_tmp3_ = g_strdup ("<Control>r");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "win.refresh", _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
	_tmp6_ = g_strdup ("<Control>comma");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "win.settings", _tmp8_);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
}

static void
dc_application_register_icons (DcApplication* self)
{
	GtkIconTheme* theme = NULL;
	GdkDisplay* _tmp0_;
	GtkIconTheme* _tmp1_;
	GtkIconTheme* _tmp2_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = gtk_icon_theme_get_for_display (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	theme = _tmp2_;
	{
		gchar* exe_path = NULL;
		gchar* _tmp3_;
		GFile* exe_dir = NULL;
		GFile* _tmp4_;
		GFile* _tmp5_;
		GFile* _tmp6_;
		GFile* _tmp7_;
		GFile* project_icons = NULL;
		GFile* _tmp8_;
		GFile* _tmp9_;
		GFile* _tmp10_;
		GFile* _tmp11_;
		GFile* _tmp12_;
		GFile* _tmp13_;
		GFile* _tmp14_;
		GFile* _tmp15_;
		_tmp3_ = g_file_read_link ("/proc/self/exe", &_inner_error0_);
		exe_path = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch0_g_file_error;
			}
			_g_object_unref0 (theme);
			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;
		}
		_tmp4_ = g_file_new_for_path (exe_path);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_file_get_parent (_tmp5_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		exe_dir = _tmp7_;
		_tmp8_ = exe_dir;
		_tmp9_ = g_file_get_parent (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_file_get_child (_tmp10_, "data");
		_tmp12_ = _tmp11_;
		_tmp13_ = g_file_get_child (_tmp12_, "icons");
		_tmp14_ = _tmp13_;
		_g_object_unref0 (_tmp12_);
		_g_object_unref0 (_tmp10_);
		project_icons = _tmp14_;
		_tmp15_ = project_icons;
		if (g_file_query_exists (_tmp15_, NULL)) {
			GFile* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp16_ = project_icons;
			_tmp17_ = g_file_get_path (_tmp16_);
			_tmp18_ = _tmp17_;
			gtk_icon_theme_add_search_path (theme, _tmp18_);
			_g_free0 (_tmp18_);
		}
		_g_object_unref0 (project_icons);
		_g_object_unref0 (exe_dir);
		_g_free0 (exe_path);
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (theme);
		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 (theme);
}

static void
dc_application_load_css (DcApplication* self)
{
	GtkCssProvider* provider = NULL;
	GtkCssProvider* _tmp0_;
	GdkDisplay* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_css_provider_new ();
	provider = _tmp0_;
	gtk_css_provider_load_from_string (provider, DC_APPLICATION_CSS);
	_tmp1_ = gdk_display_get_default ();
	gtk_style_context_add_provider_for_display (_tmp1_, (GtkStyleProvider*) provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_g_object_unref0 (provider);
}

DcRpcClient*
dc_application_get_rpc (DcApplication* self)
{
	DcRpcClient* result;
	DcRpcClient* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_rpc;
	result = _tmp0_;
	return result;
}

static void
dc_application_set_rpc (DcApplication* self,
                        DcRpcClient* value)
{
	DcRpcClient* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_application_get_rpc (self);
	if (old_value != value) {
		DcRpcClient* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_rpc);
		self->priv->_rpc = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_application_properties[DC_APPLICATION_RPC_PROPERTY]);
	}
}

static GObject *
dc_application_constructor (GType type,
                            guint n_construct_properties,
                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DcApplication * self;
	DcRpcClient* _tmp0_;
	DcRpcClient* _tmp1_;
	parent_class = G_OBJECT_CLASS (dc_application_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_APPLICATION, DcApplication);
	_tmp0_ = dc_rpc_client_new ();
	_tmp1_ = _tmp0_;
	dc_application_set_rpc (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	return obj;
}

static void
dc_application_class_init (DcApplicationClass * klass,
                           gpointer klass_data)
{
	dc_application_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcApplication_private_offset);
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) dc_application_real_activate;
	((GApplicationClass *) klass)->startup = (void (*) (GApplication*)) dc_application_real_startup;
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_application_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_application_set_property;
	G_OBJECT_CLASS (klass)->constructor = dc_application_constructor;
	G_OBJECT_CLASS (klass)->finalize = dc_application_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_APPLICATION_RPC_PROPERTY, dc_application_properties[DC_APPLICATION_RPC_PROPERTY] = g_param_spec_object ("rpc", "rpc", "rpc", DC_TYPE_RPC_CLIENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dc_application_instance_init (DcApplication * self,
                              gpointer klass)
{
	self->priv = dc_application_get_instance_private (self);
}

static void
dc_application_finalize (GObject * obj)
{
	DcApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_APPLICATION, DcApplication);
	_g_object_unref0 (self->priv->_rpc);
	G_OBJECT_CLASS (dc_application_parent_class)->finalize (obj);
}

static GType
dc_application_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcApplication), 0, (GInstanceInitFunc) dc_application_instance_init, NULL };
	GType dc_application_type_id;
	dc_application_type_id = g_type_register_static (adw_application_get_type (), "DcApplication", &g_define_type_info, 0);
	DcApplication_private_offset = g_type_add_instance_private (dc_application_type_id, sizeof (DcApplicationPrivate));
	return dc_application_type_id;
}

GType
dc_application_get_type (void)
{
	static volatile gsize dc_application_type_id__once = 0;
	if (g_once_init_enter (&dc_application_type_id__once)) {
		GType dc_application_type_id;
		dc_application_type_id = dc_application_get_type_once ();
		g_once_init_leave (&dc_application_type_id__once, dc_application_type_id);
	}
	return dc_application_type_id__once;
}

static void
_vala_dc_application_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	DcApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_APPLICATION, DcApplication);
	switch (property_id) {
		case DC_APPLICATION_RPC_PROPERTY:
		g_value_set_object (value, dc_application_get_rpc (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_application_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	DcApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_APPLICATION, DcApplication);
	switch (property_id) {
		case DC_APPLICATION_RPC_PROPERTY:
		dc_application_set_rpc (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

