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

/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * hello-world.vala
 * Copyright (C) Niels De Graef <nielsdegraef@gmail.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 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "libgimp/gimp.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include "libgimp/gimpui.h"
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib/gstdio.h>
#include <gegl.h>

#define PLUG_IN_PROC "plug-in-goat-exercise-vala"
#define PLUG_IN_ROLE "goat-exercise-vala"
#define PLUG_IN_BINARY "goat-exercise-vala"
#define PLUG_IN_SOURCE PLUG_IN_BINARY ".vala"
#define URL "https://gitlab.gnome.org/GNOME/gimp/blob/master/extensions/goat-exerci" \
"ses/goat-exercise-vala.vala"
#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 TYPE_GOAT (goat_get_type ())
#define GOAT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GOAT, Goat))
#define GOAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GOAT, GoatClass))
#define IS_GOAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GOAT))
#define IS_GOAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GOAT))
#define GOAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GOAT, GoatClass))

typedef struct _Goat Goat;
typedef struct _GoatClass GoatClass;
typedef struct _GoatPrivate GoatPrivate;
enum  {
	GOAT_0_PROPERTY,
	GOAT_NUM_PROPERTIES
};
static GParamSpec* goat_properties[GOAT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#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 _Goat {
	GimpPlugIn parent_instance;
	GoatPrivate * priv;
};

struct _GoatClass {
	GimpPlugInClass parent_class;
};

static gpointer goat_parent_class = NULL;

static gint _vala_main (gchar** args,
                 gint args_length1);
VALA_EXTERN GType goat_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Goat, g_object_unref)
static GList* goat_real_query_procedures (GimpPlugIn* base);
static GimpProcedure* goat_real_create_procedure (GimpPlugIn* base,
                                           const gchar* name);
VALA_EXTERN GimpValueArray* goat_run (Goat* self,
                          GimpProcedure* procedure,
                          GimpRunMode run_mode,
                          GimpImage* image,
                          GimpDrawable** drawables,
                          gint drawables_length1,
                          GimpProcedureConfig* config);
static GimpValueArray* _goat_run_gimp_run_image_func (GimpProcedure* procedure,
                                               GimpRunMode run_mode,
                                               GimpImage* image,
                                               GimpDrawable** drawables,
                                               GimpProcedureConfig* config,
                                               gpointer self);
static void _gimp_standard_help_func_gimp_help_func (const gchar* help_id,
                                              void* help_data);
VALA_EXTERN Goat* goat_new (void);
VALA_EXTERN Goat* goat_construct (GType object_type);
static GType goat_get_type_once (void);
static gssize _vala_array_length (gpointer array);

static gint
_vala_main (gchar** args,
            gint args_length1)
{
	gint result;
	result = gimp_main (TYPE_GOAT, (gint) args_length1, args);
	return result;
}

int
main (int argc,
      char ** argv)
{
	return _vala_main (argv, argc);
}

static GList*
goat_real_query_procedures (GimpPlugIn* base)
{
	Goat * self;
	GList* procs = NULL;
	gchar* _tmp0_;
	GList* result;
	self = (Goat*) base;
	procs = NULL;
	_tmp0_ = g_strdup (PLUG_IN_PROC);
	procs = g_list_append (procs, _tmp0_);
	result = procs;
	return result;
}

static GimpValueArray*
_goat_run_gimp_run_image_func (GimpProcedure* procedure,
                               GimpRunMode run_mode,
                               GimpImage* image,
                               GimpDrawable** drawables,
                               GimpProcedureConfig* config,
                               gpointer self)
{
	GimpValueArray* result;
	result = goat_run ((Goat*) self, procedure, run_mode, image, drawables, _vala_array_length (drawables), config);
	return result;
}

