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 signal private first NONE (NONE)
208 void googlegoogle(self)
213 signal first private NONE (NONE)
214 void googlegoogle2(self)
216 int array[5][8][9]={{{0}}};
219 testprivvirtual(foo, array);
221 private signal first NONE (NONE)
222 void googlegoogle3(self)
226 protected signal first NONE (NONE)
227 void googlegoogle4(self)
232 void testprivvirtual(self, int some_array[5][8][9])
238 void testprivvirtual2(self, const int some_array[5][8][9])
243 void testpublicvirtual(self, int const some_array[5][8][9])
248 void testprotectedvirtual(self, int some_array[5][8][9])
252 signal first NONE (POINTER)
253 void testarrsignal(self, long arr[8])
258 /* testing empty func */
259 public void foofoofoo(self) {}
260 /* testing empty func 2 */
261 public void foofoofoo2(self);
262 /* testing empty func 3 */
263 public void foofoofoo3(self) { }
264 /* testing empty func 4 */
265 public void foofoofoo4(self)
269 override (Gtk:Widget)
270 int event(Gtk:Widget *self (check null type),
271 GdkEvent *event (check null)) onerror FALSE
275 ret = PARENT_HANDLER(self,event);
279 override(Gtk:Container)
281 remove(Gtk:Container * self (check null type),
282 Gtk:Widget * wid (check null type));
286 destroy(Gtk:Object * self (check null type))
289 PARENT_HANDLER(self);
294 /* just an empty function */
298 signal last NONE(CHAR,UCHAR,BOOL,INT,UINT,LONG,ULONG,FLOAT,DOUBLE,
299 STRING,ENUM,FLAGS,BOXED,POINTER,OBJECT)
301 testargs(self, gchar a, guchar b, gboolean c, gint d, guint e, glong f,
302 gulong g, gfloat h, gdouble i, gchar * j, gint k,
303 guint l, gpointer m, gpointer o, GtkObject *p)
305 /* ugh, testing casting */
308 public signal (NO_HOOKS) last INT (INT)
309 int testflags(self, int w (check > 0)) defreturn -99 {
317 test_none_thing (self)
326 public int long const t4;
327 public const int long t5;
328 public const char * const t6;
329 public char const * const t7;
330 public enum _gob__enum_t const * const t8;
331 public union _gob__union_t t9;
332 public union _gob__union_t * const * const * t10;
333 public struct _gob__struct_t * const * const * t11;
334 public const struct _gob__struct_t * const * const * t13;
335 public const enum _gob__enum_t * const * const * t14;
336 public enum _gob__enum_t t15;
337 public gchar const t16;
338 public const gchar * const t17;
339 public const gchar t18;
341 /* testing empty statements */