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 */
13 /* this should go on the very top of the header as well */
16 /* this should go into the private header */
19 /* this should go into the private header as well*/
25 /* the next line is not mandatory, but if gob finds an include in one of
26 the %{ %} sections above the class definitions, it will not put it in
27 the file itself. So you can this way select where the include file is
29 #include "gtk-weird-button.h"
30 #include "gtk-weird-button-private.h"
32 /* this is to test if the lexer won't get confused by requires inside
37 static void jjjj(void);
45 struct _gob__struct_t {
54 /* this should be in the header, just under bubu prototype */
58 class Gtk:Weird:Button from Gtk:Button {
59 public int test_array[TEST_ARRAY];
61 argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
63 public int testing = 1;
64 argument INT testing link;
66 public char * testingstring = {g_strdup("test")}
68 argument POINTER testingstring stringlink;
70 public Gtk:Weird:Button * testingobj
71 destroywith gtk_object_unref;
72 argument POINTER testingobj objectlink;
74 classwide int foo = 20;
75 argument INT foo link;
77 public Gtk:Object * testingobj2
80 gtk_object_unref(GTK_OBJECT(VAR));
82 argument POINTER (type Gtk:Object *) testingobj2 objectlink;
84 argument POINTER (type GtkObject *) some_object
85 set { /* set some_object */ }
86 get { /* get some_object */
88 argument (CONSTRUCT) LONG (type long) write_only_long
89 set { /* set write_only_long */ };
90 argument POINTER (type char *) read_only_string
91 get { /* get readonly_long */
92 ARG = g_strdup("BLAH"); };
96 public double array[23][18];
97 protected unsigned long int wagawaga;
98 public int wagawaga_should_be_after_this_in_the_header;
111 * Returns: new object
113 public GtkWidget * new(int j (check > 0)) {
115 ret = GTK_WIDGET (GET_NEW);
117 SELF(ret)->_priv->j = j;
121 private int _blah(self, Gtk:Widget * wid (check null type),
122 int h (check > 0)) onerror -1 {
123 gtk_container_add(GTK_CONTAINER(self),wid);
125 gtk_object_set(GTK_OBJECT(self),
126 GTK_WEIRD_BUTTON_ARG_I(99),
138 * Returns: new object
140 signal last INT (POINTER, INT)
141 int bleh(self, Gtk:Widget * wid (check null type),
143 return _blah(self,wid,h);
146 * gtk_weird_button_bleh2:
153 * Returns: new object */
154 signal last INT (POINTER, INT)
155 int bleh2(self, const Gtk:Widget * wid (check null type),
157 /* testing multiple marshaller support */
160 /* this should not get documented as it's nonstandard */
166 /* Here we are testing how the gtk-doc extraction code error handeling
167 it should just ingore these */
183 *zblunk*******//**//**/
184 signal first NONE (NONE)
186 virtual void * bah(self, int h (check > 0)) onerror NULL defreturn 0 {
190 virtual int beh(self, int h (check > 0));
191 override(Gtk:Container) void add(Gtk:Container * self (check null type),
192 Gtk:Widget * wid (check null type)) {
193 PARENT_HANDLER(self,wid);
195 public int consttest(self, const gchar *text, ...)
199 public int consttest2(self, gchar const *text, ...)
203 public int consttest3(self, Gtk:Widget const *wid (check null type))
207 public int consttest4(const self)
211 public int consttest5(self const)
215 virtual int consttest6(const self)
219 virtual int consttest7(self const)
223 public int consttest8(self)
225 Self const *selfconst1, *selfconst2;
226 selfconst1 = SELF_CONST(self);
227 selfconst2 = GTK_WEIRD_BUTTON_CONST(self);
230 public int consttest9(const self, int i, double b)
234 public int consttest10(self const, int i, double b)
238 signal private first NONE (NONE)
239 void googlegoogle(self)
244 signal first private NONE (NONE)
245 void googlegoogle2(self)
247 int array[5][8][9]={{{0}}};
250 testprivvirtual(foo, array);
252 private signal first NONE (NONE)
253 void googlegoogle3(self)
257 protected signal first NONE (NONE)
258 void googlegoogle4(self)
262 protected signal first NONE (NONE)
263 void googlegoogle_const1(const self)
267 protected signal first NONE (NONE)
268 void googlegoogle_const2(self const)
273 void testprivvirtual(self, int some_array[5][8][9])
279 void testprivvirtual2(self, const int some_array[5][8][9])
284 void testpublicvirtual(self, int const some_array[5][8][9])
289 void testprotectedvirtual(self, int some_array[5][8][9])
293 signal first NONE (POINTER)
294 void testarrsignal(self, long arr[8])
299 /* testing empty func */
300 public void foofoofoo(self) {}
301 /* testing empty func 2 */
302 public void foofoofoo2(self);
303 /* testing empty func 3 */
304 public void foofoofoo3(self) { }
305 /* testing empty func 4 */
306 public void foofoofoo4(self)
310 override (Gtk:Widget)
311 int event(Gtk:Widget *self (check null type),
312 GdkEvent *event (check null)) onerror FALSE
316 ret = PARENT_HANDLER(self,event);
320 override(Gtk:Container)
322 remove(Gtk:Container * self (check null type),
323 Gtk:Widget * wid (check null type));
327 destroy(Gtk:Object * self (check null type))
330 PARENT_HANDLER(self);
335 /* just an empty function */
339 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
340 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
342 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
343 gulong g, gfloat h, gdouble i, gchar * j, gint k,
344 guint l, gpointer m, gpointer o, GtkObject *p)
346 /* ugh, testing casting */
349 public signal (NO_HOOKS) last INT (INT)
350 int testflags(self, int w (check > 0)) defreturn -99 {
358 test_none_thing (self)
367 public int long const t4;
368 public const int long t5;
369 public const char * const t6;
370 public char const * const t7;
371 public enum _gob__enum_t const * const t8;
372 public union _gob__union_t t9;
373 public union _gob__union_t * const * const * t10;
374 public struct _gob__struct_t * const * const * t11;
375 public const struct _gob__struct_t * const * const * t13;
376 public const enum _gob__enum_t * const * const * t14;
377 public enum _gob__enum_t t15;
378 public gchar const t16;
379 public const gchar * const t17;
380 public const gchar t18;
382 /* testing empty statements */