]> Dogcows Code - chaz/openbox/blobdiff - src/XScreen.cc
nls from bb-cvs
[chaz/openbox] / src / XScreen.cc
index dbc487057707c653e9a4891fc7965a2fe92ebaf8..5ae8becdd490352e853deb5adbd4034401b025cc 100644 (file)
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
+#include <X11/Xutil.h>
 #include "XScreen.h"
+#include "XDisplay.h"
 #include "Geometry.h"
 
-XScreen::XScreen(const Display *display, const unsigned int number) {
-  _display = display;
+XScreen::XScreen(const XDisplay *display, const unsigned int number) {
+  _display = display->_display;
   _number = number;
 
   _root = RootWindow(_display, _number);
@@ -33,6 +35,10 @@ XScreen::XScreen(const Display *display, const unsigned int number) {
 }
 
 
+XScreen::~XScreen() {
+}
+
+  
 /*
  * This sets up the _depth, _visual, and _colormap properties.
  */
@@ -58,10 +64,23 @@ void XScreen::setColorData() {
       }
     XFree(vinfo_return);
   }
-  if (visual)
+  if (_visual)
     _colormap = XCreateColormap(_display, _root, _visual, AllocNone);
   else {
     _visual = DefaultVisual(_display, _number);
     _colormap = DefaultColormap(_display, _number);
   }
 }
+
+
+/*
+ * Creates a window on screen.
+ */
+Window createWindow(Window parent, const Rect &area, int borderw,
+                    unsigned int winclass, unsigned long attrib_mask,
+                    XSetWindowAttributes *attrib) const {
+  return XCreateWindow(_display, parent,
+                       area.x(), area.y(), area.w(), area.h(),
+                       borderw, depth(), winclass, visual(),
+                       attrib_mask, attrib);
+}
This page took 0.020563 seconds and 4 git commands to generate.