24 #define XDRAW_PARAM2(common) (common)->get_display(), (common)->get_window_id()
25 #define XDRAW_PARAM3(common,gc) XDRAW_PARAM2(common), (common)->get_GC(gc)
28 bool drawflag =
false;
29 if (filteri & filter) {
32 drawflag = clip(transLine, clippedLine);
47 AW_device_Xm *device_xm =
DOWNCAST(AW_device_Xm*, device);
50 XDrawString(
XDRAW_PARAM3(device_xm->get_common(), gc),
AW_INT(POS.xpos()),
AW_INT(POS.ypos()), textBuffer + textStart, (
int)textLen);
76 aw_assert(stippleType>=0 && stippleType<STIPPLE_TYPES);
84 { 0x40, 0x08, 0x01, 0x20, 0x04, 0x80, 0x10, 0x02 },
85 { 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22 },
86 { 0x15, 0xa2, 0x54, 0x8a, 0x51, 0x2a, 0x45, 0xa8 },
87 { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa },
88 { 0xd5, 0xba, 0x57, 0xea, 0x5d, 0xab, 0x75, 0xae },
89 { 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee },
90 { 0xbf, 0xf7, 0xfe, 0xdf, 0xfb, 0x7f, 0xef, 0xfd }
92 pixmap[t] = XCreateBitmapFromData(common->
get_display(), common->
get_window_id(),
reinterpret_cast<const char *
>(stippleBits[t]), PIXMAP_SIZE, PIXMAP_SIZE);
97 return pixmap[stippleType];
114 if (greylevel<0.0625) {
117 if (greylevel<0.9375) {
120 if (greylevel<0.1875) stippleType =
FILLED_125;
121 else if (greylevel<0.3125) stippleType =
FILLED_25;
122 else if (greylevel<0.4375) stippleType =
FILLED_375;
123 else if (greylevel<0.5626) stippleType =
FILLED_50;
124 else if (greylevel<0.6875) stippleType =
FILLED_625;
125 else if (greylevel<0.8125) stippleType =
FILLED_75;
132 GC xgc = Common->
get_GC(gc);
134 XSetFillRule(Disp, xgc, WindingRule);
135 XSetStipple(Disp, xgc, stipple);
136 XSetFillStyle(Disp, xgc, FillStippled);
142 void AW_device_Xm::resetFillstyleForGreylevel(
int gc) {
145 XSetFillStyle(get_common()->get_display(), get_common()->get_GC(gc), FillSolid);
149 bool drawflag =
false;
150 if (filteri & filter) {
152 drawflag = generic_box(gc, rect, filteri);
157 drawflag = box_clip(transRect, clippedRect);
159 Fill_Style fillStyle = setFillstyleForGreylevel(gc, filled);
161 if (fillStyle != FS_EMPTY) {
168 if (fillStyle == FS_GREY) resetFillstyleForGreylevel(gc);
173 generic_box(gc, rect, filteri);
185 bool drawflag =
false;
186 if (filteri & filter) {
188 drawflag = generic_polygon(gc, npos, pos, filteri);
192 for (
int p = 0; p<npos; ++p) {
193 transPos[p] = transform(pos[p]);
199 drawflag = box_clip(npos, transPos, nclippedPos, clippedPos);
201 Fill_Style fillStyle = setFillstyleForGreylevel(gc, filled);
203 if (fillStyle != FS_EMPTY) {
204 XPoint *xpos =
new XPoint[nclippedPos];
206 for (
int p = 0; p<nclippedPos; ++p) {
207 xpos[p].x =
AW_INT(clippedPos[p].xpos());
208 xpos[p].y =
AW_INT(clippedPos[p].ypos());
219 if (fillStyle == FS_GREY) resetFillstyleForGreylevel(gc);
225 generic_polygon(gc, npos, pos, filteri);
232 delete [] clippedPos;
241 return arc_impl(gc, filled, center, radius, 0, 360, filteri);
248 bool drawflag =
false;
249 if (filteri & filter) {
250 Rectangle Box(center-radius, center+radius);
253 drawflag = !is_outside_clip(screen_box);
258 int xl =
AW_INT(ulc.xpos());
259 int yl =
AW_INT(ulc.ypos());
261 aw_assert(arc_degrees >= -360 && arc_degrees <= 360);
264 start_degrees = -start_degrees;
265 arc_degrees = -arc_degrees;
267 while (start_degrees<0) start_degrees += 360;
269 Fill_Style fillStyle = setFillstyleForGreylevel(gc, filled);
270 if (fillStyle != FS_EMPTY) {
271 XFillArc(
XDRAW_PARAM3(get_common(), gc), xl, yl, width, height, 64*start_degrees, 64*arc_degrees);
272 if (fillStyle == FS_GREY) resetFillstyleForGreylevel(gc);
279 XDrawArc(
XDRAW_PARAM3(get_common(), gc), xl, yl, width, height, 64*start_degrees, 64*arc_degrees);
287 void AW_device_Xm::clear(
AW_bitset filteri) {
288 if (filteri & filter) {
295 if (filteri & filter) {
298 bool drawflag = box_clip(transRect, clippedRect);
311 void AW_device_Xm::flush() {
312 XFlush(get_common()->get_display());
317 XCopyArea(get_common()->get_display(), get_common()->get_window_id(), get_common()->get_window_id(), get_common()->get_GC(gc),
XID get_window_id() const
#define DOWNCAST(totype, expr)
const Position & start() const
#define AUTO_FLUSH(device)
const double & ypos() const
#define XDRAW_PARAM3(common, gc)
Display * get_display() const
static bool AW_draw_string_on_screen(AW_device *device, int gc, const char *textBuffer, size_t textStart, size_t textLen, const AW::Position &pos, AW_CL)
const Position & upper_left_corner() const
static Pixmap getStipplePixmap(AW_common_Xm *common, StippleType stippleType)
#define XDRAW_PARAM2(common)
const double & xpos() const