Sindbad~EG File Manager

Current Path : /usr/home/beeson/ThreeBody/
Upload File :
Current File : /usr/home/beeson/ThreeBody/svgGraph3.h

/*
include file for SVG graphics for drwing graphs in Web MathXper.
M. Beeson
2.22.24,
*/

#ifndef svgGraph
#define svgGraph
#define RGB(r,g,b)  ((unsigned int)(r) | ((unsigned int)(g) << 8) | ((unsigned int)(b) << 16))
int svgSymbolText(char *c,  // reason or menu string with TeX-like abbreviations
                   char *svgOut,     // where to write the SVG code
                  int outbuffersize,  // how much space is available
                   int color,   // the color to use as an RGB value
                   int x,       // starting x-coordinate
                   int y,      // starting y-coordinate.  0 for menus, 8 for reasons
                   int fontsizeIn,  // in points
                   int *width   // returned in characters, not pixels or bytes
                  );

typedef struct { int left, right, top, bottom;} rect;
typedef struct { double left, right, top, bottom;} doublerect;
/*_____________________________________________________________________*/
#define HRES  device->numxpixels
#define VRES  device->numypixels
#define ASPECT  get_aspect()
 /* ratio of vertical to horizontal diameter of a perfect circle in pixels */

typedef struct
        {  char *outbuffer;
           char *next;
           int bytesavailable;
           unsigned int pencolor;
           unsigned int backgroundcolor;
           unsigned int graphbackgroundcolor;
           unsigned int textcolor;
           unsigned int bordercolor;
           unsigned int axescolor;
           double linewidth;  // in pixels
           double xmin;  /* world coordinates */
           double xmax;
           double ymin;
           double ymax;
           double numxpixels;  /* width in pixels of the window minus the toolbar */
           double numypixels;  /*  height in pixels of the window (not the viewport) */
           double dxmin; /* normalized device coordinates of viewport */
           double dxmax; /* normalized to 1.0 BOTH DIRECTIONS */
           double dymin; /* device coordinates start in lower left, like world coords */
           double dymax;
           double xPixelsPerInch;
           double yPixelsPerInch;
           double pxmin;  /* pixel coordinates of viewport */
           double pxmax;  /* remember these start in upper left, not lower left */
           double pymin;
           double pymax;
           double aspect;   /* ratio of vertical to horizontal diameter of circle */
           double xfactor;   /* multiply world coordinates by this to get pixels */
           double yfactor;
           double xpixel;   /* multiply device coords by this to get world coords */
           double ypixel;
           double x;     /* current pen position in world coordinates */
           double y;
           int activefont;   /* ROMAN or ITALIC */
           int fontheight;  /* height of one character in device coordinates */
           int fontwidth;   /* width of one (average) character */
           int baseline;    /* distance from top of character box to baseline */
           int lineskip;   /* desired between-line spacing, in device coordinates */
           double xcliplimit, ycliplimit;   /* these values in world
                  coordinates   */
           double ixmin,ixmax,iymin,iymax;  /* the invalid rectangle in pixel coordinates */
         } svgDevice;
         
void set_viewport(double,double,double,double);
void clear_viewport(void);
void set_world(double,double,double,double);
void world_to_pixel(double, double, double *, double *);
void world_to_hdc(double,double, double *, double *);
void begin_path(void);
void begin_path2(char *attr);
void begin_path3(double pvalue, int visibility);
void end_path(void);
void begin_svg(char *class, char *id);
void begin_svg_withrect(char *class, char *id, int top, int left, int width, int height);
void begin_svg_withmyrect(char *class, char *id, int top, int left, int width, int height);
void begin_svgGroup(char *class, char *id);
void end_svgGroup(void);
void end_svg(void);
void set_cliprect(rect r, int graphnumber);
void move_to(double,double);
void move_rel(double,double);
void line_to(double,double);
void line_rel(double,double);
int draw_pixel(double, double, unsigned);
svgDevice *get_device(void);
void relinquish_device(void);
void set_svgDevice( char *outbuffer,
                     // start of buffer eventually to send to PHP
                     int bytesavailable,  // size of that buffer
                     rect *r  // the viewport in pixel coordinates
                   );
void set_graph_decimalpoint(char);
void draw_circle(double,double,double);
void filled_circle(double x,double y,double r,int visibility);
void filled_circle2(double x,double y,double r,int visibility, double parameterValue);
void filled_rect(double,double,double,double);
void polygon(double *, double *, int);
void fill_polygon(double *, double *, int);
void open_circle(double,double,double);
void open_filled_circle(double x, double y, double r, int visibility, double parameterValue);
void open_filled_circle2(double x, double y, double r, int visibility, double parameterValue);
void draw_box(double,double,double,double);
void set_linewidth(double);
double get_linewidth(void);
void svg_colorstring(char colorbuf[32], int rgb);
void text(char *);
void xormode(int);
void set_graphbackgroundcolor(unsigned int x);
void set_graphtextcolor(unsigned int x);
void set_graphpencolor(unsigned int x);
void set_graphaxescolor(unsigned int x);
void set_graphbordercolor(unsigned int x);
unsigned int get_graphbackgroundcolor(void);
unsigned int get_graphtextcolor(void);
unsigned int get_graphpencolor(void);
unsigned int get_graphaxescolor(void);
unsigned int get_graphbordercolor(void);
#define MIN(x,y)  (x) < (y) ? (x) : (y)
typedef struct { double x,y;} POINT;
void svg_polygon(POINT *x, int npoints, unsigned stroke, unsigned fill, double strokewidth);
void svg_rect(double x1, double y1, double x2, double y2, unsigned color);
void svg_filledPolygon(POINT *x, int npoints, unsigned fillcolor);
int svg_unstyledrect(double x1, double y1, double x2, double y2);
void svg_style_rectangles(int rgb);
void svg_filledrect(double x1, double y1, double x2, double y2, unsigned color);
void svg_filledrectwithborderandclass(char *class, double x1, double y1, double x2, double y2, unsigned fillcolor, unsigned bordercolor);
void svg_filledrectwithborder( double x1, double y1, double x2, double y2, unsigned fillcolor, unsigned bordercolor);
void arrow_to(double x, double y);
void defineArrowhead(unsigned rgb);
#endif

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists