Author: manolo
Date: 2012-02-19 06:07:43 -0800 (Sun, 19 Feb 2012)
New Revision: 9243
Log:
Improved the usability of the fltk3::GraphicsDriver class to build new 
subclasses.

Modified:
   branches/branch-3.0/include/fltk3/Device.h
   branches/branch-3.0/src/fltk3/Device.cxx
   branches/branch-3.0/src/fltk3/arc.cxx
   branches/branch-3.0/src/fltk3/arci.cxx
   branches/branch-3.0/src/fltk3/vertex.cxx

Modified: branches/branch-3.0/include/fltk3/Device.h
===================================================================
--- branches/branch-3.0/include/fltk3/Device.h  2012-02-18 16:00:34 UTC (rev 
9242)
+++ branches/branch-3.0/include/fltk3/Device.h  2012-02-19 14:07:43 UTC (rev 
9243)
@@ -125,29 +125,41 @@
     fltk3::Font font_; // current font
     fltk3::Fontsize size_; // current font size
     fltk3::Color color_; // current color
-    enum {LINE, LOOP, POLYGON, POINT_};
     int sptr;
     enum { matrix_stack_size = MATRIX_STACK_SIZE };
     matrix stack[MATRIX_STACK_SIZE];
     matrix m;
     int n, p_size, gap_;
     XPOINT *p;
-    int what;
     int fl_clip_state_number;
     int rstackptr;
     enum { region_stack_max = REGION_STACK_SIZE - 1 };
     fltk3::Region rstack[REGION_STACK_SIZE];
+    Fl_Font_Descriptor *font_descriptor_;
+    void transformed_vertex0(COORD_T x, COORD_T y);
+  protected:
+#ifndef FLTK3_DOXYGEN
+    enum {LINE, LOOP, POLYGON, POINT_};
+    int what;
 #ifdef WIN32
     int numcount;
     int counts[20];
 #endif
-    Fl_Font_Descriptor *font_descriptor_;
-    void transformed_vertex0(COORD_T x, COORD_T y);
+    void prepare_circle(double x, double y, double r, int& llx, int& lly, int& 
w, int& h, double& xt, double& yt);
     void fixloop();
+#endif
     
   public:
     
     matrix *fl_matrix; /**< Points to the current coordinate transformation 
matrix */
+    /** Gives the number of vertices in the current path.
+     Useful when writing Fl_Graphics_Driver subclasses.
+     */
+    int vertex_no() { return n; }
+    /** Array of vertices in the current path.
+     Useful when writing Fl_Graphics_Driver subclasses. XPOINT is a 
system-dependent type.
+     */
+    XPOINT *vertices() { return p; }
     
     /** \brief The constructor. */
     GraphicsDriver();
@@ -209,27 +221,27 @@
     /** \brief see fltk3::curve(double X0, double Y0, double X1, double Y1, 
double X2, double Y2, double X3, double Y3). */
     virtual void curve(double X0, double Y0, double X1, double Y1, double X2, 
double Y2, double X3, double Y3);
     /** \brief see fltk3::circle(double x, double y, double r). */
-    virtual void circle(double x, double y, double r);
+    virtual void circle(double x, double y, double r) {}
     /** \brief see fltk3::arc(double x, double y, double r, double start, 
double end). */
     virtual void arc(double x, double y, double r, double start, double end);
     /** \brief see fltk3::arc(int x, int y, int w, int h, double a1, double 
a2). */
-    virtual void arc(int x, int y, int w, int h, double a1, double a2);
+    virtual void arc(int x, int y, int w, int h, double a1, double a2) {}
     /** \brief see fltk3::pie(int x, int y, int w, int h, double a1, double 
a2). */
-    virtual void pie(int x, int y, int w, int h, double a1, double a2);
+    virtual void pie(int x, int y, int w, int h, double a1, double a2) {}
     /** \brief see fltk3::end_points(). */
-    virtual void end_points();
+    virtual void end_points() {}
     /** \brief see fltk3::end_line(). */
