]> git.draconx.ca Git - gob-dx.git/blob - src/test.gob
Release 0.91.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
9 static void jjjj(void);
10 %}
11
12 %h{
13 void bubu(void);
14 %}
15
16 class Gtk:Weird:Button from Gtk:Button {
17         public int i;
18         argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
19         private int j;
20         public GtkWidget * h;
21         public char *bleh;
22
23         init(object) {
24                 GtkWeirdButton *but = GTK_WEIRD_BUTTON(object);
25                 but->i=0;
26         }
27         class_init(klass);
28         public GtkWidget * new(int j (check > 0)) {
29                 GtkWidget *ret;
30                 ret = GTK_WIDGET (GET_NEW);
31
32                 GTK_WEIRD_BUTTON(ret)->_priv->j = j;
33
34                 return ret;
35         }
36         private int blah(self, Gtk:Widget * wid (check null type),
37                          int h (check > 0)) onerror -1 {
38                 gtk_container_add(GTK_CONTAINER(self),wid);
39                 return h;
40         }
41         signal last INT (POINTER, INT)
42         int bleh(self, Gtk:Widget * wid (check null type),
43                         int h (check > 0)) {
44                 return blah(self,wid,h);
45         }
46         signal first NONE (NONE)
47         void bloh(self);
48         virtual void * bah(self, int h (check > 0)) onerror NULL {
49                 beh(self,h);
50                 return NULL;
51         }
52         virtual int beh(self, int h (check > 0));
53         override(Gtk:Container) void add(Gtk:Container * self (check null type),
54                                          Gtk:Widget * wid (check null type)) {
55                 PARENT_HANDLER(self,wid);
56         }
57         public int consttest(self, const gchar *text, ...)
58         {
59                 return 25;
60         }
61         signal private first NONE (NONE)
62         void googlegoogle(self)
63         {
64                 puts("TEST1");
65                 googlegoogle2(self);
66         }
67         signal first private NONE (NONE)
68         void googlegoogle2(self)
69         {
70                 puts("TEST2");
71                 testprivvirtual(self);
72         }
73         virtual private
74         void testprivvirtual(self)
75         {
76                 puts("TEST3");
77                 googlegoogle(self);
78         }
79 }
80
81 %{
82
83 static void
84 jjjj(void)
85 {
86 }
87
88 void
89 bubu(void)
90 {
91         jjjj();
92 }
93
94 %}