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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "planify.h"

#define COLOR_SCHEME_SETTINGS_PORTAL_DBUS_DESKTOP_PATH "/org/freedesktop/portal/desktop"
#define COLOR_SCHEME_SETTINGS_PORTAL_DBUS_DESKTOP_NAME "org.freedesktop.portal.Desktop"
#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 COLOR_SCHEME_SETTINGS_FDO_TYPE_ACCOUNTS (color_scheme_settings_fdo_accounts_get_type ())
#define COLOR_SCHEME_SETTINGS_FDO_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLOR_SCHEME_SETTINGS_FDO_TYPE_ACCOUNTS, ColorSchemeSettingsFDOAccounts))
#define COLOR_SCHEME_SETTINGS_FDO_IS_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLOR_SCHEME_SETTINGS_FDO_TYPE_ACCOUNTS))
#define COLOR_SCHEME_SETTINGS_FDO_ACCOUNTS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), COLOR_SCHEME_SETTINGS_FDO_TYPE_ACCOUNTS, ColorSchemeSettingsFDOAccountsIface))

typedef struct _ColorSchemeSettingsFDOAccounts ColorSchemeSettingsFDOAccounts;
typedef struct _ColorSchemeSettingsFDOAccountsIface ColorSchemeSettingsFDOAccountsIface;

#define COLOR_SCHEME_SETTINGS_FDO_TYPE_ACCOUNTS_PROXY (color_scheme_settings_fdo_accounts_proxy_get_type ())
typedef GDBusProxy ColorSchemeSettingsFDOAccountsProxy;
typedef GDBusProxyClass ColorSchemeSettingsFDOAccountsProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS (color_scheme_settings_portal_settings_get_type ())
#define COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS, ColorSchemeSettingsPortalSettings))
#define COLOR_SCHEME_SETTINGS_PORTAL_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS))
#define COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS, ColorSchemeSettingsPortalSettingsIface))

typedef struct _ColorSchemeSettingsPortalSettings ColorSchemeSettingsPortalSettings;
typedef struct _ColorSchemeSettingsPortalSettingsIface ColorSchemeSettingsPortalSettingsIface;

#define COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS_PROXY (color_scheme_settings_portal_settings_proxy_get_type ())
enum  {
	COLOR_SCHEME_SETTINGS_SETTINGS_0_PROPERTY,
	COLOR_SCHEME_SETTINGS_SETTINGS_PREFERS_COLOR_SCHEME_PROPERTY,
	COLOR_SCHEME_SETTINGS_SETTINGS_NUM_PROPERTIES
};
static GParamSpec* color_scheme_settings_settings_properties[COLOR_SCHEME_SETTINGS_SETTINGS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_SETTING_CHANGED_SIGNAL,
	COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_NUM_SIGNALS
};
static guint color_scheme_settings_portal_settings_signals[COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_NUM_SIGNALS] = {0};
typedef GDBusProxy ColorSchemeSettingsPortalSettingsProxy;
typedef GDBusProxyClass ColorSchemeSettingsPortalSettingsProxyClass;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

struct _ColorSchemeSettingsFDOAccountsIface {
	GTypeInterface parent_iface;
	gchar* (*find_user_by_name) (ColorSchemeSettingsFDOAccounts* self, const gchar* username, GError** error);
};

struct _ColorSchemeSettingsPortalSettingsIface {
	GTypeInterface parent_iface;
	GHashTable* (*read_all) (ColorSchemeSettingsPortalSettings* self, gchar** namespaces, gint namespaces_length1, GError** error);
	GVariant* (*read) (ColorSchemeSettingsPortalSettings* self, const gchar* namespace, const gchar* key, GError** error);
};

struct _ColorSchemeSettingsSettingsPrivate {
	ColorSchemeSettingsSettingsColorScheme* _prefers_color_scheme;
	ColorSchemeSettingsPortalSettings* portal;
};

static gint ColorSchemeSettingsSettings_private_offset;
static gpointer color_scheme_settings_settings_parent_class = NULL;
static GOnce color_scheme_settings_settings_instance;
static GOnce color_scheme_settings_settings_instance = G_ONCE_INIT;

VALA_EXTERN GType color_scheme_settings_fdo_accounts_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint color_scheme_settings_fdo_accounts_register_object (void* object,
                                                          GDBusConnection* connection,
                                                          const gchar* path,
                                                          GError** error);
VALA_EXTERN GType color_scheme_settings_fdo_accounts_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* color_scheme_settings_fdo_accounts_find_user_by_name (ColorSchemeSettingsFDOAccounts* self,
                                                             const gchar* username,
                                                             GError** error);
static GType color_scheme_settings_fdo_accounts_get_type_once (void);
static void color_scheme_settings_fdo_accounts_proxy_g_signal (GDBusProxy* proxy,
                                                        const gchar* sender_name,
                                                        const gchar* signal_name,
                                                        GVariant* parameters);
static gchar* color_scheme_settings_fdo_accounts_proxy_find_user_by_name (ColorSchemeSettingsFDOAccounts* self,
                                                                   const gchar* username,
                                                                   GError** error);
static void color_scheme_settings_fdo_accounts_proxy_color_scheme_settings_fdo_accounts_interface_init (ColorSchemeSettingsFDOAccountsIface* iface);
static void _dbus_color_scheme_settings_fdo_accounts_find_user_by_name (ColorSchemeSettingsFDOAccounts* self,
                                                                 GVariant* _parameters_,
                                                                 GDBusMethodInvocation* invocation);