-    virtual void end_line();
+    virtual void end_line() {}
     /** \brief see fltk3::end_loop(). */
     virtual void end_loop();
     /** \brief see fltk3::end_polygon(). */
-    virtual void end_polygon();
+    virtual void end_polygon() {}
     /** \brief see fltk3::begin_complex_polygon(). */
     virtual void begin_complex_polygon();
     /** \brief see fltk3::gap(). */
     virtual void gap();
     /** \brief see fltk3::end_complex_polygon(). */
-    virtual void end_complex_polygon();
+    virtual void end_complex_polygon() {}
     /** \brief see fltk3::transformed_vertex(double xf, double yf). */
     virtual void transformed_vertex(double xf, double yf);
     /** \brief see fltk3::push_clip(int x, int y, int w, int h). */
@@ -301,7 +313,6 @@
      */
     virtual void draw(fltk3::Bitmap *bm, int XP, int YP, int WP, int HP, int 
cx, int cy) {}
     
-  public:
     static const char *class_id;
     virtual const char *class_name() {return class_id;};
     /** \brief see fltk3::font(fltk3::Font face, fltk3::Fontsize size). */
@@ -361,6 +372,13 @@
     void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
     int height();
     int descent();
+    void end_points();
+    void end_line();
+    void end_polygon();
+    void end_complex_polygon();
+    void circle(double x, double y, double r);
+    void arc(int x,int y,int w,int h,double a1,double a2);
+    void pie(int x,int y,int w,int h,double a1,double a2);
   };
 #endif
   
@@ -392,6 +410,13 @@
     void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
     int height();
     int descent();
+    void end_points();
+    void end_line();
+    void end_polygon();
+    void end_complex_polygon();
+    void circle(double x, double y, double r);
+    void arc(int x,int y,int w,int h,double a1,double a2);
+    void pie(int x,int y,int w,int h,double a1,double a2);
   };
 #endif
   
@@ -423,6 +448,13 @@
     void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
     int height();
     int descent();
+    void end_points();
+    void end_line();
+    void end_polygon();
+    void end_complex_polygon();
+    void circle(double x, double y, double r);
+    void arc(int x,int y,int w,int h,double a1,double a2);
+    void pie(int x,int y,int w,int h,double a1,double a2);
   };
 #endif
   

Modified: branches/branch-3.0/src/fltk3/Device.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Device.cxx    2012-02-18 16:00:34 UTC (rev 
9242)
+++ branches/branch-3.0/src/fltk3/Device.cxx    2012-02-19 14:07:43 UTC (rev 
9243)
@@ -65,6 +65,7 @@
   p = (XPOINT *)0;
   font_descriptor_ = NULL;
   p_size = 0;
+  n = 0;
 };
 
 void fltk3::GraphicsDriver::text_extents(const char*t, int n, int& dx, int& 
dy, int& w, int& h)

Modified: branches/branch-3.0/src/fltk3/arc.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/arc.cxx       2012-02-18 16:00:34 UTC (rev 
9242)
+++ branches/branch-3.0/src/fltk3/arc.cxx       2012-02-19 14:07:43 UTC (rev 
9243)
@@ -75,17 +75,11 @@
     do {
       double Xnew =  cos_e*X + sin_e*Y;
                Y = -sin_e*X + cos_e*Y;
-      fltk3::vertex(x + (X=Xnew), y + Y);
+      vertex(x + (X=Xnew), y + Y);
     } while (--i);
   }
 }
 
-#if 0 // portable version.  X-specific one in fltk3::vertex.cxx
-void fltk3::circle(double x,double y,double r) {
-  _fl_arc(x, y, r, r, 0, 360);
-}
-#endif
-
 //
 // End of "$Id$".
 //

Modified: branches/branch-3.0/src/fltk3/arci.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/arci.cxx      2012-02-18 16:00:34 UTC (rev 
9242)
+++ branches/branch-3.0/src/fltk3/arci.cxx      2012-02-19 14:07:43 UTC (rev 
9243)
@@ -47,21 +47,9 @@
 #endif
 #include <config.h>
 
