36PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_plmeta =
"plmeta:PLplot Native Meta-File:0:plmeta:26:plm\n";
42void plD_line_plm(
PLStream *,
short,
short,
short,
short );
58static void WriteFileHeader(
PLStream *pls );
59static void UpdatePrevPagehdr(
PLStream *pls );
62static void plm_fill(
PLStream *pls );
63static void plm_swin(
PLStream *pls );
69#define DEBUG_PRINT_LOCATION( a ) PrintLocation( pls, a )
71static 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" );
197plD_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 )
257plD_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" );
569 if ( args->text_type == PL_STRING_TEXT )
572 len = strlen( args->string );
592handle_fsetpos_failed(
const char *where,
const char *which,
FPOS_T position )
594 char buffer[BUFFER_LEN];
597 snprintf( buffer, BUFFER_LEN,
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 );
void(*) plD_polyline_fp(struct PLStream_struct *, short *, short *, PLINT)
void(*) plD_state_fp(struct PLStream_struct *, PLINT)
void(*) plD_line_fp(struct PLStream_struct *, short, short, short, short)
void(*) plD_bop_fp(struct PLStream_struct *)
void(*) plD_init_fp(struct PLStream_struct *)
void(*) plD_tidy_fp(struct PLStream_struct *)
void(*) plD_esc_fp(struct PLStream_struct *, PLINT, void *)
void(*) plD_eop_fp(struct PLStream_struct *)
PLDLLIMPEXP_DRIVER void plD_dispatch_init_plm(PLDispatchTable *pdt)
int pdf_rd_4bytes(PDFstrm *pdfs, U_LONG *ps)
int pdf_wr_4bytes(PDFstrm *pdfs, U_LONG s)
int pdf_wr_ieeef(PDFstrm *pdfs, float f)
int pdf_wr_1byte(PDFstrm *pdfs, U_CHAR s)
int pdf_wr_2bytes(PDFstrm *pdfs, U_SHORT s)
PDFstrm * pdf_finit(FILE *file)
int pdf_wr_header(PDFstrm *pdfs, PLCHAR_VECTOR header)
int pdf_wr_2nbytes(PDFstrm *pdfs, U_SHORT *s, PLINT n)
int pdf_close(PDFstrm *pdfs)
int pdf_wr_string(PDFstrm *pdfs, PLCHAR_VECTOR string)
void plP_setpxl(PLFLT xpmm, PLFLT ypmm)
void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
void plFamInit(PLStream *pls)
void plwarn(PLCHAR_VECTOR errormsg)
void plOpenFile(PLStream *pls)
void plexit(PLCHAR_VECTOR errormsg)
void plGetFam(PLStream *pls)
#define PLDLLIMPEXP_DRIVER
#define PLESC_CONTROL_CHAR
plD_polyline_fp pl_polyline