diff options
-rw-r--r-- | src/FbTk/FbPixmap.cc | 33 | ||||
-rw-r--r-- | src/FbTk/FbPixmap.hh | 3 |
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 | ||
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(); |
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 |