FbPixmap is a FbDrawable

This commit is contained in:
fluxgen 2003-04-29 08:53:24 +00:00
parent d9467066a9
commit f589d55aa9
2 changed files with 5 additions and 56 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: FbPixmap.cc,v 1.3 2003/04/27 23:56:13 fluxgen Exp $
// $Id: FbPixmap.cc,v 1.4 2003/04/29 08:53:24 fluxgen Exp $
#include "FbPixmap.hh"
#include "App.hh"
@ -62,48 +62,6 @@ FbPixmap::~FbPixmap() {
free();
}
void FbPixmap::copyArea(Drawable src, GC gc,
int src_x, int src_y,
int dest_x, int dest_y,
unsigned int width, unsigned int height) {
if (m_pm == 0 || src == 0 || gc == 0)
return;
XCopyArea(FbTk::App::instance()->display(),
src, m_pm, gc,
src_x, src_y,
width, height,
dest_x, dest_y);
}
void FbPixmap::fillRectangle(GC gc, int x, int y,
unsigned int width, unsigned int height) {
if (m_pm == 0 || gc == 0)
return;
XFillRectangle(FbTk::App::instance()->display(),
m_pm, gc,
x, y,
width, height);
}
void FbPixmap::drawRectangle(GC gc, int x, int y,
unsigned int width, unsigned int height) {
if (m_pm == 0 || gc == 0)
return;
XDrawRectangle(FbTk::App::instance()->display(),
m_pm, gc,
x, y,
width, height);
}
void FbPixmap::fillPolygon(GC gc, XPoint *points, int npoints,
int shape, int mode) {
if (m_pm == 0 || gc == 0 || points == 0 || npoints == 0)
return;
XFillPolygon(FbTk::App::instance()->display(),
m_pm, gc, points, npoints,
shape, mode);
}
FbPixmap &FbPixmap::operator = (const FbPixmap &the_copy) {
copy(the_copy);
return *this;
@ -207,7 +165,6 @@ void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) {
static_cast<int>(src_x),
static_cast<int>(src_y)));
XDrawPoint(dpy, new_pm.drawable(), gc, tx, ty);
}
}

View file

@ -19,17 +19,19 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: FbPixmap.hh,v 1.3 2003/04/27 23:55:08 fluxgen Exp $
// $Id: FbPixmap.hh,v 1.4 2003/04/29 08:52:51 fluxgen Exp $
#ifndef FBTK_FBPIXMAP_HH
#define FBTK_FBPIXMAP_HH
#include "FbDrawable.hh"
#include <X11/Xlib.h>
namespace FbTk {
/// a wrapper for X Pixmap
class FbPixmap {
class FbPixmap:public FbDrawable {
public:
FbPixmap();
/// copy pixmap
@ -42,16 +44,6 @@ public:
~FbPixmap();
void copyArea(Drawable src, GC gc,
int src_x, int src_y,
int dest_x, int dest_y,
unsigned int width, unsigned int height);
void fillRectangle(GC gc, int x, int y,
unsigned int width, unsigned int height);
void drawRectangle(GC gc, int x, int y,
unsigned int width, unsigned int height);
void fillPolygon(GC gc, XPoint *points, int npoints,
int shape, int mode);
void copy(const FbPixmap &the_copy);
/// scales the pixmap to specified size
void scale(unsigned int width, unsigned int height);