4
#include <glib-object.h>
8
typedef struct _TestAnimal TestAnimal;
9
typedef struct _TestAnimalClass TestAnimalClass;
10
// typedef struct _TestAnimalPrivate TestAnimalPrivate;
13
#define TEST_TYPE_ANIMAL test_animal_get_type ()
15
G_DECLARE_DERIVABLE_TYPE (TestAnimal, test_animal, TEST, ANIMAL, GObject)
18
// OLD STYLE: This is how we used to do this. This has some advantages over
19
// the new style, in that the instance structure could be changed and have
20
// public variabels that way. This has been replaced with properties instead.
21
// We will come to that later.
22
#define TEST_TYPE_ANIMAL (test_animal_get_type ())
23
#define TEST_ANIMAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_ANIMAL, TestAnimal))
24
#define TEST_IS_ANIMAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_ANIMAL))
25
#define TEST_ANIMAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_ANIMAL, TestAnimalClass))
26
#define TEST_ANIMAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_ANIMAL))
27
#define TEST_ANIMAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_ANIMAL, TestAnimalClass))
30
GObject padding_instance;
36
struct _TestAnimalClass {
37
GObjectClass parent_class;
39
void (* make_sound)(TestAnimal *);
41
void (* move)(TestAnimal *, gint, gint);
51
test_animal_make_sound (TestAnimal * self);
54
test_animal_move (TestAnimal * self, gint x, gint y);