[Ohrrpgce] SVN: jay/5073 gui*: cleaning up GuiManager and the GUI_MESSAGES
Ralph Versteegen
teeemcee at gmail.com
Thu Feb 23 19:08:59 PST 2012
On 24 February 2012 07:24, <subversion at hamsterrepublic.com> wrote:
> jay
> 2012-02-23 10:24:36 -0800 (Thu, 23 Feb 2012)
> 49
> gui*: cleaning up GuiManager and the GUI_MESSAGES
> ---
> U wip/gui.cpp
> U wip/gui.h
> U wip/guiBase.cpp
> U wip/guiBase.h
I know that it's probably too early to have a close look since you're
still busy on it, but I did it anyway, so here are some comments.
It's (currently) a lot of code, mostly because you were implementing
everything from scratch, but partially I had forgotten just how much
logic a GUI framework would contain. The later isn't a bad thing:
it'll hopefully save a lot of code elsewhere.
Object factory classes don't seem useful, and tracking the factories
of objects isn't actually used anywhere. Much simpler to just let the
object constructors handle everything, passing in a pointer to the
GuiManager. That removes lots of code.
I would just delete guiText.*.
Switching to slices really will simplify CGuiObject.
Seeing all this low level stuff, I thought some more about the
abstraction of other GUI systems. Having a (low level) abstraction
layer seems to make the idea somewhat useless, since there's no hope
of mapping between the abstraction and the low level details of some
framework. I think that if we did abstraction, it would have to be at
a much higher level where the GUI manager handles everything and
there's no other framework-specific code anywhere else in the engine.
(Even then, it doesn't seem worth much effort). And we wouldn't be
passing creation and destruction and hittest messages to widgets, the
framework would do all of that itself. So plumbing details
(GUI_CREATE?) which are useless to the engine have no purpose and
should be removed.
More information about the Ohrrpgce
mailing list