1 /* this is a TEST file, it's VERY VERY ugly, it's just supposed to test
2 the parser of gob and somewhat test some output as well, you can
3 look in here to see a whole array of different syntax options, but
4 don't expect this to be an easy to read file */
10 /* the next line is not mandatory, but if gob finds an include in one of
11 the %{ %} sections above the class definitions, it will not put it in
12 the file itself. So you can this way select where the include file is
14 #include "gtk-weird-button.h"
15 #include "gtk-weird-button-private.h"
17 /* this is to test if the lexer won't get confused by requires inside
22 static void jjjj(void);
29 class Gtk:Weird:Button from Gtk:Button {
31 argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
32 argument POINTER (type GtkObject *) some_object
33 set { /* set some_object */ }
34 get { /* get some_object */
36 argument (CONSTRUCT) LONG (type long) write_only_long
37 set { /* set write_only_long */ };
38 argument POINTER (type char *) read_only_string
39 get { /* get readonly_long */
40 ARG = g_strdup("BLAH"); };
44 public double array[23][18];
45 protected unsigned long int wagawaga;
46 public int wagawaga_should_be_after_this_in_the_header;
52 public GtkWidget * new(int j (check > 0)) {
54 ret = GTK_WIDGET (GET_NEW);
56 GTK_WEIRD_BUTTON(ret)->_priv->j = j;
60 private int blah(self, Gtk:Widget * wid (check null type),
61 int h (check > 0)) onerror -1 {
62 gtk_container_add(GTK_CONTAINER(self),wid);
64 gtk_object_set(GTK_OBJECT(self),
65 GTK_WEIRD_BUTTON_ARG_I(99),
69 signal last INT (POINTER, INT)
70 int bleh(self, Gtk:Widget * wid (check null type),
72 return blah(self,wid,h);
74 signal last INT (POINTER, INT)
75 int bleh2(self, Gtk:Widget * wid (check null type),
77 /* testing multiple marshaller support */
80 signal first NONE (NONE)
82 virtual void * bah(self, int h (check > 0)) onerror NULL {
86 virtual int beh(self, int h (check > 0));
87 override(Gtk:Container) void add(Gtk:Container * self (check null type),
88 Gtk:Widget * wid (check null type)) {
89 PARENT_HANDLER(self,wid);
91 public int consttest(self, const gchar *text, ...)
95 signal private first NONE (NONE)
96 void googlegoogle(self)
101 signal first private NONE (NONE)
102 void googlegoogle2(self)
104 int array[5][8][9]={{{0}}};
106 testprivvirtual(self,array);
108 private signal first NONE (NONE)
109 void googlegoogle3(self)
113 protected signal first NONE (NONE)
114 void googlegoogle4(self)
119 void testprivvirtual(self, int some_array[5][8][9])
125 void testprivvirtual2(self, int some_array[5][8][9])
130 void testpublicvirtual(self, int some_array[5][8][9])
135 void testprotectedvirtual(self, int some_array[5][8][9])
139 signal first NONE (POINTER)
140 void testarrsignal(self, long arr[8])
145 /* testing empty func */
146 public void foofoofoo(self) {}
147 /* testing empty func 2 */
148 public void foofoofoo2(self);
149 /* testing empty func 3 */
150 public void foofoofoo3(self) { }
151 /* testing empty func 4 */
152 public void foofoofoo4(self)
156 override (Gtk:Widget)
157 int event(Gtk:Widget *self (check null type),
158 GdkEvent *event (check null)) onerror FALSE
162 ret = PARENT_HANDLER(self,event);
166 override(Gtk:Container)
168 remove(Gtk:Container * self (check null type),
169 Gtk:Widget * wid (check null type));
173 /* just an empty function */
177 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
178 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
180 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
181 gulong g, gfloat h, gdouble i, gchar * j, gint k,
182 guint l, gpointer m, gpointer o, GtkObject *p)
184 /* ugh, testing casting */