- Main Page
- Modules
- Files
- Related Pages

# g2.h

    00001 /*****************************************************************************
    00002 **  Copyright (C) 1998-2005  Ljubomir Milanovic & Horst Wagner
    00003 **  This file is part of the g2 library
    00004 **
    00005 **  This library is free software; you can redistribute it and/or
    00006 **  modify it under the terms of the GNU Lesser General Public
    00007 **  License as published by the Free Software Foundation; either
    00008 **  version 2.1 of the License, or (at your option) any later version.
    00009 **
    00010 **  This library is distributed in the hope that it will be useful,
    00011 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 **  Lesser General Public License for more details.
    00014 **
    00015 **  You should have received a copy of the GNU Lesser General Public
    00016 **  License along with this library; if not, write to the Free Software
    00017 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 ******************************************************************************/
    00019 #ifndef _G2_H
    00020 #define _G2_H
    00021
    00022
    00023 /* g2 version */
    00024 #define G2_VERSION "0.72"
    00025
    00026
    00027 #if defined(__cplusplus)
    00028 extern "C"
    00029 {
    00030 #endif
    00031
    00032 /* Common Library header for DLL and application */
    00033 #ifdef WIN32
    00034 #ifdef G2DLL
    00035 #ifdef MAKEDLL
    00036 /* Create DLL */
    00037 #pragma message( "Building DLL library")
    00038 #define G2L __declspec( dllexport)
    00039 #else
    00040 /* Use DLL */
    00041 #define G2L __declspec( dllimport)
    00042 #endif
    00043 #else
    00044 /* Use static win32 */
    00045 #define G2L
    00046 #endif
    00047 #else
    00048 /* Use non-win32 */
    00049 #define G2L
    00050 #endif
    00051
    00052
    00053 #define G2LD g2_ld()
    00054
    00055 #if defined(SWIG)
    00056 #if defined(DO_X11)
    00057 %include "X11/g2_X11.h"
    00058 #endif
    00059 #if defined(DO_PS)
    00060 %include "PS/g2_PS.h"
    00061 #endif
    00062 #if defined(DO_GD)
    00063 %include "GD/g2_gd.h"
    00064 #endif
    00065 #if defined(DO_WIN32)
    00066 %include "WIN32/g2_win32.h"
    00067 #endif
    00068
    00069 %module g2
    00070
    00071 %include typemaps.i
    00072
    00073 %{
    00074 #include "g2.h"
    00075 #if defined(DO_X11)
    00076 #include "g2_X11.h"
    00077 #endif
    00078 #if defined(DO_PS)
    00079 #include "g2_PS.h"
    00080 #endif
    00081 #if defined(DO_GD)
    00082 #include "g2_gd.h"
    00083 #endif
    00084 #if defined(DO_WIN32)
    00085 #include "WIN32/g2_win32.h"
    00086 #endif
    00087 %}
    00088
    00089 #endif
    00090 /* end SWIG */
    00091
    00092
    00093 enum QPshape {
    00094     QPrect,
    00095     QPcirc
    00096 };
    00097
    00098 /* compatibility with old versions */
    00099 #define g2_draw_string(dev, x, y, text) g2_string((dev), (x), (y), (text))
    00100
    00101
    00102
    00103 G2L int  g2_open_vd(void);
    00104 G2L void g2_attach(int vd_dev, int dev);
    00105 G2L void g2_detach(int vd_dev, int dev);
    00106
    00107 G2L void g2_close(int dev);
    00108 G2L void g2_set_auto_flush(int dev, int on_off);
    00109 G2L void g2_flush(int dev);
    00110 G2L void g2_save(int dev);
    00111 G2L void g2_set_coordinate_system(int dev, double x_origin, double y_origin,
    00112                               double x_mul,    double y_mul);
    00113
    00114 G2L int  g2_ld();
    00115 G2L void g2_set_ld(int dev);
    00116
    00117 G2L int  g2_ink(int pd_dev, double red, double green, double blue);
    00118 G2L void g2_pen(int dev, int color);
    00119 G2L void g2_set_dash(int dev, int N, double *dashes);
    00120 G2L void g2_set_font_size(int dev, double size);
    00121 G2L void g2_set_line_width(int dev, double w);
    00122 G2L void g2_clear_palette(int dev);
    00123 G2L void g2_reset_palette(int dev);
    00124 G2L void g2_allocate_basic_colors(int dev);
    00125
    00126 G2L void g2_clear(int dev);
    00127 G2L void g2_set_background(int dev, int color);
    00128
    00129 G2L void g2_move(int dev, double x, double y);
    00130 G2L void g2_move_r(int dev, double dx, double dy);
    00131
    00132 G2L void g2_plot(int dev, double x, double y);
    00133 G2L void g2_plot_r(int dev, double dx, double dy);
    00134 G2L void g2_line(int dev, double x1, double y1, double x2, double y2);
    00135 G2L void g2_line_r(int dev, double dx, double dy);
    00136 G2L void g2_line_to(int dev, double x, double y);
    00137 G2L void g2_poly_line(int dev, int N_pt, double *points);
    00138 G2L void g2_triangle(int dev, double x1, double y1,
    00139                  double x2, double y2,
    00140                  double x3, double y3);
    00141 G2L void g2_filled_triangle(int dev, double x1, double y1,
    00142                         double x2, double y2,
    00143                         double x3, double y3);
    00144 G2L void g2_rectangle(int dev, double x1, double y1, double x2, double y2);
    00145 G2L void g2_filled_rectangle(int dev,
    00146                              double x1, double y1, double x2, double y2);
    00147 G2L void g2_polygon(int dev, int N_pt, double *points);
    00148 G2L void g2_filled_polygon(int dev, int N_pt, double *points);
    00149 G2L void g2_circle(int dev, double x, double y, double r);
    00150 G2L void g2_filled_circle(int dev, double x, double y, double r);
    00151 G2L void g2_ellipse(int dev, double x, double y, double r1, double r2);
    00152 G2L void g2_filled_ellipse(int dev, double x, double y, double r1, double r2);
    00153 G2L void g2_arc(int dev,
    00154             double x, double y,
    00155             double r1, double r2,
    00156             double a1, double a2);
    00157 G2L void g2_filled_arc(int dev, double x, double y,
    00158                    double r1, double r2,
    00159                    double a1, double a2);
    00160 G2L void g2_string(int dev, double x, double y, const char *text);
    00161 G2L void g2_image(int dev,
    00162                   double x, double y, int x_size, int y_size, int *pens);
    00163
    00164 G2L void g2_set_QP(int dev, double d, enum QPshape shape);
    00165 G2L void g2_plot_QP(int dev, double x, double y);
    00166 #if !defined(SWIG)
    00167 G2L void g2_query_pointer(int dev, double *x, double *y, unsigned int *button);
    00168 #else
    00169 extern void g2_query_pointer(int dev, double *OUTPUT,double *OUTPUT,unsigned int *OUTPUT);
    00170 #endif
    00171
    00172
    00173  /* Tijs Michels */
    00174  /* 06/16/99     */
    00175
    00176 G2L void g2_spline(int id, int n, double *points, int o);
    00177 G2L void g2_b_spline(int id, int n, double *points, int o);
    00178 G2L void g2_raspln(int id, int n, double *points, double tn);
    00179 G2L void g2_para_3(int id, int n, double *points);
    00180 G2L void g2_para_5(int id, int n, double *points);
    00181 G2L void g2_filled_spline(int id, int n, double *points, int o);
    00182 G2L void g2_filled_b_spline(int id, int n, double *points, int o);
    00183 G2L void g2_filled_raspln(int id, int n, double *points, double tn);
    00184 G2L void g2_filled_para_3(int id, int n, double *points);
    00185 G2L void g2_filled_para_5(int id, int n, double *points);
    00186
    00187
    00189 G2L int g2_device_exist(int dix);
    00190
    00192 #define G2_PD_HANDLES_SIZE 32
    00193 G2L void g2_get_pd_handles(int pd, void *handles[G2_PD_HANDLES_SIZE]);
    00194
    00195
    00196 #if defined(__cplusplus)
    00197 } /* end extern "C" */
    00198 #endif
    00199
    00200 #endif /* _G2_H */