1 /* This file contains both declaration and definition of the TestSimpleText class,
2 * a simple wrapper for a text string not longer than MAX_DESCR_LENGTH symbols.
5 #include "test-simple-text.h"
8 test_simple_text_get_type (void);
10 static GObjectClass *parent_class_simple_text = NULL;
12 /******************************************************************/
14 /******************************************************************/
16 simple_text_instance_init (GTypeInstance *instance, gpointer g_class)
18 TestSimpleText *self = (TestSimpleText *)instance;
20 self->disposed = FALSE;
21 self->text = g_new (char, MAX_DESCR_LENGTH + 1);
24 //g_print ("\tCreate string\n");
28 test_simple_text_dispose (GObject *obj)
30 TestSimpleText *self = (TestSimpleText *)obj;
37 /* Make sure dispose does not run twice. */
38 self->disposed = TRUE;
42 //g_print ("\tDelete string\n");
44 /* Chain up to the parent class */
45 G_OBJECT_CLASS (parent_class_simple_text)->dispose (obj);
49 test_simple_text_finalize (GObject *obj)
51 TestSimpleText *self = (TestSimpleText *)obj;
54 /*free (self->pdata->descr);
55 g_free (self->pdata);*/
58 /* Chain up to the parent class */
59 G_OBJECT_CLASS (parent_class_simple_text)->finalize (obj);
63 test_simple_text_class_init (gpointer g_class, gpointer g_class_data)
65 GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
66 TestSimpleTextClass *klass = TEST_SIMPLE_TEXT_CLASS (g_class);
68 gobject_class->dispose = test_simple_text_dispose;
69 gobject_class->finalize = test_simple_text_finalize;
71 parent_class_simple_text = g_type_class_peek_parent (klass);
75 test_simple_text_get_type (void)
77 static GType type = 0;
80 static const GTypeInfo info =
82 sizeof (TestSimpleTextClass),
84 NULL, /* base_finalize */
85 test_simple_text_class_init, /* class_init */
86 NULL, /* class_finalize */
87 NULL, /* class_data */
88 sizeof (TestSimpleText),
90 simple_text_instance_init /* instance_init */
93 type = g_type_register_static (ATK_TYPE_OBJECT,