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);
152 test_handler (self, GtkWidget *w, int h, gpointer data)
158 * gtk_weird_button_bleh2:
165 * Returns: new object */
166 signal last INT (POINTER, INT)
167 int bleh2(self, const Gtk:Widget * wid (check null type),
169 gtk_signal_connect (GTK_OBJECT (self),
170 GTK_WEIRD_BUTTON_SIGNAL_BLEH (test_handler),
173 /* testing multiple marshaller support */
176 /* this should not get documented as it's nonstandard */
182 /* Here we are testing how the gtk-doc extraction code error handeling
183 it should just ingore these */
199 *zblunk*******//**//**/
200 signal first NONE (NONE)
202 virtual void * bah(self, int h (check > 0)) onerror NULL defreturn 0 {
206 virtual int beh(self, int h (check > 0));
207 override(Gtk:Container) void add(Gtk:Container * self (check null type),
208 Gtk:Widget * wid (check null type)) {
209 PARENT_HANDLER(self,wid);
211 public int consttest(self, const gchar *text, ...)
215 public int consttest2(self, gchar const *text, ...)
219 public int consttest3(self, Gtk:Widget const *wid (check null type))
223 public int consttest4(const self)
227 public int consttest5(self const)
231 virtual int consttest6(const self)
235 virtual int consttest7(self const)
239 public int consttest8(self)
241 Self const *selfconst1, *selfconst2;
242 selfconst1 = SELF_CONST(self);
243 selfconst2 = GTK_WEIRD_BUTTON_CONST(self);
246 public int consttest9(const self, int i, double b)
250 public int consttest10(self const, int i, double b)
254 signal private first NONE (NONE)
255 void googlegoogle(self)
260 signal first private NONE (NONE)
261 void googlegoogle2(self)
263 int array[5][8][9]={{{0}}};
266 testprivvirtual(foo, array);
268 private signal first NONE (NONE)
269 void googlegoogle3(self)
273 protected signal first NONE (NONE)
274 void googlegoogle4(self)
278 protected signal first NONE (NONE)
279 void googlegoogle_const1(const self)
283 protected signal first NONE (NONE)
284 void googlegoogle_const2(self const)
289 void testprivvirtual(self, int some_array[5][8][9])
295 void testprivvirtual2(self, const int some_array[5][8][9])
300 void testpublicvirtual(self, int const some_array[5][8][9])
305 void testprotectedvirtual(self, int some_array[5][8][9])
309 signal first NONE (POINTER)
310 void testarrsignal(self, long arr[8])
315 /* testing empty func */
316 public void foofoofoo(self) {}
317 /* testing empty func 2 */
318 public void foofoofoo2(self);
319 /* testing empty func 3 */
320 public void foofoofoo3(self) { }
321 /* testing empty func 4 */
322 public void foofoofoo4(self)
326 override (Gtk:Widget)
327 int event(Gtk:Widget *self (check null type),
328 GdkEvent *event (check null)) onerror FALSE
332 ret = PARENT_HANDLER(self,event);
336 override(Gtk:Container)
338 remove(Gtk:Container * self (check null type),
339 Gtk:Widget * wid (check null type));
343 destroy(Gtk:Object * self (check null type))
346 PARENT_HANDLER(self);
351 /* just an empty function */
355 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
356 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
358 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
359 gulong g, gfloat h, gdouble i, gchar * j, gint k,
360 guint l, gpointer m, gpointer o, GtkObject *p)
362 /* ugh, testing casting */
365 public signal (NO_HOOKS) last INT (INT)
366 int testflags(self, int w (check > 0)) defreturn -99 {
374 test_none_thing (self)
383 public int long const t4;
384 public const int long t5;
385 public const char * const t6;
386 public char const * const t7;
387 public enum _gob__enum_t const * const t8;
388 public union _gob__union_t t9;
389 public union _gob__union_t * const * const * t10;
390 public struct _gob__struct_t * const * const * t11;
391 public const struct _gob__struct_t * const * const * t13;
392 public const enum _gob__enum_t * const * const * t14;
393 public enum _gob__enum_t t15;
394 public gchar const t16;
395 public const gchar * const t17;
396 public const gchar t18;
398 /* testing method with no arguments */
399 public void method_with_no_arguments (void)
404 /* testing calling the above method */
405 public void foo (self) {
406 method_with_no_arguments ();
410 /* testing empty statements */