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

/* -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-*/
/*
* Copyright (c) 2011-2017 elementary LLC. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 3, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gobject/gvaluecollector.h>

#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 TERMINAL_TYPE_DBUS (terminal_dbus_get_type ())
#define TERMINAL_DBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TERMINAL_TYPE_DBUS, TerminalDBus))
#define TERMINAL_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TERMINAL_TYPE_DBUS, TerminalDBusClass))
#define TERMINAL_IS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TERMINAL_TYPE_DBUS))
#define TERMINAL_IS_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TERMINAL_TYPE_DBUS))
#define TERMINAL_DBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TERMINAL_TYPE_DBUS, TerminalDBusClass))

typedef struct _TerminalDBus TerminalDBus;
typedef struct _TerminalDBusClass TerminalDBusClass;
typedef struct _TerminalDBusPrivate TerminalDBusPrivate;
typedef struct _TerminalParamSpecDBus TerminalParamSpecDBus;
enum  {
	TERMINAL_DBUS_FINISHED_PROCESS_SIGNAL,
	TERMINAL_DBUS_ATTENTION_REQUESTED_SIGNAL,
	TERMINAL_DBUS_NUM_SIGNALS
};
static guint terminal_dbus_signals[TERMINAL_DBUS_NUM_SIGNALS] = {0};
#define _g_free0(var) (var = (g_free (var), NULL))

struct _TerminalDBus {
	GTypeInstance parent_instance;
	volatile int ref_count;
	TerminalDBusPrivate * priv;
};

struct _TerminalDBusClass {
	GTypeClass parent_class;
	void (*finalize) (TerminalDBus *self);
};

struct _TerminalParamSpecDBus {
	GParamSpec parent_instance;
};

static gpointer terminal_dbus_parent_class = NULL;

VALA_EXTERN gpointer terminal_dbus_ref (gpointer instance);
VALA_EXTERN void terminal_dbus_unref (gpointer instance);
VALA_EXTERN GParamSpec* terminal_param_spec_dbus (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags);
VALA_EXTERN void terminal_value_set_dbus (GValue* value,
                              gpointer v_object);
VALA_EXTERN void terminal_value_take_dbus (GValue* value,
                               gpointer v_object);
VALA_EXTERN gpointer terminal_value_get_dbus (const GValue* value);
VALA_EXTERN GType terminal_dbus_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TerminalDBus, terminal_dbus_unref)
VALA_EXTERN guint terminal_dbus_register_object (void* object,
                                     GDBusConnection* connection,
                                     const gchar* path,
                                     GError** error);
VALA_EXTERN TerminalDBus* terminal_dbus_new (void);
VALA_EXTERN TerminalDBus* terminal_dbus_construct (GType object_type);
VALA_EXTERN void terminal_dbus_process_finished (TerminalDBus* self,
                                     const gchar* terminal_id,
                                     const gchar* process,
                                     gint exit_status,
                                     GError** error);
VALA_EXTERN void terminal_dbus_request_attention (TerminalDBus* self,
                                      const gchar* terminal_id,
                                      const gchar* message,
                                      GError** error);
static void g_cclosure_user_marshal_VOID__STRING_STRING_INT (GClosure * closure,
                                                      GValue * return_value,
                                                      guint n_param_values,
                                                      const GValue * param_values,
                                                      gpointer invocation_hint,
                                                      gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void terminal_dbus_finalize (TerminalDBus * obj);
static GType terminal_dbus_get_type_once (void);
static void _dbus_terminal_dbus_process_finished (TerminalDBus* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation);
static void _dbus_terminal_dbus_request_attention (TerminalDBus* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void terminal_dbus_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* terminal_dbus_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 gboolean terminal_dbus_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 _terminal_dbus_unregister_object (gpointer user_data);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _terminal_dbus_dbus_arg_info_process_finished_terminal_id = {-1, "terminal_id", "s", NULL};
static const GDBusArgInfo _terminal_dbus_dbus_arg_info_process_finished_process = {-1, "process", "s", NULL};
static const GDBusArgInfo _terminal_dbus_dbus_arg_info_process_finished_exit_status = {-1, "exit_status", "i", NULL};
static const GDBusArgInfo * const _terminal_dbus_dbus_arg_info_process_finished_in[] = {&_terminal_dbus_dbus_arg_info_process_finished_terminal_id, &_terminal_dbus_dbus_arg_info_process_finished_process, &_terminal_dbus_dbus_arg_info_process_finished_exit_status, NULL};
static const GDBusArgInfo * const _terminal_dbus_dbus_arg_info_process_finished_out[] = {NULL};
static const GDBusMethodInfo _terminal_dbus_dbus_method_info_process_finished = {-1, "ProcessFinished", (GDBusArgInfo **) (&_terminal_dbus_dbus_arg_info_process_finished_in), (GDBusArgInfo **) (&_terminal_dbus_dbus_arg_info_process_finished_out), NULL};
static const GDBusArgInfo _terminal_dbus_dbus_arg_info_request_attention_terminal_id = {-1, "terminal_id", "s", NULL};
static const GDBusArgInfo _terminal_dbus_dbus_arg_info_request_attention_message = {-1, "message", "s", NULL};
static const GDBusArgInfo * const _terminal_dbus_dbus_arg_info_request_attention_in[] = {&_terminal_dbus_dbus_arg_info_request_attention_terminal_id, &_terminal_dbus_dbus_arg_info_request_attention_message, NULL};
static const GDBusArgInfo * const _terminal_dbus_dbus_arg_info_request_attention_out[] = {NULL};
static const GDBusMethodInfo _terminal_dbus_dbus_method_info_request_attention = {-1, "RequestAttention", (GDBusArgInfo **) (&_terminal_dbus_dbus_arg_info_request_attention_in), (GDBusArgInfo **) (&_terminal_dbus_dbus_arg_info_request_attention_out), NULL};
static const GDBusMethodInfo * const _terminal_dbus_dbus_method_info[] = {&_terminal_dbus_dbus_method_info_process_finished, &_terminal_dbus_dbus_method_info_request_attention, NULL};
static const GDBusSignalInfo * const _terminal_dbus_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _terminal_dbus_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _terminal_dbus_dbus_interface_info = {-1, "io.elementary.terminal", (GDBusMethodInfo **) (&_terminal_dbus_dbus_method_info), (GDBusSignalInfo **) (&_terminal_dbus_dbus_signal_info), (GDBusPropertyInfo **) (&_terminal_dbus_dbus_property_info), NULL};
static const GDBusInterfaceVTable _terminal_dbus_dbus_interface_vtable = {terminal_dbus_dbus_interface_method_call, terminal_dbus_dbus_interface_get_property, terminal_dbus_dbus_interface_set_property};

TerminalDBus*
terminal_dbus_construct (GType object_type)
{
	TerminalDBus* self = NULL;
	self = (TerminalDBus*) g_type_create_instance (object_type);
	return self;
}

TerminalDBus*
terminal_dbus_new (void)
{
	return terminal_dbus_construct (TERMINAL_TYPE_DBUS);
}

void
terminal_dbus_process_finished (TerminalDBus* self,
                                const gchar* terminal_id,
                                const gchar* process,
                                gint exit_status,
                                GError** error)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (terminal_id != NULL);
	g_return_if_fail (process != NULL);
	g_signal_emit (self, terminal_dbus_signals[TERMINAL_DBUS_FINISHED_PROCESS_SIGNAL], 0, terminal_id, process, exit_status);
}

void
terminal_dbus_request_attention (TerminalDBus* self,
                                 const gchar* terminal_id,
                                 const gchar* message,
                                 GError** error)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (terminal_id != NULL);
	g_return_if_fail (message != NULL);
	g_signal_emit (self, terminal_dbus_signals[TERMINAL_DBUS_ATTENTION_REQUESTED_SIGNAL], 0, terminal_id, message);
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING_INT (GClosure * closure,
                                                 GValue * return_value,
                                                 guint n_param_values,
                                                 const GValue * param_values,
                                                 gpointer invocation_hint,
                                                 gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING_INT) (gpointer data1, const char* arg_1, const char* arg_2, gint arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	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__STRING_STRING_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_int (param_values + 3), data2);
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING 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__STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), data2);
}

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

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

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

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

static gchar*
terminal_value_dbus_collect_value (GValue* value,
                                   guint n_collect_values,
                                   GTypeCValue* collect_values,
                                   guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		TerminalDBus * 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 = terminal_dbus_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
terminal_value_dbus_lcopy_value (const GValue* value,
                                 guint n_collect_values,
                                 GTypeCValue* collect_values,
                                 guint collect_flags)
{
	TerminalDBus ** 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 = terminal_dbus_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
terminal_param_spec_dbus (const gchar* name,
                          const gchar* nick,
                          const gchar* blurb,
                          GType object_type,
                          GParamFlags flags)
{
	TerminalParamSpecDBus* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TERMINAL_TYPE_DBUS), 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
terminal_value_get_dbus (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TERMINAL_TYPE_DBUS), NULL);
	return value->data[0].v_pointer;
}

void
terminal_value_set_dbus (GValue* value,
                         gpointer v_object)
{
	TerminalDBus * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TERMINAL_TYPE_DBUS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TERMINAL_TYPE_DBUS));
		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;
		terminal_dbus_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		terminal_dbus_unref (old);
	}
}

void
terminal_value_take_dbus (GValue* value,
                          gpointer v_object)
{
	TerminalDBus * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TERMINAL_TYPE_DBUS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TERMINAL_TYPE_DBUS));
		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) {
		terminal_dbus_unref (old);
	}
}

static void
terminal_dbus_class_init (TerminalDBusClass * klass,
                          gpointer klass_data)
{
	terminal_dbus_parent_class = g_type_class_peek_parent (klass);
	((TerminalDBusClass *) klass)->finalize = terminal_dbus_finalize;
	terminal_dbus_signals[TERMINAL_DBUS_FINISHED_PROCESS_SIGNAL] = g_signal_new ("finished-process", TERMINAL_TYPE_DBUS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_INT, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
	terminal_dbus_signals[TERMINAL_DBUS_ATTENTION_REQUESTED_SIGNAL] = g_signal_new ("attention-requested", TERMINAL_TYPE_DBUS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
}

static void
terminal_dbus_instance_init (TerminalDBus * self,
                             gpointer klass)
{
	self->ref_count = 1;
}

static void
terminal_dbus_finalize (TerminalDBus * obj)
{
	TerminalDBus * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TERMINAL_TYPE_DBUS, TerminalDBus);
	g_signal_handlers_destroy (self);
}

static GType
terminal_dbus_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { terminal_value_dbus_init, terminal_value_dbus_free_value, terminal_value_dbus_copy_value, terminal_value_dbus_peek_pointer, "p", terminal_value_dbus_collect_value, "p", terminal_value_dbus_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (TerminalDBusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) terminal_dbus_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TerminalDBus), 0, (GInstanceInitFunc) terminal_dbus_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 terminal_dbus_type_id;
	terminal_dbus_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TerminalDBus", &g_define_type_info, &g_define_type_fundamental_info, 0);
	g_type_set_qdata (terminal_dbus_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) terminal_dbus_register_object);
	return terminal_dbus_type_id;
}

GType
terminal_dbus_get_type (void)
{
	static volatile gsize terminal_dbus_type_id__once = 0;
	if (g_once_init_enter (&terminal_dbus_type_id__once)) {
		GType terminal_dbus_type_id;
		terminal_dbus_type_id = terminal_dbus_get_type_once ();
		g_once_init_leave (&terminal_dbus_type_id__once, terminal_dbus_type_id);
	}
	return terminal_dbus_type_id__once;
}

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

void
terminal_dbus_unref (gpointer instance)
{
	TerminalDBus * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		TERMINAL_DBUS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_dbus_terminal_dbus_process_finished (TerminalDBus* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* terminal_id = NULL;
	GVariant* _tmp0_;
	gchar* process = NULL;
	GVariant* _tmp1_;
	gint exit_status = 0;
	GVariant* _tmp2_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	terminal_id = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	process = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	exit_status = g_variant_get_int32 (_tmp2_);
	g_variant_unref (_tmp2_);
	terminal_dbus_process_finished (self, terminal_id, process, exit_status, &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 (terminal_id);
	_g_free0 (process);
	;
}

static void
_dbus_terminal_dbus_request_attention (TerminalDBus* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* terminal_id = NULL;
	GVariant* _tmp3_;
	gchar* message = NULL;
	GVariant* _tmp4_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	terminal_id = g_variant_dup_string (_tmp3_, NULL);
	g_variant_unref (_tmp3_);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	message = g_variant_dup_string (_tmp4_, NULL);
	g_variant_unref (_tmp4_);
	terminal_dbus_request_attention (self, terminal_id, message, &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 (terminal_id);
	_g_free0 (message);
	;
}

static void
terminal_dbus_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, "ProcessFinished") == 0) {
		_dbus_terminal_dbus_process_finished (object, parameters, invocation);
	} else if (strcmp (method_name, "RequestAttention") == 0) {
		_dbus_terminal_dbus_request_attention (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
terminal_dbus_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)
{
	return NULL;
}

static gboolean
terminal_dbus_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;
}

guint
terminal_dbus_register_object (gpointer object,
                               GDBusConnection* connection,
                               const gchar* path,
                               GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = terminal_dbus_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_terminal_dbus_dbus_interface_info), &_terminal_dbus_dbus_interface_vtable, data, _terminal_dbus_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_terminal_dbus_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	terminal_dbus_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

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

