Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:07:25

0001 /* Copyright (C) 2010, Guy Barrand. All rights reserved. */
0002 /* See the file tools.license for terms.                 */
0003 
0004 #ifndef tools_gl2ps_def_h
0005 #define tools_gl2ps_def_h
0006 
0007 typedef int            tools_GLint;
0008 typedef unsigned int   tools_GLuint;
0009 typedef float          tools_GLfloat;
0010 typedef unsigned int   tools_GLenum;
0011 typedef short          tools_GLshort;
0012 typedef unsigned short tools_GLushort;
0013 typedef int            tools_GLsizei;
0014 typedef unsigned char  tools_GLboolean;
0015 
0016 /*----------------------------------------------------------*/
0017 /*---  from gl2ps.h : --------------------------------------*/
0018 /*----------------------------------------------------------*/
0019 #define TOOLS_GL2PSDLL_API inline
0020 
0021 #define TOOLS_GL2PS_MAJOR_VERSION 1
0022 #define TOOLS_GL2PS_MINOR_VERSION 4
0023 #define TOOLS_GL2PS_PATCH_VERSION 2
0024 #define TOOLS_GL2PS_EXTRA_VERSION ""
0025 
0026 #define TOOLS_GL2PS_VERSION (TOOLS_GL2PS_MAJOR_VERSION + \
0027                        0.01 * TOOLS_GL2PS_MINOR_VERSION + \
0028                        0.0001 * TOOLS_GL2PS_PATCH_VERSION)
0029 
0030 #define TOOLS_GL2PS_COPYRIGHT "(C) 1999-2020 C. Geuzaine"
0031 
0032 /* Output file formats (the values and the ordering are important!) */
0033 
0034 #define TOOLS_GL2PS_PS  0
0035 #define TOOLS_GL2PS_EPS 1
0036 #define TOOLS_GL2PS_TEX 2
0037 #define TOOLS_GL2PS_PDF 3
0038 #define TOOLS_GL2PS_SVG 4
0039 #define TOOLS_GL2PS_PGF 5
0040 
0041 /* Sorting algorithms */
0042 
0043 #define TOOLS_GL2PS_NO_SORT     1
0044 #define TOOLS_GL2PS_SIMPLE_SORT 2
0045 #define TOOLS_GL2PS_BSP_SORT    3
0046 
0047 /* Message levels and error codes */
0048 
0049 #define TOOLS_GL2PS_SUCCESS       0
0050 #define TOOLS_GL2PS_INFO          1
0051 #define TOOLS_GL2PS_WARNING       2
0052 #define TOOLS_GL2PS_ERROR         3
0053 #define TOOLS_GL2PS_NO_FEEDBACK   4
0054 #define TOOLS_GL2PS_OVERFLOW      5
0055 #define TOOLS_GL2PS_UNINITIALIZED 6
0056 
0057 /* Options for tools_gl2psBeginPage */
0058 
0059 #define TOOLS_GL2PS_NONE                 0
0060 #define TOOLS_GL2PS_DRAW_BACKGROUND      (1<<0)
0061 #define TOOLS_GL2PS_SIMPLE_LINE_OFFSET   (1<<1)
0062 #define TOOLS_GL2PS_SILENT               (1<<2)
0063 #define TOOLS_GL2PS_BEST_ROOT            (1<<3)
0064 #define TOOLS_GL2PS_OCCLUSION_CULL       (1<<4)
0065 #define TOOLS_GL2PS_NO_TEXT              (1<<5)
0066 #define TOOLS_GL2PS_LANDSCAPE            (1<<6)
0067 #define TOOLS_GL2PS_NO_PS3_SHADING       (1<<7)
0068 #define TOOLS_GL2PS_NO_PIXMAP            (1<<8)
0069 #define TOOLS_GL2PS_USE_CURRENT_VIEWPORT (1<<9)
0070 #define TOOLS_GL2PS_COMPRESS             (1<<10)
0071 #define TOOLS_GL2PS_NO_BLENDING          (1<<11)
0072 #define TOOLS_GL2PS_TIGHT_BOUNDING_BOX   (1<<12)
0073 #define TOOLS_GL2PS_NO_OPENGL_CONTEXT    (1<<13)
0074 #define TOOLS_GL2PS_NO_TEX_FONTSIZE      (1<<14)
0075 #define TOOLS_GL2PS_PORTABLE_SORT        (1<<15)
0076 
0077 /* Arguments for tools_gl2psEnable/tools_gl2psDisable */
0078 
0079 #define TOOLS_GL2PS_POLYGON_OFFSET_FILL 1
0080 #define TOOLS_GL2PS_POLYGON_BOUNDARY    2
0081 #define TOOLS_GL2PS_LINE_STIPPLE        3
0082 #define TOOLS_GL2PS_BLEND               4
0083 
0084 
0085 /* Arguments for tools_gl2psLineCap/Join */
0086 
0087 #define TOOLS_GL2PS_LINE_CAP_BUTT       0
0088 #define TOOLS_GL2PS_LINE_CAP_ROUND      1
0089 #define TOOLS_GL2PS_LINE_CAP_SQUARE     2
0090 
0091 #define TOOLS_GL2PS_LINE_JOIN_MITER     0
0092 #define TOOLS_GL2PS_LINE_JOIN_ROUND     1
0093 #define TOOLS_GL2PS_LINE_JOIN_BEVEL     2
0094 
0095 /* Text alignment (o=raster position; default mode is BL):
0096    +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o
0097    | o | o   | |   o |   | |   | |   | |   | |   | |   |
0098    +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+
0099     C     CL    CR    B     BL    BR    T     TL    TR */
0100 
0101 #define TOOLS_GL2PS_TEXT_C  1
0102 #define TOOLS_GL2PS_TEXT_CL 2
0103 #define TOOLS_GL2PS_TEXT_CR 3
0104 #define TOOLS_GL2PS_TEXT_B  4
0105 #define TOOLS_GL2PS_TEXT_BL 5
0106 #define TOOLS_GL2PS_TEXT_BR 6
0107 #define TOOLS_GL2PS_TEXT_T  7
0108 #define TOOLS_GL2PS_TEXT_TL 8
0109 #define TOOLS_GL2PS_TEXT_TR 9
0110 
0111 typedef tools_GLfloat tools_GL2PSrgba[4];
0112 typedef tools_GLfloat tools_GL2PSxyz[3];
0113 
0114 typedef struct {
0115   tools_GL2PSxyz xyz;
0116   tools_GL2PSrgba rgba;
0117 } tools_GL2PSvertex;
0118 
0119 /* Primitive types */
0120 #define TOOLS_GL2PS_NO_TYPE          -1
0121 #define TOOLS_GL2PS_TEXT             1
0122 #define TOOLS_GL2PS_POINT            2
0123 #define TOOLS_GL2PS_LINE             3
0124 #define TOOLS_GL2PS_QUADRANGLE       4
0125 #define TOOLS_GL2PS_TRIANGLE         5
0126 #define TOOLS_GL2PS_PIXMAP           6
0127 #define TOOLS_GL2PS_IMAGEMAP         7
0128 #define TOOLS_GL2PS_IMAGEMAP_WRITTEN 8
0129 #define TOOLS_GL2PS_IMAGEMAP_VISIBLE 9
0130 #define TOOLS_GL2PS_SPECIAL          10
0131 
0132 /*----------------------------------------------------------*/
0133 /*--- from OpenGL : ----------------------------------------*/
0134 /*----------------------------------------------------------*/
0135 #define TOOLS_GL_TRUE                           1
0136 #define TOOLS_GL_FALSE                          0
0137 
0138 #define TOOLS_GL_FLOAT              0x1406
0139 #define TOOLS_GL_BLEND              0x0BE2
0140 
0141 #define TOOLS_GL_SRC_ALPHA              0x0302
0142 #define TOOLS_GL_ONE_MINUS_SRC_ALPHA                  0x0303
0143 
0144 #define TOOLS_GL_RGB                    0x1907
0145 #define TOOLS_GL_RGBA                                 0x1908
0146 
0147 #define TOOLS_GL_POINTS                               0x0000
0148 
0149 #define TOOLS_GL_CURRENT_RASTER_POSITION_VALID  0x0B08
0150 #define TOOLS_GL_CURRENT_RASTER_POSITION        0x0B07
0151 #define TOOLS_GL_CURRENT_RASTER_COLOR           0x0B04
0152 #define TOOLS_GL_ZERO                   0
0153 #define TOOLS_GL_ONE                    1
0154 #define TOOLS_GL_COLOR_INDEX                0x1900
0155 
0156 #define TOOLS_GL_POINT_TOKEN                0x0701
0157 #define TOOLS_GL_LINE_TOKEN             0x0702
0158 #define TOOLS_GL_LINE_RESET_TOKEN           0x0707
0159 #define TOOLS_GL_POLYGON_TOKEN          0x0703
0160 #define TOOLS_GL_BITMAP_TOKEN               0x0704
0161 #define TOOLS_GL_DRAW_PIXEL_TOKEN           0x0705
0162 
0163 #define TOOLS_GL_COPY_PIXEL_TOKEN           0x0706
0164 #define TOOLS_GL_PASS_THROUGH_TOKEN         0x0700
0165 
0166 #define TOOLS_GL_FEEDBACK               0x1C01
0167 #define TOOLS_GL_COLOR_CLEAR_VALUE          0x0C22
0168 #define TOOLS_GL_INDEX_CLEAR_VALUE          0x0C20
0169 #define TOOLS_GL_RENDER             0x1C00
0170 #define TOOLS_GL_VIEWPORT               0x0BA2
0171 #define TOOLS_GL_BLEND_SRC              0x0BE1
0172 #define TOOLS_GL_BLEND_DST              0x0BE0
0173 #define TOOLS_GL_3D_COLOR               0x0602
0174 
0175 #define TOOLS_GL_POLYGON_OFFSET_FACTOR      0x8038
0176 #define TOOLS_GL_POLYGON_OFFSET_UNITS           0x2A00
0177 #define TOOLS_GL_LINE_STIPPLE_PATTERN           0x0B25
0178 #define TOOLS_GL_LINE_STIPPLE_REPEAT            0x0B26
0179 
0180 #define TOOLS_GL_ZOOM_X             0x0D16
0181 #define TOOLS_GL_ZOOM_Y             0x0D17
0182 
0183 /*----------------------------------------------------------*/
0184 /*----------------------------------------------------------*/
0185 /*----------------------------------------------------------*/
0186 typedef struct tools_GL2PScontextRec* tools_GL2PScontextPointer;
0187 
0188 typedef tools_GLboolean (*tools_glIsEnabled_func)      (tools_GLenum);
0189 typedef void            (*tools_glBegin_func)          (tools_GLenum);
0190 typedef void            (*tools_glEnd_func)            ();
0191 typedef void            (*tools_glGetFloatv_func)      (tools_GLenum,tools_GLfloat*);
0192 typedef void            (*tools_glVertex3f_func)       (tools_GLfloat,tools_GLfloat,tools_GLfloat);
0193 typedef void            (*tools_glGetBooleanv_func)    (tools_GLenum,tools_GLboolean*);
0194 typedef void            (*tools_glGetIntegerv_func)    (tools_GLenum,tools_GLint*);
0195 typedef tools_GLint     (*tools_glRenderMode_func)     (tools_GLenum);
0196 typedef void            (*tools_glFeedbackBuffer_func) (tools_GLsizei,tools_GLenum,tools_GLfloat*);
0197 typedef void            (*tools_glPassThrough_func)    (tools_GLfloat);
0198 
0199 typedef struct {
0200   tools_glIsEnabled_func      m_glIsEnabled;
0201   tools_glBegin_func          m_glBegin;
0202   tools_glEnd_func            m_glEnd;
0203   tools_glGetFloatv_func      m_glGetFloatv;
0204   tools_glVertex3f_func       m_glVertex3f;
0205   tools_glGetBooleanv_func    m_glGetBooleanv;
0206   tools_glGetIntegerv_func    m_glGetIntegerv;
0207   tools_glRenderMode_func     m_glRenderMode;
0208   tools_glFeedbackBuffer_func m_glFeedbackBuffer;
0209   tools_glPassThrough_func    m_glPassThrough;
0210 } tools_gl2ps_gl_funcs_t;
0211 
0212 #endif