13 PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_impress =
"imp:Impress File:0:impress:37:imp\n";
20 void plD_line_imp(
PLStream *,
short,
short,
short,
short );
36 #define BUFFLENG 2 * BUFFPTS
40 #define SET_HV_SYSTEM 0315
43 #define SET_ABS_H 0207
44 #define SET_ABS_V 0211
52 #define CREATE_PATH 0346
53 #define DRAW_PATH 0352
58 static int penchange = 0, penwidth = 1;
63 #ifndef ENABLE_DYNDRIVERS
114 LineBuff = (
int *) malloc( BUFFLENG *
sizeof (
int ) );
115 if ( LineBuff == NULL )
117 plexit(
"Error in memory alloc in plD_init_imp()." );
119 fprintf( pls->
OutFile,
"@Document(Language ImPress, jobheader off)" );
120 fprintf( pls->
OutFile,
"%c%c", SET_HV_SYSTEM, OPBYTE1 );
121 fprintf( pls->
OutFile,
"%c%c%c", SET_ABS_H, OPWORDH1, OPWORDH2 );
122 fprintf( pls->
OutFile,
"%c%c%c", SET_ABS_V, OPWORDV1, OPWORDV2 );
123 fprintf( pls->
OutFile,
"%c%c", SET_HV_SYSTEM, OPBYTE2 );
133 plD_line_imp(
PLStream *pls,
short x1a,
short y1a,
short x2a,
short y2a )
136 int x1 = x1a, y1 = y1a, x2 = x2a, y2 = y2a;
142 fprintf( pls->
OutFile,
"%c%c", SET_PEN, (
char) penwidth );
150 *( LineBuff +
count++ ) = x1;
151 *( LineBuff +
count++ ) = y1;
152 *( LineBuff +
count++ ) = x2;
153 *( LineBuff +
count++ ) = y2;
155 else if ( (
count + 2 ) < BUFFLENG && x1 == dev->
xold && y1 == dev->
yold )
159 *( LineBuff +
count++ ) = x2;
160 *( LineBuff +
count++ ) = y2;
167 fprintf( pls->
OutFile,
"%c%c%c", CREATE_PATH, (
char)
count / 256, (
char)
count % 256 );
168 fwrite( (
char *) LineBuff,
sizeof (
int ), 2 *
count, pls->
OutFile );
169 fprintf( pls->
OutFile,
"%c%c", DRAW_PATH, OPTYPE );
175 fprintf( pls->
OutFile,
"%c%c", SET_PEN, (
char) penwidth );
179 *( LineBuff +
count++ ) = x1;
180 *( LineBuff +
count++ ) = y1;
181 *( LineBuff +
count++ ) = x2;
182 *( LineBuff +
count++ ) = y2;
195 plD_polyline_imp(
PLStream *pls,
short *xa,
short *ya,
PLINT npts )
199 for ( i = 0; i < npts - 1; i++ )
200 plD_line_imp( pls, xa[i], ya[i], xa[i + 1], ya[i + 1] );
213 fprintf( pls->
OutFile,
"%c", ENDPAGE );
246 free( (
void *) LineBuff );
264 penwidth = pls->
width;
298 fprintf( pls->
OutFile,
"%c%c%c", CREATE_PATH, (
char)
count / 256, (
char)
count % 256 );
299 fwrite( (
char *) LineBuff,
sizeof (
int ), 2 *
count, pls->
OutFile );
300 fprintf( pls->
OutFile,
"%c%c", DRAW_PATH, OPTYPE );
void(* plD_line_fp)(struct PLStream_struct *, short, short, short, short)
void(* plD_eop_fp)(struct PLStream_struct *)
void(* plD_state_fp)(struct PLStream_struct *, PLINT)
void(* plD_tidy_fp)(struct PLStream_struct *)
void plOpenFile(PLStream *pls)
void plCloseFile(PLStream *pls)
void plGetFam(PLStream *pls)
PLDLLIMPEXP_DRIVER void plD_dispatch_init_imp(PLDispatchTable *pdt)
void plFamInit(PLStream *pls)
void(* plD_polyline_fp)(struct PLStream_struct *, short *, short *, PLINT)
PLDev * plAllocDev(PLStream *pls)
void(* plD_esc_fp)(struct PLStream_struct *, PLINT, void *)
void(* plD_bop_fp)(struct PLStream_struct *)
void plP_setpxl(PLFLT xpmm, PLFLT ypmm)
#define PLDLLIMPEXP_DRIVER
void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
plD_polyline_fp pl_polyline
void(* plD_init_fp)(struct PLStream_struct *)
void plexit(const char *errormsg)