---- Markus Engel <p637777@...1081...> wrote:
Hi, if you used references or pointers, where would you get the actual widgets from? "newing" them? Then please make sure that every single widget is correctly deleted no matter what happens. You probably don't want to do that. How often are these files or the files referencing them changed? Are you sure that this will have an impact on the compilation times? Do some measurement and prove it :) .
I agree with Markus. It doesn't make sense to complicate code and the chances of bugs, only to reduce compilation times (is it really that significant?). Note that the dialog's cpp files would still have to include the headers :-) I you move the gtkmm/*-includes from .h to .cpp, by how much does it reduce the number of compiled files (.cpp) that include those gtkmm/*-includes?
cheers, Johan
Don't get me wrong please. Just some of my first thoughts ;) . Regards, Markus
-----Ursprüngliche Nachricht----- Von: Alex Valavanis [mailto:valavanisalex@...400...] Gesendet: Montag, 31. März 2014 15:45 An: Inkscape Devel List Betreff: [Inkscape-devel] Private implementations of widgets
Hello All,
Just wondering if we ever came up with a coding style for the private components of our widgets and dialogs. Our GUI components, for example, the dialog in [1] contain many different Gtk widgets (rather than pointers/refs to widgets) and so we need to include lots of <gtkmm/*.h> headers in our GUI class definitions.
If the embedded widgets were replaced by references to objects, we could just use forward declarations of the appropriate classes and then pull the header inclusions into the relevant .cpp files so it should improve our compilation times.
Is there a reason why we don't do more of this already?
AV
[1] http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/ui/d ialog/grid-arrange-tab.h