// 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);
}
+XScreen::~XScreen() {
+}
+
+
/*
* This sets up the _depth, _visual, and _colormap properties.
*/
}
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);
+}