]> Dogcows Code - chaz/openbox/commitdiff
set the root window, to a color for now
authorDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 07:26:32 +0000 (07:26 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 07:26:32 +0000 (07:26 +0000)
otk/display.cc
otk/display.hh
otk/rendercontrol.cc
otk/rendercontrol.hh
otk/renderstyle.cc
otk/renderstyle.hh
src/screen.cc

index 68f0862b99e534c6f6a3b55c3fb977a0bc261253..367ee3ebbc9d76884d0925b5dc7870595feaf874 100644 (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));
index ccce6ae1bfbc9f19b3c721fbc75e49c5692eb48c..28d33675a8db36e6d06066f158d4f17d0e133271 100644 (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; }
index 50a00ffa981d100b5a97ef10ba49c38b0d51ae6a..6b664b627b4a50a760dcfcaa6f5b908444519c04 100644 (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
index 1d9ab7e7501dd3c1eb23978db21e246ae3797e06..781c32d47a991b4cf50472a53a4d79655c02eec8 100644 (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 RenderColorcolor,
-                          const ustringstring) 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(Surfacesf,
-                             const RenderTexturetexture) const = 0;
+  virtual void drawBackground(Surface &sf,
+                             const RenderTexture &texture) const = 0;
 };
 
 }
index a2cfae215a8d8d26f97527e60775a47ae611ec9a..41745ea07e7899dae00934980d7b770a443c81e6 100644 (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;
 
index d61c99da26a848a6bc9dee881d67183e9c7a4897..2d2c325041b5241121183dffdc90058fa858004c 100644 (file)
@@ -27,6 +27,8 @@ public:
 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; }
 
index 1de4f72abb2fd29225ba636e1c6ed62a9a651f7b..1337038bb9cafc54fddd9d49fd499bb18567a1d5 100644 (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();
This page took 0.0334 seconds and 4 git commands to generate.