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

/* Generated by vala-dbus-binding-tool 1.0-aa2fb. Do not modify! Haha, but I did. Beat me! */
/* Generated with: vala-dbus-binding-tool --no-synced --api-path=com.feralinteractive.GameMode.xml */

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GAME_MODE_TYPE_GAME (game_mode_game_get_type ())
#define GAME_MODE_GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAME_MODE_TYPE_GAME, GameModeGame))
#define GAME_MODE_IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAME_MODE_TYPE_GAME))
#define GAME_MODE_GAME_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAME_MODE_TYPE_GAME, GameModeGameIface))

typedef struct _GameModeGame GameModeGame;
typedef struct _GameModeGameIface GameModeGameIface;

#define GAME_MODE_TYPE_GAME_PROXY (game_mode_game_proxy_get_type ())
typedef GDBusProxy GameModeGameProxy;
typedef GDBusProxyClass GameModeGameProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define GAME_MODE_TYPE_CLIENT (game_mode_client_get_type ())
#define GAME_MODE_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAME_MODE_TYPE_CLIENT, GameModeClient))
#define GAME_MODE_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAME_MODE_TYPE_CLIENT))
#define GAME_MODE_CLIENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAME_MODE_TYPE_CLIENT, GameModeClientIface))

typedef struct _GameModeClient GameModeClient;
typedef struct _GameModeClientIface GameModeClientIface;

#define GAME_MODE_TYPE_CLIENT_PROXY (game_mode_client_proxy_get_type ())

#define GAME_MODE_TYPE_GAME_INFO (game_mode_game_info_get_type ())
typedef struct _GameModeGameInfo GameModeGameInfo;
enum  {
	GAME_MODE_CLIENT_GAME_REGISTERED_SIGNAL,
	GAME_MODE_CLIENT_GAME_UNREGISTERED_SIGNAL,
	GAME_MODE_CLIENT_NUM_SIGNALS
};
static guint game_mode_client_signals[GAME_MODE_CLIENT_NUM_SIGNALS] = {0};
typedef GDBusProxy GameModeClientProxy;
typedef GDBusProxyClass GameModeClientProxyClass;

#define GAME_MODE_TYPE_PID_LIST (game_mode_pid_list_get_type ())
#define GAME_MODE_PID_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAME_MODE_TYPE_PID_LIST, GameModePidList))
#define GAME_MODE_PID_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAME_MODE_TYPE_PID_LIST, GameModePidListClass))
#define GAME_MODE_IS_PID_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAME_MODE_TYPE_PID_LIST))
#define GAME_MODE_IS_PID_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAME_MODE_TYPE_PID_LIST))
#define GAME_MODE_PID_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAME_MODE_TYPE_PID_LIST, GameModePidListClass))

typedef struct _GameModePidList GameModePidList;
typedef struct _GameModePidListClass GameModePidListClass;
typedef struct _GameModePidListPrivate GameModePidListPrivate;
enum  {
	GAME_MODE_PID_LIST_0_PROPERTY,
	GAME_MODE_PID_LIST_NUM_PROPERTIES
};
static GParamSpec* game_mode_pid_list_properties[GAME_MODE_PID_LIST_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	GAME_MODE_PID_LIST_CHANGED_SIGNAL,
	GAME_MODE_PID_LIST_NUM_SIGNALS
};
static guint game_mode_pid_list_signals[GAME_MODE_PID_LIST_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GameModeGameIface {
	GTypeInterface parent_iface;
	gint (*get_process_id) (GameModeGame* self);
	gchar* (*get_executable) (GameModeGame* self);
};

struct _GameModeGameInfo {
	gint pid;
	char* path;
};

struct _GameModeClientIface {
	GTypeInterface parent_iface;
	gint (*register_game) (GameModeClient* self, gint pid, GError** error);
	gint (*unregister_game) (GameModeClient* self, gint pid, GError** error);
	gint (*query_status) (GameModeClient* self, gint pid, GError** error);
	gint (*register_game_by_pid) (GameModeClient* self, gint pid, gint requestor, GError** error);
	gint (*unregister_game_by_pid) (GameModeClient* self, gint pid, gint requestor, GError** error);
	gint (*query_status_by_pid) (GameModeClient* self, gint pid, gint requestor, GError** error);
	gint (*refresh_config) (GameModeClient* self, GError** error);
	GameModeGameInfo* (*list_games) (GameModeClient* self, gint* result_length1, GError** error);
	gint (*get_client_count) (GameModeClient* self);
};

struct _GameModePidList {
	GObject parent_instance;
	GameModePidListPrivate * priv;
};

struct _GameModePidListClass {
	GObjectClass parent_class;
};

struct _GameModePidListPrivate {
	GameModeClient* client;
	GHashTable* pids;
};

static gint GameModePidList_private_offset;
static gpointer game_mode_pid_list_parent_class = NULL;
static GameModePidList* game_mode_pid_list_singleton;
static GameModePidList* game_mode_pid_list_singleton = NULL;

VALA_EXTERN GType game_mode_game_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GameModeGame, g_object_unref)
VALA_EXTERN GType game_mode_game_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint game_mode_game_register_object (void* object,
                                      GDBusConnection* connection,
                                      const gchar* path,
                                      GError** error);
VALA_EXTERN gint game_mode_game_get_process_id (GameModeGame* self);
VALA_EXTERN gchar* game_mode_game_get_executable (GameModeGame* self);
static GType game_mode_game_get_type_once (void);
static void game_mode_game_proxy_g_signal (GDBusProxy* proxy,
                                    const gchar* sender_name,
                                    const gchar* signal_name,
                                    GVariant* parameters);
static gint game_mode_game_dbus_proxy_get_process_id (GameModeGame* self);
static gchar* game_mode_game_dbus_proxy_get_executable (GameModeGame* self);
static void game_mode_game_proxy_game_mode_game_interface_init (GameModeGameIface* iface);
static void game_mode_game_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* game_mode_game_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_game_mode_game_get_process_id (GameModeGame* self);
static GVariant* _dbus_game_mode_game_get_executable (GameModeGame* self);
static gboolean game_mode_game_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 _game_mode_game_unregister_object (gpointer user_data);
VALA_EXTERN GType game_mode_client_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint game_mode_client_register_object (void* object,
                                        GDBusConnection* connection,
                                        const gchar* path,
                                        GError** error);
VALA_EXTERN GType game_mode_game_info_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GameModeGameInfo* game_mode_game_info_dup (const GameModeGameInfo* self);
VALA_EXTERN void game_mode_game_info_free (GameModeGameInfo* self);
VALA_EXTERN void game_mode_game_info_copy (const GameModeGameInfo* self,
                               GameModeGameInfo* dest);
