widget layout progress
caolanm at redhat.com
Mon Aug 20 09:03:23 PDT 2012
Making a bit of progress in widget layout.
Seeing as I'm a bit "close" to it, I'd like to demo some sample commits
of how conversions would look to see if it makes anyone violently ill.
Basically we'd use the gtk ui builder format which is ui editable with
Full Conversion: Here's what a "full conversion" of a dialog away from
the binary res format to the xml .ui format would look like
a) remove the .src and .hrc
b) remove from the .hxx and .cxx any controls which only exist in the
code in order to get them loaded from the .res file
c) adapt the code to use "get_by_name" to find a widget if code needs to
get an explicit handle to one to set callbacks or whatever[*]
And its help ids in helpcontent2 like so..
i.e. help ids become the path/to/dialog + dialog name + widget name
Incremental Conversion: Here's an "incremental" conversion from the
binary format to to .ui. In this case no code changes happen at all.
Once the .ui widget ids (and their types) match the ids that the
existing code expects then "magic" makes it work out of the box if the
ui is correctly named and put in the right place.
The idea here is that, with the right conversion utility, the .src files
could be converted to some basic glade-editable skeleton and there's no
programming ability required to knock that into shape for submission.
The submitted .ui can then be dropped in as-is, and/or code then
optimized to complete the conversion.
I'll do up a wiki page with a bit more detail in a while.
[*] maybe the cast-happy syntax looks a bit vile. Perhaps a bit family
of get_foos_by_name, or a get_by_name<T> template instead ?
More information about the LibreOffice