aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-08-11 14:59:07 (GMT)
committerfluxgen <fluxgen>2003-08-11 14:59:07 (GMT)
commit346dacc633a68e14315cdd13f79c31b6e86f124f (patch)
tree16f375af7c195243043d8255280eb71acf9a5962 /src
parentac033939cbed373b7ce1465f112e359161216c86 (diff)
downloadfluxbox-346dacc633a68e14315cdd13f79c31b6e86f124f.zip
fluxbox-346dacc633a68e14315cdd13f79c31b6e86f124f.tar.bz2
added copy for X Pixmap
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/FbPixmap.cc33
-rw-r--r--src/FbTk/FbPixmap.hh3
2 files changed, 34 insertions, 2 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index 75ab8d7..f96a872 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -19,7 +19,7 @@
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.5 2003/07/10 11:55:01 fluxgen Exp $ 22// $Id: FbPixmap.cc,v 1.6 2003/08/11 14:58:49 fluxgen Exp $
23 23
24#include "FbPixmap.hh" 24#include "FbPixmap.hh"
25#include "App.hh" 25#include "App.hh"
@@ -132,6 +132,37 @@ void FbPixmap::copy(const FbPixmap &the_copy) {
132 } 132 }
133} 133}
134 134
135void FbPixmap::copy(Pixmap pm) {
136 free();
137 if (pm == 0)
138 return;
139
140 // get width, height and depth for the pixmap
141 Window root;
142 int x, y;
143 unsigned int border_width, bpp;
144 unsigned int new_width, new_height;
145
146 XGetGeometry(FbTk::App::instance()->display(),
147 pm,
148 &root,
149 &x, &y,
150 &new_width, &new_height,
151 &border_width,
152 &bpp);
153 // create new pixmap and copy area
154 create(root, new_width, new_height, bpp);
155 // determine screen gc
156 Display *disp = FbTk::App::instance()->display();
157 XWindowAttributes attr;
158 XGetWindowAttributes(disp, root, &attr);
159 GC gc = DefaultGCOfScreen(attr.screen);
160 XCopyArea(disp, pm, drawable(), gc,
161 0, 0,
162 width(), height(),
163 0, 0);
164}
165
135void FbPixmap::rotate() { 166void FbPixmap::rotate() {
136 167
137 Display *dpy = FbTk::App::instance()->display(); 168 Display *dpy = FbTk::App::instance()->display();
diff --git a/src/FbTk/FbPixmap.hh b/src/FbTk/FbPixmap.hh
index 787c06f..f901aa0 100644
--- a/src/FbTk/FbPixmap.hh
+++ b/src/FbTk/FbPixmap.hh
@@ -19,7 +19,7 @@
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.hh,v 1.5 2003/07/10 11:55:01 fluxgen Exp $ 22// $Id: FbPixmap.hh,v 1.6 2003/08/11 14:59:07 fluxgen Exp $
23 23
24#ifndef FBTK_FBPIXMAP_HH 24#ifndef FBTK_FBPIXMAP_HH
25#define FBTK_FBPIXMAP_HH 25#define FBTK_FBPIXMAP_HH
@@ -45,6 +45,7 @@ public:
45 ~FbPixmap(); 45 ~FbPixmap();
46 46
47 void copy(const FbPixmap &the_copy); 47 void copy(const FbPixmap &the_copy);
48 void copy(Pixmap pixmap);
48 /// rotates the pixmap 90 deg, not implemented! 49 /// rotates the pixmap 90 deg, not implemented!
49 void rotate(); 50 void rotate();
50 /// scales the pixmap to specified size 51 /// scales the pixmap to specified size