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 */
13 /* this should go on the very top of the header */
17 /* this should go on the very top of the header as well */
20 /* this should go into the private header */
23 /* this should go into the private header as well*/
29 /* the next line is not mandatory, but if gob finds an include in one of
30 the %{ %} sections above the class definitions, it will not put it in
31 the file itself. So you can this way select where the include file is
33 #include "gtk-weird-button.h"
34 #include "gtk-weird-button-private.h"
36 /* this is to test if the lexer won't get confused by requires inside
41 static void jjjj(void);
49 struct _gob__struct_t {
58 /* this should be in the header, just under bubu prototype */
62 class Gtk:Weird:Button from Gtk:Button {
63 public int test_array[TEST_ARRAY];
65 argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
67 public int testing = 1;
68 argument INT testing link;
70 public char * testingstring = {g_strdup("test")}
72 argument POINTER testingstring stringlink;
74 public Gtk:Weird:Button * testingobj
75 destroywith gtk_object_unref;
76 argument POINTER testingobj objectlink;
78 classwide int foo = 20;
79 argument INT foo link;
81 public Gtk:Object * testingobj2
84 gtk_object_unref(GTK_OBJECT(VAR));
86 argument POINTER (type Gtk:Object *) testingobj2 objectlink;
88 argument POINTER (type GtkObject *) some_object
89 set { /* set some_object */ }
90 get { /* get some_object */
92 argument (CONSTRUCT) LONG (type long) write_only_long
93 set { /* set write_only_long */ };
94 argument POINTER (type char *) read_only_string
95 get { /* get readonly_long */
96 ARG = g_strdup("BLAH"); };
100 public double array[23][18];
101 protected unsigned long int wagawaga;
102 public int wagawaga_should_be_after_this_in_the_header;
115 * Returns: new object
117 public GtkWidget * new(int j (check > 0)) {
119 ret = GTK_WIDGET (GET_NEW);
121 SELF(ret)->_priv->j = j;
125 private int _blah(self, Gtk:Widget * wid (check null type),
126 int h (check > 0)) onerror -1 {
127 gtk_container_add(GTK_CONTAINER(self),wid);
129 gtk_object_set(GTK_OBJECT(self),
130 GTK_WEIRD_BUTTON_ARG_I(99),
142 * Returns: new object
144 signal last INT (POINTER, INT)
145 int bleh(self, Gtk:Widget * wid (check null type),
147 return _blah(self,wid,h);
150 * gtk_weird_button_bleh2:
157 * Returns: new object */
158 signal last INT (POINTER, INT)
159 int bleh2(self, const Gtk:Widget * wid (check null type),
161 /* testing multiple marshaller support */
164 /* this should not get documented as it's nonstandard */
170 /* Here we are testing how the gtk-doc extraction code error handeling
171 it should just ingore these */
187 *zblunk*******//**//**/
188 signal first NONE (NONE)
190 virtual void * bah(self, int h (check > 0)) onerror NULL defreturn 0 {
194 virtual int beh(self, int h (check > 0));
195 override(Gtk:Container) void add(Gtk:Container * self (check null type),
196 Gtk:Widget * wid (check null type)) {
197 PARENT_HANDLER(self,wid);
199 public int consttest(self, const gchar *text, ...)
203 public int consttest2(self, gchar const *text, ...)
207 public int consttest3(self, Gtk:Widget const *wid (check null type))
211 public int consttest4(const self)
215 public int consttest5(self const)
219 virtual int consttest6(const self)
223 virtual int consttest7(self const)
227 public int consttest8(self)
229 Self const *selfconst1, *selfconst2;
230 selfconst1 = SELF_CONST(self);
231 selfconst2 = GTK_WEIRD_BUTTON_CONST(self);
234 public int consttest9(const self, int i, double b)
238 public int consttest10(self const, int i, double b)
242 signal private first NONE (NONE)
243 void googlegoogle(self)
248 signal first private NONE (NONE)
249 void googlegoogle2(self)
251 int array[5][8][9]={{{0}}};
254 testprivvirtual(foo, array);
256 private signal first NONE (NONE)
257 void googlegoogle3(self)
261 protected signal first NONE (NONE)
262 void googlegoogle4(self)
266 protected signal first NONE (NONE)
267 void googlegoogle_const1(const self)
271 protected signal first NONE (NONE)
272 void googlegoogle_const2(self const)
277 void testprivvirtual(self, int some_array[5][8][9])
283 void testprivvirtual2(self, const int some_array[5][8][9])
288 void testpublicvirtual(self, int const some_array[5][8][9])
293 void testprotectedvirtual(self, int some_array[5][8][9])
297 signal first NONE (POINTER)
298 void testarrsignal(self, long arr[8])
303 /* testing empty func */
304 public void foofoofoo(self) {}
305 /* testing empty func 2 */
306 public void foofoofoo2(self);
307 /* testing empty func 3 */
308 public void foofoofoo3(self) { }
309 /* testing empty func 4 */
310 public void foofoofoo4(self)
314 override (Gtk:Widget)
315 int event(Gtk:Widget *self (check null type),
316 GdkEvent *event (check null)) onerror FALSE
320 ret = PARENT_HANDLER(self,event);
324 override(Gtk:Container)
326 remove(Gtk:Container * self (check null type),
327 Gtk:Widget * wid (check null type));
331 destroy(Gtk:Object * self (check null type))
334 PARENT_HANDLER(self);
339 /* just an empty function */
343 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
344 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
346 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
347 gulong g, gfloat h, gdouble i, gchar * j, gint k,
348 guint l, gpointer m, gpointer o, GtkObject *p)
350 /* ugh, testing casting */
353 public signal (NO_HOOKS) last INT (INT)
354 int testflags(self, int w (check > 0)) defreturn -99 {
362 test_none_thing (self)
371 public int long const t4;
372 public const int long t5;
373 public const char * const t6;
374 public char const * const t7;
375 public enum _gob__enum_t const * const t8;
376 public union _gob__union_t t9;
377 public union _gob__union_t * const * const * t10;
378 public struct _gob__struct_t * const * const * t11;
379 public const struct _gob__struct_t * const * const * t13;
380 public const enum _gob__enum_t * const * const * t14;
381 public enum _gob__enum_t t15;
382 public gchar const t16;
383 public const gchar * const t17;
384 public const gchar t18;
386 /* testing empty statements */