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 */
9 /* this should go on the very top of the header */
12 /* this should go on the very top of the header as well */
15 /* this should go into the private header */
18 /* this should go into the private header as well*/
24 /* the next line is not mandatory, but if gob finds an include in one of
25 the %{ %} sections above the class definitions, it will not put it in
26 the file itself. So you can this way select where the include file is
28 #include "gtk-weird-button.h"
29 #include "gtk-weird-button-private.h"
31 /* this is to test if the lexer won't get confused by requires inside
36 static void jjjj(void);
43 /* this should be in the header, just under bubu prototype */
46 class Gtk:Weird:Button from Gtk:Button {
48 argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
49 argument POINTER (type GtkObject *) some_object
50 set { /* set some_object */ }
51 get { /* get some_object */
53 argument (CONSTRUCT) LONG (type long) write_only_long
54 set { /* set write_only_long */ };
55 argument POINTER (type char *) read_only_string
56 get { /* get readonly_long */
57 ARG = g_strdup("BLAH"); };
61 public double array[23][18];
62 protected unsigned long int wagawaga;
63 public int wagawaga_should_be_after_this_in_the_header;
69 public GtkWidget * new(int j (check > 0)) {
71 ret = GTK_WIDGET (GET_NEW);
73 GTK_WEIRD_BUTTON(ret)->_priv->j = j;
77 private int blah(self, Gtk:Widget * wid (check null type),
78 int h (check > 0)) onerror -1 {
79 gtk_container_add(GTK_CONTAINER(self),wid);
81 gtk_object_set(GTK_OBJECT(self),
82 GTK_WEIRD_BUTTON_ARG_I(99),
86 signal last INT (POINTER, INT)
87 int bleh(self, Gtk:Widget * wid (check null type),
89 return blah(self,wid,h);
91 signal last INT (POINTER, INT)
92 int bleh2(self, Gtk:Widget * wid (check null type),
94 /* testing multiple marshaller support */
97 signal first NONE (NONE)
99 virtual void * bah(self, int h (check > 0)) onerror NULL {
103 virtual int beh(self, int h (check > 0));
104 override(Gtk:Container) void add(Gtk:Container * self (check null type),
105 Gtk:Widget * wid (check null type)) {
106 PARENT_HANDLER(self,wid);
108 public int consttest(self, const gchar *text, ...)
112 signal private first NONE (NONE)
113 void googlegoogle(self)
118 signal first private NONE (NONE)
119 void googlegoogle2(self)
121 int array[5][8][9]={{{0}}};
123 testprivvirtual(self,array);
125 private signal first NONE (NONE)
126 void googlegoogle3(self)
130 protected signal first NONE (NONE)
131 void googlegoogle4(self)
136 void testprivvirtual(self, int some_array[5][8][9])
142 void testprivvirtual2(self, int some_array[5][8][9])
147 void testpublicvirtual(self, int some_array[5][8][9])
152 void testprotectedvirtual(self, int some_array[5][8][9])
156 signal first NONE (POINTER)
157 void testarrsignal(self, long arr[8])
162 /* testing empty func */
163 public void foofoofoo(self) {}
164 /* testing empty func 2 */
165 public void foofoofoo2(self);
166 /* testing empty func 3 */
167 public void foofoofoo3(self) { }
168 /* testing empty func 4 */
169 public void foofoofoo4(self)
173 override (Gtk:Widget)
174 int event(Gtk:Widget *self (check null type),
175 GdkEvent *event (check null)) onerror FALSE
179 ret = PARENT_HANDLER(self,event);
183 override(Gtk:Container)
185 remove(Gtk:Container * self (check null type),
186 Gtk:Widget * wid (check null type));
190 /* just an empty function */
194 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
195 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
197 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
198 gulong g, gfloat h, gdouble i, gchar * j, gint k,
199 guint l, gpointer m, gpointer o, GtkObject *p)
201 /* ugh, testing casting */