/* objects_property_construct_only.c generated by valac, the Vala compiler * generated from objects_property_construct_only.vala, do not modify */ #include #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 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_MANAM_PROPERTY, FOO_NUM_PROPERTIES }; static GParamSpec* foo_properties[FOO_NUM_PROPERTIES]; #define _g_free0(var) (var = (g_free (var), NULL)) #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 TYPE_FAZ (faz_get_type ()) #define FAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FAZ, Faz)) #define FAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FAZ, FazClass)) #define IS_FAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FAZ)) #define IS_FAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FAZ)) #define FAZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FAZ, FazClass)) typedef struct _Faz Faz; typedef struct _FazClass FazClass; typedef struct _FazPrivate FazPrivate; enum { FAZ_0_PROPERTY, FAZ_MANAM_PROPERTY, FAZ_NUM_PROPERTIES }; static GParamSpec* faz_properties[FAZ_NUM_PROPERTIES]; #define TYPE_BAZ (baz_get_type ()) #define BAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BAZ, Baz)) #define BAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BAZ, BazClass)) #define IS_BAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BAZ)) #define IS_BAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BAZ)) #define BAZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BAZ, BazClass)) typedef struct _Baz Baz; typedef struct _BazClass BazClass; typedef struct _BazPrivate BazPrivate; enum { BAZ_0_PROPERTY, BAZ_NUM_PROPERTIES }; static GParamSpec* baz_properties[BAZ_NUM_PROPERTIES]; #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 _Foo { GObject parent_instance; FooPrivate * priv; }; struct _FooClass { GObjectClass parent_class; }; struct _FooPrivate { gchar* _manam; }; struct _Bar { Foo parent_instance; BarPrivate * priv; }; struct _BarClass { FooClass parent_class; }; struct _Faz { GObject parent_instance; FazPrivate * priv; }; struct _FazClass { GObjectClass parent_class; }; struct _FazPrivate { gchar* _manam; }; struct _Baz { Faz parent_instance; BazPrivate * priv; }; struct _BazClass { FazClass parent_class; }; static gint Foo_private_offset; static gpointer foo_parent_class = NULL; static gpointer bar_parent_class = NULL; static gint Faz_private_offset; static gpointer faz_parent_class = NULL; static gpointer baz_parent_class = NULL; VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref) VALA_EXTERN Foo* foo_new (void); VALA_EXTERN Foo* foo_construct (GType object_type); VALA_EXTERN const gchar* foo_get_manam (Foo* self); static void foo_set_manam (Foo* self, const gchar* value); static GObject * foo_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); static void foo_finalize (GObject * obj); static GType foo_get_type_once (void); static void _vala_foo_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_foo_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref) VALA_EXTERN Bar* bar_new (void); VALA_EXTERN Bar* bar_construct (GType object_type); static GObject * bar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties); static GType bar_get_type_once (void); VALA_EXTERN GType faz_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (Faz, g_object_unref) VALA_EXTERN Faz* faz_new (void); VALA_EXTERN Faz* faz_construct (GType object_type); VALA_EXTERN const gchar* faz_get_manam (Faz* self); static void faz_set_manam (Faz* self, const gchar* value); static void faz_finalize (GObject * obj); static GType faz_get_type_once (void); static void _vala_faz_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_faz_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); VALA_EXTERN GType baz_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (Baz, g_object_unref) VALA_EXTERN Baz* baz_new (void); VALA_EXTERN Baz* baz_construct (GType object_type); static GType baz_get_type_once (void); static void _vala_main (void); static inline gpointer foo_get_instance_private (Foo* self) { return G_STRUCT_MEMBER_P (self, Foo_private_offset); } Foo* foo_construct (GType object_type) { Foo * self = NULL; self = (Foo*) g_object_new (object_type, NULL); return self; } Foo* foo_new (void) { return foo_construct (TYPE_FOO); } const gchar* foo_get_manam (Foo* self) { const gchar* result; const gchar* _tmp0_; g_return_val_if_fail (IS_FOO (self), NULL); _tmp0_ = self->priv->_manam; result = _tmp0_; return result; } static void foo_set_manam (Foo* self, const gchar* value) { gchar* old_value; g_return_if_fail (IS_FOO (self)); old_value = foo_get_manam (self); if (g_strcmp0 (value, old_value) != 0) { gchar* _tmp0_; _tmp0_ = g_strdup (value); _g_free0 (self->priv->_manam); self->priv->_manam = _tmp0_; g_object_notify_by_pspec ((GObject *) self, foo_properties[FOO_MANAM_PROPERTY]); } } static GObject * foo_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { GObject * obj; GObjectClass * parent_class; Foo * self; parent_class = G_OBJECT_CLASS (foo_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FOO, Foo); foo_set_manam (self, "foo"); return obj; } static void foo_class_init (FooClass * klass, gpointer klass_data) { foo_parent_class = g_type_class_peek_parent (klass); g_type_class_adjust_private_offset (klass, &Foo_private_offset); G_OBJECT_CLASS (klass)->get_property = _vala_foo_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_foo_set_property; G_OBJECT_CLASS (klass)->constructor = foo_constructor; G_OBJECT_CLASS (klass)->finalize = foo_finalize; g_object_class_install_property (G_OBJECT_CLASS (klass), FOO_MANAM_PROPERTY, foo_properties[FOO_MANAM_PROPERTY] = g_param_spec_string ("manam", "manam", "manam", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); } static void foo_instance_init (Foo * self, gpointer klass) { self->priv = foo_get_instance_private (self); } static void foo_finalize (GObject * obj) { Foo * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FOO, Foo); _g_free0 (self->priv->_manam); G_OBJECT_CLASS (foo_parent_class)->finalize (obj); } 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, 0); Foo_private_offset = g_type_add_instance_private (foo_type_id, sizeof (FooPrivate)); 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 _vala_foo_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { Foo * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FOO, Foo); switch (property_id) { case FOO_MANAM_PROPERTY: g_value_set_string (value, foo_get_manam (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void _vala_foo_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { Foo * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FOO, Foo); switch (property_id) { case FOO_MANAM_PROPERTY: foo_set_manam (self, g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } 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 GObject * bar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { GObject * obj; GObjectClass * parent_class; Bar * self; parent_class = G_OBJECT_CLASS (bar_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BAR, Bar); foo_set_manam (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_FOO, Foo), "bar"); return obj; } static void bar_class_init (BarClass * klass, gpointer klass_data) { bar_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->constructor = bar_constructor; } 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 inline gpointer faz_get_instance_private (Faz* self) { return G_STRUCT_MEMBER_P (self, Faz_private_offset); } Faz* faz_construct (GType object_type) { Faz * self = NULL; self = (Faz*) g_object_new (object_type, "manam", "faz", NULL); return self; } Faz* faz_new (void) { return faz_construct (TYPE_FAZ); } const gchar* faz_get_manam (Faz* self) { const gchar* result; const gchar* _tmp0_; g_return_val_if_fail (IS_FAZ (self), NULL); _tmp0_ = self->priv->_manam; result = _tmp0_; return result; } static void faz_set_manam (Faz* self, const gchar* value) { gchar* old_value; g_return_if_fail (IS_FAZ (self)); old_value = faz_get_manam (self); if (g_strcmp0 (value, old_value) != 0) { gchar* _tmp0_; _tmp0_ = g_strdup (value); _g_free0 (self->priv->_manam); self->priv->_manam = _tmp0_; g_object_notify_by_pspec ((GObject *) self, faz_properties[FAZ_MANAM_PROPERTY]); } } static void faz_class_init (FazClass * klass, gpointer klass_data) { faz_parent_class = g_type_class_peek_parent (klass); g_type_class_adjust_private_offset (klass, &Faz_private_offset); G_OBJECT_CLASS (klass)->get_property = _vala_faz_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_faz_set_property; G_OBJECT_CLASS (klass)->finalize = faz_finalize; g_object_class_install_property (G_OBJECT_CLASS (klass), FAZ_MANAM_PROPERTY, faz_properties[FAZ_MANAM_PROPERTY] = g_param_spec_string ("manam", "manam", "manam", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); } static void faz_instance_init (Faz * self, gpointer klass) { self->priv = faz_get_instance_private (self); } static void faz_finalize (GObject * obj) { Faz * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FAZ, Faz); _g_free0 (self->priv->_manam); G_OBJECT_CLASS (faz_parent_class)->finalize (obj); } static GType faz_get_type_once (void) { static const GTypeInfo g_define_type_info = { sizeof (FazClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) faz_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Faz), 0, (GInstanceInitFunc) faz_instance_init, NULL }; GType faz_type_id; faz_type_id = g_type_register_static (G_TYPE_OBJECT, "Faz", &g_define_type_info, 0); Faz_private_offset = g_type_add_instance_private (faz_type_id, sizeof (FazPrivate)); return faz_type_id; } GType faz_get_type (void) { static volatile gsize faz_type_id__once = 0; if (g_once_init_enter (&faz_type_id__once)) { GType faz_type_id; faz_type_id = faz_get_type_once (); g_once_init_leave (&faz_type_id__once, faz_type_id); } return faz_type_id__once; } static void _vala_faz_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { Faz * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FAZ, Faz); switch (property_id) { case FAZ_MANAM_PROPERTY: g_value_set_string (value, faz_get_manam (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void _vala_faz_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { Faz * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FAZ, Faz); switch (property_id) { case FAZ_MANAM_PROPERTY: faz_set_manam (self, g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } Baz* baz_construct (GType object_type) { Baz * self = NULL; self = (Baz*) g_object_new (object_type, "manam", "baz", NULL); return self; } Baz* baz_new (void) { return baz_construct (TYPE_BAZ); } static void baz_class_init (BazClass * klass, gpointer klass_data) { baz_parent_class = g_type_class_peek_parent (klass); } static void baz_instance_init (Baz * self, gpointer klass) { } static GType baz_get_type_once (void) { static const GTypeInfo g_define_type_info = { sizeof (BazClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baz_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Baz), 0, (GInstanceInitFunc) baz_instance_init, NULL }; GType baz_type_id; baz_type_id = g_type_register_static (TYPE_FAZ, "Baz", &g_define_type_info, 0); return baz_type_id; } GType baz_get_type (void) { static volatile gsize baz_type_id__once = 0; if (g_once_init_enter (&baz_type_id__once)) { GType baz_type_id; baz_type_id = baz_get_type_once (); g_once_init_leave (&baz_type_id__once, baz_type_id); } return baz_type_id__once; } static void _vala_main (void) { { Foo* foo = NULL; Foo* _tmp0_; const gchar* _tmp1_; const gchar* _tmp2_; _tmp0_ = foo_new (); foo = _tmp0_; _tmp1_ = foo_get_manam (foo); _tmp2_ = _tmp1_; _vala_assert (g_strcmp0 (_tmp2_, "foo") == 0, "foo.manam == \"foo\""); _g_object_unref0 (foo); } { Bar* bar = NULL; Bar* _tmp3_; const gchar* _tmp4_; const gchar* _tmp5_; _tmp3_ = bar_new (); bar = _tmp3_; _tmp4_ = foo_get_manam (G_TYPE_CHECK_INSTANCE_CAST (bar, TYPE_FOO, Foo)); _tmp5_ = _tmp4_; _vala_assert (g_strcmp0 (_tmp5_, "bar") == 0, "bar.manam == \"bar\""); _g_object_unref0 (bar); } { Faz* faz = NULL; Faz* _tmp6_; const gchar* _tmp7_; const gchar* _tmp8_; _tmp6_ = faz_new (); faz = _tmp6_; _tmp7_ = faz_get_manam (faz); _tmp8_ = _tmp7_; _vala_assert (g_strcmp0 (_tmp8_, "faz") == 0, "faz.manam == \"faz\""); _g_object_unref0 (faz); } { Baz* baz = NULL; Baz* _tmp9_; const gchar* _tmp10_; const gchar* _tmp11_; _tmp9_ = baz_new (); baz = _tmp9_; _tmp10_ = faz_get_manam (G_TYPE_CHECK_INSTANCE_CAST (baz, TYPE_FAZ, Faz)); _tmp11_ = _tmp10_; _vala_assert (g_strcmp0 (_tmp11_, "baz") == 0, "baz.manam == \"baz\""); _g_object_unref0 (baz); } } int main (int argc, char ** argv) { _vala_main (); return 0; }