diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:33:48 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:33:48 +0000 |
| commit | 99cd843fc6dc7a7f55b6c90fd1162f233853aad2 (patch) | |
| tree | 42b25c02cbf984fe29b378e9d0dbfbca1436c87b /otk/renderstyle.cc | |
| parent | d2df40965bbf042e062b65d6adc12bc158d503eb (diff) | |
Brand spankin new widgets for otk (Label and Button).
Add a new Size class.
Rect, Point, and Size are immutable classes.
Size uses *UNSIGNED* ints. This is causing me headaches * a bajillion right now, so we'll see about that.
Diffstat (limited to 'otk/renderstyle.cc')
| -rw-r--r-- | otk/renderstyle.cc | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/otk/renderstyle.cc b/otk/renderstyle.cc index 5e19aa47..13d9e577 100644 --- a/otk/renderstyle.cc +++ b/otk/renderstyle.cc @@ -8,8 +8,49 @@ #include "display.hh" #include "screeninfo.hh" +#include <cassert> + namespace otk { +RenderStyle **RenderStyle::_styles = 0; +std::list<StyleNotify*> *RenderStyle::_notifies = 0; + +void RenderStyle::initialize() +{ + int screens = ScreenCount(**display); + _styles = new RenderStyle*[screens]; + for (int i = 0; i < screens; ++i) + _styles[i] = new RenderStyle(i, ""); // XXX get a path + _notifies = new std::list<StyleNotify*>[screens]; +} + +void RenderStyle::destroy() +{ + int screens = ScreenCount(**display); + for (int i = 0; i < screens; ++i) + delete _styles[i]; + delete [] _styles; + delete [] _notifies; +} + +void RenderStyle::registerNotify(int screen, StyleNotify *n) +{ + assert(screen >= 0 && screen < ScreenCount(**display)); + _notifies[screen].push_back(n); +} + +void RenderStyle::unregisterNotify(int screen, StyleNotify *n) +{ + assert(screen >= 0 && screen < ScreenCount(**display)); + _notifies[screen].remove(n); +} + +RenderStyle *RenderStyle::style(int screen) +{ + assert(screen >= 0 && screen < ScreenCount(**display)); + return _styles[screen]; +} + RenderStyle::RenderStyle(int screen, const std::string &stylefile) : _screen(screen), _file(stylefile) @@ -175,7 +216,7 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) 0x0); _label_font = new Font(_screen, "Arial,Sans-9:bold", true, 1, 0x40); - _label_justify = RightJustify; + _label_justify = RightBottomJustify; _max_mask = new PixmapMask(); _max_mask->w = _max_mask->h = 8; |