VALA_EXTERN void game_mode_game_info_destroy (GameModeGameInfo* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (GameModeGameInfo, game_mode_game_info_destroy)
VALA_EXTERN GType game_mode_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GameModeClient, g_object_unref)
VALA_EXTERN gint game_mode_client_register_game (GameModeClient* self,
                                     gint pid,
                                     GError** error);
VALA_EXTERN gint game_mode_client_unregister_game (GameModeClient* self,
                                       gint pid,
                                       GError** error);
VALA_EXTERN gint game_mode_client_query_status (GameModeClient* self,
                                    gint pid,
                                    GError** error);
VALA_EXTERN gint game_mode_client_register_game_by_pid (GameModeClient* self,
                                            gint pid,
                                            gint requestor,
                                            GError** error);
VALA_EXTERN gint game_mode_client_unregister_game_by_pid (GameModeClient* self,
                                              gint pid,
                                              gint requestor,
                                              GError** error);
VALA_EXTERN gint game_mode_client_query_status_by_pid (GameModeClient* self,
                                           gint pid,
                                           gint requestor,
                                           GError** error);
VALA_EXTERN gint game_mode_client_refresh_config (GameModeClient* self,
                                      GError** error);
VALA_EXTERN GameModeGameInfo* game_mode_client_list_games (GameModeClient* self,
                                               gint* result_length1,
                                               GError** error);
VALA_EXTERN gint game_mode_client_get_client_count (GameModeClient* self);
static void g_cclosure_user_marshal_VOID__INT_STRING (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data);
static GType game_mode_client_get_type_once (void);
static void game_mode_client_proxy_g_signal (GDBusProxy* proxy,
                                      const gchar* sender_name,
                                      const gchar* signal_name,
                                      GVariant* parameters);
static void _dbus_handle_game_mode_client_game_registered (GameModeClient* self,
                                                    GVariant* parameters);
static void _dbus_handle_game_mode_client_game_unregistered (GameModeClient* self,
                                                      GVariant* parameters);
static gint game_mode_client_proxy_register_game (GameModeClient* self,
                                           gint pid,
                                           GError** error);
static gint game_mode_client_proxy_unregister_game (GameModeClient* self,
                                             gint pid,
                                             GError** error);
static gint game_mode_client_proxy_query_status (GameModeClient* self,
                                          gint pid,
                                          GError** error);
static gint game_mode_client_proxy_register_game_by_pid (GameModeClient* self,
                                                  gint pid,
                                                  gint requestor,
                                                  GError** error);
static gint game_mode_client_proxy_unregister_game_by_pid (GameModeClient* self,
                                                    gint pid,
                                                    gint requestor,
                                                    GError** error);
static gint game_mode_client_proxy_query_status_by_pid (GameModeClient* self,
                                                 gint pid,
                                                 gint requestor,
                                                 GError** error);
static gint game_mode_client_proxy_refresh_config (GameModeClient* self,
                                            GError** error);
static GameModeGameInfo* game_mode_client_proxy_list_games (GameModeClient* self,
                                                     gint* result_length1,
                                                     GError** error);
