36 PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_plmeta =
"plmeta:PLplot Native Meta-File:0:plmeta:26:plm\n";
42 void plD_line_plm(
PLStream *,
short,
short,
short,
short );
54 #define BUFFER_LEN 256
69 #define DEBUG_PRINT_LOCATION( a ) PrintLocation( pls, a )
71 static void PrintLocation(
PLStream *
pls,
char *tag )
80 plexit(
"PrintLocation (plmeta.c): fgetpos call failed" );
82 pldebug( tag,
"at offset %d in file %s\n",
83 (
int) current_offset, pls->
FileName );
87 #define DEBUG_PRINT_LOCATION( a )
92 #ifndef ENABLE_DYNDRIVERS
155 pls->
dev = calloc( 1, (
size_t)
sizeof (
PLmDev ) );
156 if ( pls->
dev == NULL )
157 plexit(
"plD_init_plm: Out of memory." );
177 WriteFileHeader( pls );
186 DEBUG_PRINT_LOCATION(
"before init" );
197 plD_line_plm(
PLStream *pls,
short x1,
short y1,
short x2,
short y2 )
207 if ( x1 < dev->xmin || x1 > dev->
xmax ||
208 x2 < dev->xmin || x2 > dev->
xmax ||
209 y1 < dev->ymin || y1 > dev->
ymax ||
210 y2 < dev->ymin || y2 > dev->
ymax )
212 pldebug(
"plD_line_plm",
213 "coordinates out of bounds -- \nActual: (%i,%i), (%i,%i) Bounds: (%i,%i,%i,%i)\n",
228 if ( x1 == dev->
xold && y1 == dev->
yold )
257 plD_polyline_plm(
PLStream *pls,
short *xa,
short *ya,
PLINT npts )
270 dev->
xold = xa[npts - 1];
271 dev->
yold = ya[npts - 1];
317 UpdatePrevPagehdr( pls );
330 WritePageInfo( pls, pp_offset );
392 for ( i = 0; i < pls->
ncol0; i++ )
402 for ( i = 0; i < pls->
ncol1; i++ )
463 plm_text( pls, (
EscText *) ptr );
473 plwarn(
"plmeta: Alternate Unicode text handling is not implemented" );
545 if ( args->
xform != NULL )
554 plwarn(
"plmeta: transformation matrix undefined, using a guess" );
572 len = strlen( args->
string );
592 handle_fsetpos_failed(
const char *where,
const char *which,
FPOS_T position )
598 "%s: fsetpos to %s (%lu) failed",
601 (
unsigned long) position );
619 dbug_enter(
"WriteFileHeader(PLStream *pls" );
632 plexit(
"WriteFileHeader: fgetpos call failed" );
705 plexit(
"WritePageInfo (plmeta.c): fgetpos call failed" );
707 UpdateIndex( pls, cp_offset );
752 plexit(
"plD_bop_plm: fgetpos call failed" );
760 pldebug(
"UpdatePrevPagehdr 1 (plmeta.c)",
761 "Location: %d, seeking to: %d\n",
768 handle_fsetpos_failed(
"UpdatePrevPagehdr",
769 "fwbyte_offset", fwbyte_offset );
776 plexit(
"UpdatePrevPagehdr (plmeta.c): fgetpos call failed" );
778 pldebug(
"UpdatePrevPagehdr 2 (plmeta.c)",
779 "Now at: %d, to write: %d\n",
780 (
int) fwbyte_offset, (
int) cp_offset );
793 handle_fsetpos_failed(
"UpdatePrevPagehdr",
794 "fwbyte_offset", fwbyte_offset );
799 pldebug(
"UpdatePrevPagehdr 3 (plmeta.c)",
800 "Value read as: %d\n", read_offset );
808 handle_fsetpos_failed(
"UpdatePrevPagehdr",
809 "cp_offset", cp_offset );
831 pldebug(
"UpdateIndex (plmeta.c)",
832 "Location: %d, seeking to: %d\n",
837 handle_fsetpos_failed(
"UpdateIndex",
843 pldebug(
"UpdateIndex (plmeta.c)",
844 "Location: %d, seeking to: %d\n",
849 handle_fsetpos_failed(
"UpdateIndex",
850 "cp_offset", cp_offset );
PDFstrm * pdf_finit(FILE *file)
void(* plD_line_fp)(struct PLStream_struct *, short, short, short, short)
int pdf_wr_4bytes(PDFstrm *pdfs, U_LONG s)
void plexit(PLCHAR_VECTOR errormsg)
#define PLESC_CONTROL_CHAR
void(* plD_eop_fp)(struct PLStream_struct *)
void(* plD_state_fp)(struct PLStream_struct *, PLINT)
void(* plD_tidy_fp)(struct PLStream_struct *)
int pdf_wr_header(PDFstrm *pdfs, PLCHAR_VECTOR header)
int pdf_wr_string(PDFstrm *pdfs, PLCHAR_VECTOR string)
void plOpenFile(PLStream *pls)
int pdf_wr_2bytes(PDFstrm *pdfs, U_SHORT s)
int pdf_wr_2nbytes(PDFstrm *pdfs, U_SHORT *s, PLINT n)
void plGetFam(PLStream *pls)
void plFamInit(PLStream *pls)
void(* plD_polyline_fp)(struct PLStream_struct *, short *, short *, PLINT)
void(* plD_esc_fp)(struct PLStream_struct *, PLINT, void *)
void(* plD_bop_fp)(struct PLStream_struct *)
enum EscText::@5 text_type
void plP_setpxl(PLFLT xpmm, PLFLT ypmm)
#define PLDLLIMPEXP_DRIVER
static PLStream * pls[PL_NSTREAMS]
void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
int pdf_wr_ieeef(PDFstrm *pdfs, float f)
int pdf_close(PDFstrm *pdfs)
PLDLLIMPEXP_DRIVER void plD_dispatch_init_plm(PLDispatchTable *pdt)
void plwarn(PLCHAR_VECTOR errormsg)
int pdf_rd_4bytes(PDFstrm *pdfs, U_LONG *ps)
plD_polyline_fp pl_polyline
int pdf_wr_1byte(PDFstrm *pdfs, U_CHAR s)
void(* plD_init_fp)(struct PLStream_struct *)