/* base-options-group.c generated by valac 0.56.19, the Vala compiler
 * generated from base-options-group.vala, do not modify */

#include "protonplus_core.h"
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.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

enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_IS_ADVANCED_GROUP_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_NUM_PROPERTIES];

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass;

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_SPIN_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_SPIN_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_ADVANCED_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_NUM_SIGNALS
};
static guint proton_plus_widgets_games_launch_options_editor_groups_base_options_group_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroupPrivate {
	gboolean _is_advanced_group;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_groups_base_options_group_parent_class = NULL;

VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_is_advanced_group (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                      gboolean value);
VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_game_argument_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                                                                                const gchar* title,
                                                                                                                                                                const gchar* subtitle,
                                                                                                                                                                gchar** tokens,
                                                                                                                                                                gint tokens_length1,
                                                                                                                                                                gboolean is_advanced,
                                                                                                                                                                const gchar* id);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                                                                  const gchar* title,
                                                                                                                                                  const gchar* subtitle,
                                                                                                                                                  gchar** tokens,
                                                                                                                                                  gint tokens_length1,
                                                                                                                                                  gboolean is_advanced,
                                                                                                                                                  ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                                                                                  const gchar* id);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_launch_option_tile_new (const gchar* title,
                                                                                                                                   const gchar* subtitle,
                                                                                                                                   gchar** tokens,
                                                                                                                                   gint tokens_length1,
                                                                                                                                   gboolean is_advanced,
                                                                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_launch_option_tile_construct (GType object_type,
                                                                                                                                         const gchar* title,
                                                                                                                                         const gchar* subtitle,
                                                                                                                                         gchar** tokens,
                                                                                                                                         gint tokens_length1,
                                                                                                                                         gboolean is_advanced,
                                                                                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self);
static void __lambda126_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self);
static void ___lambda126__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_spin_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                                                                           const gchar* title,
                                                                                                                                                           const gchar* subtitle,
                                                                                                                                                           const gchar* value_label,
                                                                                                                                                           gdouble lower,
                                                                                                                                                           gdouble upper,
                                                                                                                                                           gint default_value,
                                                                                                                                                           const gchar* env_prefix,
                                                                                                                                                           gboolean is_advanced,
                                                                                                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                                                                                           const gchar* id);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_new (const gchar* title,
                                                                                                                                            const gchar* subtitle,
                                                                                                                                            const gchar* value_label,
                                                                                                                                            gdouble lower,
                                                                                                                                            gdouble upper,
                                                                                                                                            gint default_value,
                                                                                                                                            const gchar* env_prefix);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_construct (GType object_type,
                                                                                                                                                  const gchar* title,
                                                                                                                                                  const gchar* subtitle,
                                                                                                                                                  const gchar* value_label,
                                                                                                                                                  gdouble lower,
                                                                                                                                                  gdouble upper,
                                                                                                                                                  gint default_value,
                                                                                                                                                  const gchar* env_prefix);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
static void __lambda127_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self);
static void ___lambda127__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda128_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self);
static void ___lambda128__proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_value_applied (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _sender,
                                                                                                          gpointer self);
static gboolean proton_plus_widgets_games_launch_options_editor_groups_base_options_group_text_matches (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                 const gchar* text,
                                                                                                 const gchar* query);
static gboolean proton_plus_widgets_games_launch_options_editor_groups_base_options_group_real_has_advanced_active (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self);
VALA_EXTERN gboolean proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_is_advanced_group (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self);
static void proton_plus_widgets_games_launch_options_editor_groups_base_options_group_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_property (GObject * object,
                                                                                                   guint property_id,
                                                                                                   GValue * value,
                                                                                                   GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_property (GObject * object,
                                                                                                   guint property_id,
                                                                                                   const GValue * value,
                                                                                                   GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup_private_offset);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_construct (GType object_type,
                                                                                     ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                     gboolean is_advanced_group,
                                                                                     ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry,
                                                                                     gboolean presentation_movable)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup * self = NULL;
	g_return_val_if_fail (launch_option_handlers != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) g_object_new (object_type, NULL);
	self->launch_option_handlers = launch_option_handlers;
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_is_advanced_group (self, is_advanced_group);
	self->presentation_registry = presentation_registry;
	self->presentation_movable = presentation_movable;
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_new (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                               gboolean is_advanced_group,
                                                                               ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry,
                                                                               gboolean presentation_movable)
{
	return proton_plus_widgets_games_launch_options_editor_groups_base_options_group_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, launch_option_handlers, is_advanced_group, presentation_registry, presentation_movable);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_game_argument_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                     const gchar* title,
                                                                                                     const gchar* subtitle,
                                                                                                     gchar** tokens,
                                                                                                     gint tokens_length1,
                                                                                                     gboolean is_advanced,
                                                                                                     const gchar* id)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (subtitle != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile (self, title, subtitle, tokens, (gint) tokens_length1, is_advanced, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ARGUMENT, id);
	result = _tmp0_;
	return result;
}