static gint game_mode_client_dbus_proxy_get_client_count (GameModeClient* self);
static void game_mode_client_proxy_game_mode_client_interface_init (GameModeClientIface* iface);
static void _dbus_game_mode_client_register_game (GameModeClient* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation);
static void _dbus_game_mode_client_unregister_game (GameModeClient* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void _dbus_game_mode_client_query_status (GameModeClient* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation);
static void _dbus_game_mode_client_register_game_by_pid (GameModeClient* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation);
static void _dbus_game_mode_client_unregister_game_by_pid (GameModeClient* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation);
static void _dbus_game_mode_client_query_status_by_pid (GameModeClient* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation);
static void _dbus_game_mode_client_refresh_config (GameModeClient* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _vala_GameModeGameInfo_array_free (GameModeGameInfo * array,
                                        gssize array_length);
static void _dbus_game_mode_client_list_games (GameModeClient* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void game_mode_client_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* game_mode_client_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_game_mode_client_get_client_count (GameModeClient* self);
static gboolean game_mode_client_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_game_mode_client_game_registered (GObject* _sender,
                                             gint pid,
                                             const char* path,
                                             gpointer* _data);
static void _dbus_game_mode_client_game_unregistered (GObject* _sender,
                                               gint pid,
                                               const char* path,
                                               gpointer* _data);
static void _game_mode_client_unregister_object (gpointer user_data);
VALA_EXTERN GType game_mode_pid_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GameModePidList, g_object_unref)
VALA_EXTERN GameModePidList* game_mode_pid_list_get_default (void);
VALA_EXTERN GameModePidList* game_mode_pid_list_new (void);
VALA_EXTERN GameModePidList* game_mode_pid_list_construct (GType object_type);
static void game_mode_pid_list_on_game_registered (GameModePidList* self,
                                            gint pid,
                                            const char* path);
static void _game_mode_pid_list_on_game_registered_game_mode_client_game_registered (GameModeClient* _sender,
                                                                              gint pid,
                                                                              const char* path,
                                                                              gpointer self);
static void game_mode_pid_list_on_game_unregistered (GameModePidList* self,
                                              gint pid,
                                              const char* path);
static void _game_mode_pid_list_on_game_unregistered_game_mode_client_game_unregistered (GameModeClient* _sender,
                                                                                  gint pid,
                                                                                  const char* path,
                                                                                  gpointer self);
VALA_EXTERN gboolean game_mode_pid_list_contains (GameModePidList* self,
                                      gint pid);
static void g_cclosure_user_marshal_VOID__INT_BOOLEAN (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static GObject * game_mode_pid_list_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static void _g_free0_ (gpointer var);
static void game_mode_pid_list_finalize (GObject * obj);
static GType game_mode_pid_list_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusMethodInfo * const _game_mode_game_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _game_mode_game_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _game_mode_game_dbus_property_info_process_id = {-1, "ProcessId", "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _game_mode_game_dbus_property_info_executable = {-1, "Executable", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _game_mode_game_dbus_property_info[] = {&_game_mode_game_dbus_property_info_process_id, &_game_mode_game_dbus_property_info_executable, NULL};
static const GDBusInterfaceInfo _game_mode_game_dbus_interface_info = {-1, "com.feralinteractive.GameMode.Game", (GDBusMethodInfo **) (&_game_mode_game_dbus_method_info), (GDBusSignalInfo **) (&_game_mode_game_dbus_signal_info), (GDBusPropertyInfo **) (&_game_mode_game_dbus_property_info), NULL};
static const GDBusInterfaceVTable _game_mode_game_dbus_interface_vtable = {game_mode_game_dbus_interface_method_call, game_mode_game_dbus_interface_get_property, game_mode_game_dbus_interface_set_property};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_register_game_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_register_game_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_register_game_in[] = {&_game_mode_client_dbus_arg_info_register_game_pid, NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_register_game_out[] = {&_game_mode_client_dbus_arg_info_register_game_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_register_game = {-1, "RegisterGame", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_register_game_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_register_game_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_unregister_game_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_unregister_game_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_unregister_game_in[] = {&_game_mode_client_dbus_arg_info_unregister_game_pid, NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_unregister_game_out[] = {&_game_mode_client_dbus_arg_info_unregister_game_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_unregister_game = {-1, "UnregisterGame", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_unregister_game_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_unregister_game_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_query_status_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_query_status_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_query_status_in[] = {&_game_mode_client_dbus_arg_info_query_status_pid, NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_query_status_out[] = {&_game_mode_client_dbus_arg_info_query_status_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_query_status = {-1, "QueryStatus", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_query_status_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_query_status_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_register_game_by_pid_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_register_game_by_pid_requestor = {-1, "requestor", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_register_game_by_pid_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_register_game_by_pid_in[] = {&_game_mode_client_dbus_arg_info_register_game_by_pid_pid, &_game_mode_client_dbus_arg_info_register_game_by_pid_requestor, NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_register_game_by_pid_out[] = {&_game_mode_client_dbus_arg_info_register_game_by_pid_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_register_game_by_pid = {-1, "RegisterGameByPID", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_register_game_by_pid_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_register_game_by_pid_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_unregister_game_by_pid_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_unregister_game_by_pid_requestor = {-1, "requestor", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_unregister_game_by_pid_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_unregister_game_by_pid_in[] = {&_game_mode_client_dbus_arg_info_unregister_game_by_pid_pid, &_game_mode_client_dbus_arg_info_unregister_game_by_pid_requestor, NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_unregister_game_by_pid_out[] = {&_game_mode_client_dbus_arg_info_unregister_game_by_pid_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_unregister_game_by_pid = {-1, "UnregisterGameByPID", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_unregister_game_by_pid_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_unregister_game_by_pid_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_query_status_by_pid_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_query_status_by_pid_requestor = {-1, "requestor", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_query_status_by_pid_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_query_status_by_pid_in[] = {&_game_mode_client_dbus_arg_info_query_status_by_pid_pid, &_game_mode_client_dbus_arg_info_query_status_by_pid_requestor, NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_query_status_by_pid_out[] = {&_game_mode_client_dbus_arg_info_query_status_by_pid_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_query_status_by_pid = {-1, "QueryStatusByPID", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_query_status_by_pid_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_query_status_by_pid_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_refresh_config_result = {-1, "result", "i", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_refresh_config_in[] = {NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_refresh_config_out[] = {&_game_mode_client_dbus_arg_info_refresh_config_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_refresh_config = {-1, "RefreshConfig", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_refresh_config_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_refresh_config_out), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_list_games_result = {-1, "result", "a(io)", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_list_games_in[] = {NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_list_games_out[] = {&_game_mode_client_dbus_arg_info_list_games_result, NULL};
static const GDBusMethodInfo _game_mode_client_dbus_method_info_list_games = {-1, "ListGames", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_list_games_in), (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_list_games_out), NULL};
static const GDBusMethodInfo * const _game_mode_client_dbus_method_info[] = {&_game_mode_client_dbus_method_info_register_game, &_game_mode_client_dbus_method_info_unregister_game, &_game_mode_client_dbus_method_info_query_status, &_game_mode_client_dbus_method_info_register_game_by_pid, &_game_mode_client_dbus_method_info_unregister_game_by_pid, &_game_mode_client_dbus_method_info_query_status_by_pid, &_game_mode_client_dbus_method_info_refresh_config, &_game_mode_client_dbus_method_info_list_games, NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_game_registered_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_game_registered_path = {-1, "path", "o", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_game_registered[] = {&_game_mode_client_dbus_arg_info_game_registered_pid, &_game_mode_client_dbus_arg_info_game_registered_path, NULL};
static const GDBusSignalInfo _game_mode_client_dbus_signal_info_game_registered = {-1, "GameRegistered", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_game_registered), NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_game_unregistered_pid = {-1, "pid", "i", NULL};
static const GDBusArgInfo _game_mode_client_dbus_arg_info_game_unregistered_path = {-1, "path", "o", NULL};
static const GDBusArgInfo * const _game_mode_client_dbus_arg_info_game_unregistered[] = {&_game_mode_client_dbus_arg_info_game_unregistered_pid, &_game_mode_client_dbus_arg_info_game_unregistered_path, NULL};
static const GDBusSignalInfo _game_mode_client_dbus_signal_info_game_unregistered = {-1, "GameUnregistered", (GDBusArgInfo **) (&_game_mode_client_dbus_arg_info_game_unregistered), NULL};
static const GDBusSignalInfo * const _game_mode_client_dbus_signal_info[] = {&_game_mode_client_dbus_signal_info_game_registered, &_game_mode_client_dbus_signal_info_game_unregistered, NULL};
static const GDBusPropertyInfo _game_mode_client_dbus_property_info_client_count = {-1, "ClientCount", "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _game_mode_client_dbus_property_info[] = {&_game_mode_client_dbus_property_info_client_count, NULL};
static const GDBusInterfaceInfo _game_mode_client_dbus_interface_info = {-1, "com.feralinteractive.GameMode", (GDBusMethodInfo **) (&_game_mode_client_dbus_method_info), (GDBusSignalInfo **) (&_game_mode_client_dbus_signal_info), (GDBusPropertyInfo **) (&_game_mode_client_dbus_property_info), NULL};
static const GDBusInterfaceVTable _game_mode_client_dbus_interface_vtable = {game_mode_client_dbus_interface_method_call, game_mode_client_dbus_interface_get_property, game_mode_client_dbus_interface_set_property};

gint
game_mode_game_get_process_id (GameModeGame* self)
{
	GameModeGameIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_GAME_GET_INTERFACE (self);
	if (_iface_->get_process_id) {
		return _iface_->get_process_id (self);
	}
	return -1;
}

gchar*
game_mode_game_get_executable (GameModeGame* self)
{
	GameModeGameIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GAME_MODE_GAME_GET_INTERFACE (self);
	if (_iface_->get_executable) {
		return _iface_->get_executable (self);
	}
	return NULL;
}

static void
game_mode_game_default_init (GameModeGameIface * iface,
                             gpointer iface_data)
{
}

static GType
game_mode_game_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GameModeGameIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_mode_game_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType game_mode_game_type_id;
	game_mode_game_type_id = g_type_register_static (G_TYPE_INTERFACE, "GameModeGame", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (game_mode_game_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (game_mode_game_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) game_mode_game_proxy_get_type);
	g_type_set_qdata (game_mode_game_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "com.feralinteractive.GameMode.Game");
	g_type_set_qdata (game_mode_game_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_game_mode_game_dbus_interface_info));
	g_type_set_qdata (game_mode_game_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) game_mode_game_register_object);
	return game_mode_game_type_id;
}

GType
game_mode_game_get_type (void)
{
	static volatile gsize game_mode_game_type_id__once = 0;
	if (g_once_init_enter (&game_mode_game_type_id__once)) {
		GType game_mode_game_type_id;
		game_mode_game_type_id = game_mode_game_get_type_once ();
		g_once_init_leave (&game_mode_game_type_id__once, game_mode_game_type_id);
	}
	return game_mode_game_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (GameModeGameProxy, game_mode_game_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (GAME_MODE_TYPE_GAME, game_mode_game_proxy_game_mode_game_interface_init) )
static void
game_mode_game_proxy_class_init (GameModeGameProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = game_mode_game_proxy_g_signal;
}

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

static void
game_mode_game_proxy_init (GameModeGameProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_game_mode_game_dbus_interface_info));
}

static gint
game_mode_game_dbus_proxy_get_process_id (GameModeGame* self)
{
	GVariant *_inner_reply;
	gint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "ProcessId");
	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 ("com.feralinteractive.GameMode.Game"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ProcessId"));
		_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, 120000, NULL, NULL);
		if (!_reply) {
			gint _tmp15_ = 0;
			return _tmp15_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_int32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
game_mode_game_dbus_proxy_get_executable (GameModeGame* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Executable");
	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 ("com.feralinteractive.GameMode.Game"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Executable"));
		_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, 120000, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
game_mode_game_proxy_game_mode_game_interface_init (GameModeGameIface* iface)
{
	iface->get_process_id = game_mode_game_dbus_proxy_get_process_id;
	iface->get_executable = game_mode_game_dbus_proxy_get_executable;
}

static void
game_mode_game_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_game_mode_game_get_process_id (GameModeGame* self)
{
	gint result;
	GVariant* _reply;
	result = game_mode_game_get_process_id (self);
	_reply = g_variant_new_int32 (result);
	return _reply;
}

static GVariant*
_dbus_game_mode_game_get_executable (GameModeGame* self)
{
	gchar* result;
	GVariant* _reply;
	result = game_mode_game_get_executable (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
game_mode_game_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, "ProcessId") == 0) {
		return _dbus_game_mode_game_get_process_id (object);
	} else if (strcmp (property_name, "Executable") == 0) {
		return _dbus_game_mode_game_get_executable (object);
	}
	return NULL;
}

static gboolean
game_mode_game_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
game_mode_game_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 *) (&_game_mode_game_dbus_interface_info), &_game_mode_game_dbus_interface_vtable, data, _game_mode_game_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

gint
game_mode_client_register_game (GameModeClient* self,
                                gint pid,
                                GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->register_game) {
		return _iface_->register_game (self, pid, error);
	}
	return -1;
}

gint
game_mode_client_unregister_game (GameModeClient* self,
                                  gint pid,
                                  GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->unregister_game) {
		return _iface_->unregister_game (self, pid, error);
	}
	return -1;
}

gint
game_mode_client_query_status (GameModeClient* self,
                               gint pid,
                               GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->query_status) {
		return _iface_->query_status (self, pid, error);
	}
	return -1;
}

gint
game_mode_client_register_game_by_pid (GameModeClient* self,
                                       gint pid,
                                       gint requestor,
                                       GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->register_game_by_pid) {
		return _iface_->register_game_by_pid (self, pid, requestor, error);
	}
	return -1;
}

gint
game_mode_client_unregister_game_by_pid (GameModeClient* self,
                                         gint pid,
                                         gint requestor,
                                         GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->unregister_game_by_pid) {
		return _iface_->unregister_game_by_pid (self, pid, requestor, error);
	}
	return -1;
}

gint
game_mode_client_query_status_by_pid (GameModeClient* self,
                                      gint pid,
                                      gint requestor,
                                      GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->query_status_by_pid) {
		return _iface_->query_status_by_pid (self, pid, requestor, error);
	}
	return -1;
}

gint
game_mode_client_refresh_config (GameModeClient* self,
                                 GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->refresh_config) {
		return _iface_->refresh_config (self, error);
	}
	return -1;
}

GameModeGameInfo*
game_mode_client_list_games (GameModeClient* self,
                             gint* result_length1,
                             GError** error)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->list_games) {
		return _iface_->list_games (self, result_length1, error);
	}
	return NULL;
}

gint
game_mode_client_get_client_count (GameModeClient* self)
{
	GameModeClientIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = GAME_MODE_CLIENT_GET_INTERFACE (self);
	if (_iface_->get_client_count) {
		return _iface_->get_client_count (self);
	}
	return -1;
}

static void
g_cclosure_user_marshal_VOID__INT_STRING (GClosure * closure,
                                          GValue * return_value,
                                          guint n_param_values,
                                          const GValue * param_values,
                                          gpointer invocation_hint,
                                          gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT_STRING) (gpointer data1, gint arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__INT_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static void
game_mode_client_default_init (GameModeClientIface * iface,
                               gpointer iface_data)
{
	game_mode_client_signals[GAME_MODE_CLIENT_GAME_REGISTERED_SIGNAL] = g_signal_new ("game-registered", GAME_MODE_TYPE_CLIENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_STRING, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING);
	game_mode_client_signals[GAME_MODE_CLIENT_GAME_UNREGISTERED_SIGNAL] = g_signal_new ("game-unregistered", GAME_MODE_TYPE_CLIENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_STRING, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING);
}

static GType
game_mode_client_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GameModeClientIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_mode_client_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType game_mode_client_type_id;
	game_mode_client_type_id = g_type_register_static (G_TYPE_INTERFACE, "GameModeClient", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (game_mode_client_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (game_mode_client_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) game_mode_client_proxy_get_type);
	g_type_set_qdata (game_mode_client_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "com.feralinteractive.GameMode");
	g_type_set_qdata (game_mode_client_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_game_mode_client_dbus_interface_info));
	g_type_set_qdata (game_mode_client_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) game_mode_client_register_object);
	return game_mode_client_type_id;
}

GType
game_mode_client_get_type (void)
{
	static volatile gsize game_mode_client_type_id__once = 0;
	if (g_once_init_enter (&game_mode_client_type_id__once)) {
		GType game_mode_client_type_id;
		game_mode_client_type_id = game_mode_client_get_type_once ();
		g_once_init_leave (&game_mode_client_type_id__once, game_mode_client_type_id);
	}
	return game_mode_client_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (GameModeClientProxy, game_mode_client_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (GAME_MODE_TYPE_CLIENT, game_mode_client_proxy_game_mode_client_interface_init) )
static void
game_mode_client_proxy_class_init (GameModeClientProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = game_mode_client_proxy_g_signal;
}

static void
_dbus_handle_game_mode_client_game_registered (GameModeClient* self,
                                               GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp16_;
	char* path = NULL;
	GVariant* _tmp17_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp16_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp16_);
	g_variant_unref (_tmp16_);
	_tmp17_ = g_variant_iter_next_value (&_arguments_iter);
	path = g_variant_dup_string (_tmp17_, NULL);
	g_variant_unref (_tmp17_);
	g_signal_emit_by_name (self, "game-registered", pid, path);
	_g_free0 (path);
}

static void
_dbus_handle_game_mode_client_game_unregistered (GameModeClient* self,
                                                 GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp18_;
	char* path = NULL;
	GVariant* _tmp19_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp18_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp18_);
	g_variant_unref (_tmp18_);
	_tmp19_ = g_variant_iter_next_value (&_arguments_iter);
	path = g_variant_dup_string (_tmp19_, NULL);
	g_variant_unref (_tmp19_);
	g_signal_emit_by_name (self, "game-unregistered", pid, path);
	_g_free0 (path);
}

static void
game_mode_client_proxy_g_signal (GDBusProxy* proxy,
                                 const gchar* sender_name,
                                 const gchar* signal_name,
                                 GVariant* parameters)
{
	if (strcmp (signal_name, "GameRegistered") == 0) {
		_dbus_handle_game_mode_client_game_registered ((GameModeClient*) proxy, parameters);
	} else if (strcmp (signal_name, "GameUnregistered") == 0) {
		_dbus_handle_game_mode_client_game_unregistered ((GameModeClient*) proxy, parameters);
	}
}

static void
game_mode_client_proxy_init (GameModeClientProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_game_mode_client_dbus_interface_info));
}

static gint
game_mode_client_proxy_register_game (GameModeClient* self,
                                      gint pid,
                                      GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp22_;
	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), "com.feralinteractive.GameMode", "RegisterGame");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (pid));
	_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) {
		gint _tmp20_ = 0;
		return _tmp20_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp21_ = 0;
		g_object_unref (_reply_message);
		return _tmp21_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp22_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp22_);
	g_variant_unref (_tmp22_);
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_proxy_unregister_game (GameModeClient* self,
                                        gint pid,
                                        GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp25_;
	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), "com.feralinteractive.GameMode", "UnregisterGame");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (pid));
	_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) {
		gint _tmp23_ = 0;
		return _tmp23_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp24_ = 0;
		g_object_unref (_reply_message);
		return _tmp24_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp25_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp25_);
	g_variant_unref (_tmp25_);
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_proxy_query_status (GameModeClient* self,
                                     gint pid,
                                     GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp28_;
	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), "com.feralinteractive.GameMode", "QueryStatus");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (pid));
	_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) {
		gint _tmp26_ = 0;
		return _tmp26_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp27_ = 0;
		g_object_unref (_reply_message);
		return _tmp27_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp28_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp28_);
	g_variant_unref (_tmp28_);
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_proxy_register_game_by_pid (GameModeClient* self,
                                             gint pid,
                                             gint requestor,
                                             GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp31_;
	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), "com.feralinteractive.GameMode", "RegisterGameByPID");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (pid));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (requestor));
	_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) {
		gint _tmp29_ = 0;
		return _tmp29_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp30_ = 0;
		g_object_unref (_reply_message);
		return _tmp30_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp31_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp31_);
	g_variant_unref (_tmp31_);
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_proxy_unregister_game_by_pid (GameModeClient* self,
                                               gint pid,
                                               gint requestor,
                                               GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp34_;
	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), "com.feralinteractive.GameMode", "UnregisterGameByPID");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (pid));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (requestor));
	_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) {
		gint _tmp32_ = 0;
		return _tmp32_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp33_ = 0;
		g_object_unref (_reply_message);
		return _tmp33_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp34_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp34_);
	g_variant_unref (_tmp34_);
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_proxy_query_status_by_pid (GameModeClient* self,
                                            gint pid,
                                            gint requestor,
                                            GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp37_;
	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), "com.feralinteractive.GameMode", "QueryStatusByPID");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (pid));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (requestor));
	_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) {
		gint _tmp35_ = 0;
		return _tmp35_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp36_ = 0;
		g_object_unref (_reply_message);
		return _tmp36_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp37_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp37_);
	g_variant_unref (_tmp37_);
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_proxy_refresh_config (GameModeClient* self,
                                       GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint _result = 0;
	GVariant* _tmp40_;
	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), "com.feralinteractive.GameMode", "RefreshConfig");
	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) {
		gint _tmp38_ = 0;
		return _tmp38_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint _tmp39_ = 0;
		g_object_unref (_reply_message);
		return _tmp39_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp40_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int32 (_tmp40_);
	g_variant_unref (_tmp40_);
	g_object_unref (_reply_message);
	return _result;
}

