PLplot
5.11.0
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
plcore.h
Go to the documentation of this file.
1
// Contains declarations for core plplot data structures. This file
2
// should be included only by plcore.c.
3
//
4
// Copyright (C) 2004 Andrew Roach
5
// Copyright (C) 2005 Thomas J. Duck
6
//
7
// This file is part of PLplot.
8
//
9
// PLplot is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU Library General Public License as published
11
// by the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
13
//
14
// PLplot is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU Library General Public License for more details.
18
//
19
// You should have received a copy of the GNU Library General Public License
20
// along with PLplot; if not, write to the Free Software
21
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
//
23
//
24
25
#ifndef __PLCORE_H__
26
#define __PLCORE_H__
27
28
#include "
plplotP.h
"
29
#include "
drivers.h
"
30
#include "
plDevs.h
"
31
#include "
disptab.h
"
32
33
#ifdef ENABLE_DYNDRIVERS
34
#ifndef LTDL_WIN32
35
#include <ltdl.h>
36
#else
37
#include "
ltdl_win32.h
"
38
#endif
39
typedef
lt_ptr
( *
PLDispatchInit
)(
PLDispatchTable
*pdt );
40
#else
41
typedef
void
( *
PLDispatchInit
)(
PLDispatchTable
*pdt );
42
#endif
43
44
#ifdef HAVE_LIBUNICODE
45
#include <unicode.h>
46
#endif
47
48
49
// Static function prototypes
50
51
static
const
char
*
utf8_to_ucs4
(
const
char
*ptr,
PLUNICODE
*unichar );
52
static
void
grline
(
short
*,
short
*,
PLINT
);
53
static
void
grpolyline
(
short
*,
short
*,
PLINT
);
54
static
void
grfill
(
short
*,
short
*,
PLINT
);
55
static
void
grgradient
(
short
*,
short
*,
PLINT
);
56
static
void
plSelectDev
(
void
);
57
static
void
pldi_ini
(
void
);
58
static
void
calc_diplt
(
void
);
59
static
void
calc_didev
(
void
);
60
static
void
calc_diori
(
void
);
61
static
void
calc_dimap
(
void
);
62
static
void
plgdevlst
(
const
char
**,
const
char
**,
int
*,
int
);
63
64
static
void
plInitDispatchTable
(
void
);
65
66
static
void
plLoadDriver
(
void
);
67
68
// Static variables
69
70
static
PLINT
xscl
[
PL_MAXPOLY
],
yscl
[
PL_MAXPOLY
];
71
72
static
PLINT
initfont
= 1;
// initial font: extended by default
73
74
static
PLINT
lib_initialized
= 0;
75
76
//--------------------------------------------------------------------------
77
// Allocate a PLStream data structure (defined in plstrm.h).
78
//
79
// This struct contains a copy of every variable that is stream dependent.
80
// Only the first [index=0] stream is statically allocated; the rest
81
// are dynamically allocated when you switch streams (yes, it is legal
82
// to only initialize the first element of the array of pointers).
83
//--------------------------------------------------------------------------
84
85
static
PLStream
pls0
;
// preallocated stream
86
static
PLINT
ipls
;
// current stream number
87
88
static
PLStream
*
pls
[
PL_NSTREAMS
] = { &pls0 };
// Array of stream pointers
89
90
// Current stream pointer. Global, for easier access to state info
91
92
PLDLLIMPEXP_DATA
(
PLStream
) * plsc = &
pls0
;
93
94
// Only now can we include this
95
96
#include "
pldebug.h
"
97
98
//--------------------------------------------------------------------------
99
// Initialize dispatch table.
100
//
101
// Each device is selected by the appropriate define, passed in from the
102
// makefile. When installing plplot you may wish to exclude devices not
103
// present on your system in order to reduce screen clutter.
104
//
105
// If you hit a <CR> in response to the plinit() prompt, you get the FIRST
106
// one active below, so arrange them accordingly for your system (i.e. all
107
// the system-specific ones should go first, since they won't appear on
108
// most systems.)
109
//--------------------------------------------------------------------------
110
111
static
PLDispatchTable
**
dispatch_table
= 0;
112
static
int
npldrivers
= 0;
113
114
static
PLDispatchInit
static_device_initializers
[] = {
115
#ifdef PLD_mac
116
plD_dispatch_init_mac8
,
117
plD_dispatch_init_mac1
,
118
#endif
119
#ifdef PLD_next
120
plD_dispatch_init_nx
,
121
#endif
122
#ifdef PLD_os2pm
123
plD_dispatch_init_os2
,
124
#endif
125
#if defined ( PLD_xwin ) && !defined ( ENABLE_DYNDRIVERS )
126
plD_dispatch_init_xw
,
127
#endif
128
#if defined ( PLD_gnome ) && !defined ( ENABLE_DYNDRIVERS )
129
plD_dispatch_init_gnome
,
130
#endif
131
#if defined ( PLD_gcw ) && !defined ( ENABLE_DYNDRIVERS )
132
plD_dispatch_init_gcw
,
133
#endif
134
#if defined ( PLD_tk ) && !defined ( ENABLE_DYNDRIVERS )
135
plD_dispatch_init_tk
,
136
#endif
137
#if defined ( PLD_linuxvga ) && !defined ( ENABLE_DYNDRIVERS )
138
plD_dispatch_init_vga
,
139
#endif
140
#ifdef PLD_mgr
141
plD_dispatch_init_mgr
,
142
#endif
143
#ifdef PLD_win3
144
plD_dispatch_init_win3
,
145
#endif
146
#if defined ( _MSC_VER ) && defined ( VGA ) // graphics for msc
147
plD_dispatch_init_vga
,
148
#endif
149
#ifdef PLD_bgi
150
plD_dispatch_init_vga
,
151
#endif
152
#ifdef PLD_gnusvga
153
plD_dispatch_init_vga
,
154
#endif
155
#ifdef PLD_tiff
156
plD_dispatch_init_tiff
,
157
#endif
158
#if defined ( PLD_jpg )
159
plD_dispatch_init_jpg
,
160
#endif
161
#if defined ( PLD_bmp ) && !defined ( ENABLE_DYNDRIVERS )
162
plD_dispatch_init_bmp
,
163
#endif
164
#ifdef PLD_emxvga // graphics for emx+gcc
165
plD_dispatch_init_vga
,
166
#endif
167
#if defined ( PLD_xterm ) && !defined ( ENABLE_DYNDRIVERS )
168
plD_dispatch_init_xterm
,
169
#endif
170
#if defined ( PLD_tek4010 ) && !defined ( ENABLE_DYNDRIVERS )
171
plD_dispatch_init_tekt
,
172
#endif
173
#if defined ( PLD_tek4107 ) && !defined ( ENABLE_DYNDRIVERS )
174
plD_dispatch_init_tek4107t
,
175
#endif
176
#if defined ( PLD_mskermit ) && !defined ( ENABLE_DYNDRIVERS )
177
plD_dispatch_init_mskermit
,
178
#endif
179
#if defined ( PLD_versaterm ) && !defined ( ENABLE_DYNDRIVERS )
180
plD_dispatch_init_versaterm
,
181
#endif
182
#if defined ( PLD_vlt ) && !defined ( ENABLE_DYNDRIVERS )
183
plD_dispatch_init_vlt
,
184
#endif
185
#if defined ( PLD_conex ) && !defined ( ENABLE_DYNDRIVERS )
186
plD_dispatch_init_conex
,
187
#endif
188
#if defined ( PLD_dg300 ) && !defined ( ENABLE_DYNDRIVERS )
189
plD_dispatch_init_dg
,
190
#endif
191
#if defined ( PLD_plmeta ) && !defined ( ENABLE_DYNDRIVERS )
192
plD_dispatch_init_plm
,
193
#endif
194
#if defined ( PLD_tek4010f ) && !defined ( ENABLE_DYNDRIVERS )
195
plD_dispatch_init_tekf
,
196
#endif
197
#if defined ( PLD_tek4107f ) && !defined ( ENABLE_DYNDRIVERS )
198
plD_dispatch_init_tek4107f
,
199
#endif
200
#if defined ( PLD_ps ) && !defined ( ENABLE_DYNDRIVERS )
201
plD_dispatch_init_psm
,
202
plD_dispatch_init_psc
,
203
#endif
204
#if defined ( PLD_xfig ) && !defined ( ENABLE_DYNDRIVERS )
205
plD_dispatch_init_xfig
,
206
#endif
207
#if defined ( PLD_ljiip ) && !defined ( ENABLE_DYNDRIVERS )
208
plD_dispatch_init_ljiip
,
209
#endif
210
#if defined ( PLD_ljii ) && !defined ( ENABLE_DYNDRIVERS )
211
plD_dispatch_init_ljii
,
212
#endif
213
#if defined ( PLD_hp7470 ) && !defined ( ENABLE_DYNDRIVERS )
214
plD_dispatch_init_hp7470
,
215
#endif
216
#if defined ( PLD_hp7580 ) && !defined ( ENABLE_DYNDRIVERS )
217
plD_dispatch_init_hp7580
,
218
#endif
219
#if defined ( PLD_lj_hpgl ) && !defined ( ENABLE_DYNDRIVERS )
220
plD_dispatch_init_hpgl
,
221
#endif
222
#if defined ( PLD_imp ) && !defined ( ENABLE_DYNDRIVERS )
223
plD_dispatch_init_imp
,
224
#endif
225
#if defined ( PLD_pbm ) && !defined ( ENABLE_DYNDRIVERS )
226
plD_dispatch_init_pbm
,
227
#endif
228
#if defined ( PLD_png ) && !defined ( ENABLE_DYNDRIVERS )
229
plD_dispatch_init_png
,
230
#endif
231
#if defined ( PLD_jpeg ) && !defined ( ENABLE_DYNDRIVERS )
232
plD_dispatch_init_jpeg
,
233
#endif
234
#if defined ( PLD_gif ) && !defined ( ENABLE_DYNDRIVERS )
235
plD_dispatch_init_gif
,
236
#endif
237
#if defined ( PLD_pstex ) && !defined ( ENABLE_DYNDRIVERS )
238
plD_dispatch_init_pstex
,
239
#endif
240
#if defined ( PLD_ntk ) && !defined ( ENABLE_DYNDRIVERS )
241
plD_dispatch_init_ntk
,
242
#endif
243
#if defined ( PLD_cgm ) && !defined ( ENABLE_DYNDRIVERS )
244
plD_dispatch_init_cgm
,
245
#endif
246
#if defined ( PLD_mem ) && !defined ( ENABLE_DYNDRIVERS )
247
plD_dispatch_init_mem
,
248
#endif
249
#if defined ( PLD_null ) && !defined ( ENABLE_DYNDRIVERS )
250
plD_dispatch_init_null
,
251
#endif
252
#if defined ( PLD_tkwin ) && !defined ( ENABLE_DYNDRIVERS )
253
plD_dispatch_init_tkwin
,
254
#endif
255
#if defined ( PLD_wingcc ) && !defined ( ENABLE_DYNDRIVERS )
256
plD_dispatch_init_wingcc
,
257
#endif
258
#if defined ( PLD_aqt ) && !defined ( ENABLE_DYNDRIVERS )
259
plD_dispatch_init_aqt
,
260
#endif
261
#if defined ( PLD_wxwidgets ) && !defined ( ENABLE_DYNDRIVERS )
262
plD_dispatch_init_wxwidgets
,
263
#endif
264
#if defined ( PLD_wxpng ) && !defined ( ENABLE_DYNDRIVERS )
265
plD_dispatch_init_wxpng
,
266
#endif
267
#if defined ( PLD_svg ) && !defined ( ENABLE_DYNDRIVERS )
268
plD_dispatch_init_svg
,
269
#endif
270
#if defined ( PLD_pdf ) && !defined ( ENABLE_DYNDRIVERS )
271
plD_dispatch_init_pdf
,
272
#endif
273
#if defined ( PLD_psttf ) && !defined ( ENABLE_DYNDRIVERS )
274
plD_dispatch_init_psttfm
,
275
plD_dispatch_init_psttfc
,
276
#endif
277
#if defined ( PLD_xcairo ) && !defined ( ENABLE_DYNDRIVERS )
278
plD_dispatch_init_xcairo
,
279
#endif
280
#if defined ( PLD_pdfcairo ) && !defined ( ENABLE_DYNDRIVERS )
281
plD_dispatch_init_pdfcairo
,
282
#endif
283
#if defined ( PLD_pscairo ) && !defined ( ENABLE_DYNDRIVERS )
284
plD_dispatch_init_pscairo
,
285
#endif
286
#if defined ( PLD_epscairo ) && !defined ( ENABLE_DYNDRIVERS )
287
plD_dispatch_init_epscairo
,
288
#endif
289
#if defined ( PLD_svgcairo ) && !defined ( ENABLE_DYNDRIVERS )
290
plD_dispatch_init_svgcairo
,
291
#endif
292
#if defined ( PLD_pngcairo ) && !defined ( ENABLE_DYNDRIVERS )
293
plD_dispatch_init_pngcairo
,
294
#endif
295
#if defined ( PLD_memcairo ) && !defined ( ENABLE_DYNDRIVERS )
296
plD_dispatch_init_memcairo
,
297
#endif
298
#if defined ( PLD_extcairo ) && !defined ( ENABLE_DYNDRIVERS )
299
plD_dispatch_init_extcairo
,
300
#endif
301
#if defined ( PLD_wincairo ) && !defined ( ENABLE_DYNDRIVERS )
302
plD_dispatch_init_wincairo
,
303
#endif
304
#if defined ( PLD_bmpqt ) && !defined ( ENABLE_DYNDRIVERS )
305
plD_dispatch_init_bmpqt
,
306
#endif
307
#if defined ( PLD_jpgqt ) && !defined ( ENABLE_DYNDRIVERS )
308
plD_dispatch_init_jpgqt
,
309
#endif
310
#if defined ( PLD_pngqt ) && !defined ( ENABLE_DYNDRIVERS )
311
plD_dispatch_init_pngqt
,
312
#endif
313
#if defined ( PLD_ppmqt ) && !defined ( ENABLE_DYNDRIVERS )
314
plD_dispatch_init_ppmqt
,
315
#endif
316
#if defined ( PLD_tiffqt ) && !defined ( ENABLE_DYNDRIVERS )
317
plD_dispatch_init_tiffqt
,
318
#endif
319
#if defined ( PLD_svgqt ) && !defined ( ENABLE_DYNDRIVERS )
320
plD_dispatch_init_svgqt
,
321
#endif
322
#if defined ( PLD_epsqt ) && !defined ( ENABLE_DYNDRIVERS )
323
plD_dispatch_init_epsqt
,
324
#endif
325
#if defined ( PLD_pdfqt ) && !defined ( ENABLE_DYNDRIVERS )
326
plD_dispatch_init_pdfqt
,
327
#endif
328
#if defined ( PLD_qtwidget ) && !defined ( ENABLE_DYNDRIVERS )
329
plD_dispatch_init_qtwidget
,
330
#endif
331
#if defined ( PLD_extqt ) && !defined ( ENABLE_DYNDRIVERS )
332
plD_dispatch_init_extqt
,
333
#endif
334
#if defined ( PLD_memqt ) && !defined ( ENABLE_DYNDRIVERS )
335
plD_dispatch_init_memqt
,
336
#endif
337
NULL
338
};
339
340
static
int
nplstaticdevices
= (
sizeof
(
static_device_initializers
) /
341
sizeof
(
PLDispatchInit
) ) - 1;
342
static
int
npldynamicdevices
= 0;
343
344
//--------------------------------------------------------------------------
345
// Stuff to support the loadable device drivers.
346
//--------------------------------------------------------------------------
347
348
#ifdef ENABLE_DYNDRIVERS
349
typedef
struct
350
{
351
char
*devnam;
352
char
*description;
353
char
*drvnam;
354
char
*tag;
355
int
drvidx;
356
} PLLoadableDevice;
357
358
typedef
struct
359
{
360
char
*drvnam;
361
lt_dlhandle
dlhand;
362
} PLLoadableDriver;
363
364
static
PLLoadableDevice *loadable_device_list;
365
static
PLLoadableDriver *loadable_driver_list;
366
367
static
int
nloadabledrivers = 0;
368
369
#endif
370
371
#endif // __PLCORE_H__
plplot_source
include
plcore.h
Generated on Sun Apr 12 2015 03:08:36 for PLplot by
1.8.1.2