widget layout progress

Jan Holesovsky kendy at suse.cz
Tue Aug 21 01:38:50 PDT 2012


Hi Caolán,

On 2012-08-20 at 17:03 +0100, Caolán McNamara wrote:

> 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[*]
[...]
> [*] 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 ?

This is great, I hope I'm not going to start some bikeshedding fest :-)

The thing that hit my eyes is the use of string identifiers to address
the UI elements.  Could we (for the compilation purposes) generate .hxx
files out of the .ui files that would allow to do something like:

m_pBodyContent = modules::swriter::ui::linenumbering::content::get(m_pUIBuilder);

[or whatever syntax equivalent that would avoid the use of string
literal]

Of course, that has nothing to do with the runtime, internally it would
be still indexed by name etc., so if somebody edits his/her .ui file not
carefully after the build, they'd be in trouble, but at least, during
the build we'd be fine.

Another extremely minor question - why the "modules/" prefix?  Is that
needed? - seems to just repeat on many places (mainly in help), so maybe
we could avoid that?

Thanks a lot,
Kendy



More information about the LibreOffice mailing list