/+junk/GObject_tutorial

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/GObject_tutorial

« back to all changes in this revision

Viewing changes to pt1_animals_done/main.c

  • Committer: Gustav Hartvigsson
  • Date: 2017-04-04 20:29:08 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20170404202908-37q4rzsskk2nzuaz
First lesson.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
#include "animal.h"
 
4
#include "cat.h"
 
5
#include "dog.h"
 
6
 
 
7
 
 
8
int
 
9
main (char ** argv, int argc){
 
10
  TestAnimal * a = test_animal_new ();
 
11
  TestCat * c = test_cat_new ();
 
12
  TestDog * d = test_dog_new ();
 
13
  
 
14
  test_animal_make_sound (a);
 
15
  test_animal_move (a, 5, 6);
 
16
  
 
17
  test_animal_make_sound (TEST_ANIMAL(c));
 
18
  test_animal_move (TEST_ANIMAL(c), 7, 2);
 
19
  
 
20
  test_animal_make_sound (TEST_ANIMAL(d));
 
21
  test_animal_move (TEST_ANIMAL(d), 4, 8);
 
22
  
 
23
  g_object_unref (a);
 
24
  g_object_unref (c);
 
25
  g_object_unref (d);
 
26
  
 
27
  return 0;
 
28
}