set the root window, to a color for now

This commit is contained in:
Dana Jansens 2003-01-23 07:26:32 +00:00
parent bf3a40ad66
commit 9a64438a5a
7 changed files with 29 additions and 11 deletions

View file

@ -197,7 +197,7 @@ Display::~Display()
}
const ScreenInfo* Display::screenInfo(int snum)
const ScreenInfo* Display::screenInfo(int snum) const
{
assert(snum >= 0);
assert(snum < (signed) ScreenCount(_display));
@ -205,7 +205,7 @@ const ScreenInfo* Display::screenInfo(int snum)
}
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)
@ -214,7 +214,7 @@ const ScreenInfo* Display::findScreen(Window root)
}
const RenderControl *Display::renderControl(int snum)
const RenderControl *Display::renderControl(int snum) const
{
assert(snum >= 0);
assert(snum < (signed) ScreenCount(_display));

View file

@ -94,13 +94,13 @@ public:
@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; }

View file

@ -60,6 +60,13 @@ RenderControl::~RenderControl()
}
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

View file

@ -71,14 +71,16 @@ public:
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;
};
}

View file

@ -14,6 +14,8 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)
: _screen(screen),
_file(stylefile)
{
_root_color = new RenderColor(_screen, 0x272a2f);
_text_color_focus = new RenderColor(_screen, 0x272a2f);
_text_color_unfocus = new RenderColor(_screen, 0x676869);
@ -220,6 +222,8 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)
RenderStyle::~RenderStyle()
{
delete _root_color;
delete _text_color_focus;
delete _text_color_unfocus;

View file

@ -28,6 +28,8 @@ private:
int _screen;
std::string _file;
RenderColor *_root_color;
RenderColor *_text_color_focus;
RenderColor *_text_color_unfocus;
@ -75,6 +77,8 @@ public:
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; }

View file

@ -89,6 +89,7 @@ Screen::Screen(int screen)
}
_style.load(sconfig);
*/
otk::display->renderControl(_number)->drawRoot(*_style.rootColor());
// set up notification of netwm support
changeSupportedAtoms();