static GimpProcedure*
goat_real_create_procedure (GimpPlugIn* base,
                            const gchar* name)
{
	Goat * self;
	GimpImageProcedure* procedure = NULL;
	GimpImageProcedure* _tmp0_;
	GimpProcedure* result;
	self = (Goat*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_vala_assert (g_strcmp0 (name, PLUG_IN_PROC) == 0, "name == PLUG_IN_PROC");
	_tmp0_ = (GimpImageProcedure*) gimp_image_procedure_new ((GimpPlugIn*) self, name, GIMP_PDB_PROC_TYPE_PLUGIN, _goat_run_gimp_run_image_func, g_object_ref (self), g_object_unref);
	procedure = _tmp0_;
	gimp_procedure_set_image_types ((GimpProcedure*) procedure, "RGB*, INDEXED*, GRAY*");
	gimp_procedure_set_sensitivity_mask ((GimpProcedure*) procedure, (gint) GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
	gimp_procedure_set_menu_label ((GimpProcedure*) procedure, _ ("Plug-In Example in _Vala"));
	gimp_procedure_set_documentation ((GimpProcedure*) procedure, _ ("Plug-in example in Vala"), _ ("Plug-in example in Vala"), PLUG_IN_PROC);
	gimp_procedure_add_menu_path ((GimpProcedure*) procedure, "<Image>/Filters/Development/Plug-In Examples/");
	gimp_procedure_set_attribution ((GimpProcedure*) procedure, "Niels De Graef", "Niels De Graef", "2020");
	gimp_procedure_set_icon_name ((GimpProcedure*) procedure, GIMP_ICON_GEGL);
	result = (GimpProcedure*) procedure;
	return result;
}

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

static void
_gimp_standard_help_func_gimp_help_func (const gchar* help_id,
                                         void* help_data)
{
	gimp_standard_help_func (help_id, help_data);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

GimpValueArray*
goat_run (Goat* self,
          GimpProcedure* procedure,
          GimpRunMode run_mode,
          GimpImage* image,
          GimpDrawable** drawables,
          gint drawables_length1,
          GimpProcedureConfig* config)
{
	GimpDrawable* drawable = NULL;
	GimpDrawable* _tmp0_;
	GimpDrawable* _tmp1_;
	gint x = 0;
	gint y = 0;
	gint width = 0;
	gint height = 0;
	GimpDrawable* _tmp46_;
	gint _tmp47_ = 0;
	gint _tmp48_ = 0;
	gint _tmp49_ = 0;
	gint _tmp50_ = 0;
	gboolean _tmp51_;
	gchar** argv = NULL;
	gint argv_length1;
	gint _argv_size_;
	GimpDrawable* _tmp62_;
	GimpDrawable* _tmp63_;
	GimpValueArray* _tmp64_;
	GError* _inner_error0_ = NULL;
	GimpValueArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (procedure != NULL, NULL);
	g_return_val_if_fail (image != NULL, NULL);
	g_return_val_if_fail (config != NULL, NULL);
	_tmp0_ = drawables[0];
	_tmp1_ = _g_object_ref0 (_tmp0_);
	drawable = _tmp1_;
	if (run_mode == GIMP_RUN_INTERACTIVE) {
		GimpDialog* dialog = NULL;
		GimpDialog* _tmp2_;
		GdkGeometry geometry = {0};
		GimpDialog* _tmp3_;
		GdkGeometry _tmp4_;
		GtkBox* box = NULL;
		GtkBox* _tmp5_;
		GtkBox* _tmp6_;
		GimpDialog* _tmp7_;
		GtkBox* _tmp8_;
		GtkBox* _tmp9_;
		GtkBox* _tmp10_;
		gchar* head_text = NULL;
		gchar* _tmp11_;
		GtkLabel* label = NULL;
		const gchar* _tmp12_;
		GtkLabel* _tmp13_;
		GtkBox* _tmp14_;
		GtkLabel* _tmp15_;
		GtkLabel* _tmp16_;
		gchar* file = NULL;
		const gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* contents = NULL;
		GtkScrolledWindow* scrolled = NULL;
		GtkScrolledWindow* _tmp24_;
		GtkScrolledWindow* _tmp25_;
		GtkBox* _tmp26_;
		GtkScrolledWindow* _tmp27_;
		GtkScrolledWindow* _tmp28_;
		GtkTextView* view = NULL;
		GtkTextView* _tmp29_;
		GtkTextView* _tmp30_;
		GtkTextView* _tmp31_;
		GtkTextView* _tmp32_;
		GtkTextBuffer* _tmp33_;
		GtkTextBuffer* _tmp34_;
		const gchar* _tmp35_;
		GtkScrolledWindow* _tmp36_;
		GtkTextView* _tmp37_;
		GtkTextView* _tmp38_;
		gimp_ui_init (PLUG_IN_BINARY);
		_tmp2_ = (GimpDialog*) gimp_dialog_new (_ ("Plug-In Example in Vala"), PLUG_IN_ROLE, NULL, GTK_DIALOG_USE_HEADER_BAR, _gimp_standard_help_func_gimp_help_func, PLUG_IN_PROC, _ ("_Cancel"), GTK_RESPONSE_CANCEL, _ ("_Source"), GTK_RESPONSE_APPLY, _ ("_Run"), GTK_RESPONSE_OK, NULL, NULL);
		g_object_ref_sink (_tmp2_);
		dialog = _tmp2_;
		memset (&geometry, 0, sizeof (GdkGeometry));
		geometry.min_aspect = 0.5;
		geometry.max_aspect = 1.0;
		_tmp3_ = dialog;
		_tmp4_ = geometry;
		gtk_window_set_geometry_hints ((GtkWindow*) _tmp3_, NULL, &_tmp4_, GDK_HINT_ASPECT);
		_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
		g_object_ref_sink (_tmp5_);
		box = _tmp5_;
		_tmp6_ = box;
		gtk_container_set_border_width ((GtkContainer*) _tmp6_, (guint) 12);
		_tmp7_ = dialog;
		_tmp8_ = gtk_dialog_get_content_area ((GtkDialog*) _tmp7_);
		_tmp9_ = box;
		gtk_container_add ((GtkContainer*) _tmp8_, (GtkWidget*) _tmp9_);
		_tmp10_ = box;
		gtk_widget_show ((GtkWidget*) _tmp10_);
		_tmp11_ = g_strdup_printf (_ ("This plug-in is an exercise in '%s' to demo plug-in creation.\n" \
"Check out the last version of the source code online by clicking the \"" \
"Source\" button."), "Vala");
		head_text = _tmp11_;
		_tmp12_ = head_text;
		_tmp13_ = (GtkLabel*) gtk_label_new (_tmp12_);
		g_object_ref_sink (_tmp13_);
		label = _tmp13_;
		_tmp14_ = box;
		_tmp15_ = label;
		gtk_box_pack_start (_tmp14_, (GtkWidget*) _tmp15_, FALSE, FALSE, (guint) 1);
		_tmp16_ = label;
		gtk_widget_show ((GtkWidget*) _tmp16_);
		_tmp17_ = gimp_plug_in_directory ();
		_tmp18_ = g_build_filename (_tmp17_, "extensions", "org.gimp.extension.goat-exercises", PLUG_IN_SOURCE, NULL);
		file = _tmp18_;
		{
			const gchar* _tmp19_;
			gchar* _tmp20_ = NULL;
			_tmp19_ = file;
			g_file_get_contents (_tmp19_, &_tmp20_, NULL, &_inner_error0_);
			_g_free0 (contents);
			contents = _tmp20_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* err = NULL;
			GError* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp21_ = err;
			_tmp22_ = _tmp21_->message;
			_tmp23_ = g_strdup_printf ("Couldn't get file contents: %s", _tmp22_);
			_g_free0 (contents);
			contents = _tmp23_;
			_g_error_free0 (err);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (contents);
			_g_free0 (file);
			_g_object_unref0 (label);
			_g_free0 (head_text);
			_g_object_unref0 (box);
			_g_object_unref0 (dialog);
			_g_object_unref0 (drawable);
			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;
		}
		_tmp24_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
		g_object_ref_sink (_tmp24_);
		scrolled = _tmp24_;
		_tmp25_ = scrolled;
		gtk_widget_set_vexpand ((GtkWidget*) _tmp25_, TRUE);
		_tmp26_ = box;
		_tmp27_ = scrolled;
		gtk_box_pack_start (_tmp26_, (GtkWidget*) _tmp27_, TRUE, TRUE, (guint) 1);
		_tmp28_ = scrolled;
		gtk_widget_show ((GtkWidget*) _tmp28_);
		_tmp29_ = (GtkTextView*) gtk_text_view_new ();
		g_object_ref_sink (_tmp29_);
		view = _tmp29_;
		_tmp30_ = view;
		gtk_text_view_set_wrap_mode (_tmp30_, GTK_WRAP_WORD);
		_tmp31_ = view;
		gtk_text_view_set_editable (_tmp31_, FALSE);
		_tmp32_ = view;
		_tmp33_ = gtk_text_view_get_buffer (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = contents;
		g_object_set (_tmp34_, "text", _tmp35_, NULL);
		_tmp36_ = scrolled;
		_tmp37_ = view;
		gtk_container_add ((GtkContainer*) _tmp36_, (GtkWidget*) _tmp37_);
		_tmp38_ = view;
		gtk_widget_show ((GtkWidget*) _tmp38_);
		while (TRUE) {
			gint response = 0;
			GimpDialog* _tmp39_;
			_tmp39_ = dialog;
			response = gimp_dialog_run (_tmp39_);
			if (response == ((gint) GTK_RESPONSE_OK)) {
				GimpDialog* _tmp40_;
				_tmp40_ = dialog;
				gtk_widget_destroy ((GtkWidget*) _tmp40_);
				break;
			} else {
				if (response == ((gint) GTK_RESPONSE_APPLY)) {
					{
						GimpDialog* _tmp41_;
						_tmp41_ = dialog;
						gtk_show_uri_on_window ((GtkWindow*) _tmp41_, URL, (guint32) GDK_CURRENT_TIME, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch1_g_error;
						}
					}
					goto __finally1;
					__catch1_g_error:
					{
						GError* err = NULL;
						GError* _tmp42_;
						const gchar* _tmp43_;
						err = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp42_ = err;
						_tmp43_ = _tmp42_->message;
						g_warning ("goat-exercise-vala.vala:127: Couldn't launch browser for %s: %s", URL, _tmp43_);
						_g_error_free0 (err);
					}
					__finally1:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (view);
						_g_object_unref0 (scrolled);
						_g_free0 (contents);
						_g_free0 (file);
						_g_object_unref0 (label);
						_g_free0 (head_text);
						_g_object_unref0 (box);
						_g_object_unref0 (dialog);
						_g_object_unref0 (drawable);
						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;
					}
					continue;
				} else {
					GimpDialog* _tmp44_;
					GimpValueArray* _tmp45_;
					_tmp44_ = dialog;
					gtk_widget_destroy ((GtkWidget*) _tmp44_);
					_tmp45_ = gimp_procedure_new_return_values (procedure, GIMP_PDB_CANCEL, NULL);
					result = _tmp45_;
					_g_object_unref0 (view);
					_g_object_unref0 (scrolled);
					_g_free0 (contents);
					_g_free0 (file);
					_g_object_unref0 (label);
					_g_free0 (head_text);
					_g_object_unref0 (box);
					_g_object_unref0 (dialog);
					_g_object_unref0 (drawable);
					return result;
				}
			}
		}
		_g_object_unref0 (view);
		_g_object_unref0 (scrolled);
		_g_free0 (contents);
		_g_free0 (file);
		_g_object_unref0 (label);
		_g_free0 (head_text);
		_g_object_unref0 (box);
		_g_object_unref0 (dialog);
	}
	_tmp46_ = drawable;
	_tmp51_ = gimp_drawable_mask_intersect (_tmp46_, &_tmp47_, &_tmp48_, &_tmp49_, &_tmp50_);
	x = _tmp47_;
	y = _tmp48_;
	width = _tmp49_;
	height = _tmp50_;
	if (!_tmp51_) {
		GError* _error_ = NULL;
		GError* _tmp52_;
		GError* _tmp53_;
		GError* _tmp54_;
		GimpValueArray* _tmp55_;
		_tmp52_ = g_error_new_literal (g_quark_from_string ("goat-error-quark"), 0, "No pixels to process in the selected area.");
		_error_ = _tmp52_;
		_tmp53_ = _error_;
		_tmp54_ = _g_error_copy0 (_tmp53_);
		_tmp55_ = gimp_procedure_new_return_values (procedure, GIMP_PDB_CALLING_ERROR, _tmp54_);
		result = _tmp55_;
		_g_error_free0 (_error_);
		_g_object_unref0 (drawable);
		return result;
	}
	argv = NULL;
	argv_length1 = 0;
	_argv_size_ = argv_length1;
	gegl_init ((gint*) (&argv_length1), &argv);
	_argv_size_ = argv_length1;
	{
		GeglBuffer* buffer = NULL;
		GimpDrawable* _tmp56_;
		GeglBuffer* _tmp57_;
		GeglBuffer* shadow_buffer = NULL;
		GimpDrawable* _tmp58_;
		GeglBuffer* _tmp59_;
		GeglBuffer* _tmp60_;
		GeglBuffer* _tmp61_;
		_tmp56_ = drawable;
		_tmp57_ = gimp_drawable_get_buffer (_tmp56_);
		buffer = _tmp57_;
		_tmp58_ = drawable;
		_tmp59_ = gimp_drawable_get_shadow_buffer (_tmp58_);
		shadow_buffer = _tmp59_;
		_tmp60_ = buffer;
		_tmp61_ = shadow_buffer;
		gegl_render_op (_tmp60_, _tmp61_, "gegl:invert", NULL, NULL);
		_g_object_unref0 (shadow_buffer);
		_g_object_unref0 (buffer);
	}
	_tmp62_ = drawable;
	gimp_drawable_merge_shadow (_tmp62_, TRUE);
	_tmp63_ = drawable;
	gimp_drawable_update (_tmp63_, x, y, width, height);
	gimp_displays_flush ();
	gegl_exit ();
	_tmp64_ = gimp_procedure_new_return_values (procedure, GIMP_PDB_SUCCESS, NULL);
	result = _tmp64_;
	_g_object_unref0 (drawable);
	return result;
}

Goat*
goat_construct (GType object_type)
{
	Goat * self = NULL;
	self = (Goat*) g_object_new (object_type, NULL);
	return self;
}

Goat*
goat_new (void)
{
	return goat_construct (TYPE_GOAT);
}

static void
goat_class_init (GoatClass * klass,
                 gpointer klass_data)
{
	goat_parent_class = g_type_class_peek_parent (klass);
	((GimpPlugInClass *) klass)->query_procedures = (GList* (*) (GimpPlugIn*)) goat_real_query_procedures;
	((GimpPlugInClass *) klass)->create_procedure = (GimpProcedure* (*) (GimpPlugIn*, const gchar*)) goat_real_create_procedure;
}

static void
goat_instance_init (Goat * self,
                    gpointer klass)
{
}

static GType
goat_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GoatClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) goat_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Goat), 0, (GInstanceInitFunc) goat_instance_init, NULL };
	GType goat_type_id;
	goat_type_id = g_type_register_static (gimp_plug_in_get_type (), "Goat", &g_define_type_info, 0);
	return goat_type_id;
}

GType
goat_get_type (void)
{
	static volatile gsize goat_type_id__once = 0;
	if (g_once_init_enter (&goat_type_id__once)) {
		GType goat_type_id;
		goat_type_id = goat_get_type_once ();
		g_once_init_leave (&goat_type_id__once, goat_type_id);
	}
	return goat_type_id__once;
}

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

