File: 02_export_png.patch

package info (click to toggle)
tcm 2.20%2BTSQD-8
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 22,860 kB
  • sloc: ansic: 78,544; sh: 3,618; makefile: 1,351; perl: 753; yacc: 595; lex: 257
file content (746 lines) | stat: -rw-r--r-- 25,912 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
#!/bin/sh -e
## 02_export_png.dpatch.dpatch by Otavio Salvador <otavio@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix the export png function (#183588)

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
--- a/src/ui/figgrafport.c
+++ b/src/ui/figgrafport.c
@@ -150,56 +150,69 @@ void FigGrafport::SetFont(XFont *f) {
 	SetTexFont();
 }
 
-void FigGrafport::DrawFigEllipse(double center_x, double center_y,
-	double radius_x, double radius_y, int sub_type)
-{
-	int object_code = 1;  // Ellipse
 
-	int line_style = 0;  // Solid
-	if (GetLineStyle()==LineStyle::DASHED)
-	 	line_style = 1;
-	if (GetLineStyle()==LineStyle::DOTTED ||
-	    GetLineStyle()==LineStyle::WIDE_DOTTED)
-	 	line_style = 2;
+void FigGrafport::FillFigEllipse(double topleft_x, double topleft_y,
+	double diameter_x, double diameter_y)
+{
+	topleft_x = Zoom(topleft_x * F);
+	topleft_y = Zoom(topleft_y * F);
+	double radius_x = Zoom(diameter_x * (0.5 * F));
+	double radius_y = Zoom(diameter_y * (0.5 * F));
+	double center_x = topleft_x + radius_x;
+	double center_y = topleft_y + radius_y;
+
+	// 1 = object_code: Ellipse, 1 = sub_type: ellipse specified by radii,
+	// 0 = line_style: solid,
+	// 0 = thickness: 0, 0 = pen color: default, 50 = depth,
+	// 0 = pen_style (not used), 20 = area_fill: full saturation
+	fprintf(fd, "1 1 0 0 0 %d 50 0 20 ", fillColor);
+	// 0.0 = style_val (normal), 1 = direction , 0.0 = angle
+	fprintf(fd, "0.0 1 0.0 %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f\n",
+		center_x, center_y, radius_x,
+		radius_y, center_x, center_y, topleft_x, topleft_y);
+}
 
-	int thickness = GetLineWidth();  // 1/80 inch
-	if (GetLineStyle()==LineStyle::INVISIBLE &&
-	    GetFillStyle()==FillStyle::UNFILLED)
-		return; // don't draw
-
-	int pen_color = penColor;
-	int fill_color = 7; // 7 = white
-	int depth = 0;
-	int pen_style = 0;  // not used.
-	int area_fill = -1; // no fill.
-	if (GetFillStyle()==FillStyle::FILLED) {
-		fill_color = fillColor;
-		area_fill = 20;// full saturation.
-		if (GetLineStyle()==LineStyle::INVISIBLE)
-			pen_color = fill_color;
-	} 
 
+void FigGrafport::DrawFigEllipse(double topleft_x, double topleft_y,
+	double diameter_x, double diameter_y)
+{
+	int line_style = 0;  // Solid
 	float style_val = 0;// 1/80 inch
-	if (GetLineStyle()==LineStyle::DASHED)
+	switch ( GetLineStyle() ) {
+	case LineStyle::DASHED:
+		line_style = 1;
 	 	style_val = 4.0;
-	if (GetLineStyle()==LineStyle::DOTTED)
+		break;
+	case LineStyle::DOTTED:
+		line_style = 2;
 	 	style_val = 1.0;
-	if (GetLineStyle()==LineStyle::WIDE_DOTTED)
+		break;
+	case LineStyle::WIDE_DOTTED:
+		line_style = 2;
 	 	style_val = 2.0;
+		break;
+	case LineStyle::INVISIBLE:
+		return;
+	default:
+		line_style = 0;
+		style_val = 0.0;
+		break;
+	}
 
-	int direction = 1; // always 1
-	float angle = 0;   // angle with x-axis.
-	double start_x = center_x;
-	double start_y = center_y;
-	double end_x = start_x + radius_x;
-	double end_y = start_y + radius_y;
-
-	fprintf(fd, "%d %d %d %d %d %d %d %d %d ", object_code, sub_type,
-		line_style, thickness, pen_color, fill_color, depth,
-		pen_style, area_fill);
-	fprintf(fd, "%f %d %f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f\n",
-		style_val, direction, angle, center_x, center_y, radius_x,
-		radius_y, start_x, start_y, end_x, end_y);
+	topleft_x = Zoom(topleft_x * F);
+	topleft_y = Zoom(topleft_y * F);
+	double radius_x = Zoom(diameter_x * (0.5 * F));
+	double radius_y = Zoom(diameter_y * (0.5 * F));
+	double center_x = topleft_x + radius_x;
+	double center_y = topleft_y + radius_y;
+
+	// 1 = object code: ellipse, 1 = subtype: ellipse specified by radii,
+	// 7 = fill color: white, 0 = depth, 0 = pen style, -1 = no fill
+	fprintf(fd, "1 1 %d %d %d 7 0 0 -1 ", line_style, GetLineWidth(), penColor);
+	// 1 = direction, 0.0 = angle
+	fprintf(fd, "%f 1 0.0 %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f\n",
+		style_val, center_x, center_y, radius_x,
+		radius_y, center_x, center_y, topleft_x, topleft_y);
 }
 
 
@@ -308,41 +321,6 @@ void FigGrafport::FillRectangle(double,
 	SetFillColor();
 }
 
-//void FigGrafport::DrawRoundedRectangle(double x, double y, double wd, double ht, double rd) {
-//	DrawFigRectangle(x, y, wd, ht, 4, rd);
-//	SetFillStyle(FillStyle::UNFILLED);
-//}
-//
-//void FigGrafport::FillRoundedRectangle(double, double, double, double, double) {
-//	SetFillStyle(FillStyle::FILLED);
-//	SetFillColor();
-//}
-//
-//void FigGrafport::DrawEllipsedRectangle(double x, double y, double wd, double ht, double rd) {
-//	DrawRoundedRectangle(x, y, wd, ht, rd);
-//}
-//
-//void FigGrafport::FillEllipsedRectangle(double, double, double, double, double) {
-//	SetFillStyle(FillStyle::FILLED);
-//	SetFillColor();
-//}
-//
-//void FigGrafport::DrawDisk(double x, double y, double wd, double ht, double el) {
-//	// draw two lines (without the corner points).
-//        double ah = el/2;
-//        DrawLine(x, y+ah+1, x, y+ht-ah-1);
-//        DrawLine(x+wd, y+ah+1, x+wd, y+ht-ah-1);
-//        // draw 1st ellipse.
-//        DrawEllipse(x, y, wd, el+1);
-//        // draw bottom arc (in two parts)
-//	DrawArc(x, y + ht - el - 1, wd, el + 1, 180, 270);
-//	DrawArc(x, y + ht - el - 1, wd, el + 1, 270, 360);
-//}
-//
-//void FigGrafport::FillDisk(double, double, double, double, double) {
-//	SetFillStyle(FillStyle::FILLED);
-//	SetFillColor();
-//}
 
 void FigGrafport::DrawFigText(double px, double py, const char *str, int sub_type) {
 	px = Zoom(px);
@@ -441,45 +419,6 @@ void FigGrafport::DrawStringCenteredUnde
 	SetLineStyle(save);			// and restore
 }
 
-//void FigGrafport::DrawLine(double _x1, double _y1, double _x2, double _y2) {
-//	if (_x1 == _x2 && _y1 == _y2)
-//		return;
-//
-//	double x1 = Zoom(_x1); 
-//	double y1 = Zoom(_y1);
-//	double x2 = Zoom(_x2);
-//	double y2 = Zoom(_y2);
-//
-//	List<DPoint *> points;
-//	int sub_type = 1;
-//
-//	DPoint p1(F*x1, F*y1);
-//	DPoint p2(F*x2, F*y2);
-//	points.add(&p1);
-//	points.add(&p2);
-//
-//	DrawFigPolyLine(&points, sub_type);
-//
-//	if (GetLineStyle()==LineStyle::DUAL) {
-//		SetLineStyle(LineStyle::SOLID);
-//		int n = GetLineWidth();
-//		if (y1 == y2) {  // horizontal
-//			DrawLine(_x1, _y1+n, _x2, _y2+n);
-//			DrawLine(_x1, _y1-n, _x2, _y2-n);
-//		}
-//		else if (x1 == x2) {  // vertical
-//			DrawLine(_x1+n, _y1, _x2+n, _y2);
-//			DrawLine(_x1-n, _y1, _x2-n, _y2);
-//		}
-//		else {
-//			DrawLine(_x1, _y1, _x2, _y2);
-//			DrawLine(_x1, _y1+2*n, _x2, _y2+2*n);
-//		}
-//		SetLineStyle(LineStyle::DUAL);
-//	}
-//	SetFillStyle(FillStyle::UNFILLED);
-//}
-
 
 void FigGrafport::DrawUnzoomedLine(double x1, double y1, double x2, double y2) {
 	DrawLine(ZoomCorrect(x1), ZoomCorrect(y1), 
@@ -487,66 +426,6 @@ void FigGrafport::DrawUnzoomedLine(doubl
 }
 
 
-//void FigGrafport::DrawCurve(const Point *p1, const Point *p2, 
-//			   const Point *p3, const Point *p4) {
-//	int object_code = 3;  // Spline
-//	int sub_type = 0;     // Open Aproximated Spline
-//
-//	double x1 = Zoom(p1->x*F);
-//	double y1 = Zoom(p1->y*F);
-//	double x2 = Zoom(p2->x*F);
-//	double y2 = Zoom(p2->y*F);
-//	double x3 = Zoom(p3->x*F);
-//	double y3 = Zoom(p3->y*F);
-//	double x4 = Zoom(p4->x*F);
-//	double y4 = Zoom(p4->y*F);
-//
-//	int line_style = 0;  // Solid
-//	if (GetLineStyle()==LineStyle::DASHED)
-//	 	line_style = 1;
-//	if (GetLineStyle()==LineStyle::DOTTED ||
-//	    GetLineStyle()==LineStyle::WIDE_DOTTED)
-//	 	line_style = 2;
-//
-//	int thickness = GetLineWidth();  // 1/80 inch
-//	if (GetLineStyle()==LineStyle::INVISIBLE)
-//		return;
-//	 	// thickness = 0;
-//
-//	int pen_color = penColor;
-//	int fill_color = 7; // 7 = white
-//	int depth = 0;
-//	int pen_style = 0;  // not used.
-//	int area_fill = -1; // no fill.
-//	if (GetFillStyle()==FillStyle::FILLED) {
-//		fill_color = fillColor;
-//		area_fill = 20;// full saturation.
-//	} 
-//
-//	float style_val = 0;// 1/80 inch
-//	if (GetLineStyle()==LineStyle::DASHED)
-//	 	style_val = 4.0;
-//	if (GetLineStyle()==LineStyle::DOTTED)
-//	 	style_val = 1.0;
-//	if (GetLineStyle()==LineStyle::WIDE_DOTTED)
-//	 	style_val = 2.0;
-//
-//	int cap_style = 0;  // Butt
-//	int forward_arrow = 0;
-//	int backward_arrow = 0;
-//	int npoints = 4;
-//
-//	fprintf(fd, "%d %d %d %d %d %d %d %d %d %.1f %d %d %d %d\n",
-//		object_code, sub_type, line_style, thickness, pen_color,
-//		fill_color, depth, pen_style, area_fill, style_val,
-//		cap_style, forward_arrow, backward_arrow,
-//		npoints);
-//	fprintf(fd, "%f %f %f %f %f %f %f %f\n",
-//		x1, y1, x2, y2, x3, y3, x4, y4);
-//	SetFillStyle(FillStyle::UNFILLED);
-//}
-
-
 void FigGrafport::FillCurve(const DPoint *p) {
 	// 3 = object code: spline, 0 = subtype: open approximated, 0 = line
 	// style: solid, 0 = thickness, 0 = pen color: default, 50 = depth, 0 =
@@ -636,6 +515,10 @@ static void CalcCurvePoints(DPoint *p, d
 void FigGrafport::DrawSimpleArc(double x, double y,
 	double wd, double ht, int a1, int a2)
 {
+	if ( 0 == (a2 - a1) % 360 ) {
+		DrawFigEllipse(x, y, wd, ht);
+		return;
+	}
 	if ( ! (int) (F * Zoom(wd - ht) + 0.5) ) {
 		/* (almost) circular arc */
 		int line_style;
@@ -673,25 +556,36 @@ void FigGrafport::DrawSimpleArc(double x
 		fprintf(fd, " %f %f", centre.x, centre.y);
 		double arc1 = a1 * deg2rad;
 		fprintf(fd, " %.0f %.0f", centre.x + radius * cos(arc1),
-					 centre.y - radius * sin(arc1));
+					centre.y - radius * sin(arc1));
 		double arc3 = (deg2rad / 2.0) * (a1 + a2);
 		fprintf(fd, " %.0f %.0f", centre.x + radius * cos(arc3),
-					 centre.y - radius * sin(arc3));
+					centre.y - radius * sin(arc3));
 		double arc2 = a2 * deg2rad;
 		fprintf(fd, " %.0f %.0f\n", centre.x+radius * cos(arc2),
-					 centre.y - radius * sin(arc2));
-	} else {
-		/* elliptic arc: approximate by a curve */
-		DPoint p[4];
-		CalcCurvePoints(p, x, y, wd, ht, a1);
-		DrawSimpleCurve(p);
+					centre.y - radius * sin(arc2));
+		return;
 	}
+	if ( 180 == (a2 - a1) % 360 ) {
+		DrawSimpleArc(x, y, wd, ht, a1, a1 + 90);
+		a1 += 90;
+	} else if ( 270 == (a2 - a1) % 360 ) {
+		DrawSimpleArc(x, y, wd, ht, a1, a1 + 180);
+		a1 += 180;
+	}
+	/* elliptic arc: approximate by a curve */
+	DPoint p[4];
+	CalcCurvePoints(p, x, y, wd, ht, a1);
+	DrawSimpleCurve(p);
 }
 
 
 void FigGrafport::FillSegment(double x, double y, double wd, double ht,
 	int a1, int a2)
 {
+	if ( 0 == (a2 - a1) % 360 ) {
+		FillFigEllipse(x, y, wd, ht);
+		return;
+	}
 	if ( ! (int) (F * Zoom(wd - ht) + 0.5) ) {
 		/* (almost) circular arc */
 		double radius = Zoom((wd + ht) * (F / 4.0));
@@ -714,47 +608,14 @@ void FigGrafport::FillSegment(double x,
 		double arc2 = a2 * deg2rad;
 		fprintf(fd, " %.0f %.0f\n", centre.x+radius * cos(arc2),
 					 centre.y - radius * sin(arc2));
-	} else {
-		/* elliptic arc: approximate by a curve */
-		DPoint p[4];
-		CalcCurvePoints(p, x, y, wd, ht, a1);
-		FillCurve(p);
-	}
-}
-
-
-//void FigGrafport::FillArc(double, double, double, double, int, int) {
-//	/* Actually, this procedure is not implemented correctly; arcs
-//	   are never filled as pie slices, but always as segments. dj */
-//	SetFillStyle(FillStyle::FILLED);
-//	SetFillColor();
-//}
-
-void FigGrafport::DrawEllipse(double x, double y, double wd, double ht) {
-	int sub_type;
-	if (wd == ht)
-		sub_type = 3; // circle def. by radius.
-	else
-		sub_type = 1; // ellipse def. by radius.
-	double radius_x = (wd*F)/2;
-	double radius_y = (ht*F)/2;
-	double center_x = x*F + radius_x;
-	double center_y = y*F + radius_y;
-	DrawFigEllipse(center_x, center_y, radius_x, radius_y, sub_type);
-	if (GetLineStyle()==LineStyle::DUAL) {
-		SetLineStyle(LineStyle::SOLID); // avoid recursion
-	 	int n = 2*GetLineWidth();
-		if (ht > 2*n && wd > 2*n)
-	 		DrawEllipse(x+n, y+n, wd-2*n, ht-2*n);
-		SetLineStyle(LineStyle::DUAL);
+		return;
 	}
-	SetFillStyle(FillStyle::UNFILLED);
+	/* elliptic arc: approximate by a curve */
+	DPoint p[4];
+	CalcCurvePoints(p, x, y, wd, ht, a1);
+	FillCurve(p);
 }
 
-void FigGrafport::FillEllipse(double, double, double, double) {
-	SetFillStyle(FillStyle::FILLED);
-	SetFillColor();
-}
 
 void FigGrafport::DrawPolygon(const Point *p, int n) {
 	if (n < 1)
@@ -886,6 +747,7 @@ void FigGrafport::MakeFigString(string *
 	*str = newstr;
 }
 
+
 void FigGrafport::SetFillColor() {
 	Color *color = LookupColor(GetForegroundColor());
         if (color)
--- a/src/ui/figgrafport.h
+++ b/src/ui/figgrafport.h
@@ -93,12 +93,6 @@ public:
 	///
 	void DrawPoint(double x, double y);
 
-// Drawing Ellipses.
-	///
-	void DrawEllipse(double x, double y, double wd, double ht);
-	///
-	void FillEllipse(double x, double y, double wd, double ht);
-
 // Drawing Arcs.
 	///
 	/* virtual */ void FillSegment(double x, double y, double wd, double ht,
@@ -180,7 +174,9 @@ private:
 	void DrawFigRectangle(double x, double y, double wd, double ht, 
 			int sub_type, double radius = -1);
 	///
-	void DrawFigEllipse(double x, double y, double rd_x, double rd_y, int sub_type);
+	void DrawFigEllipse(double x, double y, double rd_x, double rd_y);
+	///
+	void FillFigEllipse(double x, double y, double rd_x, double rd_y);
 	///
 	void DrawFigText(double x, double y, const char *text, int sub_type); 
 
--- a/src/ui/grafport.c
+++ b/src/ui/grafport.c
@@ -314,6 +314,8 @@ void Grafport::RecalcPolygon(const Point
 void Grafport::DrawArc(double x, double y, double w, double h,
 	int arc1, int arc2)
 {
+	if ( arc1 == arc2 )
+		return;
 	if ( GetLineStyle() != LineStyle::DUAL ) {
 		DrawSimpleArc(x, y, w, h, arc1, arc2);
 		return;
--- a/src/ui/grafport.h
+++ b/src/ui/grafport.h
@@ -210,11 +210,11 @@ public:
 // Drawing Ellipses
 	// used in lineend.c
 	///
-	virtual void DrawEllipse(double x, double y,
-		double wd, double ht)=0;
-	/// 
-	virtual void FillEllipse(double x, double y,
-		double wd, double ht)=0;
+	void DrawEllipse(double x, double y,
+		double wd, double ht) { DrawArc(x, y, wd, ht, 0, 360); }
+	///
+	void FillEllipse(double x, double y,
+		double wd, double ht) { FillSegment(x, y, wd, ht, 0, 360); }
 
 // Drawing Arcs
 	/// Draw an arc. (x,y) = top left of the corresponding ellipse,
--- a/src/ui/psgrafport.c
+++ b/src/ui/psgrafport.c
@@ -585,13 +585,6 @@ void PSGrafport::DrawPoint(double x, dou
 	DrawLine(x, y, x, y);
 }
 
-void PSGrafport::DrawEllipse(double x, double y, double wd, double ht) {
-	DrawArc(x, y, wd, ht, 0, 360);
-}
-
-void PSGrafport::FillEllipse(double x, double y, double wd, double ht) {
-	FillSegment(x, y, wd, ht, 0, 360);
-}
 
 /* virtual */ void PSGrafport::DrawSimpleArc(double x, double y,
 	double wd, double ht, int arc1, int arc2)
--- a/src/ui/psgrafport.h
+++ b/src/ui/psgrafport.h
@@ -95,12 +95,6 @@ public:
 	///
 	void DrawPoint(double x, double y);
 
-// Drawing Ellipses.
-	///
-	void DrawEllipse(double x, double y, double wd, double ht);
-	///
-	void FillEllipse(double x, double y, double wd, double ht);
-
 // Drawing Arcs.
 	///								
 	/* virtual */ void FillSegment(double x, double y,	
--- a/src/ui/xgrafport.c
+++ b/src/ui/xgrafport.c
@@ -837,230 +837,3 @@ void XGrafport::DrawDeactiveCaret(double
 	XFillPolygon(display, rdPixmap, xorGC, points, 4, Convex, 
 		CoordModePrevious);
 }
-
-
-//void XGrafport::DrawRoundedRectangle(double x, double y,
-//	double wd, double ht, double rd)
-//{
-//	if (GetLineStyle() == LineStyle::SOLID)
-//		DrawXRoundedRectangle(xorGC, x, y, wd, ht, rd);
-//	else if (GetLineStyle() == LineStyle::DASHED)
-//		DrawXRoundedRectangle(dashGC, x, y, wd, ht, rd);
-//	else if (GetLineStyle() == LineStyle::DOTTED)
-//		DrawXRoundedRectangle(dotGC, x, y, wd, ht, rd);
-//	else if (GetLineStyle() == LineStyle::WIDE_DOTTED)
-//		DrawXRoundedRectangle(wideDotGC, x, y, wd, ht, rd);
-//	else if (GetLineStyle() == LineStyle::DUAL) {
-//		DrawXRoundedRectangle(xorGC, x, y, wd, ht, rd);
-//		int n = 2*GetLineWidth();
-//		if (ht > 2*n && wd > 2*n)  
-//			DrawXRoundedRectangle(xorGC, x+n, y+n, wd-2*n, ht-2*n, rd);
-//	}
-//}
-//
-//void XGrafport::FillRoundedRectangle(double x, double y,
-//	double wd, double ht, double rd)
-//{
-//	FillXRoundedRectangle(xorGC, x, y, wd, ht, rd);
-//}
-//
-//void XGrafport::DrawEllipsedRectangle(double x, double y,
-//	double wd, double ht, double rd)
-//{
-//        if (GetLineStyle() == LineStyle::SOLID)
-//                DrawXEllipsedRectangle(xorGC, x, y, wd, ht, rd);
-//        else if (GetLineStyle() == LineStyle::DASHED)
-//                DrawXEllipsedRectangle(dashGC, x, y, wd, ht, rd);
-//        else if (GetLineStyle() == LineStyle::DOTTED)
-//                DrawXEllipsedRectangle(dotGC, x, y, wd, ht, rd);
-//        else if (GetLineStyle() == LineStyle::WIDE_DOTTED)
-//                DrawXEllipsedRectangle(wideDotGC, x, y, wd, ht, rd);
-//        else if (GetLineStyle() == LineStyle::DUAL) {
-//                DrawXEllipsedRectangle(xorGC, x, y, wd, ht, rd);
-//                int n = 2*GetLineWidth();
-//		if (ht > 2*n && wd > 2*n)  
-//                	DrawXEllipsedRectangle(xorGC, x+n, y+n, wd-2*n, ht-2*n, rd-n);
-//        }
-//}
-//
-//void XGrafport::DrawDisk(double x, double y,
-//	double wd, double ht, double el)
-//{
-//        if (GetLineStyle() == LineStyle::SOLID)
-//                DrawXDisk(xorGC, x, y, wd, ht, el);
-//        else if (GetLineStyle() == LineStyle::DASHED)
-//                DrawXDisk(dashGC, x, y, wd, ht, el);
-//        else if (GetLineStyle() == LineStyle::DOTTED)
-//                DrawXDisk(dotGC, x, y, wd, ht, el);
-//        else if (GetLineStyle() == LineStyle::WIDE_DOTTED)
-//                DrawXDisk(wideDotGC, x, y, wd, ht, el);
-//        else if (GetLineStyle() == LineStyle::DUAL) {
-//                DrawXDisk(xorGC, x, y, wd, ht, el);
-//                int n = 2*GetLineWidth();
-//		if (ht > 2*n && wd > 2*n)  
-//                	DrawXDisk(xorGC, x+n, y+n, wd-2*n, ht-2*n, el-2*n);
-//        }
-//}
-// 
-//void XGrafport::FillEllipsedRectangle(double x, double y,
-//	double wd, double ht, double rd)
-//{
-//        FillXEllipsedRectangle(xorGC, x, y, wd, ht, rd);
-//}
-//
-//void XGrafport::FillDisk(double x, double y,
-//	double wd, double ht, double el)
-//{
-//        FillXDisk(xorGC, x, y, wd, ht, el);
-//}
-//
-//void XGrafport::DrawXRoundedRectangle(GC gc, double x_, double y_,
-//	double wd_, double ht_, double rd_)
-//{
-//	int x = round(Zoom(x_)); int y = round(Zoom(y_));
-//	int wd = round(Zoom(wd_)); int ht = round(Zoom(ht_)); int rd = round(Zoom(rd_));
-//	// draw four lines (widthout the corner parts).
-//	XDrawLine(display, window, gc, x, y+rd+1, x, y+ht-rd-1);
-//	XDrawLine(display, window, gc, x+rd+1, y+ht, x+wd-rd-1, y+ht);
-//	XDrawLine(display, window, gc, x+wd, y+ht-rd-1, x+wd, y+rd+1);
-//	XDrawLine(display, window, gc, x+wd-rd-1, y, x+rd+1, y);
-//	XDrawLine(display, rdPixmap, gc, x, y+rd+1, x, y+ht-rd-1);
-//	XDrawLine(display, rdPixmap, gc, x+rd+1, y+ht, x+wd-rd-1, y+ht);
-//	XDrawLine(display, rdPixmap, gc, x+wd, y+ht-rd-1, x+wd, y+rd+1);
-//	XDrawLine(display, rdPixmap, gc, x+wd-rd-1, y, x+rd+1, y);
-//	// draw four corner arcs.
-//	int diam = 2*rd;
-//	XDrawArc(display, window, gc, x, y, diam, diam, 90*64, 90*64);
-//	XDrawArc(display, window, gc, x, y+ht-diam, diam, diam, 180*64, 90*64);
-//	XDrawArc(display, window, gc, x+wd-diam, y+ht-diam, diam, diam, 
-//			270*64, 90*64);
-//	XDrawArc(display, window, gc, x+wd-diam, y, diam, diam, 0*64, 90*64);
-//	XDrawArc(display, rdPixmap, gc, x, y, diam, diam, 90*64, 90*64);
-//	XDrawArc(display, rdPixmap, gc, x, y+ht-diam, diam, diam, 
-//			180*64, 90*64);
-//	XDrawArc(display, rdPixmap, gc, x+wd-diam, y+ht-diam, diam, diam, 
-//			270*64, 90*64);
-//	XDrawArc(display, rdPixmap, gc, x+wd-diam, y, diam, diam, 0*64, 90*64);
-//}
-//
-//void XGrafport::FillXRoundedRectangle(GC gc, double x_, double y_,
-//	double wd_, double ht_, double rd_)
-//{
-//	int x = round(Zoom(x_)); int y = round(Zoom(y_));
-//	int wd = round(Zoom(wd_)); int ht = round(Zoom(ht_)); int rd = round(Zoom(rd_));
-//	// fill rectangle parts.
-//	XFillRectangle(display, window, gc, x, y+rd, wd, ht-2*rd);
-//	XFillRectangle(display, window, gc, x+rd, y, wd-2*rd, rd);
-//	XFillRectangle(display, window, gc, x+rd, y+ht-rd, wd-2*rd, rd);
-//	XFillRectangle(display, rdPixmap, gc, x, y+rd, wd, ht-2*rd);
-//	XFillRectangle(display, rdPixmap, gc, x+rd, y, wd-2*rd, rd);
-//	XFillRectangle(display, rdPixmap, gc, x+rd, y+ht-rd, wd-2*rd, rd);
-//	// fill four corner arcs.
-//	int diam = 2*rd;
-//	XFillArc(display, window, gc, x, y, diam, diam, 90*64, 90*64);
-//	XFillArc(display, window, gc, x, y+ht-diam, diam, diam, 180*64, 90*64);
-//	XFillArc(display, window, gc, x+wd-diam, y+ht-diam, diam, diam, 
-//			270*64, 90*64);
-//	XFillArc(display, window, gc, x+wd-diam, y, diam, diam, 0*64, 90*64);
-//	XFillArc(display, rdPixmap, gc, x, y, diam, diam, 90*64, 90*64);
-//	XFillArc(display, rdPixmap, gc, x, y+ht-diam, diam, diam, 
-//			180*64, 90*64);
-//	XFillArc(display, rdPixmap, gc, x+wd-diam, y+ht-diam, diam, diam, 
-//			270*64, 90*64);
-//	XFillArc(display, rdPixmap, gc, x+wd-diam, y, diam, diam, 
-//			0*64, 90*64);
-//}
-//
-//void XGrafport::DrawXEllipsedRectangle(GC gc, double x_, double y_,
-//	double wd_, double ht_, double rd_)
-//{
-//        int x = round(Zoom(x_)); int y = round(Zoom(y_));
-//        int wd = round(Zoom(wd_)); int ht = round(Zoom(ht_)); int rd = round(Zoom(rd_));
-//        // draw two lines (without the corner parts).
-//        XDrawLine(display, window, gc, x+rd+1, y, x+wd-rd-1, y);
-//        XDrawLine(display, window, gc, x+rd+1, y+ht, x+wd-rd-1, y+ht);
-//        XDrawLine(display, rdPixmap, gc, x+rd+1, y, x+wd-rd-1, y);
-//        XDrawLine(display, rdPixmap, gc, x+rd+1, y+ht, x+wd-rd-1, y+ht);
-//        // draw two half circle parts.
-//        int diam = 2*rd;        // (== ht)
-//        XDrawArc(display, window, gc, x, y, diam, ht, 
-//		90*64, 180*64);
-//        XDrawArc(display, window, gc, x+wd-diam, y, diam, ht, 
-//		270*64, 180*64);
-//        XDrawArc(display, rdPixmap, gc, x, y, diam, ht, 
-//		90*64, 180*64);
-//        XDrawArc(display, rdPixmap, gc, x+wd-diam, y, diam, ht, 
-//		270*64, 180*64);
-//}
-// 
-//void XGrafport::FillXEllipsedRectangle(GC gc, double x_, double y_,
-//	double wd_, double ht_, double rd_)
-//{
-//        int x = round(Zoom(x_)); int y = round(Zoom(y_));
-//        int wd = round(Zoom(wd_)); int ht = round(Zoom(ht_)); int rd = round(Zoom(rd_));
-//        // fill rectangle part.
-//        XFillRectangle(display, window, gc, x+rd, y, wd-2*rd, ht);
-//        XFillRectangle(display, rdPixmap, gc, x+rd, y, wd-2*rd, ht);
-//        // fill two half circle parts.
-//        int diam = 2*rd;        // (== ht)
-//        XFillArc(display, window, gc, x, y, diam, ht, 
-//		 90*64, 180*64);
-//        XFillArc(display, window, gc, x+wd-diam, y, diam, ht, 
-//		 270*64, 180*64);
-//        XFillArc(display, rdPixmap, gc, x, y, diam, ht, 
-//		 90*64, 180*64);
-//        XFillArc(display, rdPixmap, gc, x+wd-diam, y, diam, ht, 
-//		270*64, 180*64);
-//}
-//
-//void XGrafport::DrawXDisk(GC gc, double x_, double y_, 
-//	double wd_, double ht_, double el_)
-//{
-//        int x = round(Zoom(x_)); int y = round(Zoom(y_));
-//        int wd = round(Zoom(wd_)); int ht = round(Zoom(ht_)); int el = round(Zoom(el_));
-//	int ah = el/2; // arc height
-//        // draw two lines (without the corner points).
-//        XDrawLine(display, window, gc, x, y+ah+1, x, y+ht-ah-1);
-//        XDrawLine(display, window, gc, x+wd, y+ah+1, x+wd, y+ht-ah-1);
-//        XDrawLine(display, rdPixmap, gc, x, y+ah+1, x, y+ht-ah-1);
-//        XDrawLine(display, rdPixmap, gc, x+wd, y+ah+1, x+wd, y+ht-ah-1);
-//        // draw whole ellipse (arc) and half ellipse
-//        XDrawArc(display, window, gc, x, y, wd, el, 0*64, 360*64);
-//        XDrawArc(display, window, gc, x, y+ht-el, wd, el, 0*64, -180*64);
-//        XDrawArc(display, rdPixmap, gc, x, y, wd, el, 0*64, 360*64);
-//        XDrawArc(display, rdPixmap, gc, x, y+ht-el, wd, el, 0*64, -180*64);
-//}
-// 
-//void XGrafport::FillXDisk(GC gc, double x_, double y_, 
-//	double wd_, double ht_, double el_)
-//{
-//        int x = round(Zoom(x_)); int y = round(Zoom(y_));
-//        int wd = round(Zoom(wd_)); int ht = round(Zoom(ht_)); int el = round(Zoom(el_));
-//	int ah = el/2; // arc height
-//	XFillRectangle(display, window, gc, x, y+ah+1, wd, ht-2*ah-1); 
-//	XFillRectangle(display, rdPixmap, gc, x, y+ah+1, wd, ht-2*ah-1); 
-//	// fill ellipse parts
-//        XFillArc(display, window, gc, x, y, wd, el, 0*64, 180*64);
-//        XFillArc(display, window, gc, x, y+ht-el, wd, el, 0*64, -180*64);
-//        XFillArc(display, rdPixmap, gc, x, y, wd, el, 0*64, 180*64);
-//        XFillArc(display, rdPixmap, gc, x, y+ht-el, wd, el, 0*64, -180*64);
-//}
-
-void XGrafport::DrawEllipse(double x, double y,
-	double wd, double ht)
-{
-	DrawArc(x, y, wd, ht, 0, 360);
-}
-
-void XGrafport::FillEllipse(double x, double y,
-	double wd, double ht)
-{
-	FillSegment(x, y, wd, ht, 0, 360);
-}
-
-//void XGrafport::FillArc(double x, double y,
-//	double wd, double ht, int arc1, int arc2)
-//{
-//	XSetArcMode(display, xorGC, ArcPieSlice);
-//	FillXArc(xorGC, x, y, wd, ht, arc1, arc2);
-//}
--- a/src/ui/xgrafport.h
+++ b/src/ui/xgrafport.h
@@ -126,12 +126,6 @@ public:
 	///
 	void DrawPoint(double x, double y);
 
-// Drawing Ellipses
-	///
-	void DrawEllipse(double x, double y, double wd, double ht);
-	///
-	void FillEllipse(double x, double y, double wd, double ht);
-
 // Drawing Arcs
 	///
 	/* virtual */ void FillSegment(double x, double y,