-void fltk3::GraphicsDriver::arc(int x,int y,int w,int h,double a1,double a2) {
+#if defined(__APPLE_QUARTZ__)
+void fltk3::QuartzGraphicsDriver::arc(int x,int y,int w,int h,double a1,double 
a2) {
   if (w <= 0 || h <= 0) return;
-
-#if defined(USE_X11)
-  XDrawArc(fl_display, fl_window, fl_gc, x,y,w-1,h-1, 
int(a1*64),int((a2-a1)*64));
-#elif defined(WIN32)
-  int xa = x+w/2+int(w*cos(a1/180.0*M_PI));
-  int ya = y+h/2-int(h*sin(a1/180.0*M_PI));
-  int xb = x+w/2+int(w*cos(a2/180.0*M_PI));
-  int yb = y+h/2-int(h*sin(a2/180.0*M_PI));
-  if (fabs(a1 - a2) < 90) {
-    if (xa == xb && ya == yb) SetPixel(fl_gc, xa, ya, fl_RGB());
-    else Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb);
-  } else Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb);
-#elif defined(__APPLE_QUARTZ__)
   a1 = (-a1)/180.0f*M_PI; a2 = (-a2)/180.0f*M_PI;
   float cx = x + 0.5f*w - 0.5f, cy = y + 0.5f*h - 0.5f;
   CGContextSetShouldAntialias(fl_gc, true);
@@ -77,32 +65,30 @@
   }
   CGContextStrokePath(fl_gc);
   CGContextSetShouldAntialias(fl_gc, false);
-#else
-# error unsupported platform
-#endif
 }
-
-void fltk3::GraphicsDriver::pie(int x,int y,int w,int h,double a1,double a2) {
+#elif defined(WIN32)
+void fltk3::GDIGraphicsDriver::arc(int x,int y,int w,int h,double a1,double 
a2) {
   if (w <= 0 || h <= 0) return;
-
-#if defined(USE_X11)
-  XDrawArc(fl_display, fl_window, fl_gc, x,y,w-1,h-1, 
int(a1*64),int((a2-a1)*64));
-  XFillArc(fl_display, fl_window, fl_gc, x,y,w-1,h-1, 
int(a1*64),int((a2-a1)*64));
-#elif defined(WIN32)
-  if (a1 == a2) return;
   int xa = x+w/2+int(w*cos(a1/180.0*M_PI));
   int ya = y+h/2-int(h*sin(a1/180.0*M_PI));
   int xb = x+w/2+int(w*cos(a2/180.0*M_PI));
   int yb = y+h/2-int(h*sin(a2/180.0*M_PI));
-  SelectObject(fl_gc, fl_brush());
   if (fabs(a1 - a2) < 90) {
-    if (xa == xb && ya == yb) {
-      MoveToEx(fl_gc, x+w/2, y+h/2, 0L); 
-      LineTo(fl_gc, xa, ya);
-      SetPixel(fl_gc, xa, ya, fl_RGB());
-    } else Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb);
-  } else Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); 
-#elif defined(__APPLE_QUARTZ__)
+    if (xa == xb && ya == yb) SetPixel(fl_gc, xa, ya, fl_RGB());
+    else Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb);
+  } else Arc(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb);
+}
+#else
+void fltk3::XlibGraphicsDriver::arc(int x,int y,int w,int h,double a1,double 
a2) {
+  if (w <= 0 || h <= 0) return;
+  XDrawArc(fl_display, fl_window, fl_gc, x,y,w-1,h-1, 
int(a1*64),int((a2-a1)*64));
+}
+#endif
+
+
+#if defined(__APPLE_QUARTZ__)
+void fltk3::QuartzGraphicsDriver::pie(int x,int y,int w,int h,double a1,double 
a2) {
+  if (w <= 0 || h <= 0) return;
   a1 = (-a1)/180.0f*M_PI; a2 = (-a2)/180.0f*M_PI;
   float cx = x + 0.5f*w - 0.5f, cy = y + 0.5f*h - 0.5f;
   CGContextSetShouldAntialias(fl_gc, true);
@@ -122,11 +108,31 @@
   }
   CGContextFillPath(fl_gc);
   CGContextSetShouldAntialias(fl_gc, false);
