2001-04-10 23:13:08 +00:00
|
|
|
#ifndef _xdvi_h
|
|
|
|
#define _xdvi_h
|
2000-11-25 15:31:29 +00:00
|
|
|
|
1997-10-18 11:34:02 +00:00
|
|
|
/*
|
|
|
|
* Written by Eric C. Cooper, CMU
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* pixel_conv is currently used only for converting absolute positions
|
|
|
|
* to pixel values; although normally it should be
|
|
|
|
* ((int) ((x) / shrink_factor + (1 << 15) >> 16)),
|
|
|
|
* the rounding is achieved instead by moving the constant 1 << 15 to
|
|
|
|
* PAGE_OFFSET in dvi_draw.c.
|
|
|
|
*/
|
2000-06-09 05:31:11 +00:00
|
|
|
|
2000-05-05 08:18:32 +00:00
|
|
|
#define pixel_conv(x) ((int) ((x) / (shrink_factor * 65536)))
|
|
|
|
#define pixel_round(x) ((int) ROUNDUP(x, shrink_factor * 65536))
|
1997-10-18 11:34:02 +00:00
|
|
|
#define spell_conv0(n, f) ((long) (n * f))
|
|
|
|
#define spell_conv(n) spell_conv0(n, dimconv)
|
|
|
|
|
|
|
|
#ifdef BMBYTE
|
|
|
|
#define BMUNIT unsigned char
|
|
|
|
#define BITS_PER_BMUNIT 8
|
|
|
|
#define BYTES_PER_BMUNIT 1
|
|
|
|
#else /* !BMBYTE */
|
|
|
|
#ifdef BMSHORT
|
|
|
|
#define BMUNIT unsigned short
|
|
|
|
#define BITS_PER_BMUNIT 16
|
|
|
|
#define BYTES_PER_BMUNIT 2
|
|
|
|
#else /* !BMSHORT */
|
|
|
|
#define BMLONG
|
|
|
|
#ifdef __alpha
|
|
|
|
#define BMUNIT unsigned int
|
|
|
|
#else
|
|
|
|
#define BMUNIT unsigned long
|
|
|
|
#endif /* if __alpha */
|
|
|
|
#define BITS_PER_BMUNIT 32
|
|
|
|
#define BYTES_PER_BMUNIT 4
|
|
|
|
#endif /* !BMSHORT */
|
|
|
|
#endif /* !BMBYTE */
|
|
|
|
|
|
|
|
#define ADD(a, b) ((BMUNIT *) (((char *) a) + b))
|
|
|
|
#define SUB(a, b) ((BMUNIT *) (((char *) a) - b))
|
|
|
|
|
|
|
|
extern BMUNIT bit_masks[BITS_PER_BMUNIT + 1];
|
|
|
|
|
2000-02-29 11:27:53 +00:00
|
|
|
|
2000-05-20 05:08:51 +00:00
|
|
|
extern struct drawinf currinf;
|
1997-10-18 11:34:02 +00:00
|
|
|
|
|
|
|
/* entries below with the characters 'dvi' in them are actually stored in
|
|
|
|
scaled pixel units */
|
|
|
|
|
|
|
|
#define DVI_H currinf.data.dvi_h
|
|
|
|
#define PXL_H pixel_conv(currinf.data.dvi_h)
|
|
|
|
#define DVI_V currinf.data.dvi_v
|
|
|
|
#define PXL_V currinf.data.pxl_v
|
|
|
|
#define WW currinf.data.w
|
|
|
|
#define XX currinf.data.x
|
|
|
|
#define YY currinf.data.y
|
|
|
|
#define ZZ currinf.data.z
|
|
|
|
#define ROUNDUP(x,y) (((x)+(y)-1)/(y))
|
|
|
|
|
2000-05-26 00:00:15 +00:00
|
|
|
extern QIntDict<struct font> tn_table;
|
|
|
|
|
1997-10-18 11:34:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Command line flags.
|
|
|
|
*/
|
|
|
|
|
2000-02-29 11:27:53 +00:00
|
|
|
extern int _pixels_per_inch;
|
1997-10-18 11:34:02 +00:00
|
|
|
|
2001-11-16 16:26:38 +00:00
|
|
|
extern unsigned long num (FILE *, int);
|
|
|
|
extern long snum(FILE *, int);
|
1997-10-18 11:34:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define pixels_per_inch _pixels_per_inch
|
|
|
|
|
2001-11-01 09:53:31 +00:00
|
|
|
extern struct WindowRec mane, currwin;
|
1997-10-18 11:34:02 +00:00
|
|
|
|
|
|
|
#define shrink_factor currwin.shrinkfactor
|
|
|
|
|
|
|
|
#define one(fp) ((unsigned char) getc(fp))
|
|
|
|
#define sone(fp) ((long) one(fp))
|
|
|
|
#define two(fp) num (fp, 2)
|
|
|
|
#define stwo(fp) snum(fp, 2)
|
|
|
|
#define four(fp) num (fp, 4)
|
|
|
|
#define sfour(fp) snum(fp, 4)
|
2001-04-10 23:13:08 +00:00
|
|
|
|
|
|
|
#endif /* _xdvi_h */
|