static void color_scheme_settings_fdo_accounts_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* color_scheme_settings_fdo_accounts_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 color_scheme_settings_fdo_accounts_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 _color_scheme_settings_fdo_accounts_unregister_object (gpointer user_data);
VALA_EXTERN GType color_scheme_settings_portal_settings_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint color_scheme_settings_portal_settings_register_object (void* object,
                                                             GDBusConnection* connection,
                                                             const gchar* path,
                                                             GError** error);
VALA_EXTERN GType color_scheme_settings_portal_settings_get_type (void) G_GNUC_CONST ;
static ColorSchemeSettingsSettings* __lambda74_ (void);
static ColorSchemeSettingsSettings* color_scheme_settings_settings_new (void);
static ColorSchemeSettingsSettings* color_scheme_settings_settings_construct (GType object_type);
static gpointer ___lambda74__gthread_func (gpointer self);
static void color_scheme_settings_settings_setup_prefers_color_scheme (ColorSchemeSettingsSettings* self);
VALA_EXTERN ColorSchemeSettingsPortalSettings* color_scheme_settings_portal_settings_get (GError** error);
VALA_EXTERN GVariant* color_scheme_settings_portal_settings_read (ColorSchemeSettingsPortalSettings* self,
                                                      const gchar* namespace,
                                                      const gchar* key,
                                                      GError** error);
static void color_scheme_settings_settings_set_prefers_color_scheme (ColorSchemeSettingsSettings* self,
                                                              ColorSchemeSettingsSettingsColorScheme value);
static void ___lambda75_ (ColorSchemeSettingsSettings* self,
                   const gchar* scheme,
                   const gchar* key,
                   GVariant* value);
static void ____lambda75__color_scheme_settings_portal_settings_setting_changed (ColorSchemeSettingsPortalSettings* _sender,
                                                                          const gchar* namespace,
                                                                          const gchar* key,
                                                                          GVariant* value,
                                                                          gpointer self);
static ColorSchemeSettingsSettingsColorScheme* _color_scheme_settings_settings_color_scheme_dup (ColorSchemeSettingsSettingsColorScheme* self);
static void color_scheme_settings_settings_finalize (GObject * obj);
static GType color_scheme_settings_settings_get_type_once (void);
static void _vala_color_scheme_settings_settings_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_color_scheme_settings_settings_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
VALA_EXTERN GHashTable* color_scheme_settings_portal_settings_read_all (ColorSchemeSettingsPortalSettings* self,
                                                            gchar** namespaces,
                                                            gint namespaces_length1,
                                                            GError** error);
static void g_cclosure_user_marshal_VOID__STRING_STRING_VARIANT (GClosure * closure,
                                                          GValue * return_value,
                                                          guint n_param_values,
                                                          const GValue * param_values,
                                                          gpointer invocation_hint,
                                                          gpointer marshal_data);
static GType color_scheme_settings_portal_settings_get_type_once (void);
static void color_scheme_settings_portal_settings_proxy_g_signal (GDBusProxy* proxy,
                                                           const gchar* sender_name,
                                                           const gchar* signal_name,
                                                           GVariant* parameters);
static void _dbus_handle_color_scheme_settings_portal_settings_setting_changed (ColorSchemeSettingsPortalSettings* self,
                                                                         GVariant* parameters);
static GHashTable* color_scheme_settings_portal_settings_proxy_read_all (ColorSchemeSettingsPortalSettings* self,
                                                                  gchar** namespaces,
                                                                  gint namespaces_length1,
                                                                  GError** error);
static GVariant* color_scheme_settings_portal_settings_proxy_read (ColorSchemeSettingsPortalSettings* self,
                                                            const gchar* namespace,
                                                            const gchar* key,
                                                            GError** error);
static void color_scheme_settings_portal_settings_proxy_color_scheme_settings_portal_settings_interface_init (ColorSchemeSettingsPortalSettingsIface* iface);
static void _dbus_color_scheme_settings_portal_settings_read_all (ColorSchemeSettingsPortalSettings* self,
                                                           GVariant* _parameters_,
                                                           GDBusMethodInvocation* invocation);
static void _dbus_color_scheme_settings_portal_settings_read (ColorSchemeSettingsPortalSettings* self,
                                                       GVariant* _parameters_,
                                                       GDBusMethodInvocation* invocation);
static void color_scheme_settings_portal_settings_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* color_scheme_settings_portal_settings_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 color_scheme_settings_portal_settings_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_color_scheme_settings_portal_settings_setting_changed (GObject* _sender,
                                                                  const gchar* namespace,
                                                                  const gchar* key,
                                                                  GVariant* value,
                                                                  gpointer* _data);
