}
-const ScreenInfo* Display::screenInfo(int snum)
+const ScreenInfo* Display::screenInfo(int snum) const
{
assert(snum >= 0);
assert(snum < (signed) ScreenCount(_display));
}
-const ScreenInfo* Display::findScreen(Window root)
+const ScreenInfo* Display::findScreen(Window root) const
{
for (int i = 0; i < ScreenCount(_display); ++i)
if (_screeninfo_list[i]->rootWindow() == root)
}
-const RenderControl *Display::renderControl(int snum)
+const RenderControl *Display::renderControl(int snum) const
{
assert(snum >= 0);
assert(snum < (signed) ScreenCount(_display));
@param snum The screen number of the screen to retrieve info on
@return Info on the requested screen, in a ScreenInfo class
*/
- const ScreenInfo* screenInfo(int snum);
+ const ScreenInfo* screenInfo(int snum) const;
//! Find a ScreenInfo based on a root window
- const ScreenInfo* findScreen(Window root);
+ const ScreenInfo* findScreen(Window root) const;
//! Gets the RenderControl for a screen
- const RenderControl *renderControl(int snum);
+ const RenderControl *renderControl(int snum) const;
//! Returns if the display has the xkb extension available
inline bool xkb() const { return _xkb; }
}
+void RenderControl::drawRoot(const RenderColor &color) const
+{
+ Window root = display->screenInfo(_screen)->rootWindow();
+ XSetWindowBackground(**display, root, color.pixel());
+ XClearWindow(**display, root);
+}
+
void RenderControl::drawString(Surface& sf, const Font &font, int x, int y,
const RenderColor &color,
const ustring &string) const
static RenderControl *getRenderControl(int screen);
+ virtual void drawRoot(const RenderColor &color) const;
+
//! Draws a string onto a Surface
- virtual void drawString(Surface& sf, const Font& font, int x, int y,
- const RenderColor& color,
- const ustring& string) const;
+ virtual void drawString(Surface &sf, const Font &font, int x, int y,
+ const RenderColor &color,
+ const ustring &string) const;
//! Draws a background onto a Surface, as specified by a RenderTexture
- virtual void drawBackground(Surface& sf,
- const RenderTexture& texture) const = 0;
+ virtual void drawBackground(Surface &sf,
+ const RenderTexture &texture) const = 0;
};
}
: _screen(screen),
_file(stylefile)
{
+ _root_color = new RenderColor(_screen, 0x272a2f);
+
_text_color_focus = new RenderColor(_screen, 0x272a2f);
_text_color_unfocus = new RenderColor(_screen, 0x676869);
RenderStyle::~RenderStyle()
{
+ delete _root_color;
+
delete _text_color_focus;
delete _text_color_unfocus;
private:
int _screen;
std::string _file;
+
+ RenderColor *_root_color;
RenderColor *_text_color_focus;
RenderColor *_text_color_unfocus;
inline int screen() const { return _screen; }
+ inline RenderColor *rootColor() const { return _root_color; }
+
inline RenderColor *textFocusColor() const { return _text_color_focus; }
inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; }
}
_style.load(sconfig);
*/
+ otk::display->renderControl(_number)->drawRoot(*_style.rootColor());
// set up notification of netwm support
changeSupportedAtoms();