Last modified 4 years ago
Last modified on 09/13/08 16:22:41
Existing GUI
The main problems with the current widget/form system are:
- It is convoluted and hard to maintain.
- It provides a limited set of widgets.
- It is hard to develop for, requiring a lot of boiler plate code.
- It is not really script friendly.
While the public interface is nothing short of awful, the actual implementation of some of the widgets it not that bad.
Therefore, the general consensus is that it needs to be redesigned. While many have proposed using an OpenGL widget toolkit instead of our own, I do not see this as being practical:
- It would add an extra dependency.
- It would probably use its own font rendering system.
- It would need to be skinned.
New GUI Proposal
Requirements
The new GUI needs to be:
- easy to use, requiring as little boiler-plate code as possible;
- flexible, such that all of the widgets currently used in Warzone can be re-created using it;
- scriptable, allowing the scripting engine access to the functionality it provides;
- testable and simulate-able.
Potential Solution
The design which I am proposing (hopefully) solves these problems. Broadly:
- It uses an object oriented system based off of GObject, albeit heavily stripped down.
- Drawing is done using cairo, thus providing vector drawing capabilities.
- General design borrowed from Swing.
- All widgets are containers and so can contain children.
- Events are passed bottom-up, so if we clicked on a button the click event would pass: Form => ... => Button
Final Solution
The new library is currently in the development phase and is currently known as Betawidget ?. It can be found at lib/betawidget.