static void _color_scheme_settings_portal_settings_unregister_object (gpointer user_data);
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 const GDBusArgInfo _color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_username = {-1, "username", "s", NULL};
static const GDBusArgInfo _color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_result = {-1, "result", "s", NULL};
static const GDBusArgInfo * const _color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_in[] = {&_color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_username, NULL};
static const GDBusArgInfo * const _color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_out[] = {&_color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_result, NULL};
static const GDBusMethodInfo _color_scheme_settings_fdo_accounts_dbus_method_info_find_user_by_name = {-1, "FindUserByName", (GDBusArgInfo **) (&_color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_in), (GDBusArgInfo **) (&_color_scheme_settings_fdo_accounts_dbus_arg_info_find_user_by_name_out), NULL};
static const GDBusMethodInfo * const _color_scheme_settings_fdo_accounts_dbus_method_info[] = {&_color_scheme_settings_fdo_accounts_dbus_method_info_find_user_by_name, NULL};
static const GDBusSignalInfo * const _color_scheme_settings_fdo_accounts_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _color_scheme_settings_fdo_accounts_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _color_scheme_settings_fdo_accounts_dbus_interface_info = {-1, "org.freedesktop.Accounts", (GDBusMethodInfo **) (&_color_scheme_settings_fdo_accounts_dbus_method_info), (GDBusSignalInfo **) (&_color_scheme_settings_fdo_accounts_dbus_signal_info), (GDBusPropertyInfo **) (&_color_scheme_settings_fdo_accounts_dbus_property_info), NULL};
static const GDBusInterfaceVTable _color_scheme_settings_fdo_accounts_dbus_interface_vtable = {color_scheme_settings_fdo_accounts_dbus_interface_method_call, color_scheme_settings_fdo_accounts_dbus_interface_get_property, color_scheme_settings_fdo_accounts_dbus_interface_set_property};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_read_all_namespaces = {-1, "namespaces", "as", NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_read_all_result = {-1, "result", "a{sa{sv}}", NULL};
static const GDBusArgInfo * const _color_scheme_settings_portal_settings_dbus_arg_info_read_all_in[] = {&_color_scheme_settings_portal_settings_dbus_arg_info_read_all_namespaces, NULL};
static const GDBusArgInfo * const _color_scheme_settings_portal_settings_dbus_arg_info_read_all_out[] = {&_color_scheme_settings_portal_settings_dbus_arg_info_read_all_result, NULL};
static const GDBusMethodInfo _color_scheme_settings_portal_settings_dbus_method_info_read_all = {-1, "ReadAll", (GDBusArgInfo **) (&_color_scheme_settings_portal_settings_dbus_arg_info_read_all_in), (GDBusArgInfo **) (&_color_scheme_settings_portal_settings_dbus_arg_info_read_all_out), NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_read_namespace = {-1, "namespace", "s", NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_read_key = {-1, "key", "s", NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_read_result = {-1, "result", "v", NULL};
static const GDBusArgInfo * const _color_scheme_settings_portal_settings_dbus_arg_info_read_in[] = {&_color_scheme_settings_portal_settings_dbus_arg_info_read_namespace, &_color_scheme_settings_portal_settings_dbus_arg_info_read_key, NULL};
static const GDBusArgInfo * const _color_scheme_settings_portal_settings_dbus_arg_info_read_out[] = {&_color_scheme_settings_portal_settings_dbus_arg_info_read_result, NULL};
static const GDBusMethodInfo _color_scheme_settings_portal_settings_dbus_method_info_read = {-1, "Read", (GDBusArgInfo **) (&_color_scheme_settings_portal_settings_dbus_arg_info_read_in), (GDBusArgInfo **) (&_color_scheme_settings_portal_settings_dbus_arg_info_read_out), NULL};
static const GDBusMethodInfo * const _color_scheme_settings_portal_settings_dbus_method_info[] = {&_color_scheme_settings_portal_settings_dbus_method_info_read_all, &_color_scheme_settings_portal_settings_dbus_method_info_read, NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_setting_changed_namespace = {-1, "namespace", "s", NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_setting_changed_key = {-1, "key", "s", NULL};
static const GDBusArgInfo _color_scheme_settings_portal_settings_dbus_arg_info_setting_changed_value = {-1, "value", "v", NULL};
static const GDBusArgInfo * const _color_scheme_settings_portal_settings_dbus_arg_info_setting_changed[] = {&_color_scheme_settings_portal_settings_dbus_arg_info_setting_changed_namespace, &_color_scheme_settings_portal_settings_dbus_arg_info_setting_changed_key, &_color_scheme_settings_portal_settings_dbus_arg_info_setting_changed_value, NULL};
static const GDBusSignalInfo _color_scheme_settings_portal_settings_dbus_signal_info_setting_changed = {-1, "SettingChanged", (GDBusArgInfo **) (&_color_scheme_settings_portal_settings_dbus_arg_info_setting_changed), NULL};
static const GDBusSignalInfo * const _color_scheme_settings_portal_settings_dbus_signal_info[] = {&_color_scheme_settings_portal_settings_dbus_signal_info_setting_changed, NULL};
static const GDBusPropertyInfo * const _color_scheme_settings_portal_settings_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _color_scheme_settings_portal_settings_dbus_interface_info = {-1, "org.freedesktop.portal.Settings", (GDBusMethodInfo **) (&_color_scheme_settings_portal_settings_dbus_method_info), (GDBusSignalInfo **) (&_color_scheme_settings_portal_settings_dbus_signal_info), (GDBusPropertyInfo **) (&_color_scheme_settings_portal_settings_dbus_property_info), NULL};
static const GDBusInterfaceVTable _color_scheme_settings_portal_settings_dbus_interface_vtable = {color_scheme_settings_portal_settings_dbus_interface_method_call, color_scheme_settings_portal_settings_dbus_interface_get_property, color_scheme_settings_portal_settings_dbus_interface_set_property};

gchar*
color_scheme_settings_fdo_accounts_find_user_by_name (ColorSchemeSettingsFDOAccounts* self,
                                                      const gchar* username,
                                                      GError** error)
{
	ColorSchemeSettingsFDOAccountsIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = COLOR_SCHEME_SETTINGS_FDO_ACCOUNTS_GET_INTERFACE (self);
	if (_iface_->find_user_by_name) {
		return _iface_->find_user_by_name (self, username, error);
	}
	return NULL;
}

static void
color_scheme_settings_fdo_accounts_default_init (ColorSchemeSettingsFDOAccountsIface * iface,
                                                 gpointer iface_data)
{
}

static GType
color_scheme_settings_fdo_accounts_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ColorSchemeSettingsFDOAccountsIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) color_scheme_settings_fdo_accounts_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType color_scheme_settings_fdo_accounts_type_id;
	color_scheme_settings_fdo_accounts_type_id = g_type_register_static (G_TYPE_INTERFACE, "ColorSchemeSettingsFDOAccounts", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (color_scheme_settings_fdo_accounts_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (color_scheme_settings_fdo_accounts_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) color_scheme_settings_fdo_accounts_proxy_get_type);
	g_type_set_qdata (color_scheme_settings_fdo_accounts_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.Accounts");
	g_type_set_qdata (color_scheme_settings_fdo_accounts_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_color_scheme_settings_fdo_accounts_dbus_interface_info));
	g_type_set_qdata (color_scheme_settings_fdo_accounts_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) color_scheme_settings_fdo_accounts_register_object);
	return color_scheme_settings_fdo_accounts_type_id;
}

GType
color_scheme_settings_fdo_accounts_get_type (void)
{
	static volatile gsize color_scheme_settings_fdo_accounts_type_id__once = 0;
	if (g_once_init_enter (&color_scheme_settings_fdo_accounts_type_id__once)) {
		GType color_scheme_settings_fdo_accounts_type_id;
		color_scheme_settings_fdo_accounts_type_id = color_scheme_settings_fdo_accounts_get_type_once ();
		g_once_init_leave (&color_scheme_settings_fdo_accounts_type_id__once, color_scheme_settings_fdo_accounts_type_id);
	}
	return color_scheme_settings_fdo_accounts_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (ColorSchemeSettingsFDOAccountsProxy, color_scheme_settings_fdo_accounts_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (COLOR_SCHEME_SETTINGS_FDO_TYPE_ACCOUNTS, color_scheme_settings_fdo_accounts_proxy_color_scheme_settings_fdo_accounts_interface_init) )
static void
color_scheme_settings_fdo_accounts_proxy_class_init (ColorSchemeSettingsFDOAccountsProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = color_scheme_settings_fdo_accounts_proxy_g_signal;
}

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

static void
color_scheme_settings_fdo_accounts_proxy_init (ColorSchemeSettingsFDOAccountsProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_color_scheme_settings_fdo_accounts_dbus_interface_info));
}

static gchar*
color_scheme_settings_fdo_accounts_proxy_find_user_by_name (ColorSchemeSettingsFDOAccounts* self,
                                                            const gchar* username,
                                                            GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar* _result = NULL;
	GVariant* _tmp0_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.Accounts", "FindUserByName");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (username));
	_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 NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp0_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	g_object_unref (_reply_message);
	return _result;
}

static void
color_scheme_settings_fdo_accounts_proxy_color_scheme_settings_fdo_accounts_interface_init (ColorSchemeSettingsFDOAccountsIface* iface)
{
	iface->find_user_by_name = color_scheme_settings_fdo_accounts_proxy_find_user_by_name;
}

static void
_dbus_color_scheme_settings_fdo_accounts_find_user_by_name (ColorSchemeSettingsFDOAccounts* self,
                                                            GVariant* _parameters_,
                                                            GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* username = NULL;
	GVariant* _tmp1_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	username = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	result = color_scheme_settings_fdo_accounts_find_user_by_name (self, username, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result));
	_g_free0 (result);
	_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 (username);
	;
}

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

static GVariant*
color_scheme_settings_fdo_accounts_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
color_scheme_settings_fdo_accounts_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
color_scheme_settings_fdo_accounts_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 *) (&_color_scheme_settings_fdo_accounts_dbus_interface_info), &_color_scheme_settings_fdo_accounts_dbus_interface_vtable, data, _color_scheme_settings_fdo_accounts_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

static inline gpointer
color_scheme_settings_settings_get_instance_private (ColorSchemeSettingsSettings* self)
{
	return G_STRUCT_MEMBER_P (self, ColorSchemeSettingsSettings_private_offset);
}

static GType
color_scheme_settings_settings_color_scheme_get_type_once (void)
{
	static const GEnumValue values[] = {{COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_NO_PREFERENCE, "COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_NO_PREFERENCE", "no-preference"}, {COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_DARK, "COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_DARK", "dark"}, {COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_LIGHT, "COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_LIGHT", "light"}, {0, NULL, NULL}};
	GType color_scheme_settings_settings_color_scheme_type_id;
	color_scheme_settings_settings_color_scheme_type_id = g_enum_register_static ("ColorSchemeSettingsSettingsColorScheme", values);
	return color_scheme_settings_settings_color_scheme_type_id;
}

GType
color_scheme_settings_settings_color_scheme_get_type (void)
{
	static volatile gsize color_scheme_settings_settings_color_scheme_type_id__once = 0;
	if (g_once_init_enter (&color_scheme_settings_settings_color_scheme_type_id__once)) {
		GType color_scheme_settings_settings_color_scheme_type_id;
		color_scheme_settings_settings_color_scheme_type_id = color_scheme_settings_settings_color_scheme_get_type_once ();
		g_once_init_leave (&color_scheme_settings_settings_color_scheme_type_id__once, color_scheme_settings_settings_color_scheme_type_id);
	}
	return color_scheme_settings_settings_color_scheme_type_id__once;
}

static ColorSchemeSettingsSettings*
__lambda74_ (void)
{
	ColorSchemeSettingsSettings* _tmp0_;
	ColorSchemeSettingsSettings* result;
	_tmp0_ = color_scheme_settings_settings_new ();
	result = _tmp0_;
	return result;
}

static gpointer
___lambda74__gthread_func (gpointer self)
{
	gpointer result;
	result = __lambda74_ ();
	return result;
}

ColorSchemeSettingsSettings*
color_scheme_settings_settings_get_default (void)
{
	gconstpointer _tmp0_;
	ColorSchemeSettingsSettings* result;
	_tmp0_ = g_once (&color_scheme_settings_settings_instance, ___lambda74__gthread_func, NULL);
	result = (ColorSchemeSettingsSettings*) _tmp0_;
	return result;
}

static ColorSchemeSettingsSettings*
color_scheme_settings_settings_construct (GType object_type)
{
	ColorSchemeSettingsSettings * self = NULL;
	self = (ColorSchemeSettingsSettings*) g_object_new (object_type, NULL);
	return self;
}

static ColorSchemeSettingsSettings*
color_scheme_settings_settings_new (void)
{
	return color_scheme_settings_settings_construct (COLOR_SCHEME_SETTINGS_TYPE_SETTINGS);
}

static void
___lambda75_ (ColorSchemeSettingsSettings* self,
              const gchar* scheme,
              const gchar* key,
              GVariant* value)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (scheme != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (value != NULL);
	if (g_strcmp0 (scheme, "org.freedesktop.appearance") == 0) {
		_tmp0_ = g_strcmp0 (key, "color-scheme") == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		color_scheme_settings_settings_set_prefers_color_scheme (self, (ColorSchemeSettingsSettingsColorScheme) g_variant_get_uint32 (value));
	}
}

static void
____lambda75__color_scheme_settings_portal_settings_setting_changed (ColorSchemeSettingsPortalSettings* _sender,
                                                                     const gchar* namespace,
                                                                     const gchar* key,
                                                                     GVariant* value,
                                                                     gpointer self)
{
	___lambda75_ ((ColorSchemeSettingsSettings*) self, namespace, key, value);
}

static void
color_scheme_settings_settings_setup_prefers_color_scheme (ColorSchemeSettingsSettings* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		ColorSchemeSettingsPortalSettings* _tmp0_ = NULL;
		ColorSchemeSettingsPortalSettings* _tmp1_;
		ColorSchemeSettingsPortalSettings* _tmp2_;
		GVariant* _tmp3_ = NULL;
		ColorSchemeSettingsPortalSettings* _tmp4_;
		GVariant* _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		ColorSchemeSettingsPortalSettings* _tmp8_;
		_tmp1_ = color_scheme_settings_portal_settings_get (&_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->portal);
		self->priv->portal = _tmp2_;
		_tmp4_ = self->priv->portal;
		_tmp5_ = color_scheme_settings_portal_settings_read (_tmp4_, "org.freedesktop.appearance", "color-scheme", &_inner_error0_);
		_tmp3_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp0_);
			goto __catch0_g_error;
		}
		_tmp6_ = g_variant_get_variant (_tmp3_);
		_tmp7_ = _tmp6_;
		color_scheme_settings_settings_set_prefers_color_scheme (self, (ColorSchemeSettingsSettingsColorScheme) g_variant_get_uint32 (_tmp7_));
		_g_variant_unref0 (_tmp7_);
		_tmp8_ = self->priv->portal;
		g_signal_connect_object (_tmp8_, "setting-changed", (GCallback) ____lambda75__color_scheme_settings_portal_settings_setting_changed, self, 0);
		_g_variant_unref0 (_tmp3_);
		_g_object_unref0 (_tmp0_);
		return;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		g_debug ("ColorSchemeSettings.vala:77: cannot use the portal, using the Accounts" \
"Service: %s", _tmp10_);
		_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;
	}
	color_scheme_settings_settings_set_prefers_color_scheme (self, COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_NO_PREFERENCE);
}

