]> git.draconx.ca Git - gob-dx.git/blob - src/test.gob
Release 0.91.2
[gob-dx.git] / src / test.gob
1 %{
2 #include <stdio.h>
3 /* the next line is not mandatory, but if gob finds an include in one of
4    the %{ %} sections above the class definitions, it will not put it in
5    the file itself.  So you can this way select where the include file is
6    at */
7 #include "gtk-weird-button.h"
8 #include "gtk-weird-button-private.h"
9
10 static void jjjj(void);
11 %}
12
13 %h{
14 void bubu(void);
15 %}
16
17 class Gtk:Weird:Button from Gtk:Button {
18         public int i;
19         argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
20         private int j;
21         public GtkWidget * h;
22         public char *bleh;
23         public double array[23][18];
24
25         init(object) {
26                 object->i=0;
27         }
28         class_init(klass);
29         public GtkWidget * new(int j (check > 0)) {
30                 GtkWidget *ret;
31                 ret = GTK_WIDGET (GET_NEW);
32
33                 GTK_WEIRD_BUTTON(ret)->_priv->j = j;
34
35                 return ret;
36         }
37         private int blah(self, Gtk:Widget * wid (check null type),
38                          int h (check > 0)) onerror -1 {
39                 gtk_container_add(GTK_CONTAINER(self),wid);
40                 return h;
41         }
42         signal last INT (POINTER, INT)
43         int bleh(self, Gtk:Widget * wid (check null type),
44                         int h (check > 0)) {
45                 return blah(self,wid,h);
46         }
47         signal first NONE (NONE)
48         void bloh(self);
49         virtual void * bah(self, int h (check > 0)) onerror NULL {
50                 beh(self,h);
51                 return NULL;
52         }
53         virtual int beh(self, int h (check > 0));
54         override(Gtk:Container) void add(Gtk:Container * self (check null type),
55                                          Gtk:Widget * wid (check null type)) {
56                 PARENT_HANDLER(self,wid);
57         }
58         public int consttest(self, const gchar *text, ...)
59         {
60                 return 25;
61         }
62         signal private first NONE (NONE)
63         void googlegoogle(self)
64         {
65                 puts("TEST1");
66                 googlegoogle2(self);
67         }
68         signal first private NONE (NONE)
69         void googlegoogle2(self)
70         {
71                 int array[5][8][9]={{{0}}};
72                 puts("TEST2");
73                 testprivvirtual(self,array);
74         }
75         virtual private
76         void testprivvirtual(self, int some_array[5][8][9])
77         {
78                 puts("TEST3");
79                 googlegoogle(self);
80         }
81         signal first NONE (POINTER)
82         void testarrsignal(self, long arr[8])
83         {
84                 puts("TEST2");
85         }
86
87         /* testing empty func */
88         public void foofoofoo(self) {}
89
90         override (Gtk:Widget)
91         int event(Gtk:Widget *self (check null type),
92                   GdkEvent *event (check null)) onerror FALSE
93         {
94                 int ret;
95                 /* some code */
96                 ret = PARENT_HANDLER(self,event);
97                 /* some code */
98                 return ret;
99         }
100
101 }
102
103 %{
104
105 static void
106 jjjj(void)
107 {
108 }
109
110 void
111 bubu(void)
112 {
113         jjjj();
114 }
115
116 %}