1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
5 #endif // HAVE_CONFIG_H
9 #include "screeninfo.hh"
12 #include <X11/Xutil.h>
17 Surface::Surface(int screen)
26 Surface::Surface(int screen, const Point &size)
40 void Surface::createObjects()
42 assert(_pm == None); assert(!_xftdraw);
44 const ScreenInfo *info = display->screenInfo(_screen);
46 _pm = XCreatePixmap(**display, info->rootWindow(), _size.x(), _size.y(),
49 _xftdraw = XftDrawCreate(**display, _pm, info->visual(), info->colormap());
52 void Surface::destroyObjects()
54 assert(_pm != None); assert(_xftdraw);
56 XftDrawDestroy(_xftdraw);
59 XFreePixmap(**display, _pm);
63 void Surface::setSize(int w, int h)
65 if (w == _size.x() && h == _size.y()) return; // no change