ColorSchemeSettingsSettingsColorScheme
color_scheme_settings_settings_get_prefers_color_scheme (ColorSchemeSettingsSettings* self)
{
	ColorSchemeSettingsSettingsColorScheme result;
	ColorSchemeSettingsSettingsColorScheme* _tmp0_;
	ColorSchemeSettingsSettingsColorScheme* _tmp1_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_prefers_color_scheme;
	if (_tmp0_ == NULL) {
		color_scheme_settings_settings_setup_prefers_color_scheme (self);
	}
	_tmp1_ = self->priv->_prefers_color_scheme;
	result = *_tmp1_;
	return result;
}

static ColorSchemeSettingsSettingsColorScheme*
_color_scheme_settings_settings_color_scheme_dup (ColorSchemeSettingsSettingsColorScheme* self)
{
	ColorSchemeSettingsSettingsColorScheme* dup;
	dup = g_new0 (ColorSchemeSettingsSettingsColorScheme, 1);
	memcpy (dup, self, sizeof (ColorSchemeSettingsSettingsColorScheme));
	return dup;
}

static gpointer
__color_scheme_settings_settings_color_scheme_dup0 (gpointer self)
{
	return self ? _color_scheme_settings_settings_color_scheme_dup (self) : NULL;
}

static void
color_scheme_settings_settings_set_prefers_color_scheme (ColorSchemeSettingsSettings* self,
                                                         ColorSchemeSettingsSettingsColorScheme value)
{
	ColorSchemeSettingsSettingsColorScheme* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = __color_scheme_settings_settings_color_scheme_dup0 (&value);
	_g_free0 (self->priv->_prefers_color_scheme);
	self->priv->_prefers_color_scheme = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, color_scheme_settings_settings_properties[COLOR_SCHEME_SETTINGS_SETTINGS_PREFERS_COLOR_SCHEME_PROPERTY]);
}

