00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "FbDrawable.hh"
00025
00026 #include "App.hh"
00027
00028 namespace FbTk {
00029
00030 void FbDrawable::copyArea(Drawable src, GC gc,
00031 int src_x, int src_y,
00032 int dest_x, int dest_y,
00033 unsigned int width, unsigned int height) {
00034 if (drawable() == 0 || src == 0 || gc == 0)
00035 return;
00036 XCopyArea(FbTk::App::instance()->display(),
00037 src, drawable(), gc,
00038 src_x, src_y,
00039 width, height,
00040 dest_x, dest_y);
00041 }
00042
00043 void FbDrawable::fillRectangle(GC gc, int x, int y,
00044 unsigned int width, unsigned int height) {
00045 if (drawable() == 0 || gc == 0)
00046 return;
00047 XFillRectangle(FbTk::App::instance()->display(),
00048 drawable(), gc,
00049 x, y,
00050 width, height);
00051 }
00052
00053 void FbDrawable::drawRectangle(GC gc, int x, int y,
00054 unsigned int width, unsigned int height) {
00055 if (drawable() == 0 || gc == 0)
00056 return;
00057 XDrawRectangle(FbTk::App::instance()->display(),
00058 drawable(), gc,
00059 x, y,
00060 width, height);
00061 }
00062
00063 void FbDrawable::drawLine(GC gc, int start_x, int start_y,
00064 int end_x, int end_y) {
00065 if (drawable() == 0 || gc == 0)
00066 return;
00067 XDrawLine(FbTk::App::instance()->display(),
00068 drawable(),
00069 gc,
00070 start_x, start_y,
00071 end_x, end_y);
00072 }
00073
00074 void FbDrawable::fillPolygon(GC gc, XPoint *points, int npoints,
00075 int shape, int mode) {
00076 if (drawable() == 0 || gc == 0 || points == 0 || npoints == 0)
00077 return;
00078 XFillPolygon(FbTk::App::instance()->display(),
00079 drawable(), gc, points, npoints,
00080 shape, mode);
00081 }
00082
00083 void FbDrawable::drawPoint(GC gc, int x, int y) {
00084 if (drawable() == 0 || gc == 0)
00085 return;
00086 XDrawPoint(FbTk::App::instance()->display(), drawable(), gc, x, y);
00087 }
00088
00089 XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const {
00090 return XGetImage(FbTk::App::instance()->display(), drawable(),
00091 x, y, width, height,
00092 AllPlanes,
00093 ZPixmap);
00094 }
00095
00096 };