static void
__lambda126_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	g_signal_emit (self, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_CHANGED_SIGNAL], 0);
}

static void
___lambda126__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda126_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                       const gchar* title,
                                                                                       const gchar* subtitle,
                                                                                       gchar** tokens,
                                                                                       gint tokens_length1,
                                                                                       gboolean is_advanced,
                                                                                       ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                       const gchar* id)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* tile = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp1_;
	GtkSwitch* _tmp2_;
	GtkSwitch* _tmp3_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp4_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp5_;
	gboolean _tmp6_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (subtitle != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_new (title, subtitle, tokens, tokens_length1, is_advanced, type);
	g_object_ref_sink (_tmp0_);
	tile = _tmp0_;
	_tmp1_ = tile;
	_tmp2_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (_tmp1_);
	_tmp3_ = _tmp2_;
	g_signal_connect_object ((GObject*) _tmp3_, "notify::active", (GCallback) ___lambda126__g_object_notify, self, 0);
	_tmp4_ = self->launch_option_handlers;
	_tmp5_ = tile;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_add (_tmp4_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp5_);
	if (g_strcmp0 (id, "") != 0) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp7_;
		_tmp7_ = self->presentation_registry;
		_tmp6_ = _tmp7_ != NULL;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp8_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp9_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp10_;
		_tmp8_ = self->presentation_registry;
		_tmp9_ = tile;
		_tmp10_ = tile;
		proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_register (_tmp8_, id, (GtkWidget*) _tmp9_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp10_, self->presentation_movable);
	}
	result = tile;
	return result;
}

static void
__lambda127_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	g_signal_emit (self, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_CHANGED_SIGNAL], 0);
}

static void
___lambda127__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda127_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self);
}

static void
__lambda128_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	g_signal_emit (self, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_CHANGED_SIGNAL], 0);
}

static void
___lambda128__proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_value_applied (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _sender,
                                                                                                     gpointer self)
{
	__lambda128_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_spin_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                            const gchar* title,
                                                                                            const gchar* subtitle,
                                                                                            const gchar* value_label,
                                                                                            gdouble lower,
                                                                                            gdouble upper,
                                                                                            gint default_value,
                                                                                            const gchar* env_prefix,
                                                                                            gboolean is_advanced,
                                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                            const gchar* id)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* tile = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp2_;
	GtkSwitch* _tmp3_;
	GtkSwitch* _tmp4_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp6_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp7_;
	gboolean _tmp8_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (subtitle != NULL, NULL);
	g_return_val_if_fail (value_label != NULL, NULL);
	g_return_val_if_fail (env_prefix != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_new (title, subtitle, value_label, lower, upper, default_value, env_prefix);
	g_object_ref_sink (_tmp0_);
	tile = _tmp0_;
	_tmp1_ = tile;
	proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_line_type ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp1_, type);
	_tmp2_ = tile;
	_tmp3_ = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_toggle (_tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_connect_object ((GObject*) _tmp4_, "notify::active", (GCallback) ___lambda127__g_object_notify, self, 0);
	_tmp5_ = tile;
	g_signal_connect_object (_tmp5_, "value-applied", (GCallback) ___lambda128__proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_value_applied, self, 0);
	_tmp6_ = self->launch_option_handlers;
	_tmp7_ = tile;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_add (_tmp6_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp7_);
	if (g_strcmp0 (id, "") != 0) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp9_;
		_tmp9_ = self->presentation_registry;
		_tmp8_ = _tmp9_ != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp10_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp11_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp12_;
		_tmp10_ = self->presentation_registry;
		_tmp11_ = tile;
		_tmp12_ = tile;
		proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_register (_tmp10_, id, (GtkWidget*) _tmp11_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp12_, self->presentation_movable);
	}
	result = tile;
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_register_option (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                           const gchar* id,
                                                                                           GtkWidget* widget,
                                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* option)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->presentation_registry;
	if (_tmp0_ != NULL) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp1_;
		_tmp1_ = self->presentation_registry;
		proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_register (_tmp1_, id, widget, option, self->presentation_movable);
	}
}

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