static GameModeGameInfo*
game_mode_client_proxy_list_games (GameModeClient* self,
                                   gint* result_length1,
                                   GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GameModeGameInfo* _result = NULL;
	gint _result_length1;
	GVariant* _tmp41_;
	GameModeGameInfo* _tmp42_;
	gint _tmp42__length;
	gint _tmp42__size;
	gint _tmp42__length1;
	GVariantIter _tmp43_;
	GVariant* _tmp44_;
	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), "com.feralinteractive.GameMode", "ListGames");
	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 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);
	_result_length1 = 0;
	_tmp41_ = g_variant_iter_next_value (&_reply_iter);
	_tmp42_ = g_new (GameModeGameInfo, 5);
	_tmp42__length = 0;
	_tmp42__size = 4;
	_tmp42__length1 = 0;
	g_variant_iter_init (&_tmp43_, _tmp41_);
	for (; (_tmp44_ = g_variant_iter_next_value (&_tmp43_)) != NULL; _tmp42__length1++) {
		GameModeGameInfo _tmp45_;
		GVariantIter _tmp46_;
		GVariant* _tmp47_;
		GVariant* _tmp48_;
		if (_tmp42__size == _tmp42__length) {
			_tmp42__size = 2 * _tmp42__size;
			_tmp42_ = g_renew (GameModeGameInfo, _tmp42_, _tmp42__size + 1);
		}
		g_variant_iter_init (&_tmp46_, _tmp44_);
		_tmp47_ = g_variant_iter_next_value (&_tmp46_);
		_tmp45_.pid = g_variant_get_int32 (_tmp47_);
		g_variant_unref (_tmp47_);
		_tmp48_ = g_variant_iter_next_value (&_tmp46_);
		_tmp45_.path = g_variant_dup_string (_tmp48_, NULL);
		g_variant_unref (_tmp48_);
		_tmp42_[_tmp42__length++] = _tmp45_;
		g_variant_unref (_tmp44_);
	}
	_result_length1 = _tmp42__length1;
	_result = _tmp42_;
	g_variant_unref (_tmp41_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static gint
game_mode_client_dbus_proxy_get_client_count (GameModeClient* self)
{
	GVariant *_inner_reply;
	gint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "ClientCount");
	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 ("com.feralinteractive.GameMode"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ClientCount"));
		_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, 120000, NULL, NULL);
		if (!_reply) {
			gint _tmp49_ = 0;
			return _tmp49_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_int32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
game_mode_client_proxy_game_mode_client_interface_init (GameModeClientIface* iface)
{
	iface->register_game = game_mode_client_proxy_register_game;
	iface->unregister_game = game_mode_client_proxy_unregister_game;
	iface->query_status = game_mode_client_proxy_query_status;
	iface->register_game_by_pid = game_mode_client_proxy_register_game_by_pid;
	iface->unregister_game_by_pid = game_mode_client_proxy_unregister_game_by_pid;
	iface->query_status_by_pid = game_mode_client_proxy_query_status_by_pid;
	iface->refresh_config = game_mode_client_proxy_refresh_config;
	iface->list_games = game_mode_client_proxy_list_games;
	iface->get_client_count = game_mode_client_dbus_proxy_get_client_count;
}

static void
_dbus_game_mode_client_register_game (GameModeClient* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp50_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp50_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp50_);
	g_variant_unref (_tmp50_);
	result = game_mode_client_register_game (self, pid, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_dbus_game_mode_client_unregister_game (GameModeClient* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp51_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp51_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp51_);
	g_variant_unref (_tmp51_);
	result = game_mode_client_unregister_game (self, pid, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_dbus_game_mode_client_query_status (GameModeClient* self,
                                     GVariant* _parameters_,
                                     GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp52_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp52_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp52_);
	g_variant_unref (_tmp52_);
	result = game_mode_client_query_status (self, pid, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_dbus_game_mode_client_register_game_by_pid (GameModeClient* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp53_;
	gint requestor = 0;
	GVariant* _tmp54_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp53_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp53_);
	g_variant_unref (_tmp53_);
	_tmp54_ = g_variant_iter_next_value (&_arguments_iter);
	requestor = g_variant_get_int32 (_tmp54_);
	g_variant_unref (_tmp54_);
	result = game_mode_client_register_game_by_pid (self, pid, requestor, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_dbus_game_mode_client_unregister_game_by_pid (GameModeClient* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp55_;
	gint requestor = 0;
	GVariant* _tmp56_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp55_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp55_);
	g_variant_unref (_tmp55_);
	_tmp56_ = g_variant_iter_next_value (&_arguments_iter);
	requestor = g_variant_get_int32 (_tmp56_);
	g_variant_unref (_tmp56_);
	result = game_mode_client_unregister_game_by_pid (self, pid, requestor, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_dbus_game_mode_client_query_status_by_pid (GameModeClient* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint pid = 0;
	GVariant* _tmp57_;
	gint requestor = 0;
	GVariant* _tmp58_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp57_ = g_variant_iter_next_value (&_arguments_iter);
	pid = g_variant_get_int32 (_tmp57_);
	g_variant_unref (_tmp57_);
	_tmp58_ = g_variant_iter_next_value (&_arguments_iter);
	requestor = g_variant_get_int32 (_tmp58_);
	g_variant_unref (_tmp58_);
	result = game_mode_client_query_status_by_pid (self, pid, requestor, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_dbus_game_mode_client_refresh_config (GameModeClient* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = game_mode_client_refresh_config (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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (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);
}

static void
_vala_GameModeGameInfo_array_free (GameModeGameInfo * array,
                                   gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			game_mode_game_info_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_dbus_game_mode_client_list_games (GameModeClient* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GameModeGameInfo* result;
	gint result_length1 = 0;
	GameModeGameInfo* _tmp59_;
	GVariantBuilder _tmp60_;
	gint _tmp61_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = game_mode_client_list_games (self, &result_length1, &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);
	_tmp59_ = result;
	g_variant_builder_init (&_tmp60_, G_VARIANT_TYPE ("a(io)"));
	for (_tmp61_ = 0; _tmp61_ < result_length1; _tmp61_++) {
		GVariantBuilder _tmp62_;
		g_variant_builder_init (&_tmp62_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp62_, g_variant_new_int32 ((*_tmp59_).pid));
		g_variant_builder_add_value (&_tmp62_, g_variant_new_object_path ((*_tmp59_).path));
		g_variant_builder_add_value (&_tmp60_, g_variant_builder_end (&_tmp62_));
		_tmp59_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp60_));
	result = (_vala_GameModeGameInfo_array_free (result, result_length1), NULL);
	_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
game_mode_client_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, "RegisterGame") == 0) {
		_dbus_game_mode_client_register_game (object, parameters, invocation);
	} else if (strcmp (method_name, "UnregisterGame") == 0) {
		_dbus_game_mode_client_unregister_game (object, parameters, invocation);
	} else if (strcmp (method_name, "QueryStatus") == 0) {
		_dbus_game_mode_client_query_status (object, parameters, invocation);
	} else if (strcmp (method_name, "RegisterGameByPID") == 0) {
		_dbus_game_mode_client_register_game_by_pid (object, parameters, invocation);
	} else if (strcmp (method_name, "UnregisterGameByPID") == 0) {
		_dbus_game_mode_client_unregister_game_by_pid (object, parameters, invocation);
	} else if (strcmp (method_name, "QueryStatusByPID") == 0) {
		_dbus_game_mode_client_query_status_by_pid (object, parameters, invocation);
	} else if (strcmp (method_name, "RefreshConfig") == 0) {
		_dbus_game_mode_client_refresh_config (object, parameters, invocation);
	} else if (strcmp (method_name, "ListGames") == 0) {
		_dbus_game_mode_client_list_games (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_game_mode_client_get_client_count (GameModeClient* self)
{
	gint result;
	GVariant* _reply;
	result = game_mode_client_get_client_count (self);
	_reply = g_variant_new_int32 (result);
	return _reply;
}

static GVariant*
game_mode_client_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, "ClientCount") == 0) {
		return _dbus_game_mode_client_get_client_count (object);
	}
	return NULL;
}

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

static void
_dbus_game_mode_client_game_registered (GObject* _sender,
                                        gint pid,
                                        const char* path,
                                        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_int32 (pid));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (path));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.feralinteractive.GameMode", "GameRegistered", _arguments, NULL);
}

static void
_dbus_game_mode_client_game_unregistered (GObject* _sender,
                                          gint pid,
                                          const char* path,
                                          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_int32 (pid));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (path));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.feralinteractive.GameMode", "GameUnregistered", _arguments, NULL);
}

guint
game_mode_client_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 *) (&_game_mode_client_dbus_interface_info), &_game_mode_client_dbus_interface_vtable, data, _game_mode_client_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "game-registered", (GCallback) _dbus_game_mode_client_game_registered, data);
	g_signal_connect (object, "game-unregistered", (GCallback) _dbus_game_mode_client_game_unregistered, data);
	return result;
}

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

void
game_mode_game_info_copy (const GameModeGameInfo* self,
                          GameModeGameInfo* dest)
{
	const char* _tmp0_;
	char* _tmp1_;
	(*dest).pid = (*self).pid;
	_tmp0_ = (*self).path;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).path);
	(*dest).path = _tmp1_;
}