static void
color_scheme_settings_settings_class_init (ColorSchemeSettingsSettingsClass * klass,
                                           gpointer klass_data)
{
	color_scheme_settings_settings_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ColorSchemeSettingsSettings_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_color_scheme_settings_settings_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_color_scheme_settings_settings_set_property;
	G_OBJECT_CLASS (klass)->finalize = color_scheme_settings_settings_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), COLOR_SCHEME_SETTINGS_SETTINGS_PREFERS_COLOR_SCHEME_PROPERTY, color_scheme_settings_settings_properties[COLOR_SCHEME_SETTINGS_SETTINGS_PREFERS_COLOR_SCHEME_PROPERTY] = g_param_spec_enum ("prefers-color-scheme", "prefers-color-scheme", "prefers-color-scheme", COLOR_SCHEME_SETTINGS_SETTINGS_TYPE_COLOR_SCHEME, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
color_scheme_settings_settings_instance_init (ColorSchemeSettingsSettings * self,
                                              gpointer klass)
{
	self->priv = color_scheme_settings_settings_get_instance_private (self);
	self->priv->_prefers_color_scheme = NULL;
	self->priv->portal = NULL;
}

static void
color_scheme_settings_settings_finalize (GObject * obj)
{
	ColorSchemeSettingsSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, COLOR_SCHEME_SETTINGS_TYPE_SETTINGS, ColorSchemeSettingsSettings);
	_g_free0 (self->priv->_prefers_color_scheme);
	_g_object_unref0 (self->priv->portal);
	G_OBJECT_CLASS (color_scheme_settings_settings_parent_class)->finalize (obj);
}

