]> git.draconx.ca Git - gob-dx.git/blob - src/test.gob
Release 0.92.0
[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         protected unsigned long int wagawaga;
25         public int wagawaga_should_be_after_this_in_the_header;
26
27         init(object) {
28                 object->i=0;
29         }
30         class_init(klass);
31         public GtkWidget * new(int j (check > 0)) {
32                 GtkWidget *ret;
33                 ret = GTK_WIDGET (GET_NEW);
34
35                 GTK_WEIRD_BUTTON(ret)->_priv->j = j;
36
37                 return ret;
38         }
39         private int blah(self, Gtk:Widget * wid (check null type),
40                          int h (check > 0)) onerror -1 {
41                 gtk_container_add(GTK_CONTAINER(self),wid);
42                 return h;
43         }
44         signal last INT (POINTER, INT)
45         int bleh(self, Gtk:Widget * wid (check null type),
46                         int h (check > 0)) {
47                 return blah(self,wid,h);
48         }
49         signal last INT (POINTER, INT)
50         int bleh2(self, Gtk:Widget * wid (check null type),
51                         int h (check > 0)) {
52                 /* testing multiple marshaller support */
53                 return 0;
54         }
55         signal first NONE (NONE)
56         void bloh(self);
57         virtual void * bah(self, int h (check > 0)) onerror NULL {
58                 beh(self,h);
59                 return NULL;
60         }
61         virtual int beh(self, int h (check > 0));
62         override(Gtk:Container) void add(Gtk:Container * self (check null type),
63                                          Gtk:Widget * wid (check null type)) {
64                 PARENT_HANDLER(self,wid);
65         }
66         public int consttest(self, const gchar *text, ...)
67         {
68                 return 25;
69         }
70         signal private first NONE (NONE)
71         void googlegoogle(self)
72         {
73                 puts("TEST1");
74                 googlegoogle2(self);
75         }
76         signal first private NONE (NONE)
77         void googlegoogle2(self)
78         {
79                 int array[5][8][9]={{{0}}};
80                 puts("TEST2");
81                 testprivvirtual(self,array);
82         }
83         private signal first NONE (NONE)
84         void googlegoogle3(self)
85         {
86                 puts("TEST3");
87         }
88         protected signal first NONE (NONE)
89         void googlegoogle4(self)
90         {
91                 puts("TEST4");
92         }
93         virtual private
94         void testprivvirtual(self, int some_array[5][8][9])
95         {
96                 puts("TEST3");
97                 googlegoogle(self);
98         }
99         private virtual
100         void testprivvirtual2(self, int some_array[5][8][9])
101         {
102                 /* nothing here */
103         }
104         public virtual
105         void testpublicvirtual(self, int some_array[5][8][9])
106         {
107                 /* nothing here */
108         }
109         protected virtual
110         void testprotectedvirtual(self, int some_array[5][8][9])
111         {
112                 /* nothing here */
113         }
114         signal first NONE (POINTER)
115         void testarrsignal(self, long arr[8])
116         {
117                 /* foo */
118         }
119
120         /* testing empty func */
121         public void foofoofoo(self) {}
122         /* testing empty func 2 */
123         public void foofoofoo2(self);
124         /* testing empty func 3 */
125         public void foofoofoo3(self) {   }
126         /* testing empty func 4 */
127         public void foofoofoo4(self)
128         {
129         }
130
131         override (Gtk:Widget)
132         int event(Gtk:Widget *self (check null type),
133                   GdkEvent *event (check null)) onerror FALSE
134         {
135                 int ret;
136                 /* some code */
137                 ret = PARENT_HANDLER(self,event);
138                 /* some code */
139                 return ret;
140         }
141         override(Gtk:Container)
142         void
143         remove(Gtk:Container * self (check null type),
144                Gtk:Widget * wid (check null type));
145
146         protected
147         int foobar(self) {
148                 /* just an empty function */
149                 return 5;
150         }
151
152         signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
153                          STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
154         void
155         testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
156                  gulong g, gfloat h, gdouble i, gchar * j, gint k,
157                  guint l, gpointer m, gpointer o, GtkObject *p)
158         {
159                 /* ugh, testing casting */
160         }
161 }
162
163 %{
164
165 static void
166 jjjj(void)
167 {
168 }
169
170 void
171 bubu(void)
172 {
173         jjjj();
174 }
175
176 %}