void
game_mode_game_info_destroy (GameModeGameInfo* self)
{
	_g_free0 ((*self).path);
}

GameModeGameInfo*
game_mode_game_info_dup (const GameModeGameInfo* self)
{
	GameModeGameInfo* dup;
	dup = g_new0 (GameModeGameInfo, 1);
	game_mode_game_info_copy (self, dup);
	return dup;
}

void
game_mode_game_info_free (GameModeGameInfo* self)
{
	game_mode_game_info_destroy (self);
	g_free (self);
}

static GType
game_mode_game_info_get_type_once (void)
{
	GType game_mode_game_info_type_id;
	game_mode_game_info_type_id = g_boxed_type_register_static ("GameModeGameInfo", (GBoxedCopyFunc) game_mode_game_info_dup, (GBoxedFreeFunc) game_mode_game_info_free);
	return game_mode_game_info_type_id;
}

GType
game_mode_game_info_get_type (void)
{
	static volatile gsize game_mode_game_info_type_id__once = 0;
	if (g_once_init_enter (&game_mode_game_info_type_id__once)) {
		GType game_mode_game_info_type_id;
		game_mode_game_info_type_id = game_mode_game_info_get_type_once ();
		g_once_init_leave (&game_mode_game_info_type_id__once, game_mode_game_info_type_id);
	}
	return game_mode_game_info_type_id__once;
}

