/* objects_bug788964.c generated by valac, the Vala compiler * generated from objects_bug788964.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_NUM_PROPERTIES }; static GParamSpec* foo_properties[FOO_NUM_PROPERTIES]; enum { FOO_LAST_SIGNAL, FOO_NUM_SIGNALS }; static guint foo_signals[FOO_NUM_SIGNALS] = {0}; #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_DUMMY_PROPERTY, BAR_LAST_PROPERTY, BAR_NUM_PROPERTIES }; static GParamSpec* bar_properties[BAR_NUM_PROPERTIES]; #define _g_free0(var) (var = (g_free (var), NULL)) struct _Foo { GObject parent_instance; FooPrivate * priv; }; struct _FooClass { GObjectClass parent_class; }; struct _Bar { GObject parent_instance; BarPrivate * priv; }; struct _BarClass { GObjectClass parent_class; }; struct _BarPrivate { gchar* _dummy; gchar* _last; }; static gpointer foo_parent_class = NULL; static gint Bar_private_offset; 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 Foo* foo_new (void); 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) VALA_EXTERN Bar* bar_new (void); VALA_EXTERN Bar* bar_construct (GType object_type); VALA_EXTERN const gchar* bar_get_dummy (Bar* self); VALA_EXTERN void bar_set_dummy (Bar* self, const gchar* value); VALA_EXTERN const gchar* bar_get_last (Bar* self); VALA_EXTERN void bar_set_last (Bar* self, const gchar* value); static void bar_finalize (GObject * obj); static GType bar_get_type_once (void); static void _vala_bar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_bar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void _vala_main (void); 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); } static void foo_class_init (FooClass * klass, gpointer klass_data) { foo_parent_class = g_type_class_peek_parent (klass); foo_signals[FOO_LAST_SIGNAL] = g_signal_new ("last", TYPE_FOO, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } 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, 0); 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 inline gpointer bar_get_instance_private (Bar* self) { return G_STRUCT_MEMBER_P (self, Bar_private_offset); } Bar* bar_construct (GType object_type) { Bar * self = NULL; self = (Bar*) g_object_new (object_type, NULL); return self; } Bar* bar_new (void) { return bar_construct (TYPE_BAR); } const gchar* bar_get_dummy (Bar* self) { const gchar* result; const gchar* _tmp0_; g_return_val_if_fail (IS_BAR (self), NULL); _tmp0_ = self->priv->_dummy; result = _tmp0_; return result; } void bar_set_dummy (Bar* self, const gchar* value) { gchar* old_value; g_return_if_fail (IS_BAR (self)); old_value = bar_get_dummy (self); if (g_strcmp0 (value, old_value) != 0) { gchar* _tmp0_; _tmp0_ = g_strdup (value); _g_free0 (self->priv->_dummy); self->priv->_dummy = _tmp0_; g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_DUMMY_PROPERTY]); } } const gchar* bar_get_last (Bar* self) { const gchar* result; const gchar* _tmp0_; g_return_val_if_fail (IS_BAR (self), NULL); _tmp0_ = self->priv->_last; result = _tmp0_; return result; } void bar_set_last (Bar* self, const gchar* value) { gchar* old_value; g_return_if_fail (IS_BAR (self)); old_value = bar_get_last (self); if (g_strcmp0 (value, old_value) != 0) { gchar* _tmp0_; _tmp0_ = g_strdup (value); _g_free0 (self->priv->_last); self->priv->_last = _tmp0_; g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_LAST_PROPERTY]); } } static void bar_class_init (BarClass * klass, gpointer klass_data) { bar_parent_class = g_type_class_peek_parent (klass); g_type_class_adjust_private_offset (klass, &Bar_private_offset); G_OBJECT_CLASS (klass)->get_property = _vala_bar_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_bar_set_property; G_OBJECT_CLASS (klass)->finalize = bar_finalize; g_object_class_install_property (G_OBJECT_CLASS (klass), BAR_DUMMY_PROPERTY, bar_properties[BAR_DUMMY_PROPERTY] = g_param_spec_string ("dummy", "dummy", "dummy", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), BAR_LAST_PROPERTY, bar_properties[BAR_LAST_PROPERTY] = g_param_spec_string ("last", "last", "last", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE)); } static void bar_instance_init (Bar * self, gpointer klass) { self->priv = bar_get_instance_private (self); } static void bar_finalize (GObject * obj) { Bar * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BAR, Bar); _g_free0 (self->priv->_dummy); _g_free0 (self->priv->_last); G_OBJECT_CLASS (bar_parent_class)->finalize (obj); } 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 (G_TYPE_OBJECT, "Bar", &g_define_type_info, 0); Bar_private_offset = g_type_add_instance_private (bar_type_id, sizeof (BarPrivate)); 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 void _vala_bar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { Bar * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_BAR, Bar); switch (property_id) { case BAR_DUMMY_PROPERTY: g_value_set_string (value, bar_get_dummy (self)); break; case BAR_LAST_PROPERTY: g_value_set_string (value, bar_get_last (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void _vala_bar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { Bar * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_BAR, Bar); switch (property_id) { case BAR_DUMMY_PROPERTY: bar_set_dummy (self, g_value_get_string (value)); break; case BAR_LAST_PROPERTY: bar_set_last (self, g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void _vala_main (void) { } int main (int argc, char ** argv) { _vala_main (); return 0; }