/* dbus.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from dbus.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 "budgie-windowing.h"
#include <glib.h>
#include <gio/gio.h>
#include <string.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

typedef GDBusProxy BudgieWindowingNotificationDispatcherProxy;
typedef GDBusProxyClass BudgieWindowingNotificationDispatcherProxyClass;

static GType budgie_windowing_notification_dispatcher_get_type_once (void);
static void budgie_windowing_notification_dispatcher_proxy_g_signal (GDBusProxy* proxy,
                                                              const gchar* sender_name,
                                                              const gchar* signal_name,
                                                              GVariant* parameters);
static gboolean budgie_windowing_notification_dispatcher_dbus_proxy_get_notifications_paused (BudgieWindowingNotificationDispatcher* self);
static void budgie_windowing_notification_dispatcher_dbus_proxy_set_notifications_paused (BudgieWindowingNotificationDispatcher* self,
                                                                                   gboolean value);
static void budgie_windowing_notification_dispatcher_proxy_budgie_windowing_notification_dispatcher_interface_init (BudgieWindowingNotificationDispatcherIface* iface);
static void budgie_windowing_notification_dispatcher_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* budgie_windowing_notification_dispatcher_dbus_interface_get_property (GDBusConnection* connection,
                                                                                const gchar* sender,
                                                                                const gchar* object_path,
                                                                                const gchar* interface_name,
                                                                                const gchar* property_name,
                                                                                GError** error,
                                                                                gpointer user_data);
static GVariant* _dbus_budgie_windowing_notification_dispatcher_get_notifications_paused (BudgieWindowingNotificationDispatcher* self);
static gboolean budgie_windowing_notification_dispatcher_dbus_interface_set_property (GDBusConnection* connection,
                                                                               const gchar* sender,
                                                                               const gchar* object_path,
                                                                               const gchar* interface_name,
                                                                               const gchar* property_name,
                                                                               GVariant* value,
                                                                               GError** error,
                                                                               gpointer user_data);
static void _dbus_budgie_windowing_notification_dispatcher_set_notifications_paused (BudgieWindowingNotificationDispatcher* self,
                                                                              GVariant* _value);
static void _budgie_windowing_notification_dispatcher_unregister_object (gpointer user_data);

static const GDBusMethodInfo * const _budgie_windowing_notification_dispatcher_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _budgie_windowing_notification_dispatcher_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _budgie_windowing_notification_dispatcher_dbus_property_info_notifications_paused = {-1, "NotificationsPaused", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo * const _budgie_windowing_notification_dispatcher_dbus_property_info[] = {&_budgie_windowing_notification_dispatcher_dbus_property_info_notifications_paused, NULL};
static const GDBusInterfaceInfo _budgie_windowing_notification_dispatcher_dbus_interface_info = {-1, "org.buddiesofbudgie.budgie.Dispatcher", (GDBusMethodInfo **) (&_budgie_windowing_notification_dispatcher_dbus_method_info), (GDBusSignalInfo **) (&_budgie_windowing_notification_dispatcher_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_windowing_notification_dispatcher_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_windowing_notification_dispatcher_dbus_interface_vtable = {budgie_windowing_notification_dispatcher_dbus_interface_method_call, budgie_windowing_notification_dispatcher_dbus_interface_get_property, budgie_windowing_notification_dispatcher_dbus_interface_set_property};

gboolean
budgie_windowing_notification_dispatcher_get_notifications_paused (BudgieWindowingNotificationDispatcher* self)
{
	BudgieWindowingNotificationDispatcherIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BUDGIE_WINDOWING_NOTIFICATION_DISPATCHER_GET_INTERFACE (self);
	if (_iface_->get_notifications_paused) {
		return _iface_->get_notifications_paused (self);
	}
	return FALSE;
}

void
budgie_windowing_notification_dispatcher_set_notifications_paused (BudgieWindowingNotificationDispatcher* self,
                                                                   gboolean value)
{
	BudgieWindowingNotificationDispatcherIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BUDGIE_WINDOWING_NOTIFICATION_DISPATCHER_GET_INTERFACE (self);
	if (_iface_->set_notifications_paused) {
		_iface_->set_notifications_paused (self, value);
	}
}

static void
budgie_windowing_notification_dispatcher_default_init (BudgieWindowingNotificationDispatcherIface * iface,
                                                       gpointer iface_data)
{
}

static GType
budgie_windowing_notification_dispatcher_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieWindowingNotificationDispatcherIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_windowing_notification_dispatcher_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType budgie_windowing_notification_dispatcher_type_id;
	budgie_windowing_notification_dispatcher_type_id = g_type_register_static (G_TYPE_INTERFACE, "BudgieWindowingNotificationDispatcher", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (budgie_windowing_notification_dispatcher_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (budgie_windowing_notification_dispatcher_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) budgie_windowing_notification_dispatcher_proxy_get_type);
	g_type_set_qdata (budgie_windowing_notification_dispatcher_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.buddiesofbudgie.budgie.Dispatcher");
	g_type_set_qdata (budgie_windowing_notification_dispatcher_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_budgie_windowing_notification_dispatcher_dbus_interface_info));
	g_type_set_qdata (budgie_windowing_notification_dispatcher_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_windowing_notification_dispatcher_register_object);
	return budgie_windowing_notification_dispatcher_type_id;
}

GType
budgie_windowing_notification_dispatcher_get_type (void)
{
	static volatile gsize budgie_windowing_notification_dispatcher_type_id__once = 0;
	if (g_once_init_enter (&budgie_windowing_notification_dispatcher_type_id__once)) {
		GType budgie_windowing_notification_dispatcher_type_id;
		budgie_windowing_notification_dispatcher_type_id = budgie_windowing_notification_dispatcher_get_type_once ();
		g_once_init_leave (&budgie_windowing_notification_dispatcher_type_id__once, budgie_windowing_notification_dispatcher_type_id);
	}
	return budgie_windowing_notification_dispatcher_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (BudgieWindowingNotificationDispatcherProxy, budgie_windowing_notification_dispatcher_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (BUDGIE_WINDOWING_TYPE_NOTIFICATION_DISPATCHER, budgie_windowing_notification_dispatcher_proxy_budgie_windowing_notification_dispatcher_interface_init) )
static void
budgie_windowing_notification_dispatcher_proxy_class_init (BudgieWindowingNotificationDispatcherProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = budgie_windowing_notification_dispatcher_proxy_g_signal;
}

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

static void
budgie_windowing_notification_dispatcher_proxy_init (BudgieWindowingNotificationDispatcherProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_budgie_windowing_notification_dispatcher_dbus_interface_info));
}

static gboolean
budgie_windowing_notification_dispatcher_dbus_proxy_get_notifications_paused (BudgieWindowingNotificationDispatcher* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "NotificationsPaused");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.buddiesofbudgie.budgie.Dispatcher"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("NotificationsPaused"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp0_ = FALSE;
			return _tmp0_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
budgie_windowing_notification_dispatcher_dbus_proxy_set_notifications_paused (BudgieWindowingNotificationDispatcher* self,
                                                                              gboolean value)
{
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.buddiesofbudgie.budgie.Dispatcher"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("NotificationsPaused"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}

static void
budgie_windowing_notification_dispatcher_proxy_budgie_windowing_notification_dispatcher_interface_init (BudgieWindowingNotificationDispatcherIface* iface)
{
	iface->get_notifications_paused = budgie_windowing_notification_dispatcher_dbus_proxy_get_notifications_paused;
	iface->set_notifications_paused = budgie_windowing_notification_dispatcher_dbus_proxy_set_notifications_paused;
}

static void
budgie_windowing_notification_dispatcher_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];
	g_object_unref (invocation);
}

static GVariant*
_dbus_budgie_windowing_notification_dispatcher_get_notifications_paused (BudgieWindowingNotificationDispatcher* self)
{
	gboolean result;
	GVariant* _reply;
	result = budgie_windowing_notification_dispatcher_get_notifications_paused (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

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

static void
_dbus_budgie_windowing_notification_dispatcher_set_notifications_paused (BudgieWindowingNotificationDispatcher* self,
                                                                         GVariant* _value)
{
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	budgie_windowing_notification_dispatcher_set_notifications_paused (self, value);
}

static gboolean
budgie_windowing_notification_dispatcher_dbus_interface_set_property (GDBusConnection* connection,
                                                                      const gchar* sender,
                                                                      const gchar* object_path,
                                                                      const gchar* interface_name,
                                                                      const gchar* property_name,
                                                                      GVariant* value,
                                                                      GError** error,
                                                                      gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "NotificationsPaused") == 0) {
		_dbus_budgie_windowing_notification_dispatcher_set_notifications_paused (object, value);
		return TRUE;
	}
	return FALSE;
}

guint
budgie_windowing_notification_dispatcher_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 *) (&_budgie_windowing_notification_dispatcher_dbus_interface_info), &_budgie_windowing_notification_dispatcher_dbus_interface_vtable, data, _budgie_windowing_notification_dispatcher_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_budgie_windowing_notification_dispatcher_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);
}