static inline gpointer
game_mode_pid_list_get_instance_private (GameModePidList* self)
{
	return G_STRUCT_MEMBER_P (self, GameModePidList_private_offset);
}

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

GameModePidList*
game_mode_pid_list_get_default (void)
{
	GameModePidList* _tmp0_;
	GameModePidList* _tmp2_;
	GameModePidList* _tmp3_;
	GameModePidList* _tmp4_;
	GameModePidList* result;
	_tmp0_ = game_mode_pid_list_singleton;
	if (_tmp0_ == NULL) {
		GameModePidList* _tmp1_;
		_tmp1_ = game_mode_pid_list_new ();
		_g_object_unref0 (game_mode_pid_list_singleton);
		game_mode_pid_list_singleton = _tmp1_;
	}
	_tmp2_ = game_mode_pid_list_singleton;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GAME_MODE_TYPE_PID_LIST, GameModePidList));
	result = _tmp3_;
	_tmp4_ = game_mode_pid_list_singleton;
	_vala_warn_if_fail (_tmp4_ != NULL, "singleton != null");
	return result;
}

static void
_game_mode_pid_list_on_game_registered_game_mode_client_game_registered (GameModeClient* _sender,
                                                                         gint pid,
                                                                         const char* path,
                                                                         gpointer self)
{
	game_mode_pid_list_on_game_registered ((GameModePidList*) self, pid, path);
}

