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
glade.
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
http://cgit.freedesktop.org/libreoffice/core/commit/?h=feature/cmclayouttrans&id=064c21aec9245148e90290afd00c46b0999d19c4
i.e.
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..
http://cgit.freedesktop.org/libreoffice/help/commit/?h=feature/cmclayouttrans&id=4add66152cd6c1c9f4f39be35d8d016cb5b11080
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.
http://cgit.freedesktop.org/libreoffice/core/commit/?h=feature/cmclayouttrans&id=aefe9698a6982eaefdae51dbaebc15a4e0bd28a7
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.
C.
[*] 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 ?
Context
- widget layout progress · Caolán McNamara
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.