+}
+#elif defined(WIN32)
+void fltk3::GDIGraphicsDriver::pie(int x,int y,int w,int h,double a1,double 
a2) {
+  if (w <= 0 || h <= 0) return;
+  if (a1 == a2) return;
+  int xa = x+w/2+int(w*cos(a1/180.0*M_PI));
+  int ya = y+h/2-int(h*sin(a1/180.0*M_PI));
+  int xb = x+w/2+int(w*cos(a2/180.0*M_PI));
+  int yb = y+h/2-int(h*sin(a2/180.0*M_PI));
+  SelectObject(fl_gc, fl_brush());
+  if (fabs(a1 - a2) < 90) {
+    if (xa == xb && ya == yb) {
+      MoveToEx(fl_gc, x+w/2, y+h/2, 0L); 
+      LineTo(fl_gc, xa, ya);
+      SetPixel(fl_gc, xa, ya, fl_RGB());
+    } else Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb);
+  } else Pie(fl_gc, x, y, x+w, y+h, xa, ya, xb, yb); 
+}
 #else
-# error unsupported platform
+void fltk3::XlibGraphicsDriver::pie(int x,int y,int w,int h,double a1,double 
a2) {
+  if (w <= 0 || h <= 0) return;
+  XDrawArc(fl_display, fl_window, fl_gc, x,y,w-1,h-1, 
int(a1*64),int((a2-a1)*64));
+  XFillArc(fl_display, fl_window, fl_gc, x,y,w-1,h-1, 
int(a1*64),int((a2-a1)*64));
+}
 #endif
-}
-
 //
 // End of "$Id$".
 //

Modified: branches/branch-3.0/src/fltk3/vertex.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/vertex.cxx    2012-02-18 16:00:34 UTC (rev 
9242)
+++ branches/branch-3.0/src/fltk3/vertex.cxx    2012-02-19 14:07:43 UTC (rev 
9243)
@@ -121,12 +121,16 @@
   transformed_vertex0(COORD_T(x*m.a + y*m.c + m.x), COORD_T(x*m.b + y*m.d + 
m.y));
 }
 
-void fltk3::GraphicsDriver::end_points() {
-#if defined(USE_X11)
-  if (n>1) XDrawPoints(fl_display, fl_window, fl_gc, p, n, 0);
-#elif defined(WIN32)
+#ifdef WIN32
+void fltk3::GDIGraphicsDriver::end_points() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
   for (int i=0; i<n; i++) SetPixel(fl_gc, p[i].x, p[i].y, fl_RGB());
-#elif defined(__APPLE_QUARTZ__)
+}
+#elif defined(__APPLE__)
+void fltk3::QuartzGraphicsDriver::end_points() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
   if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
   for (int i=0; i<n; i++) { 
     CGContextMoveToPoint(fl_gc, p[i].x, p[i].y);
@@ -134,21 +138,23 @@
     CGContextStrokePath(fl_gc);
   }
   if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
+}
 #else
-# error unsupported platform
+void fltk3::XlibGraphicsDriver::end_points() {
+  int n = vertex_no();
+  if (n > 1) XDrawPoints(fl_display, fl_window, fl_gc, vertices(), n, 0);
+}
 #endif
-}
 
-void fltk3::GraphicsDriver::end_line() {
+
+#if defined(__APPLE_QUARTZ__)
+void fltk3::QuartzGraphicsDriver::end_line() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
   if (n < 2) {
     end_points();
     return;
   }
-#if defined(USE_X11)
-  if (n>1) XDrawLines(fl_display, fl_window, fl_gc, p, n, 0);
-#elif defined(WIN32)
-  if (n>1) Polyline(fl_gc, p, n);
-#elif defined(__APPLE_QUARTZ__)
   if (n<=1) return;
   CGContextSetShouldAntialias(fl_gc, true);
   CGContextMoveToPoint(fl_gc, p[0].x, p[0].y);
@@ -156,10 +162,28 @@
     CGContextAddLineToPoint(fl_gc, p[i].x, p[i].y);
   CGContextStrokePath(fl_gc);
   CGContextSetShouldAntialias(fl_gc, false);
+}
+#elif defined(WIN32)
+void fltk3::GDIGraphicsDriver::end_line() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
+  if (n < 2) {
+    end_points();
+    return;
+  }
+  if (n>1) Polyline(fl_gc, p, n);
+}
 #else
