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; } ;
50 public int testing = 1;
51 argument INT testing link;
53 public char * testingstring = {g_strdup("test")}
55 argument POINTER testingstring stringlink;
57 public Gtk:Weird:Button * testingobj
58 destroywith gtk_object_unref;
59 argument POINTER testingobj objectlink;
61 classwide int foo = 20;
62 argument INT foo link;
64 public Gtk:Object * testingobj2
67 gtk_object_unref(GTK_OBJECT(VAR));
69 argument POINTER (type Gtk:Object *) testingobj2 objectlink;
71 argument POINTER (type GtkObject *) some_object
72 set { /* set some_object */ }
73 get { /* get some_object */
75 argument (CONSTRUCT) LONG (type long) write_only_long
76 set { /* set write_only_long */ };
77 argument POINTER (type char *) read_only_string
78 get { /* get readonly_long */
79 ARG = g_strdup("BLAH"); };
83 public double array[23][18];
84 protected unsigned long int wagawaga;
85 public int wagawaga_should_be_after_this_in_the_header;
100 public GtkWidget * new(int j (check > 0)) {
102 ret = GTK_WIDGET (GET_NEW);
104 SELF(ret)->_priv->j = j;
108 private int blah(self, Gtk:Widget * wid (check null type),
109 int h (check > 0)) onerror -1 {
110 gtk_container_add(GTK_CONTAINER(self),wid);
112 gtk_object_set(GTK_OBJECT(self),
113 GTK_WEIRD_BUTTON_ARG_I(99),
125 * Returns: new object
127 signal last INT (POINTER, INT)
128 int bleh(self, Gtk:Widget * wid (check null type),
130 return blah(self,wid,h);
133 * gtk_weird_button_bleh2:
140 * Returns: new object */
141 signal last INT (POINTER, INT)
142 int bleh2(self, Gtk:Widget * wid (check null type),
144 /* testing multiple marshaller support */
147 /* this should not get documented as it's nonstandard */
153 /* Here we are testing how the gtk-doc extraction code error handeling
154 it should just ingore these */
170 *zblunk*******//**//**/
171 signal first NONE (NONE)
173 virtual void * bah(self, int h (check > 0)) onerror NULL defreturn 0 {
177 virtual int beh(self, int h (check > 0));
178 override(Gtk:Container) void add(Gtk:Container * self (check null type),
179 Gtk:Widget * wid (check null type)) {
180 PARENT_HANDLER(self,wid);
182 public int consttest(self, const gchar *text, ...)
186 signal private first NONE (NONE)
187 void googlegoogle(self)
192 signal first private NONE (NONE)
193 void googlegoogle2(self)
195 int array[5][8][9]={{{0}}};
197 testprivvirtual(self,array);
199 private signal first NONE (NONE)
200 void googlegoogle3(self)
204 protected signal first NONE (NONE)
205 void googlegoogle4(self)
210 void testprivvirtual(self, int some_array[5][8][9])
216 void testprivvirtual2(self, int some_array[5][8][9])
221 void testpublicvirtual(self, int some_array[5][8][9])
226 void testprotectedvirtual(self, int some_array[5][8][9])
230 signal first NONE (POINTER)
231 void testarrsignal(self, long arr[8])
236 /* testing empty func */
237 public void foofoofoo(self) {}
238 /* testing empty func 2 */
239 public void foofoofoo2(self);
240 /* testing empty func 3 */
241 public void foofoofoo3(self) { }
242 /* testing empty func 4 */
243 public void foofoofoo4(self)
247 override (Gtk:Widget)
248 int event(Gtk:Widget *self (check null type),
249 GdkEvent *event (check null)) onerror FALSE
253 ret = PARENT_HANDLER(self,event);
257 override(Gtk:Container)
259 remove(Gtk:Container * self (check null type),
260 Gtk:Widget * wid (check null type));
264 /* just an empty function */
268 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
269 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
271 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
272 gulong g, gfloat h, gdouble i, gchar * j, gint k,
273 guint l, gpointer m, gpointer o, GtkObject *p)
275 /* ugh, testing casting */
278 public signal (NO_HOOKS) last INT (INT)
279 int testflags(self, int w (check > 0)) defreturn -99 {
287 test_none_thing (self)
291 /* testing empty statements */