diff options
author | fluxgen <fluxgen> | 2003-08-11 14:59:07 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-08-11 14:59:07 (GMT) |
commit | 346dacc633a68e14315cdd13f79c31b6e86f124f (patch) | |
tree | 16f375af7c195243043d8255280eb71acf9a5962 /src/FbTk/FbPixmap.cc | |
parent | ac033939cbed373b7ce1465f112e359161216c86 (diff) | |
download | fluxbox-346dacc633a68e14315cdd13f79c31b6e86f124f.zip fluxbox-346dacc633a68e14315cdd13f79c31b6e86f124f.tar.bz2 |
added copy for X Pixmap
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r-- | src/FbTk/FbPixmap.cc | 33 |
1 files changed, 32 insertions, 1 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 | ||
135 | void 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 | |||
135 | void FbPixmap::rotate() { | 166 | void FbPixmap::rotate() { |
136 | 167 | ||
137 | Display *dpy = FbTk::App::instance()->display(); | 168 | Display *dpy = FbTk::App::instance()->display(); |