aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.cc
diff options
context:
space:
mode:
authorakir <akir>2004-09-09 14:29:10 (GMT)
committerakir <akir>2004-09-09 14:29:10 (GMT)
commit1d355a91925536ba2b4f0ffe652cb72540c91000 (patch)
treee323adb7f34038f1cdcd9c773339bb7ab679641f /src/FbTk/FbPixmap.cc
parent7507098440e300c0126affbdd469456653b41e95 (diff)
downloadfluxbox-1d355a91925536ba2b4f0ffe652cb72540c91000.zip
fluxbox-1d355a91925536ba2b4f0ffe652cb72540c91000.tar.bz2
transfered ::getRootPixmap from several places to new home, FbPixmap
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r--src/FbTk/FbPixmap.cc41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index bbc1906..c698ce6 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -19,13 +19,14 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbPixmap.cc,v 1.12 2004/07/06 10:47:36 fluxgen Exp $ 22// $Id: FbPixmap.cc,v 1.13 2004/09/09 14:29:10 akir Exp $
23 23
24#include "FbPixmap.hh" 24#include "FbPixmap.hh"
25#include "App.hh" 25#include "App.hh"
26#include "GContext.hh" 26#include "GContext.hh"
27 27
28#include <X11/Xutil.h> 28#include <X11/Xutil.h>
29#include <X11/Xatom.h>
29#include <iostream> 30#include <iostream>
30using namespace std; 31using namespace std;
31 32
@@ -203,6 +204,7 @@ void FbPixmap::rotate() {
203} 204}
204 205
205void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) { 206void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) {
207
206 if (drawable() == 0 || 208 if (drawable() == 0 ||
207 (dest_width == width() && dest_height == height())) 209 (dest_width == width() && dest_height == height()))
208 return; 210 return;
@@ -284,6 +286,43 @@ Pixmap FbPixmap::release() {
284 return ret; 286 return ret;
285} 287}
286 288
289Pixmap FbPixmap::getRootPixmap(int screen_num) {
290
291 Pixmap root_pm = 0;
292 // get root pixmap for transparency
293 Display *disp = FbTk::App::instance()->display();
294 Atom real_type;
295 int real_format;
296 unsigned long items_read, items_left;
297 unsigned int *data;
298 if (XGetWindowProperty(disp, RootWindow(disp, screen_num),
299 XInternAtom(disp, "_XROOTPMAP_ID", false),
300 0L, 1L,
301 false, XA_PIXMAP, &real_type,
302 &real_format, &items_read, &items_left,
303 (unsigned char **) &data) == Success &&
304 items_read) {
305 root_pm = (Pixmap) (*data);
306 XFree(data);
307/* TODO: analyze why this doesnt work
308 } else if (XGetWindowProperty(disp, RootWindow(disp, screen_num),
309 XInternAtom(disp, "_XSETROOT_ID", false),
310 0L, 1L,
311 false, XA_PIXMAP, &real_type,
312 &real_format, &items_read, &items_left,
313 (unsigned char **) &data) == Success &&
314 items_read) {
315 root_pm = (Pixmap) (*data);
316 XFree(data);
317*/
318 }
319
320
321 return root_pm;
322
323
324}
325
287void FbPixmap::free() { 326void FbPixmap::free() {
288 if (m_pm != 0) { 327 if (m_pm != 0) {
289 XFreePixmap(FbTk::App::instance()->display(), m_pm); 328 XFreePixmap(FbTk::App::instance()->display(), m_pm);