/* semantic_member_access_transformed_qualified.c generated by valac, the Vala compiler * generated from semantic_member_access_transformed_qualified.vala, do not modify */ #include #include #include #if !defined(VALA_EXTERN) #if defined(_WIN32) || defined(__CYGWIN__) #define VALA_EXTERN __declspec(dllexport) extern #elif __GNUC__ >= 4 #define VALA_EXTERN __attribute__((visibility("default"))) extern #else #define VALA_EXTERN extern #endif #endif #define FOO_MANAM_TYPE_FOO (foo_manam_foo_get_type ()) #define FOO_MANAM_FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_MANAM_TYPE_FOO, FooManamFoo)) #define FOO_MANAM_FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_MANAM_TYPE_FOO, FooManamFooClass)) #define FOO_MANAM_IS_FOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_MANAM_TYPE_FOO)) #define FOO_MANAM_IS_FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_MANAM_TYPE_FOO)) #define FOO_MANAM_FOO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_MANAM_TYPE_FOO, FooManamFooClass)) typedef struct _FooManamFoo FooManamFoo; typedef struct _FooManamFooClass FooManamFooClass; typedef struct _FooManamFooPrivate FooManamFooPrivate; typedef struct _FooManamParamSpecFoo FooManamParamSpecFoo; #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 _FooManamFoo { GTypeInstance parent_instance; volatile int ref_count; FooManamFooPrivate * priv; }; struct _FooManamFooClass { GTypeClass parent_class; void (*finalize) (FooManamFoo *self); }; struct _FooManamParamSpecFoo { GParamSpec parent_instance; }; VALA_EXTERN gint foo_bar_bar; gint foo_bar_bar = 23; static gpointer foo_manam_foo_parent_class = NULL; VALA_EXTERN gpointer foo_manam_foo_ref (gpointer instance); VALA_EXTERN void foo_manam_foo_unref (gpointer instance); VALA_EXTERN GParamSpec* foo_manam_param_spec_foo (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); VALA_EXTERN void foo_manam_value_set_foo (GValue* value, gpointer v_object); VALA_EXTERN void foo_manam_value_take_foo (GValue* value, gpointer v_object); VALA_EXTERN gpointer foo_manam_value_get_foo (const GValue* value); VALA_EXTERN GType foo_manam_foo_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (FooManamFoo, foo_manam_foo_unref) VALA_EXTERN void foo_manam_foo_faz (void); VALA_EXTERN FooManamFoo* foo_manam_foo_new (void); VALA_EXTERN FooManamFoo* foo_manam_foo_construct (GType object_type); static void foo_manam_foo_finalize (FooManamFoo * obj); static GType foo_manam_foo_get_type_once (void); static void _vala_main (void); void foo_manam_foo_faz (void) { foo_bar_bar = 42; } FooManamFoo* foo_manam_foo_construct (GType object_type) { FooManamFoo* self = NULL; self = (FooManamFoo*) g_type_create_instance (object_type); return self; } FooManamFoo* foo_manam_foo_new (void) { return foo_manam_foo_construct (FOO_MANAM_TYPE_FOO); } static void foo_manam_value_foo_init (GValue* value) { value->data[0].v_pointer = NULL; } static void foo_manam_value_foo_free_value (GValue* value) { if (value->data[0].v_pointer) { foo_manam_foo_unref (value->data[0].v_pointer); } } static void foo_manam_value_foo_copy_value (const GValue* src_value, GValue* dest_value) { if (src_value->data[0].v_pointer) { dest_value->data[0].v_pointer = foo_manam_foo_ref (src_value->data[0].v_pointer); } else { dest_value->data[0].v_pointer = NULL; } } static gpointer foo_manam_value_foo_peek_pointer (const GValue* value) { return value->data[0].v_pointer; } static gchar* foo_manam_value_foo_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { if (collect_values[0].v_pointer) { FooManamFoo * object; object = collect_values[0].v_pointer; if (object->parent_instance.g_class == NULL) { return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } value->data[0].v_pointer = foo_manam_foo_ref (object); } else { value->data[0].v_pointer = NULL; } return NULL; } static gchar* foo_manam_value_foo_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { FooManamFoo ** object_p; object_p = collect_values[0].v_pointer; if (!object_p) { return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); } if (!value->data[0].v_pointer) { *object_p = NULL; } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { *object_p = value->data[0].v_pointer; } else { *object_p = foo_manam_foo_ref (value->data[0].v_pointer); } return NULL; } GParamSpec* foo_manam_param_spec_foo (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { FooManamParamSpecFoo* spec; g_return_val_if_fail (g_type_is_a (object_type, FOO_MANAM_TYPE_FOO), NULL); spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); G_PARAM_SPEC (spec)->value_type = object_type; return G_PARAM_SPEC (spec); } gpointer foo_manam_value_get_foo (const GValue* value) { g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FOO_MANAM_TYPE_FOO), NULL); return value->data[0].v_pointer; } void foo_manam_value_set_foo (GValue* value, gpointer v_object) { FooManamFoo * old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FOO_MANAM_TYPE_FOO)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FOO_MANAM_TYPE_FOO)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; foo_manam_foo_ref (value->data[0].v_pointer); } else { value->data[0].v_pointer = NULL; } if (old) { foo_manam_foo_unref (old); } } void foo_manam_value_take_foo (GValue* value, gpointer v_object) { FooManamFoo * old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FOO_MANAM_TYPE_FOO)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FOO_MANAM_TYPE_FOO)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; } else { value->data[0].v_pointer = NULL; } if (old) { foo_manam_foo_unref (old); } } static void foo_manam_foo_class_init (FooManamFooClass * klass, gpointer klass_data) { foo_manam_foo_parent_class = g_type_class_peek_parent (klass); ((FooManamFooClass *) klass)->finalize = foo_manam_foo_finalize; } static void foo_manam_foo_instance_init (FooManamFoo * self, gpointer klass) { self->ref_count = 1; } static void foo_manam_foo_finalize (FooManamFoo * obj) { FooManamFoo * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, FOO_MANAM_TYPE_FOO, FooManamFoo); g_signal_handlers_destroy (self); } static GType foo_manam_foo_get_type_once (void) { static const GTypeValueTable g_define_type_value_table = { foo_manam_value_foo_init, foo_manam_value_foo_free_value, foo_manam_value_foo_copy_value, foo_manam_value_foo_peek_pointer, "p", foo_manam_value_foo_collect_value, "p", foo_manam_value_foo_lcopy_value }; static const GTypeInfo g_define_type_info = { sizeof (FooManamFooClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) foo_manam_foo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FooManamFoo), 0, (GInstanceInitFunc) foo_manam_foo_instance_init, &g_define_type_value_table }; static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; GType foo_manam_foo_type_id; foo_manam_foo_type_id = g_type_register_fundamental (g_type_fundamental_next (), "FooManamFoo", &g_define_type_info, &g_define_type_fundamental_info, 0); return foo_manam_foo_type_id; } GType foo_manam_foo_get_type (void) { static volatile gsize foo_manam_foo_type_id__once = 0; if (g_once_init_enter (&foo_manam_foo_type_id__once)) { GType foo_manam_foo_type_id; foo_manam_foo_type_id = foo_manam_foo_get_type_once (); g_once_init_leave (&foo_manam_foo_type_id__once, foo_manam_foo_type_id); } return foo_manam_foo_type_id__once; } gpointer foo_manam_foo_ref (gpointer instance) { FooManamFoo * self; self = instance; g_atomic_int_inc (&self->ref_count); return instance; } void foo_manam_foo_unref (gpointer instance) { FooManamFoo * self; self = instance; if (g_atomic_int_dec_and_test (&self->ref_count)) { FOO_MANAM_FOO_GET_CLASS (self)->finalize (self); g_type_free_instance ((GTypeInstance *) self); } } static void _vala_main (void) { _vala_assert (foo_bar_bar == 23, "bar == 23"); foo_manam_foo_faz (); _vala_assert (foo_bar_bar == 42, "bar == 42"); } int main (int argc, char ** argv) { _vala_main (); return 0; }