File: metadefs.h

package info (click to toggle)
plplot 5.14.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 30,424 kB
  • sloc: ansic: 79,613; xml: 28,583; cpp: 20,037; ada: 19,456; tcl: 12,081; f90: 11,423; ml: 7,276; java: 6,863; python: 6,792; sh: 3,185; perl: 828; lisp: 75; makefile: 48; sed: 33; fortran: 5
file content (110 lines) | stat: -rw-r--r-- 3,208 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//      Geoffrey Furnish
//      5 May 1991
//
//      This file contains definitions of constants and structures which
//      are needed by the PLplot metafile writer and renderer.
//

//
// PLMETA_HEADER holds the magic string at head of metafile.
// PLMETA_VERSION holds the version number (year & letter).
//
// Note: All strings written into the file header are limited to a maximum
// of 80 characters.
//

#define PLMETA_HEADER     "PLPLOT"
#define PLMETA_VERSION    "2005a"

// These are used by the TK driver client/server code

#define PLSERV_HEADER     "PLPLOT"
#define PLSERV_VERSION    "2005b"

// Symbolic constants for old metafile versions (prior to 1992a).
// Now these are stored in the metafile header.

#define PLMETA_X_OLD    10000
#define PLMETA_Y_OLD    10000

// Virtual dots/mm for our virtual display space.

#define PIXEL_RES_X_OLD    42
#define PIXEL_RES_Y_OLD    56

// Macros to make it easier to abort on nonzero return code
// Can't call plexit on a write failure since that would be circular

#define plm_wr( code ) \
    if ( code ) { fprintf( stderr, "Unable to write to MetaFile\n" ); exit( 1 ); }

#define plm_rd( code ) \
    if ( code ) plexit( "Unable to read from MetaFile" )

//
// Metafile commands.
//
//** NOTICE !!! ***
// If you change ANY of the following, you will wreck backward
// backward compatibility with old metafiles.  You may add, but do
// NOT delete !!!
//

#define INITIALIZE          1
#define CLOSE               2
#define SWITCH_TO_TEXT      3   // Obsolete, replaced by ESCAPE
#define SWITCH_TO_GRAPH     4   // Obsolete, replaced by ESCAPE
#define EOP                 5
#define BOP                 6
#define NEW_COLOR           7   // Obsolete, replaced by CHANGE_STATE
#define NEW_WIDTH           8   // Obsolete, replaced by CHANGE_STATE
#define LINE                9
#define LINETO              10
#define ESCAPE              11
#define ADVANCE             12  // Obsolete, BOP/EOP used instead
#define POLYLINE            13
#define NEW_COLOR0          NEW_COLOR
#define NEW_COLOR1          14
#define CHANGE_STATE        15
#define BOP0                16  // First BOP in a file
#define DRIVER_INTERFACE    17
#define SETSUB              18
#define SSUB                19
#define CLIP                20
#define END_OF_FIELD        255

// Data structures

// Metafile index data structure
typedef struct
{
    U_SHORT pages;
} PLmIndex;

// plmeta output device data structure.  Define it here so that
// it can be shared between the input/output modules.
typedef struct
{
    PLFLT   pxlx, pxly;
    PLINT   xold, yold;

    PLINT   xmin, xmax, xlen;
    PLINT   ymin, ymax, ylen;

    FPOS_T  index_offset; // Position of the metafile index
    FPOS_T  lp_offset;    // Position of the previous page

    int     notfirst;

    PLINT   version;    // Metafile version number
    U_SHORT page;       // Current page

    // Metafile coordinates to physical (virtual pixels) coordinates
    // transformation
    PLFLT  mfpcxa, mfpcxb;     // x = mfpcxa * x + mfpcxb
    PLFLT  mfpcya, mfpcyb;     // y = mfpcya * y + mfpcyb

    // Temporary storage used for metafile processing.
    void   * buffer;
    size_t buffer_size;
} PLmDev;