set the root window, to a color for now
This commit is contained in:
parent
bf3a40ad66
commit
9a64438a5a
7 changed files with 29 additions and 11 deletions
|
@ -197,7 +197,7 @@ Display::~Display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const ScreenInfo* Display::screenInfo(int snum)
|
const ScreenInfo* Display::screenInfo(int snum) const
|
||||||
{
|
{
|
||||||
assert(snum >= 0);
|
assert(snum >= 0);
|
||||||
assert(snum < (signed) ScreenCount(_display));
|
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)
|
for (int i = 0; i < ScreenCount(_display); ++i)
|
||||||
if (_screeninfo_list[i]->rootWindow() == root)
|
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 >= 0);
|
||||||
assert(snum < (signed) ScreenCount(_display));
|
assert(snum < (signed) ScreenCount(_display));
|
||||||
|
|
|
@ -94,13 +94,13 @@ public:
|
||||||
@param snum The screen number of the screen to retrieve info on
|
@param snum The screen number of the screen to retrieve info on
|
||||||
@return Info on the requested screen, in a ScreenInfo class
|
@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
|
//! 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
|
//! 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
|
//! Returns if the display has the xkb extension available
|
||||||
inline bool xkb() const { return _xkb; }
|
inline bool xkb() const { return _xkb; }
|
||||||
|
|
|
@ -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,
|
void RenderControl::drawString(Surface& sf, const Font &font, int x, int y,
|
||||||
const RenderColor &color,
|
const RenderColor &color,
|
||||||
const ustring &string) const
|
const ustring &string) const
|
||||||
|
|
|
@ -71,14 +71,16 @@ public:
|
||||||
|
|
||||||
static RenderControl *getRenderControl(int screen);
|
static RenderControl *getRenderControl(int screen);
|
||||||
|
|
||||||
|
virtual void drawRoot(const RenderColor &color) const;
|
||||||
|
|
||||||
//! Draws a string onto a Surface
|
//! Draws a string onto a Surface
|
||||||
virtual void drawString(Surface& sf, const Font& font, int x, int y,
|
virtual void drawString(Surface &sf, const Font &font, int x, int y,
|
||||||
const RenderColor& color,
|
const RenderColor &color,
|
||||||
const ustring& string) const;
|
const ustring &string) const;
|
||||||
|
|
||||||
//! Draws a background onto a Surface, as specified by a RenderTexture
|
//! Draws a background onto a Surface, as specified by a RenderTexture
|
||||||
virtual void drawBackground(Surface& sf,
|
virtual void drawBackground(Surface &sf,
|
||||||
const RenderTexture& texture) const = 0;
|
const RenderTexture &texture) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,8 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)
|
||||||
: _screen(screen),
|
: _screen(screen),
|
||||||
_file(stylefile)
|
_file(stylefile)
|
||||||
{
|
{
|
||||||
|
_root_color = new RenderColor(_screen, 0x272a2f);
|
||||||
|
|
||||||
_text_color_focus = new RenderColor(_screen, 0x272a2f);
|
_text_color_focus = new RenderColor(_screen, 0x272a2f);
|
||||||
_text_color_unfocus = new RenderColor(_screen, 0x676869);
|
_text_color_unfocus = new RenderColor(_screen, 0x676869);
|
||||||
|
|
||||||
|
@ -220,6 +222,8 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)
|
||||||
|
|
||||||
RenderStyle::~RenderStyle()
|
RenderStyle::~RenderStyle()
|
||||||
{
|
{
|
||||||
|
delete _root_color;
|
||||||
|
|
||||||
delete _text_color_focus;
|
delete _text_color_focus;
|
||||||
delete _text_color_unfocus;
|
delete _text_color_unfocus;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ public:
|
||||||
private:
|
private:
|
||||||
int _screen;
|
int _screen;
|
||||||
std::string _file;
|
std::string _file;
|
||||||
|
|
||||||
|
RenderColor *_root_color;
|
||||||
|
|
||||||
RenderColor *_text_color_focus;
|
RenderColor *_text_color_focus;
|
||||||
RenderColor *_text_color_unfocus;
|
RenderColor *_text_color_unfocus;
|
||||||
|
@ -75,6 +77,8 @@ public:
|
||||||
|
|
||||||
inline int screen() const { return _screen; }
|
inline int screen() const { return _screen; }
|
||||||
|
|
||||||
|
inline RenderColor *rootColor() const { return _root_color; }
|
||||||
|
|
||||||
inline RenderColor *textFocusColor() const { return _text_color_focus; }
|
inline RenderColor *textFocusColor() const { return _text_color_focus; }
|
||||||
inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; }
|
inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; }
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ Screen::Screen(int screen)
|
||||||
}
|
}
|
||||||
_style.load(sconfig);
|
_style.load(sconfig);
|
||||||
*/
|
*/
|
||||||
|
otk::display->renderControl(_number)->drawRoot(*_style.rootColor());
|
||||||
|
|
||||||
// set up notification of netwm support
|
// set up notification of netwm support
|
||||||
changeSupportedAtoms();
|
changeSupportedAtoms();
|
||||||
|
|
Loading…
Reference in a new issue