gboolean
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_matches_search (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                          const gchar* query)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (query != NULL, FALSE);
	if (g_strcmp0 (query, "") == 0) {
		result = TRUE;
		return result;
	}
	_tmp1_ = adw_preferences_group_get_title ((AdwPreferencesGroup*) self);
	_tmp2_ = _tmp1_;
	if (proton_plus_widgets_games_launch_options_editor_groups_base_options_group_text_matches (self, _tmp2_, query)) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = adw_preferences_group_get_description ((AdwPreferencesGroup*) self);
		_tmp4_ = _tmp3_;
		_tmp0_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_text_matches (self, _tmp4_, query);
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	{
		GtkWidget* child = NULL;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp5_ = gtk_widget_get_first_child ((GtkWidget*) self);
		_tmp6_ = _g_object_ref0 (_tmp5_);
		child = _tmp6_;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				GtkWidget* _tmp11_;
				AdwPreferencesRow* row = NULL;
				GtkWidget* _tmp12_;
				AdwPreferencesRow* _tmp13_;
				AdwActionRow* action_row = NULL;
				GtkWidget* _tmp14_;
				AdwActionRow* _tmp15_;
				gboolean _tmp16_ = FALSE;
				AdwPreferencesRow* _tmp17_;
				gboolean _tmp21_ = FALSE;
				AdwActionRow* _tmp22_;
				if (!_tmp7_) {
					GtkWidget* _tmp8_;
					GtkWidget* _tmp9_;
					GtkWidget* _tmp10_;
					_tmp8_ = child;
					_tmp9_ = gtk_widget_get_next_sibling (_tmp8_);
					_tmp10_ = _g_object_ref0 (_tmp9_);
					_g_object_unref0 (child);
					child = _tmp10_;
				}
				_tmp7_ = FALSE;
				_tmp11_ = child;
				if (!(_tmp11_ != NULL)) {
					break;
				}
				_tmp12_ = child;
				_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, adw_preferences_row_get_type ()) ? ((AdwPreferencesRow*) _tmp12_) : NULL);
				row = _tmp13_;
				_tmp14_ = child;
				_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, adw_action_row_get_type ()) ? ((AdwActionRow*) _tmp14_) : NULL);
				action_row = _tmp15_;
				_tmp17_ = row;
				if (_tmp17_ != NULL) {
					AdwPreferencesRow* _tmp18_;
					const gchar* _tmp19_;
					const gchar* _tmp20_;
					_tmp18_ = row;
					_tmp19_ = adw_preferences_row_get_title (_tmp18_);
					_tmp20_ = _tmp19_;
					_tmp16_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_text_matches (self, _tmp20_, query);
				} else {
					_tmp16_ = FALSE;
				}
				if (_tmp16_) {
					result = TRUE;
					_g_object_unref0 (action_row);
					_g_object_unref0 (row);
					_g_object_unref0 (child);
					return result;
				}
				_tmp22_ = action_row;
				if (_tmp22_ != NULL) {
					AdwActionRow* _tmp23_;
					const gchar* _tmp24_;
					const gchar* _tmp25_;
					_tmp23_ = action_row;
					_tmp24_ = adw_action_row_get_subtitle (_tmp23_);
					_tmp25_ = _tmp24_;
					_tmp21_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_text_matches (self, _tmp25_, query);
				} else {
					_tmp21_ = FALSE;
				}
				if (_tmp21_) {
					result = TRUE;
					_g_object_unref0 (action_row);
					_g_object_unref0 (row);
					_g_object_unref0 (child);
					return result;
				}
				_g_object_unref0 (action_row);
				_g_object_unref0 (row);
			}
		}
		_g_object_unref0 (child);
	}
	result = FALSE;
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_text_matches (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                        const gchar* text,
                                                                                        const gchar* query)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (query != NULL, FALSE);
	if (text != NULL) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = g_utf8_strdown (text, (gssize) -1);
		_tmp2_ = _tmp1_;
		_tmp0_ = string_contains (_tmp2_, query);
		_g_free0 (_tmp2_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_real_has_advanced_active (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	gboolean _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->_is_advanced_group;
	result = _tmp0_;
	return result;
}

gboolean
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_has_advanced_active (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroupClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_GET_CLASS (self);
	if (_klass_->has_advanced_active) {
		return _klass_->has_advanced_active (self);
	}
	return FALSE;
}

gboolean
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_is_advanced_group (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_advanced_group;
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_is_advanced_group (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_is_advanced_group (self);
	if (old_value != value) {
		self->priv->_is_advanced_group = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_IS_ADVANCED_GROUP_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroupClass * klass,
                                                                                      gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup_private_offset);
	((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroupClass *) klass)->has_advanced_active = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*)) proton_plus_widgets_games_launch_options_editor_groups_base_options_group_real_has_advanced_active;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_IS_ADVANCED_GROUP_PROPERTY, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_IS_ADVANCED_GROUP_PROPERTY] = g_param_spec_boolean ("is-advanced-group", "is-advanced-group", "is-advanced-group", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_CHANGED_SIGNAL] = g_signal_new ("changed", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_ADVANCED_CHANGED_SIGNAL] = g_signal_new ("advanced-changed", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup * self,
                                                                                         gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_instance_private (self);
	self->priv->_is_advanced_group = FALSE;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_groups_base_options_group_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_groups_base_options_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_groups_base_options_group_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id;
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id = g_type_register_static (adw_preferences_group_get_type (), "ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroupPrivate));
	return proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id;
		proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id__once, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_groups_base_options_group_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_property (GObject * object,
                                                                                              guint property_id,
                                                                                              GValue * value,
                                                                                              GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_IS_ADVANCED_GROUP_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_games_launch_options_editor_groups_base_options_group_get_is_advanced_group (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_property (GObject * object,
                                                                                              guint property_id,
                                                                                              const GValue * value,
                                                                                              GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_BASE_OPTIONS_GROUP_IS_ADVANCED_GROUP_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_groups_base_options_group_set_is_advanced_group (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