-# error unsupported platform
+void fltk3::XlibGraphicsDriver::end_line() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
+  if (n < 2) {
+    end_points();
+    return;
+  }
+  if (n>1) XDrawLines(fl_display, fl_window, fl_gc, p, n, 0);
+}
 #endif
-}
 
 void fltk3::GraphicsDriver::fixloop() {  // remove equal points from closed 
path
   while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
@@ -171,20 +195,15 @@
   end_line();
 }
 
-void fltk3::GraphicsDriver::end_polygon() {
+#if defined(__APPLE_QUARTZ__)
+void fltk3::QuartzGraphicsDriver::end_polygon() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
   fixloop();
   if (n < 3) {
     end_line();
     return;
   }
-#if defined(USE_X11)
-  if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, Convex, 0);
-#elif defined(WIN32)
-  if (n>2) {
-    SelectObject(fl_gc, fl_brush());
-    Polygon(fl_gc, p, n);
-  }
-#elif defined(__APPLE_QUARTZ__)
   if (n<=1) return;
   CGContextSetShouldAntialias(fl_gc, true);
   CGContextMoveToPoint(fl_gc, p[0].x, p[0].y);
@@ -193,10 +212,33 @@
   CGContextClosePath(fl_gc);
   CGContextFillPath(fl_gc);
   CGContextSetShouldAntialias(fl_gc, false);
+}
+#elif defined(WIN32)
+void fltk3::GDIGraphicsDriver::end_polygon() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
+  fixloop();
+  if (n < 3) {
+    end_line();
+    return;
+  }
+  if (n>2) {
+    SelectObject(fl_gc, fl_brush());
+    Polygon(fl_gc, p, n);
+  }
+}
 #else
-# error unsupported platform
+void fltk3::XlibGraphicsDriver::end_polygon() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
+  fixloop();
+  if (n < 3) {
+    end_line();
+    return;
+  }
+  if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, Convex, 0);
+}
 #endif
-}
 
 void fltk3::GraphicsDriver::begin_complex_polygon() {
   begin_polygon();
@@ -219,20 +261,15 @@
   }
 }
 
-void fltk3::GraphicsDriver::end_complex_polygon() {
+#if defined(__APPLE_QUARTZ__)
+void fltk3::QuartzGraphicsDriver::end_complex_polygon() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
   gap();
   if (n < 3) {
     end_line();
     return;
   }
-#if defined(USE_X11)
-  if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, 0, 0);
-#elif defined(WIN32)
-  if (n>2) {
-    SelectObject(fl_gc, fl_brush());
-    PolyPolygon(fl_gc, p, counts, numcount);
-  }
-#elif defined(__APPLE_QUARTZ__)
   if (n<=1) return;
   CGContextSetShouldAntialias(fl_gc, true);
   CGContextMoveToPoint(fl_gc, p[0].x, p[0].y);
@@ -241,46 +278,82 @@
   CGContextClosePath(fl_gc);
   CGContextFillPath(fl_gc);
   CGContextSetShouldAntialias(fl_gc, false);
+}
+#elif defined(WIN32)
+void fltk3::GDIGraphicsDriver::end_complex_polygon() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
+  gap();
+  if (n < 3) {
+    end_line();
+    return;
+  }
+  if (n>2) {
+    SelectObject(fl_gc, fl_brush());
+    PolyPolygon(fl_gc, p, counts, numcount);
+  }
+}
 #else
-# error unsupported platform
+void fltk3::XlibGraphicsDriver::end_complex_polygon() {
+  int n = vertex_no();
+  XPOINT *p = vertices();
+  gap();
+  if (n < 3) {
+    end_line();
+    return;
+  }
+  if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, 0, 0);
+}
 #endif
