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

/* 
 *      Copyright 2011 Julien Lavergne <gilir@ubuntu.com>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

#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 LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG (lxsession_lxsession_autostart_config_get_type ())
#define LXSESSION_LXSESSION_AUTOSTART_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG, LxsessionLxsessionAutostartConfig))
#define LXSESSION_LXSESSION_AUTOSTART_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG, LxsessionLxsessionAutostartConfigClass))
#define LXSESSION_IS_LXSESSION_AUTOSTART_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG))
#define LXSESSION_IS_LXSESSION_AUTOSTART_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG))
#define LXSESSION_LXSESSION_AUTOSTART_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG, LxsessionLxsessionAutostartConfigClass))

typedef struct _LxsessionLxsessionAutostartConfig LxsessionLxsessionAutostartConfig;
typedef struct _LxsessionLxsessionAutostartConfigClass LxsessionLxsessionAutostartConfigClass;
typedef struct _LxsessionLxsessionAutostartConfigPrivate LxsessionLxsessionAutostartConfigPrivate;

#define LXSESSION_TYPE_APP_TYPE (lxsession_app_type_get_type ())
typedef struct _LxsessionAppType LxsessionAppType;
enum  {
	LXSESSION_LXSESSION_AUTOSTART_CONFIG_0_PROPERTY,
	LXSESSION_LXSESSION_AUTOSTART_CONFIG_NUM_PROPERTIES
};
static GParamSpec* lxsession_lxsession_autostart_config_properties[LXSESSION_LXSESSION_AUTOSTART_CONFIG_NUM_PROPERTIES];
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define LXSESSION_TYPE_APP_OBJECT (lxsession_app_object_get_type ())
#define LXSESSION_APP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_APP_OBJECT, LxsessionAppObject))
#define LXSESSION_APP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_APP_OBJECT, LxsessionAppObjectClass))
#define LXSESSION_IS_APP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_APP_OBJECT))
#define LXSESSION_IS_APP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_APP_OBJECT))
#define LXSESSION_APP_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_APP_OBJECT, LxsessionAppObjectClass))

typedef struct _LxsessionAppObject LxsessionAppObject;
typedef struct _LxsessionAppObjectClass LxsessionAppObjectClass;

#define LXSESSION_TYPE_GENERIC_APP_OBJECT (lxsession_generic_app_object_get_type ())
#define LXSESSION_GENERIC_APP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_GENERIC_APP_OBJECT, LxsessionGenericAppObject))
#define LXSESSION_GENERIC_APP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_GENERIC_APP_OBJECT, LxsessionGenericAppObjectClass))
#define LXSESSION_IS_GENERIC_APP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_GENERIC_APP_OBJECT))
#define LXSESSION_IS_GENERIC_APP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_GENERIC_APP_OBJECT))
#define LXSESSION_GENERIC_APP_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_GENERIC_APP_OBJECT, LxsessionGenericAppObjectClass))

typedef struct _LxsessionGenericAppObject LxsessionGenericAppObject;
typedef struct _LxsessionGenericAppObjectClass LxsessionGenericAppObjectClass;

struct _LxsessionLxsessionAutostartConfig {
	GObject parent_instance;
	LxsessionLxsessionAutostartConfigPrivate * priv;
};

struct _LxsessionLxsessionAutostartConfigClass {
	GObjectClass parent_class;
};

struct _LxsessionAppType {
	gchar* name;
	gchar** command;
	gint command_length1;
	gboolean guard;
	gchar* application_type;
};

struct _LxsessionLxsessionAutostartConfigPrivate {
	GArray* stock_list;
};

static gint LxsessionLxsessionAutostartConfig_private_offset;
static gpointer lxsession_lxsession_autostart_config_parent_class = NULL;

VALA_EXTERN GType lxsession_lxsession_autostart_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionLxsessionAutostartConfig, g_object_unref)
VALA_EXTERN GType lxsession_app_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN LxsessionAppType* lxsession_app_type_dup (const LxsessionAppType* self);
VALA_EXTERN void lxsession_app_type_free (LxsessionAppType* self);
VALA_EXTERN void lxsession_app_type_copy (const LxsessionAppType* self,
                              LxsessionAppType* dest);
VALA_EXTERN void lxsession_app_type_destroy (LxsessionAppType* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (LxsessionAppType, lxsession_app_type_destroy)
VALA_EXTERN LxsessionLxsessionAutostartConfig* lxsession_lxsession_autostart_config_new (void);
VALA_EXTERN LxsessionLxsessionAutostartConfig* lxsession_lxsession_autostart_config_construct (GType object_type);
VALA_EXTERN GArray* lxsession_lxsession_autostart_config_load_autostart_file (LxsessionLxsessionAutostartConfig* self);
VALA_EXTERN gchar* lxsession_get_config_path (const gchar* conf_file);
static void _lxsession_app_type_free0_ (gpointer var);
static void _vala_LxsessionAppType_free_function_content_of (gpointer data);
static gchar** _vala_array_dup4 (gchar** self,
                          gssize length);
static gchar** _vala_array_dup5 (gchar** self,
                          gssize length);
VALA_EXTERN void lxsession_lxsession_autostart_config_start_applications (LxsessionLxsessionAutostartConfig* self);
VALA_EXTERN GType lxsession_app_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionAppObject, g_object_unref)
VALA_EXTERN GType lxsession_generic_app_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionGenericAppObject, g_object_unref)
VALA_EXTERN LxsessionGenericAppObject* lxsession_generic_app_object_new (LxsessionAppType* app_type);
VALA_EXTERN LxsessionGenericAppObject* lxsession_generic_app_object_construct (GType object_type,
                                                                   LxsessionAppType* app_type);
VALA_EXTERN void lxsession_app_object_launch (LxsessionAppObject* self);
VALA_EXTERN void lxsession_lxsession_autostart_config_check_dupplicate (LxsessionLxsessionAutostartConfig* self);
static void lxsession_lxsession_autostart_config_finalize (GObject * obj);
static GType lxsession_lxsession_autostart_config_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
lxsession_lxsession_autostart_config_get_instance_private (LxsessionLxsessionAutostartConfig* self)
{
	return G_STRUCT_MEMBER_P (self, LxsessionLxsessionAutostartConfig_private_offset);
}

LxsessionLxsessionAutostartConfig*
lxsession_lxsession_autostart_config_construct (GType object_type)
{
	LxsessionLxsessionAutostartConfig * self = NULL;
	GArray* _tmp0_;
	self = (LxsessionLxsessionAutostartConfig*) g_object_new (object_type, NULL);
	_tmp0_ = lxsession_lxsession_autostart_config_load_autostart_file (self);
	_g_array_unref0 (self->priv->stock_list);
	self->priv->stock_list = _tmp0_;
	return self;
}

LxsessionLxsessionAutostartConfig*
lxsession_lxsession_autostart_config_new (void)
{
	return lxsession_lxsession_autostart_config_construct (LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG);
}

static void
_lxsession_app_type_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (lxsession_app_type_free (var), NULL));
}

static void
_vala_LxsessionAppType_free_function_content_of (gpointer data)
{
	LxsessionAppType* self;
	self = *((LxsessionAppType**) data);
	_lxsession_app_type_free0_ (self);
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static gchar**
_vala_array_dup4 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gpointer
_lxsession_app_type_dup0 (gpointer self)
{
	return self ? lxsession_app_type_dup (self) : NULL;
}

static gchar**
_vala_array_dup5 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

GArray*
lxsession_lxsession_autostart_config_load_autostart_file (LxsessionLxsessionAutostartConfig* self)
{
	GFile* file = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GArray* app_list = NULL;
	GArray* _tmp4_;
	GFile* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GFile* _tmp8_;
	GError* _inner_error0_ = NULL;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = lxsession_get_config_path ("autostart");
	_tmp1_ = _tmp0_;
	_tmp2_ = g_file_new_for_path (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	file = _tmp3_;
	_tmp4_ = g_array_new (TRUE, TRUE, sizeof (LxsessionAppType*));
	g_array_set_clear_func (_tmp4_, (GDestroyNotify) _vala_LxsessionAppType_free_function_content_of);
	app_list = _tmp4_;
	_tmp5_ = file;
	_tmp6_ = g_file_get_path (_tmp5_);
	_tmp7_ = _tmp6_;
	g_message ("autostart.vala:42: Autostart path : %s", _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = file;
	if (g_file_query_exists (_tmp8_, NULL)) {
		{
			GFileInputStream* _tmp9_ = NULL;
			GFile* _tmp10_;
			GFileInputStream* _tmp11_;
			GDataInputStream* dis = NULL;
			GDataInputStream* _tmp12_;
			gchar* line = NULL;
			_tmp10_ = file;
			_tmp11_ = g_file_read (_tmp10_, NULL, &_inner_error0_);
			_tmp9_ = _tmp11_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp12_ = g_data_input_stream_new ((GInputStream*) _tmp9_);
			dis = _tmp12_;
			while (TRUE) {
				gchar* _tmp13_ = NULL;
				GDataInputStream* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				const gchar* _tmp17_;
				gchar* first = NULL;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				const gchar* _tmp20_;
				const gchar* _tmp21_;
				GQuark _tmp23_ = 0U;
				static GQuark _tmp22_label0 = 0;
				static GQuark _tmp22_label1 = 0;
				_tmp14_ = dis;
				_tmp15_ = g_data_input_stream_read_line (_tmp14_, NULL, NULL, &_inner_error0_);
				_tmp13_ = _tmp15_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (line);
					_g_object_unref0 (dis);
					_g_object_unref0 (_tmp9_);
					goto __catch0_g_error;
				}
				_tmp16_ = _tmp13_;
				_tmp13_ = NULL;
				_g_free0 (line);
				line = _tmp16_;
				_tmp17_ = line;
				if (!(_tmp17_ != NULL)) {
					_g_free0 (_tmp13_);
					break;
				}
				_tmp18_ = line;
				_tmp19_ = string_slice (_tmp18_, (glong) 0, (glong) 1);
				first = _tmp19_;
				_tmp20_ = first;
				_tmp21_ = _tmp20_;
				_tmp23_ = (NULL == _tmp21_) ? 0 : g_quark_from_string (_tmp21_);
				if (_tmp23_ == ((0 != _tmp22_label0) ? _tmp22_label0 : (_tmp22_label0 = g_quark_from_static_string ("@")))) {
					switch (0) {
						default:
						{
							GString* builder = NULL;
							GString* _tmp24_;
							GString* _tmp25_;
							const gchar* _tmp26_;
							GString* _tmp27_;
							gchar** command = NULL;
							GString* _tmp28_;
							const gchar* _tmp29_;
							gchar** _tmp30_;
							gchar** _tmp31_;
							gint command_length1;
							gint _command_size_;
							LxsessionAppType app = {0};
							gchar** _tmp32_;
							gint _tmp32__length1;
							const gchar* _tmp33_;
							gchar* _tmp34_;
							gchar** _tmp35_;
							gint _tmp35__length1;
							gchar** _tmp36_;
							gint _tmp36__length1;
							gchar* _tmp37_;
							LxsessionAppType _tmp38_ = {0};
							GArray* _tmp39_;
							LxsessionAppType _tmp40_;
							LxsessionAppType _tmp41_;
							LxsessionAppType* _tmp42_;
							_tmp24_ = g_string_new ("");
							builder = _tmp24_;
							_tmp25_ = builder;
							_tmp26_ = line;
							g_string_append (_tmp25_, _tmp26_);
							_tmp27_ = builder;
							g_string_erase (_tmp27_, (gssize) 0, (gssize) 1);
							_tmp28_ = builder;
							_tmp29_ = _tmp28_->str;
							_tmp31_ = _tmp30_ = g_strsplit_set (_tmp29_, " ", 0);
							command = _tmp31_;
							command_length1 = _vala_array_length (_tmp30_);
							_command_size_ = command_length1;
							_tmp32_ = command;
							_tmp32__length1 = command_length1;
							_tmp33_ = _tmp32_[0];
							_tmp34_ = g_strdup (_tmp33_);
							_tmp35_ = command;
							_tmp35__length1 = command_length1;
							_tmp36_ = (_tmp35_ != NULL) ? _vala_array_dup4 (_tmp35_, _tmp35__length1) : _tmp35_;
							_tmp36__length1 = _tmp35__length1;
							_tmp37_ = g_strdup ("");
							_g_free0 (_tmp38_.name);
							_tmp38_.name = _tmp34_;
							_tmp38_.command = (_vala_array_free (_tmp38_.command, _tmp38_.command_length1, (GDestroyNotify) g_free), NULL);
							_tmp38_.command = _tmp36_;
							_tmp38_.command_length1 = _tmp36__length1;
							_tmp38_.guard = TRUE;
							_g_free0 (_tmp38_.application_type);
							_tmp38_.application_type = _tmp37_;
							app = _tmp38_;
							_tmp39_ = app_list;
							_tmp40_ = app;
							_tmp41_ = _tmp40_;
							_tmp42_ = _lxsession_app_type_dup0 (&_tmp41_);
							g_array_append_val (_tmp39_, _tmp42_);
							lxsession_app_type_destroy (&app);
							command = (_vala_array_free (command, command_length1, (GDestroyNotify) g_free), NULL);
							_g_string_free0 (builder);
							break;
						}
					}
				} else if (_tmp23_ == ((0 != _tmp22_label1) ? _tmp22_label1 : (_tmp22_label1 = g_quark_from_static_string ("#")))) {
					switch (0) {
						default:
						{
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							gchar** command = NULL;
							const gchar* _tmp43_;
							gchar** _tmp44_;
							gchar** _tmp45_;
							gint command_length1;
							gint _command_size_;
							LxsessionAppType app = {0};
							gchar** _tmp46_;
							gint _tmp46__length1;
							const gchar* _tmp47_;
							gchar* _tmp48_;
							gchar** _tmp49_;
							gint _tmp49__length1;
							gchar** _tmp50_;
							gint _tmp50__length1;
							gchar* _tmp51_;
							LxsessionAppType _tmp52_ = {0};
							GArray* _tmp53_;
							LxsessionAppType _tmp54_;
							LxsessionAppType _tmp55_;
							LxsessionAppType* _tmp56_;
							_tmp43_ = line;
							_tmp45_ = _tmp44_ = g_strsplit_set (_tmp43_, " ", 0);
							command = _tmp45_;
							command_length1 = _vala_array_length (_tmp44_);
							_command_size_ = command_length1;
							_tmp46_ = command;
							_tmp46__length1 = command_length1;
							_tmp47_ = _tmp46_[0];
							_tmp48_ = g_strdup (_tmp47_);
							_tmp49_ = command;
							_tmp49__length1 = command_length1;
							_tmp50_ = (_tmp49_ != NULL) ? _vala_array_dup5 (_tmp49_, _tmp49__length1) : _tmp49_;
							_tmp50__length1 = _tmp49__length1;
							_tmp51_ = g_strdup ("");
							_g_free0 (_tmp52_.name);
							_tmp52_.name = _tmp48_;
							_tmp52_.command = (_vala_array_free (_tmp52_.command, _tmp52_.command_length1, (GDestroyNotify) g_free), NULL);
							_tmp52_.command = _tmp50_;
							_tmp52_.command_length1 = _tmp50__length1;
							_tmp52_.guard = FALSE;
							_g_free0 (_tmp52_.application_type);
							_tmp52_.application_type = _tmp51_;
							app = _tmp52_;
							_tmp53_ = app_list;
							_tmp54_ = app;
							_tmp55_ = _tmp54_;
							_tmp56_ = _lxsession_app_type_dup0 (&_tmp55_);
							g_array_append_val (_tmp53_, _tmp56_);
							lxsession_app_type_destroy (&app);
							command = (_vala_array_free (command, command_length1, (GDestroyNotify) g_free), NULL);
							break;
						}
					}
				}
				_g_free0 (first);
				_g_free0 (_tmp13_);
			}
			_g_free0 (line);
			_g_object_unref0 (dis);
			_g_object_unref0 (_tmp9_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			const gchar* _tmp57_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp57_ = e->message;
			g_error ("autostart.vala:75: %s", _tmp57_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_array_unref0 (app_list);
			_g_object_unref0 (file);
			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;
		}
	}
	result = app_list;
	_g_object_unref0 (file);
	return result;
}

void
lxsession_lxsession_autostart_config_start_applications (LxsessionLxsessionAutostartConfig* self)
{
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GArray* _tmp2_;
				LxsessionAppType s = {0};
				GArray* _tmp3_;
				LxsessionGenericAppObject* launch_app = NULL;
				LxsessionAppType _tmp4_;
				LxsessionGenericAppObject* _tmp5_;
				LxsessionGenericAppObject* _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					i = i + 1;
					_tmp1_ = i;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->stock_list;
				if (!(((guint) i) < _tmp2_->len)) {
					break;
				}
				_tmp3_ = self->priv->stock_list;
				s = *g_array_index (_tmp3_, LxsessionAppType*, (guint) i);
				_tmp4_ = s;
				_tmp5_ = lxsession_generic_app_object_new (&_tmp4_);
				launch_app = _tmp5_;
				_tmp6_ = launch_app;
				lxsession_app_object_launch ((LxsessionAppObject*) _tmp6_);
				_g_object_unref0 (launch_app);
			}
		}
	}
}

void
lxsession_lxsession_autostart_config_check_dupplicate (LxsessionLxsessionAutostartConfig* self)
{
	g_return_if_fail (self != NULL);
}

static void
lxsession_lxsession_autostart_config_class_init (LxsessionLxsessionAutostartConfigClass * klass,
                                                 gpointer klass_data)
{
	lxsession_lxsession_autostart_config_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LxsessionLxsessionAutostartConfig_private_offset);
	G_OBJECT_CLASS (klass)->finalize = lxsession_lxsession_autostart_config_finalize;
}

static void
lxsession_lxsession_autostart_config_instance_init (LxsessionLxsessionAutostartConfig * self,
                                                    gpointer klass)
{
	self->priv = lxsession_lxsession_autostart_config_get_instance_private (self);
}

static void
lxsession_lxsession_autostart_config_finalize (GObject * obj)
{
	LxsessionLxsessionAutostartConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LXSESSION_TYPE_LXSESSION_AUTOSTART_CONFIG, LxsessionLxsessionAutostartConfig);
	_g_array_unref0 (self->priv->stock_list);
	G_OBJECT_CLASS (lxsession_lxsession_autostart_config_parent_class)->finalize (obj);
}

static GType
lxsession_lxsession_autostart_config_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LxsessionLxsessionAutostartConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lxsession_lxsession_autostart_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LxsessionLxsessionAutostartConfig), 0, (GInstanceInitFunc) lxsession_lxsession_autostart_config_instance_init, NULL };
	GType lxsession_lxsession_autostart_config_type_id;
	lxsession_lxsession_autostart_config_type_id = g_type_register_static (G_TYPE_OBJECT, "LxsessionLxsessionAutostartConfig", &g_define_type_info, 0);
	LxsessionLxsessionAutostartConfig_private_offset = g_type_add_instance_private (lxsession_lxsession_autostart_config_type_id, sizeof (LxsessionLxsessionAutostartConfigPrivate));
	return lxsession_lxsession_autostart_config_type_id;
}

GType
lxsession_lxsession_autostart_config_get_type (void)
{
	static volatile gsize lxsession_lxsession_autostart_config_type_id__once = 0;
	if (g_once_init_enter (&lxsession_lxsession_autostart_config_type_id__once)) {
		GType lxsession_lxsession_autostart_config_type_id;
		lxsession_lxsession_autostart_config_type_id = lxsession_lxsession_autostart_config_get_type_once ();
		g_once_init_leave (&lxsession_lxsession_autostart_config_type_id__once, lxsession_lxsession_autostart_config_type_id);
	}
	return lxsession_lxsession_autostart_config_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

