diff options
33 files changed, 62 insertions, 87 deletions
diff --git a/tksao/frame/base.C b/tksao/frame/base.C index 851a324..b1d6076 100644 --- a/tksao/frame/base.C +++ b/tksao/frame/base.C @@ -1008,7 +1008,7 @@ void Base::psCrosshair(PSColorSpace mode) { ostringstream str; - switch ((PSColorSpace)mode) { + switch (mode) { case BW: case GRAY: psColorGray(getXColor("green"), str); diff --git a/tksao/frame/basebox.C b/tksao/frame/basebox.C index c370e7c..b3eebb1 100644 --- a/tksao/frame/basebox.C +++ b/tksao/frame/basebox.C @@ -62,7 +62,7 @@ void BaseBox::renderXDraw(Drawable drawable, GC lgc, XPoint* pp, XDrawLines(display, drawable, lgc, pp, numPoints_, CoordModeOrigin); } -void BaseBox::renderPS(int mode) +void BaseBox::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); diff --git a/tksao/frame/basebox.h b/tksao/frame/basebox.h index 960943f..e7c2d56 100644 --- a/tksao/frame/basebox.h +++ b/tksao/frame/basebox.h @@ -29,7 +29,7 @@ protected: void renderX(Drawable, Coord::InternalSystem, RenderMode); virtual void renderXDraw(Drawable, GC, XPoint*, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); virtual void renderPSDraw(int); void renderPSFillDraw(int); diff --git a/tksao/frame/baseellipse.C b/tksao/frame/baseellipse.C index 6c15b6b..6a9d25e 100644 --- a/tksao/frame/baseellipse.C +++ b/tksao/frame/baseellipse.C @@ -384,7 +384,7 @@ void BaseEllipse::renderXInclude(Drawable drawable, // renderPS -void BaseEllipse::renderPS(int mode) { +void BaseEllipse::renderPS(Widget::PSColorSpace mode) { Vector r = annuli_[numAnnuli_-1]; Vector z = parent->zoom(); @@ -413,7 +413,7 @@ void BaseEllipse::renderPSFill() Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); } -void BaseEllipse::renderPSCircle(int mode) +void BaseEllipse::renderPSCircle(Widget::PSColorSpace mode) { renderPSGC(mode); @@ -457,7 +457,7 @@ void BaseEllipse::renderPSCircle(int mode) } } -void BaseEllipse::renderPSEllipse(int mode) +void BaseEllipse::renderPSEllipse(Widget::PSColorSpace mode) { renderPSGC(mode); @@ -547,7 +547,7 @@ void BaseEllipse::renderPSEllipseArc(double a1, double a2, Vector& rr) Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); } -void BaseEllipse::renderPSInclude(int mode) +void BaseEllipse::renderPSInclude(Widget::PSColorSpace mode) { if (!(properties & INCLUDE)) { double theta = degToRad(45); @@ -558,7 +558,7 @@ void BaseEllipse::renderPSInclude(int mode) -annuli_[numAnnuli_-1][1]*sin(theta)), Coord::CANVAS); - parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor("red")); + parent->renderPSColor(mode, parent->getXColor("red")); ostringstream str; str << "newpath " diff --git a/tksao/frame/baseellipse.h b/tksao/frame/baseellipse.h index ec55684..2ebd46a 100644 --- a/tksao/frame/baseellipse.h +++ b/tksao/frame/baseellipse.h @@ -28,11 +28,11 @@ class BaseEllipse : public BaseMarker { double, double, Vector&); void renderXInclude(Drawable, Coord::InternalSystem, RenderMode); - void renderPSCircle(int); - void renderPSEllipse(int); + void renderPSCircle(Widget::PSColorSpace); + void renderPSEllipse(Widget::PSColorSpace); void renderPSEllipsePrep(double, double, double, double, Vector&); void renderPSEllipseArc(double, double, Vector&); - void renderPSInclude(int); + void renderPSInclude(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSXCircle(); @@ -57,7 +57,7 @@ class BaseEllipse : public BaseMarker { virtual void renderXBezierDraw(Drawable, GC, RenderMode); void renderXBezierDashDraw(Drawable, GC); - void renderPS(int); + void renderPS(Widget::PSColorSpace); virtual void renderPSDraw(); void renderPSFill(); diff --git a/tksao/frame/baseline.h b/tksao/frame/baseline.h index e282782..ac69bf5 100644 --- a/tksao/frame/baseline.h +++ b/tksao/frame/baseline.h @@ -14,7 +14,7 @@ protected: void renderXInclude(Drawable, Coord::InternalSystem, RenderMode) {} - void renderPSInclude(int) {} + void renderPSInclude(Widget::PSColorSpace) {} #ifdef MAC_OSX_TK void renderMACOSXInclude() {} diff --git a/tksao/frame/basepolygon.h b/tksao/frame/basepolygon.h index bb500df..9200523 100644 --- a/tksao/frame/basepolygon.h +++ b/tksao/frame/basepolygon.h @@ -14,7 +14,7 @@ class BasePolygon : public Marker { protected: virtual void renderX(Drawable, Coord::InternalSystem, RenderMode) =0; - virtual void renderPS(int) =0; + virtual void renderPS(Widget::PSColorSpace) =0; #ifdef MAC_OSX_TK virtual void renderMACOSX() =0; #endif diff --git a/tksao/frame/bpanda.C b/tksao/frame/bpanda.C index 4baa0d7..9828193 100644 --- a/tksao/frame/bpanda.C +++ b/tksao/frame/bpanda.C @@ -95,7 +95,7 @@ void Bpanda::renderX(Drawable drawable, Coord::InternalSystem sys, } } -void Bpanda::renderPS(int mode) +void Bpanda::renderPS(Widget::PSColorSpace mode) { BaseBox::renderPS(mode); diff --git a/tksao/frame/bpanda.h b/tksao/frame/bpanda.h index 4a79add..581e035 100644 --- a/tksao/frame/bpanda.h +++ b/tksao/frame/bpanda.h @@ -10,7 +10,7 @@ class Bpanda : public BaseBox { private: void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); #endif diff --git a/tksao/frame/compass.C b/tksao/frame/compass.C index 7ff3708..da6b3e5 100644 --- a/tksao/frame/compass.C +++ b/tksao/frame/compass.C @@ -130,7 +130,7 @@ GC Compass::renderXGC(RenderMode mode) return gc; } -void Compass::renderPS(int mode) +void Compass::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); @@ -248,9 +248,9 @@ void Compass::renderPS(int mode) } } -void Compass::renderPSGC(int mode) +void Compass::renderPSGC(Widget::PSColorSpace mode) { - parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor(colorName)); + parent->renderPSColor(mode, parent->getXColor(colorName)); renderPSLineNoDash(); } diff --git a/tksao/frame/compass.h b/tksao/frame/compass.h index 290ff97..b750f62 100644 --- a/tksao/frame/compass.h +++ b/tksao/frame/compass.h @@ -28,9 +28,9 @@ private: void renderXInclude(Drawable, Coord::InternalSystem, RenderMode) {} GC renderXGC(RenderMode); - void renderPS(int); - void renderPSInclude(int) {} - void renderPSGC(int); + void renderPS(Widget::PSColorSpace); + void renderPSInclude(Widget::PSColorSpace) {} + void renderPSGC(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); diff --git a/tksao/frame/composite.C b/tksao/frame/composite.C index 2952d86..f77fefd 100644 --- a/tksao/frame/composite.C +++ b/tksao/frame/composite.C @@ -55,7 +55,7 @@ void Composite::x11(Drawable drawable, Coord::InternalSystem sys, void Composite::ps(int mode, int tt) { if (tt) - renderPSText(mode); + renderPSText((Widget::PSColorSpace)mode); Marker* mk=members.head(); while (mk) { diff --git a/tksao/frame/composite.h b/tksao/frame/composite.h index b6ee43e..81bad07 100644 --- a/tksao/frame/composite.h +++ b/tksao/frame/composite.h @@ -14,7 +14,7 @@ class Composite : public Marker { int global; void renderX(Drawable, Coord::InternalSystem, RenderMode) {} - void renderPS(int mode) {} + void renderPS(Widget::PSColorSpace mode) {} #ifdef MAC_OSX_TK void renderMACOSX() {} #endif diff --git a/tksao/frame/cpanda.C b/tksao/frame/cpanda.C index 5df4e3a..b57868e 100644 --- a/tksao/frame/cpanda.C +++ b/tksao/frame/cpanda.C @@ -97,7 +97,7 @@ void Cpanda::renderX(Drawable drawable, Coord::InternalSystem sys, } } -void Cpanda::renderPS(int mode) +void Cpanda::renderPS(Widget::PSColorSpace mode) { BaseEllipse::renderPS(mode); diff --git a/tksao/frame/cpanda.h b/tksao/frame/cpanda.h index 848e11c..adfe7ff 100644 --- a/tksao/frame/cpanda.h +++ b/tksao/frame/cpanda.h @@ -10,7 +10,7 @@ class Cpanda : public BaseEllipse { private: void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); #endif diff --git a/tksao/frame/epanda.C b/tksao/frame/epanda.C index 3826c0f..f223503 100644 --- a/tksao/frame/epanda.C +++ b/tksao/frame/epanda.C @@ -95,7 +95,7 @@ void Epanda::renderX(Drawable drawable, Coord::InternalSystem sys, } } -void Epanda::renderPS(int mode) +void Epanda::renderPS(Widget::PSColorSpace mode) { BaseEllipse::renderPS(mode); diff --git a/tksao/frame/epanda.h b/tksao/frame/epanda.h index 9b92336..4134273 100644 --- a/tksao/frame/epanda.h +++ b/tksao/frame/epanda.h @@ -10,7 +10,7 @@ class Epanda : public BaseEllipse { private: void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); #endif diff --git a/tksao/frame/line.C b/tksao/frame/line.C index c4de660..7092d3c 100644 --- a/tksao/frame/line.C +++ b/tksao/frame/line.C @@ -64,7 +64,7 @@ void Line::renderX(Drawable drawable, Coord::InternalSystem sys, RenderMode mode XDrawLine(display, drawable, lgc, aa[0], aa[1], bb[0], bb[1]); } -void Line::renderPS(int mode) +void Line::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); diff --git a/tksao/frame/line.h b/tksao/frame/line.h index 66f9d06..c749b39 100644 --- a/tksao/frame/line.h +++ b/tksao/frame/line.h @@ -14,7 +14,7 @@ protected: protected: void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); #endif diff --git a/tksao/frame/marker.C b/tksao/frame/marker.C index 4175c47..acb32d4 100644 --- a/tksao/frame/marker.C +++ b/tksao/frame/marker.C @@ -377,16 +377,16 @@ void Marker::renderXLineNoDash(GC lgc) void Marker::ps(int mode, int tt) { if (tt) - renderPSText(mode); + renderPSText((Widget::PSColorSpace)mode); - renderPS(mode); - renderPSInclude(mode); + renderPS((Widget::PSColorSpace)mode); + renderPSInclude((Widget::PSColorSpace)mode); } -void Marker::renderPSInclude(int mode) +void Marker::renderPSInclude(Widget::PSColorSpace mode) { if (!(properties & INCLUDE)) { - parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor("red")); + parent->renderPSColor(mode, parent->getXColor("red")); Vector ll = handle[0]; Vector ur = handle[2]; @@ -401,7 +401,7 @@ void Marker::renderPSInclude(int mode) } } -void Marker::renderPSText(int mode) +void Marker::renderPSText(Widget::PSColorSpace mode) { if (text && *text && psfont_) { parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor(colorName)); @@ -445,7 +445,7 @@ void Marker::renderPSArrow(const Vector& p1, const Vector& p2, delete [] vv; } -void Marker::renderPSGC(int mode) +void Marker::renderPSGC(Widget::PSColorSpace mode) { // set width, color, dash parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor(colorName)); @@ -473,32 +473,6 @@ void Marker::renderPSLineNoDash() Tcl_AppendResult(parent->interp, (char*)str.str().c_str(), NULL); } -/* -void Marker::renderPSColor(int mode, XColor* clr) -{ - ostringstream str; - - switch ((Widget::PSColorSpace)mode) { - case Widget::BW: - case Widget::GRAY: - psColorGray(clr, str); - str << " setgray"; - break; - case Widget::RGB: - psColorRGB(clr, str); - str << " setrgbcolor"; - break; - case Widget::CMYK: - psColorCMYK(clr, str); - str << " setcmykcolor"; - break; - } - str << endl << ends; - - Tcl_AppendResult(parent->interp, (char*)str.str().c_str(), NULL); -} -*/ - #ifdef MAC_OSX_TK void Marker::macosx(int tt) { diff --git a/tksao/frame/marker.h b/tksao/frame/marker.h index ac3ca0f..1c09f83 100644 --- a/tksao/frame/marker.h +++ b/tksao/frame/marker.h @@ -14,6 +14,7 @@ #include "tag.h" #include "coord.h" #include "xml.h" +#include "widget.h" #define POINTSIZE 11 @@ -117,11 +118,11 @@ protected: virtual void renderXLineDash(GC); void renderXLineNoDash(GC); - virtual void renderPS(int mode) =0; - virtual void renderPSInclude(int); - virtual void renderPSText(int); + virtual void renderPS(Widget::PSColorSpace mode) =0; + virtual void renderPSInclude(Widget::PSColorSpace); + virtual void renderPSText(Widget::PSColorSpace); void renderPSArrow(const Vector&, const Vector&, Coord::InternalSystem); - virtual void renderPSGC(int); + virtual void renderPSGC(Widget::PSColorSpace); virtual void renderPSLineDash(); void renderPSLineNoDash(); void renderPSColor(int, XColor*); diff --git a/tksao/frame/point.C b/tksao/frame/point.C index 64ecaec..313a269 100644 --- a/tksao/frame/point.C +++ b/tksao/frame/point.C @@ -155,7 +155,7 @@ void Point::renderXLineDash(GC lgc) // PS -void Point::renderPS(int mode) +void Point::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); Vector* vv =NULL; diff --git a/tksao/frame/point.h b/tksao/frame/point.h index ccead2f..2bb8c96 100644 --- a/tksao/frame/point.h +++ b/tksao/frame/point.h @@ -63,7 +63,7 @@ class Point : public Marker { virtual Marker* dup() {return new Point(*this);} void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int mode); + void renderPS(Widget::PSColorSpace mode); #ifdef MAC_OSX_TK void renderMACOSX(); diff --git a/tksao/frame/polygon.C b/tksao/frame/polygon.C index 98d8583..4f07b1b 100644 --- a/tksao/frame/polygon.C +++ b/tksao/frame/polygon.C @@ -74,7 +74,7 @@ void Polygon::renderX(Drawable drawable, Coord::InternalSystem sys, delete [] pp; } -void Polygon::renderPS(int mode) +void Polygon::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); diff --git a/tksao/frame/polygon.h b/tksao/frame/polygon.h index 909b184..dcf2fe9 100644 --- a/tksao/frame/polygon.h +++ b/tksao/frame/polygon.h @@ -16,7 +16,7 @@ class Polygon : public BasePolygon { protected: int isInRef(const Vector& v); void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); #endif diff --git a/tksao/frame/projection.C b/tksao/frame/projection.C index 57f1fde..a55eca9 100644 --- a/tksao/frame/projection.C +++ b/tksao/frame/projection.C @@ -77,7 +77,7 @@ GC Projection::renderXGC(RenderMode mode) } } -void Projection::renderPS(int mode) +void Projection::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); @@ -120,9 +120,9 @@ void Projection::renderPS(int mode) } } -void Projection::renderPSGC(int mode) +void Projection::renderPSGC(Widget::PSColorSpace mode) { - parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor(colorName)); + parent->renderPSColor(mode, parent->getXColor(colorName)); renderPSLineNoDash(); } diff --git a/tksao/frame/projection.h b/tksao/frame/projection.h index edea362..05285b8 100644 --- a/tksao/frame/projection.h +++ b/tksao/frame/projection.h @@ -17,8 +17,8 @@ class Projection : public BaseLine { void renderX(Drawable, Coord::InternalSystem, RenderMode); GC renderXGC(RenderMode); - void renderPS(int); - void renderPSGC(int); + void renderPS(Widget::PSColorSpace); + void renderPSGC(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); diff --git a/tksao/frame/ruler.C b/tksao/frame/ruler.C index f1f317c..c1c4f8d 100644 --- a/tksao/frame/ruler.C +++ b/tksao/frame/ruler.C @@ -101,7 +101,7 @@ GC Ruler::renderXGC(RenderMode mode) return gc; } -void Ruler::renderPS(int mode) +void Ruler::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); @@ -174,9 +174,9 @@ void Ruler::renderPS(int mode) } } -void Ruler::renderPSGC(int mode) +void Ruler::renderPSGC(Widget::PSColorSpace mode) { - parent->renderPSColor((Widget::PSColorSpace)mode, parent->getXColor(colorName)); + parent->renderPSColor(mode, parent->getXColor(colorName)); renderPSLineNoDash(); } diff --git a/tksao/frame/ruler.h b/tksao/frame/ruler.h index 3b7e4f9..339b4c2 100644 --- a/tksao/frame/ruler.h +++ b/tksao/frame/ruler.h @@ -21,8 +21,8 @@ private: void renderX(Drawable, Coord::InternalSystem, RenderMode); GC renderXGC(RenderMode); - void renderPS(int); - void renderPSGC(int); + void renderPS(Widget::PSColorSpace); + void renderPSGC(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); diff --git a/tksao/frame/segment.C b/tksao/frame/segment.C index 265441e..8c1061f 100644 --- a/tksao/frame/segment.C +++ b/tksao/frame/segment.C @@ -54,7 +54,7 @@ void Segment::renderX(Drawable drawable, Coord::InternalSystem sys, } while (vertex.next()); } -void Segment::renderPS(int mode) +void Segment::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); diff --git a/tksao/frame/segment.h b/tksao/frame/segment.h index 9b77fc2..179f7cb 100644 --- a/tksao/frame/segment.h +++ b/tksao/frame/segment.h @@ -12,7 +12,7 @@ class Segment : public BasePolygon { protected: void renderX(Drawable, Coord::InternalSystem, RenderMode); - void renderPS(int); + void renderPS(Widget::PSColorSpace); #ifdef MAC_OSX_TK void renderMACOSX(); #endif diff --git a/tksao/frame/text.C b/tksao/frame/text.C index 3bb2e0b..065376d 100644 --- a/tksao/frame/text.C +++ b/tksao/frame/text.C @@ -59,7 +59,7 @@ void Text::renderX(Drawable drawable, Coord::InternalSystem sys, RenderMode mode } } -void Text::renderPS(int mode) +void Text::renderPS(Widget::PSColorSpace mode) { renderPSGC(mode); diff --git a/tksao/frame/text.h b/tksao/frame/text.h index f367c42..28bca37 100644 --- a/tksao/frame/text.h +++ b/tksao/frame/text.h @@ -16,9 +16,9 @@ class Text : public Marker { void renderXText(Drawable, Coord::InternalSystem, RenderMode) {} void renderXInclude(Drawable, Coord::InternalSystem, RenderMode) {} - void renderPS(int); - void renderPSText(int) {} - void renderPSInclude(int) {} + void renderPS(Widget::PSColorSpace); + void renderPSText(Widget::PSColorSpace) {} + void renderPSInclude(Widget::PSColorSpace) {} #ifdef MAC_OSX_TK void renderMACOSX(); |