PLplot 5.15.0
Loading...
Searching...
No Matches
null.c
Go to the documentation of this file.
1// PLplot Null device driver.
2//
3#include "plDevs.h"
4
5#ifdef PLD_null
6
7#include "plplotP.h"
8#include "drivers.h"
9
10// Device info
11PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_null = "null:Null device:-1:null:42:null\n";
12
14
15void plD_init_null( PLStream * );
16void plD_line_null( PLStream *, short, short, short, short );
17void plD_polyline_null( PLStream *, short *, short *, PLINT );
18void plD_eop_null( PLStream * );
19void plD_bop_null( PLStream * );
20void plD_tidy_null( PLStream * );
21void plD_state_null( PLStream *, PLINT );
22void plD_esc_null( PLStream *, PLINT, void * );
23
25{
26#ifndef ENABLE_DYNDRIVERS
27 pdt->pl_MenuStr = "Null device";
28 pdt->pl_DevName = "null";
29#endif
31 pdt->pl_seq = 42;
32 pdt->pl_init = (plD_init_fp) plD_init_null;
33 pdt->pl_line = (plD_line_fp) plD_line_null;
34 pdt->pl_polyline = (plD_polyline_fp) plD_polyline_null;
35 pdt->pl_eop = (plD_eop_fp) plD_eop_null;
36 pdt->pl_bop = (plD_bop_fp) plD_bop_null;
37 pdt->pl_tidy = (plD_tidy_fp) plD_tidy_null;
38 pdt->pl_state = (plD_state_fp) plD_state_null;
39 pdt->pl_esc = (plD_esc_fp) plD_esc_null;
40}
41
42//--------------------------------------------------------------------------
43// plD_init_null()
44//
45// Initialize device (terminal).
46//--------------------------------------------------------------------------
47
48void
49plD_init_null( PLStream *PL_UNUSED( pls ) )
50{
51 int xmin = 0;
52 int xmax = PIXELS_X - 1;
53 int ymin = 0;
54 int ymax = PIXELS_Y - 1;
55
56 PLFLT pxlx = (double) PIXELS_X / (double) LPAGE_X;
57 PLFLT pxly = (double) PIXELS_Y / (double) LPAGE_Y;
58
59// Set up device parameters
60
61 plP_setpxl( pxlx, pxly );
62 plP_setphy( xmin, xmax, ymin, ymax );
63}
64
65//--------------------------------------------------------------------------
66// The remaining driver functions are all null.
67//--------------------------------------------------------------------------
68
69void
70plD_line_null( PLStream * PL_UNUSED( pls ), short PL_UNUSED( x1a ), short PL_UNUSED( y1a ), short PL_UNUSED( x2a ), short PL_UNUSED( y2a ) )
71{
72}
73
74void
75plD_polyline_null( PLStream *PL_UNUSED( pls ), short *PL_UNUSED( xa ), short *PL_UNUSED( ya ), PLINT PL_UNUSED( npts ) )
76{
77}
78
79void
80plD_eop_null( PLStream *PL_UNUSED( pls ) )
81{
82}
83
84void
85plD_bop_null( PLStream *PL_UNUSED( pls ) )
86{
87}
88
89void
90plD_tidy_null( PLStream *PL_UNUSED( pls ) )
91{
92}
93
94void
95plD_state_null( PLStream *PL_UNUSED( pls ), PLINT PL_UNUSED( op ) )
96{
97}
98
99void
100plD_esc_null( PLStream *PL_UNUSED( pls ), PLINT PL_UNUSED( op ), void *PL_UNUSED( ptr ) )
101{
102}
103
104#else
105int
107{
108 return 0;
109}
110
111#endif // PLD_nulldev
@ plDevType_Null
Definition disptab.h:15
void(* plD_line_fp)(struct PLStream_struct *, short, short, short, short)
Definition disptab.h:68
void(* plD_tidy_fp)(struct PLStream_struct *)
Definition disptab.h:72
void(* plD_bop_fp)(struct PLStream_struct *)
Definition disptab.h:71
void(* plD_state_fp)(struct PLStream_struct *, PLINT)
Definition disptab.h:73
void(* plD_eop_fp)(struct PLStream_struct *)
Definition disptab.h:70
void(* plD_init_fp)(struct PLStream_struct *)
Definition disptab.h:67
void(* plD_esc_fp)(struct PLStream_struct *, PLINT, void *)
Definition disptab.h:74
void(* plD_polyline_fp)(struct PLStream_struct *, short *, short *, PLINT)
Definition disptab.h:69
PLDLLIMPEXP_DRIVER void plD_dispatch_init_null(PLDispatchTable *pdt)
int pldummy_null()
Definition null.c:106
void plP_setpxl(PLFLT xpmm, PLFLT ypmm)
Definition plcore.c:4238
void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
Definition plcore.c:4249
static PLStream * pls[PL_NSTREAMS]
Definition plcore.h:88
#define PLDLLIMPEXP_DRIVER
Definition pldll.h:81
#define LPAGE_X
Definition plplotP.h:308
#define PIXELS_X
Definition plplotP.h:304
#define LPAGE_Y
Definition plplotP.h:309
#define PIXELS_Y
Definition plplotP.h:305
float PLFLT
Definition plplot.h:163
#define PL_UNUSED(x)
Definition plplot.h:138
int PLINT
Definition plplot.h:181
plD_eop_fp pl_eop
Definition disptab.h:86
const char * pl_DevName
Definition disptab.h:80
plD_esc_fp pl_esc
Definition disptab.h:90
plD_polyline_fp pl_polyline
Definition disptab.h:85
plD_state_fp pl_state
Definition disptab.h:89
plD_tidy_fp pl_tidy
Definition disptab.h:88
plD_line_fp pl_line
Definition disptab.h:84
plD_init_fp pl_init
Definition disptab.h:83
plD_bop_fp pl_bop
Definition disptab.h:87
const char * pl_MenuStr
Definition disptab.h:79