diff options
author | fluxgen <fluxgen> | 2003-09-06 15:39:06 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-09-06 15:39:06 (GMT) |
commit | d75ac0afcc21375081000cbcb3bee763c90c8d08 (patch) | |
tree | a64ea2cdb43afb4932d0383a1c74ba10d912d8d5 /src/FbTk | |
parent | addb1ef43648c0b5ef348f959c83d6c94fbcc471 (diff) | |
download | fluxbox-d75ac0afcc21375081000cbcb3bee763c90c8d08.zip fluxbox-d75ac0afcc21375081000cbcb3bee763c90c8d08.tar.bz2 |
get image from drawable
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/FbDrawable.cc | 9 | ||||
-rw-r--r-- | src/FbTk/FbDrawable.hh | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/FbTk/FbDrawable.cc b/src/FbTk/FbDrawable.cc index 7a1cc9b..21f2eba 100644 --- a/src/FbTk/FbDrawable.cc +++ b/src/FbTk/FbDrawable.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: FbDrawable.cc,v 1.1 2003/04/29 08:49:36 fluxgen Exp $ | 22 | // $Id: FbDrawable.cc,v 1.2 2003/09/06 15:39:06 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbDrawable.hh" | 24 | #include "FbDrawable.hh" |
25 | 25 | ||
@@ -86,4 +86,11 @@ void FbDrawable::drawPoint(GC gc, int x, int y) { | |||
86 | XDrawPoint(FbTk::App::instance()->display(), drawable(), gc, x, y); | 86 | XDrawPoint(FbTk::App::instance()->display(), drawable(), gc, x, y); |
87 | } | 87 | } |
88 | 88 | ||
89 | XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const { | ||
90 | return XGetImage(FbTk::App::instance()->display(), drawable(), | ||
91 | x, y, width, height, | ||
92 | AllPlanes, // plane mask | ||
93 | ZPixmap); | ||
94 | } | ||
95 | |||
89 | }; // end namespace FbTk | 96 | }; // end namespace FbTk |
diff --git a/src/FbTk/FbDrawable.hh b/src/FbTk/FbDrawable.hh index 71a1ec3..30c7371 100644 --- a/src/FbTk/FbDrawable.hh +++ b/src/FbTk/FbDrawable.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: FbDrawable.hh,v 1.2 2003/05/10 13:28:11 fluxgen Exp $ | 22 | // $Id: FbDrawable.hh,v 1.3 2003/09/06 15:39:06 fluxgen Exp $ |
23 | #ifndef FBTK_FBDRAWABLE_HH | 23 | #ifndef FBTK_FBDRAWABLE_HH |
24 | #define FBTK_FBDRAWABLE_HH | 24 | #define FBTK_FBDRAWABLE_HH |
25 | 25 | ||
@@ -49,6 +49,8 @@ public: | |||
49 | 49 | ||
50 | virtual void drawPoint(GC gc, int x, int y); | 50 | virtual void drawPoint(GC gc, int x, int y); |
51 | 51 | ||
52 | virtual XImage *image(int x, int y, unsigned int width, unsigned int height) const; | ||
53 | |||
52 | /// X drawable | 54 | /// X drawable |
53 | virtual Drawable drawable() const = 0; | 55 | virtual Drawable drawable() const = 0; |
54 | virtual unsigned int width() const = 0; | 56 | virtual unsigned int width() const = 0; |