static void
_game_mode_pid_list_on_game_unregistered_game_mode_client_game_unregistered (GameModeClient* _sender,
                                                                             gint pid,
                                                                             const char* path,
                                                                             gpointer self)
{
	game_mode_pid_list_on_game_unregistered ((GameModePidList*) self, pid, path);
}

GameModePidList*
game_mode_pid_list_construct (GType object_type)
{
	GameModePidList * self = NULL;
	GError* _inner_error0_ = NULL;
	self = (GameModePidList*) g_object_new (object_type, NULL);
	{
		GameModeClient* _tmp0_ = NULL;
		GameModeClient* _tmp1_;
		GameModeClient* _tmp2_;
		GameModeClient* _tmp3_;
		GameModeClient* _tmp4_;
		GameModeClient* _tmp5_ = NULL;
		GameModeClient* _tmp6_;
		GameModeGameInfo* _tmp7_ = NULL;
		gint _tmp7__length1;
		gint __tmp7__size_;
		GameModeGameInfo* games = NULL;
		GameModeGameInfo* _tmp12_;
		gint _tmp12__length1;
		gint games_length1;
		gint _games_size_;
		GameModeGameInfo* _tmp13_;
		gint _tmp13__length1;
		_tmp1_ = (GameModeClient*) g_initable_new (GAME_MODE_TYPE_CLIENT_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "com.feralinteractive.GameMode", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/com/feralinteractive/GameMode", "g-interface-name", "com.feralinteractive.GameMode", NULL);
		_tmp0_ = (GameModeClient*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			if (_inner_error0_->domain == G_DBUS_ERROR) {
				goto __catch0_g_dbus_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->client);
		self->priv->client = _tmp2_;
		_tmp3_ = self->priv->client;
		g_signal_connect_object (_tmp3_, "game-registered", (GCallback) _game_mode_pid_list_on_game_registered_game_mode_client_game_registered, self, 0);
		_tmp4_ = self->priv->client;
		g_signal_connect_object (_tmp4_, "game-unregistered", (GCallback) _game_mode_pid_list_on_game_unregistered_game_mode_client_game_unregistered, self, 0);
		_tmp6_ = self->priv->client;
		_tmp5_ = _tmp6_;
		_tmp7_ = NULL;
		_tmp7__length1 = 0;
		__tmp7__size_ = _tmp7__length1;
		if (_tmp5_ != NULL) {
			GameModeGameInfo* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			GameModeGameInfo* _tmp10_;
			gint _tmp8__length1;
			gint __tmp8__size_;
			GameModeGameInfo* _tmp11_;
			gint _tmp11__length1;
			_tmp10_ = game_mode_client_list_games (_tmp5_, &_tmp9_, &_inner_error0_);
			_tmp8_ = _tmp10_;
			_tmp8__length1 = _tmp9_;
			__tmp8__size_ = _tmp8__length1;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_tmp7_ = (_vala_GameModeGameInfo_array_free (_tmp7_, _tmp7__length1), NULL);
				_g_object_unref0 (_tmp0_);
				if (_inner_error0_->domain == G_IO_ERROR) {
					goto __catch0_g_io_error;
				}
				if (_inner_error0_->domain == G_DBUS_ERROR) {
					goto __catch0_g_dbus_error;
				}
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			_tmp11_ = _tmp8_;
			_tmp11__length1 = _tmp8__length1;
			_tmp8_ = NULL;
			_tmp8__length1 = 0;
			_tmp7_ = (_vala_GameModeGameInfo_array_free (_tmp7_, _tmp7__length1), NULL);
			_tmp7_ = _tmp11_;
			_tmp7__length1 = _tmp11__length1;
			__tmp7__size_ = _tmp7__length1;
			_tmp8_ = (_vala_GameModeGameInfo_array_free (_tmp8_, _tmp8__length1), NULL);
		}
		_tmp12_ = _tmp7_;
		_tmp12__length1 = _tmp7__length1;
		_tmp7_ = NULL;
		_tmp7__length1 = 0;
		games = _tmp12_;
		games_length1 = _tmp12__length1;
		_games_size_ = games_length1;
		_tmp13_ = games;
		_tmp13__length1 = games_length1;
		{
			GameModeGameInfo* info_collection = NULL;
			gint info_collection_length1 = 0;
			gint _info_collection_size_ = 0;
			gint info_it = 0;
			info_collection = _tmp13_;
			info_collection_length1 = _tmp13__length1;
			for (info_it = 0; info_it < info_collection_length1; info_it = info_it + 1) {
				GameModeGameInfo _tmp14_;
				GameModeGameInfo _tmp15_ = {0};
				GameModeGameInfo info = {0};
				_tmp14_ = info_collection[info_it];
				game_mode_game_info_copy (&_tmp14_, &_tmp15_);
				info = _tmp15_;
				{
					GHashTable* _tmp16_;
					GameModeGameInfo _tmp17_;
					GameModeGameInfo _tmp18_;
					const char* _tmp19_;
					char* _tmp20_;
					_tmp16_ = self->priv->pids;
					_tmp17_ = info;
					_tmp18_ = info;
					_tmp19_ = _tmp18_.path;
					_tmp20_ = g_strdup (_tmp19_);
					g_hash_table_insert (_tmp16_, (gpointer) ((gintptr) _tmp17_.pid), _tmp20_);
					game_mode_game_info_destroy (&info);
				}
			}
		}
		games = (_vala_GameModeGameInfo_array_free (games, games_length1), NULL);
		_tmp7_ = (_vala_GameModeGameInfo_array_free (_tmp7_, _tmp7__length1), NULL);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp21_;
		const gchar* _tmp22_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp21_ = e;
		_tmp22_ = _tmp21_->message;
		g_warning ("game-mode.vala:90: GameMode Proxy creation failed: %s", _tmp22_);
		_g_error_free0 (e);
	}
	goto __finally0;
	__catch0_g_dbus_error:
	{
		GError* e = NULL;
		GError* _tmp23_;
		const gchar* _tmp24_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp23_ = e;
		_tmp24_ = _tmp23_->message;
		g_info ("game-mode.vala:92: GameMode D-Bus error: %s", _tmp24_);
		_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 NULL;
	}
	return self;
}

GameModePidList*
game_mode_pid_list_new (void)
{
	return game_mode_pid_list_construct (GAME_MODE_TYPE_PID_LIST);
}

gboolean
game_mode_pid_list_contains (GameModePidList* self,
                             gint pid)
{
	GHashTable* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->pids;
	result = g_hash_table_contains (_tmp0_, (gpointer) ((gintptr) pid));
	return result;
}

static void
game_mode_pid_list_on_game_registered (GameModePidList* self,
                                       gint pid,
                                       const char* path)
{
	GHashTable* _tmp0_;
	char* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = self->priv->pids;
	_tmp1_ = g_strdup (path);
	g_hash_table_insert (_tmp0_, (gpointer) ((gintptr) pid), _tmp1_);
	g_signal_emit (self, game_mode_pid_list_signals[GAME_MODE_PID_LIST_CHANGED_SIGNAL], g_quark_from_static_string ("added"), pid, TRUE);
}

static void
game_mode_pid_list_on_game_unregistered (GameModePidList* self,
                                         gint pid,
                                         const char* path)
{
	GHashTable* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = self->priv->pids;
	g_hash_table_remove (_tmp0_, (gpointer) ((gintptr) pid));
	g_signal_emit (self, game_mode_pid_list_signals[GAME_MODE_PID_LIST_CHANGED_SIGNAL], g_quark_from_static_string ("removed"), pid, FALSE);
}

static void
g_cclosure_user_marshal_VOID__INT_BOOLEAN (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT_BOOLEAN) (gpointer data1, gint arg_1, gboolean arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__INT_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int (param_values + 1), g_value_get_boolean (param_values + 2), data2);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static GObject *
game_mode_pid_list_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GameModePidList * self;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	parent_class = G_OBJECT_CLASS (game_mode_pid_list_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAME_MODE_TYPE_PID_LIST, GameModePidList);
	_tmp0_ = g_direct_hash;
	_tmp1_ = g_direct_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, NULL, _g_free0_);
	_g_hash_table_unref0 (self->priv->pids);
	self->priv->pids = _tmp2_;
	return obj;
}