+
+void fltk3::GraphicsDriver::prepare_circle(double x, double y, double r, int& 
llx, int& lly, int& w, int& h, double& xt, double& yt)
+{
+  xt = transform_x(x,y);
+  yt = transform_y(x,y);
+  double rx = r * (m.c ? sqrt(m.a*m.a+m.c*m.c) : fabs(m.a));
+  double ry = r * (m.b ? sqrt(m.b*m.b+m.d*m.d) : fabs(m.d));
+  llx = (int)rint(xt-rx);
+  w = (int)rint(xt+rx)-llx;
+  lly = (int)rint(yt-ry);
+  h = (int)rint(yt+ry)-lly;
 }
 
 // shortcut the closed circles so they use XDrawArc:
 // warning: these do not draw rotated ellipses correctly!
 // See fltk3::arc.c for portable version.
 
-void fltk3::GraphicsDriver::circle(double x, double y,double r) {
-  double xt = transform_x(x,y);
-  double yt = transform_y(x,y);
-  double rx = r * (m.c ? sqrt(m.a*m.a+m.c*m.c) : fabs(m.a));
-  double ry = r * (m.b ? sqrt(m.b*m.b+m.d*m.d) : fabs(m.d));
-  int llx = (int)rint(xt-rx);
-  int w = (int)rint(xt+rx)-llx;
-  int lly = (int)rint(yt-ry);
-  int h = (int)rint(yt+ry)-lly;
-
-#if defined(USE_X11)
-  (what == POLYGON ? XFillArc : XDrawArc)
-    (fl_display, fl_window, fl_gc, llx, lly, w, h, 0, 360*64);
+#if defined(__APPLE_QUARTZ__)
+void fltk3::QuartzGraphicsDriver::circle(double x, double y, double r) {
+  int llx, lly, w, h;
+  double xt, yt;
+  prepare_circle(x, y, r, llx, lly, w, h, xt, yt);
+  // Quartz warning: circle won't scale to current matrix!
+  // Last argument must be 0 (counter-clockwise) or it draws nothing under 
__LP64__ !!!!
+  CGContextSetShouldAntialias(fl_gc, true);
+  CGContextAddArc(fl_gc, xt, yt, (w+h)*0.25f, 0, 2.0f*M_PI, 0);
+  (what == POLYGON ? CGContextFillPath : CGContextStrokePath)(fl_gc);
+  CGContextSetShouldAntialias(fl_gc, false);
+}
 #elif defined(WIN32)
+void fltk3::GDIGraphicsDriver::circle(double x, double y, double r) {
+  int llx, lly, w, h;
+  double xt, yt;
+  prepare_circle(x, y, r, llx, lly, w, h, xt, yt);
   if (what==POLYGON) {
     SelectObject(fl_gc, fl_brush());
     Pie(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0); 
   } else
     Arc(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0); 
-#elif defined(__APPLE_QUARTZ__)
-  // Quartz warning: circle won't scale to current matrix!
-  // Last argument must be 0 (counter-clockwise) or it draws nothing under 
__LP64__ !!!!
-  CGContextSetShouldAntialias(fl_gc, true);
-  CGContextAddArc(fl_gc, xt, yt, (w+h)*0.25f, 0, 2.0f*M_PI, 0);
-  (what == POLYGON ? CGContextFillPath : CGContextStrokePath)(fl_gc);
-  CGContextSetShouldAntialias(fl_gc, false);
+}
 #else
-# error unsupported platform
+void fltk3::XlibGraphicsDriver::circle(double x, double y, double r) {
+  int llx, lly, w, h;
+  double xt, yt;
+  prepare_circle(x, y, r, llx, lly, w, h, xt, yt);
+  (what == POLYGON ? XFillArc : XDrawArc)
+  (fl_display, fl_window, fl_gc, llx, lly, w, h, 0, 360*64);
+}
 #endif
-}
-
 //
 // End of "$Id$".
 //

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to