X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Frenderstyle.cc;h=d45e421265666d323018284a98f897e3bd7d937f;hb=e451c08ac5a103362adbece9b8a11a16ade739c1;hp=01adeca834461ecfbf382e638e35f38cc98de295;hpb=225d4302d0b2bd40d03d3bfa54116c0adfe3143e;p=chaz%2Fopenbox diff --git a/otk/renderstyle.cc b/otk/renderstyle.cc index 01adeca8..d45e4212 100644 --- a/otk/renderstyle.cc +++ b/otk/renderstyle.cc @@ -1,22 +1,61 @@ // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif // HAVE_CONFIG_H +#include "config.h" #include "renderstyle.hh" #include "display.hh" #include "screeninfo.hh" +#include + namespace otk { +RenderStyle **RenderStyle::_styles = 0; +std::list *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[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) { // pick one.. -//#define FIERON -#define MERRY +#define FIERON +//#define MERRY #ifdef FIERON _root_color = new RenderColor(_screen, 0x272a2f); @@ -175,7 +214,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; @@ -256,10 +295,10 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) RenderTexture::Flat, RenderTexture::Bevel1, false, - RenderTexture::Solid, + RenderTexture::Vertical, false, 0xe6e6e6, - 0xe6e6e6, + 0xd9d9d9, 0x0, 0x0); @@ -268,24 +307,25 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) RenderTexture::Flat, RenderTexture::Bevel1, true, - RenderTexture::Solid, + RenderTexture::Vertical, false, //0x6a6973, //0x6a6973, 0x4c59a6, - 0x4c59a6, + 0x5a6dbd, 0x222222, 0x0); - _label_unfocus = new RenderTexture(_screen, + //urg this ain't so hot +_label_unfocus = new RenderTexture(_screen, false, RenderTexture::Flat, RenderTexture::Bevel1, true, - RenderTexture::Solid, + RenderTexture::Vertical, false, - 0xcdcac7, - 0xcdcac7, - 0xb0ada9, + 0xb4b2ad, + 0xc3c1bc, + 0x6a696a, 0x0); @@ -294,10 +334,10 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) RenderTexture::Flat, RenderTexture::Bevel1, false, - RenderTexture::Solid, + RenderTexture::Vertical, false, 0xe6e6e6, - 0xe6e6e6, + 0xd9d9d9, 0x0, 0x0); _handle_unfocus = new RenderTexture(_screen, @@ -339,9 +379,9 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) _button_press_focus = new RenderTexture(_screen, false, RenderTexture::Sunken, - RenderTexture::Bevel1, + RenderTexture::Bevel2, false, - RenderTexture::Solid, + RenderTexture::Vertical, false, 0xe6e6e6, 0xe6e6e6, @@ -350,9 +390,9 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) _button_press_unfocus = new RenderTexture(_screen, false, RenderTexture::Sunken, - RenderTexture::Bevel1, + RenderTexture::Bevel2, false, - RenderTexture::Solid, + RenderTexture::Vertical, false, 0xe6e6e6, 0xe6e6e6, @@ -364,10 +404,10 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) RenderTexture::Flat, RenderTexture::Bevel1, false, - RenderTexture::Solid, + RenderTexture::Vertical, false, 0xe6e6e6, - 0xe6e6e6, + 0xd9d9d9, 0x0, 0x0); _grip_unfocus = new RenderTexture(_screen, @@ -382,7 +422,7 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile) 0x0, 0x0); - _label_font = new Font(_screen, "Arial,Sans-9", true, 1, 0x3e); + _label_font = new Font(_screen, "Arial,Sans-8", true, 1, 0x3e); _label_justify = CenterJustify; _max_mask = new PixmapMask();