summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/FbPixmap.cc45
-rw-r--r--src/FbTk/FbPixmap.hh16
2 files changed, 5 insertions, 56 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index c627779..a05e287 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.3 2003/04/27 23:56:13 fluxgen Exp $ 22// $Id: FbPixmap.cc,v 1.4 2003/04/29 08:53:24 fluxgen Exp $
23 23
24#include "FbPixmap.hh" 24#include "FbPixmap.hh"
25#include "App.hh" 25#include "App.hh"
@@ -62,48 +62,6 @@ FbPixmap::~FbPixmap() {
62 free(); 62 free();
63} 63}
64 64
65void FbPixmap::copyArea(Drawable src, GC gc,
66 int src_x, int src_y,
67 int dest_x, int dest_y,
68 unsigned int width, unsigned int height) {
69 if (m_pm == 0 || src == 0 || gc == 0)
70 return;
71 XCopyArea(FbTk::App::instance()->display(),
72 src, m_pm, gc,
73 src_x, src_y,
74 width, height,
75 dest_x, dest_y);
76}
77
78void FbPixmap::fillRectangle(GC gc, int x, int y,
79 unsigned int width, unsigned int height) {
80 if (m_pm == 0 || gc == 0)
81 return;
82 XFillRectangle(FbTk::App::instance()->display(),
83 m_pm, gc,
84 x, y,
85 width, height);
86}
87
88void FbPixmap::drawRectangle(GC gc, int x, int y,
89 unsigned int width, unsigned int height) {
90 if (m_pm == 0 || gc == 0)
91 return;
92 XDrawRectangle(FbTk::App::instance()->display(),
93 m_pm, gc,
94 x, y,
95 width, height);
96}
97
98void FbPixmap::fillPolygon(GC gc, XPoint *points, int npoints,
99 int shape, int mode) {
100 if (m_pm == 0 || gc == 0 || points == 0 || npoints == 0)
101 return;
102 XFillPolygon(FbTk::App::instance()->display(),
103 m_pm, gc, points, npoints,
104 shape, mode);
105}
106
107FbPixmap &FbPixmap::operator = (const FbPixmap &the_copy) { 65FbPixmap &FbPixmap::operator = (const FbPixmap &the_copy) {
108 copy(the_copy); 66 copy(the_copy);
109 return *this; 67 return *this;
@@ -207,7 +165,6 @@ void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) {
207 static_cast<int>(src_x), 165 static_cast<int>(src_x),
208 static_cast<int>(src_y))); 166 static_cast<int>(src_y)));
209 XDrawPoint(dpy, new_pm.drawable(), gc, tx, ty); 167 XDrawPoint(dpy, new_pm.drawable(), gc, tx, ty);
210
211 168
212 } 169 }
213 } 170 }
diff --git a/src/FbTk/FbPixmap.hh b/src/FbTk/FbPixmap.hh
index 487854a..94d37de 100644
--- a/src/FbTk/FbPixmap.hh
+++ b/src/FbTk/FbPixmap.hh
@@ -19,17 +19,19 @@
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.3 2003/04/27 23:55:08 fluxgen Exp $ 22// $Id: FbPixmap.hh,v 1.4 2003/04/29 08:52:51 fluxgen Exp $
23 23
24#ifndef FBTK_FBPIXMAP_HH 24#ifndef FBTK_FBPIXMAP_HH
25#define FBTK_FBPIXMAP_HH 25#define FBTK_FBPIXMAP_HH
26 26
27#include "FbDrawable.hh"
28
27#include <X11/Xlib.h> 29#include <X11/Xlib.h>
28 30
29namespace FbTk { 31namespace FbTk {
30 32
31/// a wrapper for X Pixmap 33/// a wrapper for X Pixmap
32class FbPixmap { 34class FbPixmap:public FbDrawable {
33public: 35public:
34 FbPixmap(); 36 FbPixmap();
35 /// copy pixmap 37 /// copy pixmap
@@ -42,16 +44,6 @@ public:
42 44
43 ~FbPixmap(); 45 ~FbPixmap();
44 46
45 void copyArea(Drawable src, GC gc,
46 int src_x, int src_y,
47 int dest_x, int dest_y,
48 unsigned int width, unsigned int height);
49 void fillRectangle(GC gc, int x, int y,
50 unsigned int width, unsigned int height);
51 void drawRectangle(GC gc, int x, int y,
52 unsigned int width, unsigned int height);
53 void fillPolygon(GC gc, XPoint *points, int npoints,
54 int shape, int mode);
55 void copy(const FbPixmap &the_copy); 47 void copy(const FbPixmap &the_copy);
56 /// scales the pixmap to specified size 48 /// scales the pixmap to specified size
57 void scale(unsigned int width, unsigned int height); 49 void scale(unsigned int width, unsigned int height);