static GType
color_scheme_settings_settings_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ColorSchemeSettingsSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) color_scheme_settings_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ColorSchemeSettingsSettings), 0, (GInstanceInitFunc) color_scheme_settings_settings_instance_init, NULL };
	GType color_scheme_settings_settings_type_id;
	color_scheme_settings_settings_type_id = g_type_register_static (G_TYPE_OBJECT, "ColorSchemeSettingsSettings", &g_define_type_info, 0);
	ColorSchemeSettingsSettings_private_offset = g_type_add_instance_private (color_scheme_settings_settings_type_id, sizeof (ColorSchemeSettingsSettingsPrivate));
	return color_scheme_settings_settings_type_id;
}

GType
color_scheme_settings_settings_get_type (void)
{
	static volatile gsize color_scheme_settings_settings_type_id__once = 0;
	if (g_once_init_enter (&color_scheme_settings_settings_type_id__once)) {
		GType color_scheme_settings_settings_type_id;
		color_scheme_settings_settings_type_id = color_scheme_settings_settings_get_type_once ();
		g_once_init_leave (&color_scheme_settings_settings_type_id__once, color_scheme_settings_settings_type_id);
	}
	return color_scheme_settings_settings_type_id__once;
}

static void
_vala_color_scheme_settings_settings_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	ColorSchemeSettingsSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COLOR_SCHEME_SETTINGS_TYPE_SETTINGS, ColorSchemeSettingsSettings);
	switch (property_id) {
		case COLOR_SCHEME_SETTINGS_SETTINGS_PREFERS_COLOR_SCHEME_PROPERTY:
		g_value_set_enum (value, color_scheme_settings_settings_get_prefers_color_scheme (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_color_scheme_settings_settings_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	ColorSchemeSettingsSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, COLOR_SCHEME_SETTINGS_TYPE_SETTINGS, ColorSchemeSettingsSettings);
	switch (property_id) {
		case COLOR_SCHEME_SETTINGS_SETTINGS_PREFERS_COLOR_SCHEME_PROPERTY:
		color_scheme_settings_settings_set_prefers_color_scheme (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

ColorSchemeSettingsPortalSettings*
color_scheme_settings_portal_settings_get (GError** error)
{
	ColorSchemeSettingsPortalSettings* _tmp0_ = NULL;
	ColorSchemeSettingsPortalSettings* _tmp1_;
	ColorSchemeSettingsPortalSettings* _tmp2_;
	GError* _inner_error0_ = NULL;
	ColorSchemeSettingsPortalSettings* result;
	_tmp1_ = (ColorSchemeSettingsPortalSettings*) g_initable_new (COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS_PROXY, NULL, &_inner_error0_, "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", COLOR_SCHEME_SETTINGS_PORTAL_DBUS_DESKTOP_NAME, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", COLOR_SCHEME_SETTINGS_PORTAL_DBUS_DESKTOP_PATH, "g-interface-name", "org.freedesktop.portal.Settings", NULL);
	_tmp0_ = (ColorSchemeSettingsPortalSettings*) _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	}
	_tmp2_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp2_;
	_g_object_unref0 (_tmp0_);
	return result;
}

GHashTable*
color_scheme_settings_portal_settings_read_all (ColorSchemeSettingsPortalSettings* self,
                                                gchar** namespaces,
                                                gint namespaces_length1,
                                                GError** error)
{
	ColorSchemeSettingsPortalSettingsIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_GET_INTERFACE (self);
	if (_iface_->read_all) {
		return _iface_->read_all (self, namespaces, namespaces_length1, error);
	}
	return NULL;
}

GVariant*
color_scheme_settings_portal_settings_read (ColorSchemeSettingsPortalSettings* self,
                                            const gchar* namespace,
                                            const gchar* key,
                                            GError** error)
{
	ColorSchemeSettingsPortalSettingsIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_GET_INTERFACE (self);
	if (_iface_->read) {
		return _iface_->read (self, namespace, key, error);
	}
	return NULL;
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING_VARIANT (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_VARIANT) (gpointer data1, const char* arg_1, const char* arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING_VARIANT 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_VARIANT) (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_variant (param_values + 3), data2);
}

static void
color_scheme_settings_portal_settings_default_init (ColorSchemeSettingsPortalSettingsIface * iface,
                                                    gpointer iface_data)
{
	color_scheme_settings_portal_settings_signals[COLOR_SCHEME_SETTINGS_PORTAL_SETTINGS_SETTING_CHANGED_SIGNAL] = g_signal_new ("setting-changed", COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_VARIANT, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);
}

static GType
color_scheme_settings_portal_settings_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ColorSchemeSettingsPortalSettingsIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) color_scheme_settings_portal_settings_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType color_scheme_settings_portal_settings_type_id;
	color_scheme_settings_portal_settings_type_id = g_type_register_static (G_TYPE_INTERFACE, "ColorSchemeSettingsPortalSettings", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (color_scheme_settings_portal_settings_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (color_scheme_settings_portal_settings_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) color_scheme_settings_portal_settings_proxy_get_type);
	g_type_set_qdata (color_scheme_settings_portal_settings_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.portal.Settings");
	g_type_set_qdata (color_scheme_settings_portal_settings_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_color_scheme_settings_portal_settings_dbus_interface_info));
	g_type_set_qdata (color_scheme_settings_portal_settings_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) color_scheme_settings_portal_settings_register_object);
	return color_scheme_settings_portal_settings_type_id;
}

GType
color_scheme_settings_portal_settings_get_type (void)
{
	static volatile gsize color_scheme_settings_portal_settings_type_id__once = 0;
	if (g_once_init_enter (&color_scheme_settings_portal_settings_type_id__once)) {
		GType color_scheme_settings_portal_settings_type_id;
		color_scheme_settings_portal_settings_type_id = color_scheme_settings_portal_settings_get_type_once ();
		g_once_init_leave (&color_scheme_settings_portal_settings_type_id__once, color_scheme_settings_portal_settings_type_id);
	}
	return color_scheme_settings_portal_settings_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (ColorSchemeSettingsPortalSettingsProxy, color_scheme_settings_portal_settings_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (COLOR_SCHEME_SETTINGS_PORTAL_TYPE_SETTINGS, color_scheme_settings_portal_settings_proxy_color_scheme_settings_portal_settings_interface_init) )
static void
color_scheme_settings_portal_settings_proxy_class_init (ColorSchemeSettingsPortalSettingsProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = color_scheme_settings_portal_settings_proxy_g_signal;
}

static void
_dbus_handle_color_scheme_settings_portal_settings_setting_changed (ColorSchemeSettingsPortalSettings* self,
                                                                    GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gchar* namespace = NULL;
	GVariant* _tmp2_;
	gchar* key = NULL;
	GVariant* _tmp3_;
	GVariant* value = NULL;
	GVariant* _tmp4_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	namespace = g_variant_dup_string (_tmp2_, NULL);
	g_variant_unref (_tmp2_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	key = g_variant_dup_string (_tmp3_, NULL);
	g_variant_unref (_tmp3_);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	value = g_variant_get_variant (_tmp4_);
	g_variant_unref (_tmp4_);
	g_signal_emit_by_name (self, "setting-changed", namespace, key, value);
	_g_free0 (namespace);
	_g_free0 (key);
	_g_variant_unref0 (value);
}

static void
color_scheme_settings_portal_settings_proxy_g_signal (GDBusProxy* proxy,
                                                      const gchar* sender_name,
                                                      const gchar* signal_name,
                                                      GVariant* parameters)
{
	if (strcmp (signal_name, "SettingChanged") == 0) {
		_dbus_handle_color_scheme_settings_portal_settings_setting_changed ((ColorSchemeSettingsPortalSettings*) proxy, parameters);
	}
}

static void
color_scheme_settings_portal_settings_proxy_init (ColorSchemeSettingsPortalSettingsProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_color_scheme_settings_portal_settings_dbus_interface_info));
}

static GHashTable*
color_scheme_settings_portal_settings_proxy_read_all (ColorSchemeSettingsPortalSettings* self,
                                                      gchar** namespaces,
                                                      gint namespaces_length1,
                                                      GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	gchar** _tmp5_;
	GVariantBuilder _tmp6_;
	gint _tmp7_;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GHashTable* _result = NULL;
	GVariant* _tmp8_;
	GHashTable* _tmp9_;
	GVariantIter _tmp10_;
	GVariant* _tmp11_;
	GVariant* _tmp12_;
	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.freedesktop.portal.Settings", "ReadAll");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_tmp5_ = namespaces;
	g_variant_builder_init (&_tmp6_, G_VARIANT_TYPE ("as"));
	for (_tmp7_ = 0; _tmp7_ < namespaces_length1; _tmp7_++) {
		g_variant_builder_add_value (&_tmp6_, g_variant_new_string (*_tmp5_));
		_tmp5_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp6_));
	_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 NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp8_ = g_variant_iter_next_value (&_reply_iter);
	_tmp9_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref);
	g_variant_iter_init (&_tmp10_, _tmp8_);
	while (g_variant_iter_loop (&_tmp10_, "{?*}", &_tmp11_, &_tmp12_)) {
		GHashTable* _tmp13_;
		GVariantIter _tmp14_;
		GVariant* _tmp15_;
		GVariant* _tmp16_;
		_tmp13_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp14_, _tmp12_);
		while (g_variant_iter_loop (&_tmp14_, "{?*}", &_tmp15_, &_tmp16_)) {
			g_hash_table_insert (_tmp13_, g_variant_dup_string (_tmp15_, NULL), g_variant_get_variant (_tmp16_));
		}
		g_hash_table_insert (_tmp9_, g_variant_dup_string (_tmp11_, NULL), _tmp13_);
	}
	_result = _tmp9_;
	g_variant_unref (_tmp8_);
	g_object_unref (_reply_message);
	return _result;
}

