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 {
64 public int test_array[TEST_ARRAY];
66 argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
68 public int testing = 1;
69 argument INT testing link;
71 public char * testingstring = {g_strdup("test")}
73 argument POINTER testingstring stringlink;
75 public Gtk:Weird:Button * testingobj
76 destroywith gtk_object_unref;
77 argument POINTER testingobj objectlink;
79 classwide int foo = 20;
80 argument INT foo link;
82 public Gtk:Object * testingobj2
85 gtk_object_unref(GTK_OBJECT(VAR));
87 argument POINTER (type Gtk:Object *) testingobj2 objectlink;
89 argument POINTER (type GtkObject *) some_object
90 set { /* set some_object */ }
91 get { /* get some_object */
93 argument (CONSTRUCT) LONG (type long) write_only_long
94 set { /* set write_only_long */ };
95 argument POINTER (type char *) read_only_string
96 get { /* get readonly_long */
97 ARG = g_strdup("BLAH"); };
101 public double array[23][18];
102 protected unsigned long int wagawaga;
103 public int wagawaga_should_be_after_this_in_the_header;
116 * Returns: new object
118 public GtkWidget * new(int j (check > 0)) {
120 ret = GTK_WIDGET (GET_NEW);
122 SELF(ret)->_priv->j = j;
126 private int _blah(self, Gtk:Widget * wid (check null type),
127 int h (check > 0)) onerror -1 {
128 gtk_container_add(GTK_CONTAINER(self),wid);
130 gtk_object_set(GTK_OBJECT(self),
131 GTK_WEIRD_BUTTON_ARG_I(99),
143 * Returns: new object
145 signal last INT (POINTER, INT)
146 int bleh(self, Gtk:Widget * wid (check null type),
148 return _blah(self,wid,h);
153 test_handler (self, GtkWidget *w, int h, gpointer data)
159 * gtk_weird_button_bleh2:
166 * Returns: new object */
167 signal last INT (POINTER, INT)
168 int bleh2(self, const Gtk:Widget * wid (check null type),
170 gtk_signal_connect (GTK_OBJECT (self),
171 GTK_WEIRD_BUTTON_SIGNAL_BLEH (test_handler),
174 /* testing multiple marshaller support */
177 /* this should not get documented as it's nonstandard */
183 /* Here we are testing how the gtk-doc extraction code error handeling
184 it should just ingore these */
200 *zblunk*******//**//**/
201 signal first NONE (NONE)
203 virtual void * bah(self, int h (check > 0)) onerror NULL defreturn 0 {
207 virtual int beh(self, int h (check > 0));
208 override(Gtk:Container) void add(Gtk:Container * self (check null type),
209 Gtk:Widget * wid (check null type)) {
210 PARENT_HANDLER(self,wid);
212 public int consttest(self, const gchar *text, ...)
216 public int consttest2(self, gchar const *text, ...)
220 public int consttest3(self, Gtk:Widget const *wid (check null type))
224 public int consttest4(const self)
228 public int consttest5(self const)
232 virtual int consttest6(const self)
236 virtual int consttest7(self const)
240 public int consttest8(self)
242 Self const *selfconst1, *selfconst2;
243 selfconst1 = SELF_CONST(self);
244 selfconst2 = GTK_WEIRD_BUTTON_CONST(self);
247 public int consttest9(const self, int i, double b)
251 public int consttest10(self const, int i, double b)
255 signal private first NONE (NONE)
256 void googlegoogle(self)
261 signal first private NONE (NONE)
262 void googlegoogle2(self)
264 int array[5][8][9]={{{0}}};
267 testprivvirtual(foo, array);
269 private signal first NONE (NONE)
270 void googlegoogle3(self)
274 protected signal first NONE (NONE)
275 void googlegoogle4(self)
279 protected signal first NONE (NONE)
280 void googlegoogle_const1(const self)
284 protected signal first NONE (NONE)
285 void googlegoogle_const2(self const)
290 void testprivvirtual(self, int some_array[5][8][9])
296 void testprivvirtual2(self, const int some_array[5][8][9])
301 void testpublicvirtual(self, int const some_array[5][8][9])
306 void testprotectedvirtual(self, int some_array[5][8][9])
310 signal first NONE (POINTER)
311 void testarrsignal(self, long arr[8])
316 /* testing empty func */
317 public void foofoofoo(self) {}
318 /* testing empty func 2 */
319 public void foofoofoo2(self);
320 /* testing empty func 3 */
321 public void foofoofoo3(self) { }
322 /* testing empty func 4 */
323 public void foofoofoo4(self)
327 override (Gtk:Widget)
328 int event(Gtk:Widget *self (check null type),
329 GdkEvent *event (check null)) onerror FALSE
333 ret = PARENT_HANDLER(self,event);
337 override(Gtk:Container)
339 remove(Gtk:Container * self (check null type),
340 Gtk:Widget * wid (check null type));
344 destroy(Gtk:Object * self (check null type))
347 PARENT_HANDLER(self);
352 /* just an empty function */
356 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
357 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
359 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
360 gulong g, gfloat h, gdouble i, gchar * j, gint k,
361 guint l, gpointer m, gpointer o, GtkObject *p)
363 /* ugh, testing casting */
366 public signal (NO_HOOKS) last INT (INT)
367 int testflags(self, int w (check > 0)) defreturn -99 {
375 test_none_thing (self)
384 public int long const t4;
385 public const int long t5;
386 public const char * const t6;
387 public char const * const t7;
388 public enum _gob__enum_t const * const t8;
389 public union _gob__union_t t9;
390 public union _gob__union_t * const * const * t10;
391 public struct _gob__struct_t * const * const * t11;
392 public const struct _gob__struct_t * const * const * t13;
393 public const enum _gob__enum_t * const * const * t14;
394 public enum _gob__enum_t t15;
395 public gchar const t16;
396 public const gchar * const t17;
397 public const gchar t18;
399 /* testing method with no arguments */
400 public void method_with_no_arguments (void)
405 /* testing calling the above method */
406 public void foo (self) {
407 method_with_no_arguments ();
410 /* this is to test custom get_type */
414 static guint type = 0;
417 static const GtkTypeInfo info = {
419 sizeof (GtkWeirdButton),
420 sizeof (GtkWeirdButtonClass),
421 (GtkClassInitFunc) gtk_weird_button_class_init,
422 (GtkObjectInitFunc) gtk_weird_button_init,
425 (GtkClassInitFunc) NULL
428 type = gtk_type_unique (gtk_button_get_type(), &info);
435 /* testing empty statements */