[Glade-users] GLADE XML to CPP Code

Tristan Van Berkom tristan.van.berkom at gmail.com
Tue Jun 15 10:52:42 EDT 2010


On Tue, Jun 15, 2010 at 10:21 AM, Piyush Verma <piyush.pv at gmail.com> wrote:
> Thanks a lot Tristan , Pablo
>
> I have not profiled the time difference yet.
>
> I simply found on net that loading XML takes time.

Creating the interface by interpreting a dynamic form will
always take more time than creating it with procedural compiled
instructions.

But there are reasons why we dropped code generation
from Glade, rebuilding your interface in the future will
be tricky if you use generated code for instance - as specially
if you make the mistake of mixing in any (or too much) of your
code with the generated code (meaning you will have to possibly
"merge" in your UI changes in the future, even when keeping this
to a minimal it can represent a hassle).

Currently I really doubt that the performance of GtkBuilder
is going to be so bad on an embedded platform that you're
going to want to go through all this hassle of creating a code
generating and then dealing with merging in the code periodically.

I would suggest first to find out if it's worth your time by at
least trying out GtkBuilder with some random interfaces
on your device (and keep the xml in a const char string[] of
course to avoid the needless disk access).

>
> And that glade interface is also increasing the number of lines in code.

Err what could you mean by that ?

>
> The application we are going to do is very big database application for
> accounts & Inventory.

Excuse if this is a misplaced suggestion, but there are tools to aid with
the generation of database applications too; have you looked at Glom
for example ? (http://www.glom.org/wiki/index.php?title=Main_Page)


Best Regards,
       -Tristan

>
> So first I want to prepare easy concept and defined system for development.
>
> I found
> "http://sourceforge.net/projects/g2c/files/g2c/g2c-0.4/g2c-0.4.tar.gz/download"
> have some parser from glade to c.
>
> I am planing to modify to work with latest glade and c++.
>
> Any batter idea. please let me know
>
>
>
> Thanks & Regards
>
> Piyush Verma
>
>
>
> On Tue, Jun 15, 2010 at 1:05 PM, Juan Pablo Daniel <jpdborgna at gmail.com>
> wrote:
>>
>> If I remember well older versions of glade (< 3 ?) where able to generate
>> C code. I think it can help you.
>>
>> BTW, i'm interested on those timings and the embedded application,
>> specially the hardware used, are you going to publish something about it?
>>
>> Best regards, Juan Pablo.
>>
>>
>> On Tue, Jun 15, 2010 at 12:52 AM, Tristan Van Berkom
>> <tristan.van.berkom at gmail.com> wrote:
>>>
>>> On Mon, Jun 14, 2010 at 10:37 PM, Piyush Verma <piyush.pv at gmail.com>
>>> wrote:
>>> > Hello All
>>> >
>>> > We was developing Application for Embedded Device.
>>> >
>>> > Would it be possible to translate XML output of GLADE to Rich CPP Code.
>>> >
>>> > This can reduce the object loading and searching time while handling
>>> > them.
>>> >
>>> > If not where should we start to add this feature ?
>>>
>>> I would be interested to know, have you profiled the startup time
>>> difference
>>> between using GtkBuilder and manually creating widgets ?
>>>
>>> Is it a significant difference with a large UI ? (say 50+ widgets at
>>> least ?)
>>>
>>> I am curious because the main issues with libglade on embedded platforms
>>> seemed to be the heavy libxml2 dependency, and the load time with
>>> GtkBuilder
>>> should be reduced compared with libglade - although honestly I dont know
>>> how much so.
>>>
>>> That being said, if using GtkBuilder is too slow/not an option to you,
>>> you can
>>> consider to write your own script/tool to generate code from Glade xml
>>> output
>>> (or you can write your own optimized flavor of libglade).
>>>
>>> Cheers,
>>>          -Tristan
>>>
>>> >
>>> > --
>>> > Thanks & Regards
>>> >
>>> > Piyush Verma
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > Glade-users maillist  -  Glade-users at lists.ximian.com
>>> > http://lists.ximian.com/mailman/listinfo/glade-users
>>> >
>>> >
>>> _______________________________________________
>>> Glade-users maillist  -  Glade-users at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/glade-users
>>
>
>
>
> --
> Thanks & Regards
>
> Piyush Verma
>
>
>


More information about the Glade-users mailing list