/* DBusInterfaces.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from DBusInterfaces.vala, do not modify */

/*
 * This file is part of budgie-desktop
 *
 * Copyright Budgie Desktop Developers
 *
 * 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 2 of the License, or
 * (at your option) any later version.
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <string.h>
#include "userindicator.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

#define TYPE_POWER_DIALOG_INTERFACE (power_dialog_interface_get_type ())
#define POWER_DIALOG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_POWER_DIALOG_INTERFACE, PowerDialogInterface))
#define IS_POWER_DIALOG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_POWER_DIALOG_INTERFACE))
#define POWER_DIALOG_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_POWER_DIALOG_INTERFACE, PowerDialogInterfaceIface))

typedef struct _PowerDialogInterface PowerDialogInterface;
typedef struct _PowerDialogInterfaceIface PowerDialogInterfaceIface;

#define TYPE_POWER_DIALOG_INTERFACE_PROXY (power_dialog_interface_proxy_get_type ())
typedef GDBusProxy PowerDialogInterfaceProxy;
typedef GDBusProxyClass PowerDialogInterfaceProxyClass;

struct _PowerDialogInterfaceIface {
	GTypeInterface parent_iface;
	void (*Toggle) (PowerDialogInterface* self, GError** error);
};

static GType power_dialog_interface_type_id = 0;

VALA_EXTERN GType power_dialog_interface_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void power_dialog_interface_proxy_register_dynamic_type (GTypeModule* module);
VALA_EXTERN guint power_dialog_interface_register_object (void* object,
                                              GDBusConnection* connection,
                                              const gchar* path,
                                              GError** error);
GType power_dialog_interface_register_type (GTypeModule * module);
VALA_EXTERN GType power_dialog_interface_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void power_dialog_interface_Toggle (PowerDialogInterface* self,
                                    GError** error);
static void power_dialog_interface_proxy_g_signal (GDBusProxy* proxy,
                                            const gchar* sender_name,
                                            const gchar* signal_name,
                                            GVariant* parameters);
static void power_dialog_interface_proxy_Toggle (PowerDialogInterface* self,
                                          GError** error);
static void power_dialog_interface_proxy_power_dialog_interface_interface_init (PowerDialogInterfaceIface* iface);
static void _dbus_power_dialog_interface_Toggle (PowerDialogInterface* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation);
static void power_dialog_interface_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* power_dialog_interface_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 power_dialog_interface_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 _power_dialog_interface_unregister_object (gpointer user_data);

static const GDBusArgInfo * const _power_dialog_interface_dbus_arg_info_Toggle_in[] = {NULL};
static const GDBusArgInfo * const _power_dialog_interface_dbus_arg_info_Toggle_out[] = {NULL};
static const GDBusMethodInfo _power_dialog_interface_dbus_method_info_Toggle = {-1, "Toggle", (GDBusArgInfo **) (&_power_dialog_interface_dbus_arg_info_Toggle_in), (GDBusArgInfo **) (&_power_dialog_interface_dbus_arg_info_Toggle_out), NULL};
static const GDBusMethodInfo * const _power_dialog_interface_dbus_method_info[] = {&_power_dialog_interface_dbus_method_info_Toggle, NULL};
static const GDBusSignalInfo * const _power_dialog_interface_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _power_dialog_interface_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _power_dialog_interface_dbus_interface_info = {-1, "org.buddiesofbudgie.PowerDialog", (GDBusMethodInfo **) (&_power_dialog_interface_dbus_method_info), (GDBusSignalInfo **) (&_power_dialog_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_power_dialog_interface_dbus_property_info), NULL};
static const GDBusInterfaceVTable _power_dialog_interface_dbus_interface_vtable = {power_dialog_interface_dbus_interface_method_call, power_dialog_interface_dbus_interface_get_property, power_dialog_interface_dbus_interface_set_property};

void
power_dialog_interface_Toggle (PowerDialogInterface* self,
                               GError** error)
{
	PowerDialogInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = POWER_DIALOG_INTERFACE_GET_INTERFACE (self);
	if (_iface_->Toggle) {
		_iface_->Toggle (self, error);
	}
}

static void
power_dialog_interface_default_init (PowerDialogInterfaceIface * iface,
                                     gpointer iface_data)
{
}

GType
power_dialog_interface_get_type (void)
{
	return power_dialog_interface_type_id;
}

GType
power_dialog_interface_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (PowerDialogInterfaceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) power_dialog_interface_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	power_dialog_interface_type_id = g_type_module_register_type (module, G_TYPE_INTERFACE, "PowerDialogInterface", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (power_dialog_interface_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (power_dialog_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) power_dialog_interface_proxy_get_type);
	g_type_set_qdata (power_dialog_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.buddiesofbudgie.PowerDialog");
	g_type_set_qdata (power_dialog_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_power_dialog_interface_dbus_interface_info));
	g_type_set_qdata (power_dialog_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) power_dialog_interface_register_object);
	return power_dialog_interface_type_id;
}

G_DEFINE_DYNAMIC_TYPE_EXTENDED (PowerDialogInterfaceProxy, power_dialog_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE_DYNAMIC (TYPE_POWER_DIALOG_INTERFACE, power_dialog_interface_proxy_power_dialog_interface_interface_init) )
static void
power_dialog_interface_proxy_class_init (PowerDialogInterfaceProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = power_dialog_interface_proxy_g_signal;
}

static void
power_dialog_interface_proxy_g_signal (GDBusProxy* proxy,
                                       const gchar* sender_name,
                                       const gchar* signal_name,
                                       GVariant* parameters)
{
}

static void
power_dialog_interface_proxy_class_finalize (PowerDialogInterfaceProxyClass* klass)
{
}

void
power_dialog_interface_proxy_register_dynamic_type (GTypeModule* module)
{
	power_dialog_interface_proxy_register_type (module);
}

static void
power_dialog_interface_proxy_init (PowerDialogInterfaceProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_power_dialog_interface_dbus_interface_info));
}

static void
power_dialog_interface_proxy_Toggle (PowerDialogInterface* self,
                                     GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.buddiesofbudgie.PowerDialog", "Toggle");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
power_dialog_interface_proxy_power_dialog_interface_interface_init (PowerDialogInterfaceIface* iface)
{
	iface->Toggle = power_dialog_interface_proxy_Toggle;
}

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

static void
power_dialog_interface_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, "Toggle") == 0) {
		_dbus_power_dialog_interface_Toggle (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
power_dialog_interface_dbus_interface_get_property (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* property_name,
                                                    GError** error,
                                                    gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
power_dialog_interface_dbus_interface_set_property (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* property_name,
                                                    GVariant* value,
                                                    GError** error,
                                                    gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

guint
power_dialog_interface_register_object (gpointer object,
                                        GDBusConnection* connection,
                                        const gchar* path,
                                        GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_power_dialog_interface_dbus_interface_info), &_power_dialog_interface_dbus_interface_vtable, data, _power_dialog_interface_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