static void
game_mode_pid_list_class_init (GameModePidListClass * klass,
                               gpointer klass_data)
{
	game_mode_pid_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GameModePidList_private_offset);
	G_OBJECT_CLASS (klass)->constructor = game_mode_pid_list_constructor;
	G_OBJECT_CLASS (klass)->finalize = game_mode_pid_list_finalize;
	game_mode_pid_list_signals[GAME_MODE_PID_LIST_CHANGED_SIGNAL] = g_signal_new ("changed", GAME_MODE_TYPE_PID_LIST, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_BOOLEAN);
}

static void
game_mode_pid_list_instance_init (GameModePidList * self,
                                  gpointer klass)
{
	self->priv = game_mode_pid_list_get_instance_private (self);
}

static void
game_mode_pid_list_finalize (GObject * obj)
{
	GameModePidList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAME_MODE_TYPE_PID_LIST, GameModePidList);
	_g_object_unref0 (self->priv->client);
	_g_hash_table_unref0 (self->priv->pids);
	G_OBJECT_CLASS (game_mode_pid_list_parent_class)->finalize (obj);
}

static GType
game_mode_pid_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GameModePidListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_mode_pid_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GameModePidList), 0, (GInstanceInitFunc) game_mode_pid_list_instance_init, NULL };
	GType game_mode_pid_list_type_id;
	game_mode_pid_list_type_id = g_type_register_static (G_TYPE_OBJECT, "GameModePidList", &g_define_type_info, 0);
	GameModePidList_private_offset = g_type_add_instance_private (game_mode_pid_list_type_id, sizeof (GameModePidListPrivate));
	return game_mode_pid_list_type_id;
}

GType
game_mode_pid_list_get_type (void)
{
	static volatile gsize game_mode_pid_list_type_id__once = 0;
	if (g_once_init_enter (&game_mode_pid_list_type_id__once)) {
		GType game_mode_pid_list_type_id;
		game_mode_pid_list_type_id = game_mode_pid_list_get_type_once ();
		g_once_init_leave (&game_mode_pid_list_type_id__once, game_mode_pid_list_type_id);
	}
	return game_mode_pid_list_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

