g2: g2_PS_P.h Source File

- Main Page
- Modules
- Files
- Related Pages

# g2_PS_P.h

    00001 /*****************************************************************************
    00002 **  This is part of the g2 library
    00003 **  Copyright (C) 1998  Ljubomir Milanovic & Horst Wagner
    00004 **
    00005 **  This program is free software; you can redistribute it and/or modify
    00006 **  it under the terms of the GNU General Public License (version 2) as
    00007 **  published by the Free Software Foundation.
    00008 **
    00009 **  This program is distributed in the hope that it will be useful,
    00010 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012 **  GNU General Public License for more details.
    00013 **
    00014 **  You should have received a copy of the GNU General Public License
    00015 **  along with this program; if not, write to the Free Software
    00016 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00017 ******************************************************************************/
    00018 #ifndef _G2_PS_P_H
    00019 #define _G2_PS_P_H
    00020
    00021 #include "g2_PS.h"
    00022
    00023
    00024 typedef struct _g2_PS_inks {
    00025     double r;                                   /* red   [0:1] */
    00026     double g;                                   /* green [0:1] */
    00027     double b;                                   /* blue  [0:1] */
    00028 } g2_PS_inks;
    00029
    00030
    00031
    00032 typedef struct _g2_PS_device {
    00033   FILE                    *fp;          /* output file pointer */
    00034   enum g2_PS_paper        paper;        /* paper type */
    00035   enum g2_PS_orientation  orient;       /* page orientation */
    00036   enum g2_PS_format       format;       /* PS or EPSF format */
    00037   long                    width,height; /* width and height for EPSF */
    00038   double                  x1,y1,x2,y2;  /* min. Bounding Box */
    00039   int                     bbox;         /* Bounding Box empty flag */
    00040   double                  w,size;       /* line width/font size (required for Bbox) */
    00041
    00042   g2_PS_inks     *inks;                 /* allocated colors */
    00043   int            N_ink;                 /* number of allocated colors*/
    00044   int            pen;                   /* current pen */
    00045   int            page_counter;          /* page counter ( Clear() ) */
    00046 } g2_PS_device;
    00047
    00048
    00049
    00050 void g2_PS_bbox_add(g2_PS_device *ps,double x,double y,double size);
    00051 int g2_PS_write_file_header(g2_PS_device *psd);
    00052 int g2_PS_delete(int pid, void *pdp);
    00053 int g2_PS_ink(int pid, void *pdp,
    00054               double red, double green, double blue);
    00055 int g2_PS_pen(int pid, void *pdp, int color);
    00056 int g2_PS_set_background(int pid, void *pdp, int color);
    00057 int g2_PS_reset_palette(int pid, void *pdp);
    00058 int g2_PS_clear_palette(int pid, void *pdp);
    00059 int g2_PS_set_line_width(int pid, void *pdp, double w);
    00060 int g2_PS_set_dash(int pid, void *pdp, int N, double *data);
    00061 int g2_PS_set_font_size(int pid, void *pdp, double size);
    00062 int g2_PS_clear(int pid, void *pdp);
    00063 int g2_PS_flush(int pid, void *pdp);
    00064 int g2_PS_plot(int pid, void *pdp, double x, double y);
    00065 int g2_PS_line(int pid, void *pdp, double x1, double y1, double x2, double y2);
    00066 int g2_PS_poly_line(int pid, void *pdp, int N, double *points);
    00067 int g2_PS_polygon(int pid, void *pdp, int N, double *points);
    00068 int g2_PS_filled_polygon(int pid, void *pdp, int N, double *points);
    00069 int g2_PS_rectangle(int pid, void *pdp,
    00070                     double x1, double y1, double x2, double y2);
    00071 int g2_PS_filled_rectangle(int pid, void *pdp,
    00072                            double x1, double y1, double x2, double y2);
    00073 int g2_PS_triangle(int pid, void *pdp,
    00074                    double x1, double y1,
    00075                    double x2, double y2,
    00076                    double x3, double y3);
    00077 int g2_PS_filled_triangle(int pid, void *pdp,
    00078                          double x1, double y1,
    00079                          double x2, double y2,
    00080                          double x3, double y3);
    00081 int g2_PS_arc(int pid, void *pdp,
    00082               double x, double y,
    00083               double r1, double r2,
    00084               double a1, double a2);
    00085 int g2_PS_filled_arc(int pid, void *pdp,
    00086                      double x, double y,
    00087                      double r1, double r2,
    00088                      double a1, double a2);
    00089 int g2_PS_ellipse(int pid, void *pdp,
    00090                   double x, double y,
    00091                   double r1, double r2);
    00092 int g2_PS_filled_ellipse(int pid, void *pdp,
    00093                          double x, double y,
    00094                          double r1, double r2);
    00095 int g2_PS_draw_string(int pid, void *pdp,
    00096                       double x, double y, const char *text);
    00097
    00098 #endif /* _G2_PS_P_H */