static GVariant*
color_scheme_settings_portal_settings_proxy_read (ColorSchemeSettingsPortalSettings* self,
                                                  const gchar* namespace,
                                                  const gchar* key,
                                                  GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GVariant* _result = NULL;
	GVariant* _tmp17_;
	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.freedesktop.portal.Settings", "Read");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (namespace));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (key));
	_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 NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp17_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_variant (_tmp17_);
	g_variant_unref (_tmp17_);
	g_object_unref (_reply_message);
	return _result;
}

static void
color_scheme_settings_portal_settings_proxy_color_scheme_settings_portal_settings_interface_init (ColorSchemeSettingsPortalSettingsIface* iface)
{
	iface->read_all = color_scheme_settings_portal_settings_proxy_read_all;
	iface->read = color_scheme_settings_portal_settings_proxy_read;
}

static void
_dbus_color_scheme_settings_portal_settings_read_all (ColorSchemeSettingsPortalSettings* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar** namespaces = NULL;
	gint namespaces_length1 = 0;
	GVariant* _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length;
	gint _tmp19__size;
	gint _tmp19__length1;
	GVariantIter _tmp20_;
	GVariant* _tmp21_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GHashTable* result;
	GVariantBuilder _tmp22_;
	GHashTableIter _tmp23_;
	gpointer _tmp24_;
	gpointer _tmp25_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp18_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp19_ = g_new (gchar*, 5);
	_tmp19__length = 0;
	_tmp19__size = 4;
	_tmp19__length1 = 0;
	g_variant_iter_init (&_tmp20_, _tmp18_);
	for (; (_tmp21_ = g_variant_iter_next_value (&_tmp20_)) != NULL; _tmp19__length1++) {
		if (_tmp19__size == _tmp19__length) {
			_tmp19__size = 2 * _tmp19__size;
			_tmp19_ = g_renew (gchar*, _tmp19_, _tmp19__size + 1);
		}
		_tmp19_[_tmp19__length++] = g_variant_dup_string (_tmp21_, NULL);
		g_variant_unref (_tmp21_);
	}
	namespaces_length1 = _tmp19__length1;
	_tmp19_[_tmp19__length] = NULL;
	namespaces = _tmp19_;
	g_variant_unref (_tmp18_);
	result = color_scheme_settings_portal_settings_read_all (self, namespaces, namespaces_length1, &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);
	g_hash_table_iter_init (&_tmp23_, result);
	g_variant_builder_init (&_tmp22_, G_VARIANT_TYPE ("a{sa{sv}}"));
	while (g_hash_table_iter_next (&_tmp23_, &_tmp24_, &_tmp25_)) {
		gchar* _key;
		GHashTable* _value;
		GVariantBuilder _tmp26_;
		GHashTableIter _tmp27_;
		gpointer _tmp28_;
		gpointer _tmp29_;
		_key = (gchar*) _tmp24_;
		_value = (GHashTable*) _tmp25_;
		g_hash_table_iter_init (&_tmp27_, _value);
		g_variant_builder_init (&_tmp26_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp27_, &_tmp28_, &_tmp29_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp28_;
			_value = (GVariant*) _tmp29_;
			g_variant_builder_add (&_tmp26_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add (&_tmp22_, "{?*}", g_variant_new_string (_key), g_variant_builder_end (&_tmp26_));
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp22_));
	_g_hash_table_unref0 (result);
	_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:
	namespaces = (_vala_array_free (namespaces, namespaces_length1, (GDestroyNotify) g_free), NULL);
	;
}

static void
_dbus_color_scheme_settings_portal_settings_read (ColorSchemeSettingsPortalSettings* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* namespace = NULL;
	GVariant* _tmp30_;
	gchar* key = NULL;
	GVariant* _tmp31_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp30_ = g_variant_iter_next_value (&_arguments_iter);
	namespace = g_variant_dup_string (_tmp30_, NULL);
	g_variant_unref (_tmp30_);
	_tmp31_ = g_variant_iter_next_value (&_arguments_iter);
	key = g_variant_dup_string (_tmp31_, NULL);
	g_variant_unref (_tmp31_);
	result = color_scheme_settings_portal_settings_read (self, namespace, key, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_variant (result));
	_g_variant_unref0 (result);
	_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 (namespace);
	_g_free0 (key);
	;
}

static void
color_scheme_settings_portal_settings_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, "ReadAll") == 0) {
		_dbus_color_scheme_settings_portal_settings_read_all (object, parameters, invocation);
	} else if (strcmp (method_name, "Read") == 0) {
		_dbus_color_scheme_settings_portal_settings_read (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
color_scheme_settings_portal_settings_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
color_scheme_settings_portal_settings_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;
}

static void
_dbus_color_scheme_settings_portal_settings_setting_changed (GObject* _sender,
                                                             const gchar* namespace,
                                                             const gchar* key,
                                                             GVariant* value,
                                                             gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (namespace));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (key));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (value));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.portal.Settings", "SettingChanged", _arguments, NULL);
}

guint
color_scheme_settings_portal_settings_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 *) (&_color_scheme_settings_portal_settings_dbus_interface_info), &_color_scheme_settings_portal_settings_dbus_interface_vtable, data, _color_scheme_settings_portal_settings_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "setting-changed", (GCallback) _dbus_color_scheme_settings_portal_settings_setting_changed, data);
	return result;
}

static void
_color_scheme_settings_portal_settings_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_color_scheme_settings_portal_settings_setting_changed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

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

