Re: [Vala] widget bindings take 2



I remember now, it was lack of unions that made it impossible to do a pure vala solution.

sam

-----Original Message-----
From: Sam Liddicott <sam liddicott com>
Sent: 21 June 2008 15:29
To: vala-list gnome org
Subject: [Vala] widget bindings take 2

My widget bindings project is to have a declaration for each widget as 
part of a vala class, so that the author doesn't have to write 
this.xml.get_widget("dialer-entry"); all over the place, but definitions 
for each widget are generated and linked automatically;
e.g.

myform.widgets.inputbox

implemented in C as something like:
_GladeMyformPrivate->widgets->inputbox

I've written some xslt which generates a C (.h) file from a .glade file 
with all the right definitions.

The demo.glade.h file can be build with the attached 
gen-glade-widget-bindings.xslt, like this:

xsltproc --nodtdattr --path /usr/share/xml/libglade 
gen-glade-widget-bindings.xslt src/demo.glade > src/demo.glade.h

The difficulty is importing the defined widgets union declaration into 
the vala file, I need it to be a private member.
I also need to be able to get at the embedded xml from vala in order to 
pass to the Glade.XML

I think I need advice; I'm nearly there but I think I'm also at a dead end.

Possibly there are some [CCode] options to use but I don't think they 
are enough.

I think that if the union members will be available from vala, that I 
have to define a vala struct or class, but the union members are meant 
to be private to an existing vala class in another file, and there's no 
#include for vala that I know of.

Maybe the generated vala should be an ancestor class to the authored 
code, but vala doesn't support protected properties, only public or 
private (protected methods exist) so I'm a bit lost, maybe vala isn't 
neatly capable of this after without IDE integrated to edit the code 
on-the-fly.

Sam




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]