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

#include <glib-object.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.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 TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
#define IS_FOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FOO))
#define IS_FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FOO))
#define FOO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FOO, FooClass))

typedef struct _Foo Foo;
typedef struct _FooClass FooClass;
typedef struct _FooPrivate FooPrivate;
enum  {
	FOO_0_PROPERTY,
	FOO_NUM_PROPERTIES
};
static GParamSpec* foo_properties[FOO_NUM_PROPERTIES];

#define TYPE_BAR (bar_get_type ())
#define BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BAR, Bar))
#define BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BAR, BarClass))
#define IS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BAR))
#define IS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BAR))
#define BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BAR, BarClass))

typedef struct _Bar Bar;
typedef struct _BarClass BarClass;
typedef struct _BarPrivate BarPrivate;
enum  {
	BAR_0_PROPERTY,
	BAR_NUM_PROPERTIES
};
static GParamSpec* bar_properties[BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _Foo {
	GObject parent_instance;
	FooPrivate * priv;
};

struct _FooClass {
	GObjectClass parent_class;
	void (*test) (Foo* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, gconstpointer parameter);
};

struct _Bar {
	Foo parent_instance;
	BarPrivate * priv;
};

struct _BarClass {
	FooClass parent_class;
};

static gpointer foo_parent_class = NULL;
static gpointer bar_parent_class = NULL;

VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
VALA_EXTERN void foo_test (Foo* self,
               GType t_type,
               GBoxedCopyFunc t_dup_func,
               GDestroyNotify t_destroy_func,
               gconstpointer parameter);
static void foo_real_test (Foo* self,
                    GType t_type,
                    GBoxedCopyFunc t_dup_func,
                    GDestroyNotify t_destroy_func,
                    gconstpointer parameter);
VALA_EXTERN Foo* foo_construct (GType object_type);
static GType foo_get_type_once (void);
VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
static void bar_real_test (Foo* base,
                    GType t_type,
                    GBoxedCopyFunc t_dup_func,
                    GDestroyNotify t_destroy_func,
                    gconstpointer parameter);
VALA_EXTERN Bar* bar_new (void);
VALA_EXTERN Bar* bar_construct (GType object_type);
static GType bar_get_type_once (void);
static gint _vala_main (void);

static void
foo_real_test (Foo* self,
               GType t_type,
               GBoxedCopyFunc t_dup_func,
               GDestroyNotify t_destroy_func,
               gconstpointer parameter)
{
	g_critical ("Type `%s' does not implement abstract method `foo_test'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
foo_test (Foo* self,
          GType t_type,
          GBoxedCopyFunc t_dup_func,
          GDestroyNotify t_destroy_func,
          gconstpointer parameter)
{
	FooClass* _klass_;
	g_return_if_fail (IS_FOO (self));
	_klass_ = FOO_GET_CLASS (self);
	if (_klass_->test) {
		_klass_->test (self, t_type, t_dup_func, t_destroy_func, parameter);
	}
}

Foo*
foo_construct (GType object_type)
{
	Foo * self = NULL;
	self = (Foo*) g_object_new (object_type, NULL);
	return self;
}

static void
foo_class_init (FooClass * klass,
                gpointer klass_data)
{
	foo_parent_class = g_type_class_peek_parent (klass);
	((FooClass *) klass)->test = (void (*) (Foo*, GType, GBoxedCopyFunc, GDestroyNotify, gconstpointer)) foo_real_test;
}

static void
foo_instance_init (Foo * self,
                   gpointer klass)
{
}

static GType
foo_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FooClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) foo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Foo), 0, (GInstanceInitFunc) foo_instance_init, NULL };
	GType foo_type_id;
	foo_type_id = g_type_register_static (G_TYPE_OBJECT, "Foo", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return foo_type_id;
}

GType
foo_get_type (void)
{
	static volatile gsize foo_type_id__once = 0;
	if (g_once_init_enter (&foo_type_id__once)) {
		GType foo_type_id;
		foo_type_id = foo_get_type_once ();
		g_once_init_leave (&foo_type_id__once, foo_type_id);
	}
	return foo_type_id__once;
}

static void
bar_real_test (Foo* base,
               GType t_type,
               GBoxedCopyFunc t_dup_func,
               GDestroyNotify t_destroy_func,
               gconstpointer parameter)
{
	Bar * self;
	FILE* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_BAR, Bar);
	_tmp0_ = stdout;
	fprintf (_tmp0_, "Just a test!\n");
}

Bar*
bar_construct (GType object_type)
{
	Bar * self = NULL;
	self = (Bar*) foo_construct (object_type);
	return self;
}

Bar*
bar_new (void)
{
	return bar_construct (TYPE_BAR);
}

static void
bar_class_init (BarClass * klass,
                gpointer klass_data)
{
	bar_parent_class = g_type_class_peek_parent (klass);
	((FooClass *) klass)->test = (void (*) (Foo*, GType, GBoxedCopyFunc, GDestroyNotify, gconstpointer)) bar_real_test;
}

static void
bar_instance_init (Bar * self,
                   gpointer klass)
{
}

static GType
bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Bar), 0, (GInstanceInitFunc) bar_instance_init, NULL };
	GType bar_type_id;
	bar_type_id = g_type_register_static (TYPE_FOO, "Bar", &g_define_type_info, 0);
	return bar_type_id;
}

GType
bar_get_type (void)
{
	static volatile gsize bar_type_id__once = 0;
	if (g_once_init_enter (&bar_type_id__once)) {
		GType bar_type_id;
		bar_type_id = bar_get_type_once ();
		g_once_init_leave (&bar_type_id__once, bar_type_id);
	}
	return bar_type_id__once;
}

static gint
_vala_main (void)
{
	Bar* obj = NULL;
	Bar* _tmp0_;
	gint result;
	_tmp0_ = bar_new ();
	obj = _tmp0_;
	foo_test (G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FOO, Foo), G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, "test");
	result = 0;
	_g_object_unref0 (obj);
	return result;
}

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

