22 #include <sys/types.h>
51 typedef void (*DviFreeFunc)
__PROTO((
void *));
52 typedef
void (*DviFree2Func)
__PROTO((
void *,
void *));
89 typedef
int (*DviColorScale)
__PROTO((
void *device_data,
96 typedef
void *(*DviCreateImage)
__PROTO((
void *device_data,
100 typedef
void (*DviFreeImage)
__PROTO((
void *image));
101 typedef
void (*DviPutPixel)
__PROTO((
void *image,
int x,
int y,
Ulong color));
102 typedef
void (*DviImageDone)
__PROTO((
void *image));
103 typedef
void (*DviDevDestroy)
__PROTO((
void *data));
105 typedef
void (*DviSetColor)
__PROTO((
void *device_data,
Ulong, Ulong));
107 const
char *filename,
158 typedef void (*DviFontShrinkFunc)
161 typedef
int (*DviFontGetGlyphFunc)
__PROTO((DviParams *, DviFont *,
int));
162 typedef
void (*DviFontFreeFunc)
__PROTO((DviFont *));
163 typedef
void (*DviFontResetFunc)
__PROTO((DviFont *));
164 typedef
char *(*DviFontLookupFunc)
__PROTO((const
char *,
Ushort *, Ushort *));
190 #ifdef __STRICT_ANSI__
237 #define ISVIRTUAL(font) ((font)->search.info->getglyph == NULL)
238 #define SEARCH_DONE(s) ((s).id < 0)
239 #define SEARCH_INIT(s, name, h, v) do { \
244 (s).wanted_name = (name); \
245 (s).actual_name = NULL; \
418 typedef void (*DviSpecialHandler)
421 #define RANGE_HAS_LOWER(x) \
422 ((x) == MDVI_RANGE_BOUNDED || (x) == MDVI_RANGE_LOWER)
423 #define RANGE_HAS_UPPER(x) \
424 ((x) == MDVI_RANGE_BOUNDED || (x) == MDVI_RANGE_UPPER)
430 #define MDVI_PARAM_ANTIALIASED 1
431 #define MDVI_PARAM_MONO 2
432 #define MDVI_PARAM_CHARBOXES 4
433 #define MDVI_PARAM_SHOWUNDEF 8
434 #define MDVI_PARAM_DELAYFONTS 16
441 #define MDVI_FONTPRIO_FALLBACK -3
442 #define MDVI_FONTPRIO_LOWEST -2
443 #define MDVI_FONTPRIO_LOW -1
444 #define MDVI_FONTPRIO_NORMAL 0
445 #define MDVI_FONTPRIO_HIGH 1
446 #define MDVI_FONTPRIO_HIGHEST 2
448 #define MDVI_FONT_ENCODED (1 << 0)
450 #define MDVI_GLYPH_EMPTY ((void *)1)
452 #define MDVI_GLYPH_NONEMPTY(x) ((x) && (x) != MDVI_GLYPH_EMPTY)
454 #define MDVI_GLYPH_UNSET(x) ((x) == NULL)
456 #define MDVI_GLYPH_ISEMPTY(x) ((x) == MDVI_GLYPH_EMPTY)
458 #define MDVI_ENABLED(d,x) ((d)->params.flags & (x))
459 #define MDVI_DISABLED(d,x) !MDVI_ENABLED((d), (x))
461 #define MDVI_LASTPAGE(d) ((d)->npages - 1)
462 #define MDVI_NPAGES(d) (d)->npages
463 #define MDVI_VALIDPAGE(d,p) ((p) >= 0 && (p) <= MDVI_LASTPAGE(d))
464 #define MDVI_FLAGS(d) (d)->params.flags
465 #define MDVI_SHRINK_FROM_DPI(d) Max(1, (d) / 75)
466 #define MDVI_CURRFG(d) (d)->curr_fg
467 #define MDVI_CURRBG(d) (d)->curr_bg
469 #define pixel_round(d,v) (int)((d)->params.conv * (v) + 0.5)
470 #define vpixel_round(d,v) (int)((d)->params.vconv * (v) + 0.5)
471 #define rule_round(d,v) (int)((d)->params.conv * (v) + 0.99999)
472 #define vrule_round(d,v) (int)((d)->params.vconv * (v) + 0.99999)
491 #define get_metrics(name) get_font_metrics((name), DviFontAny, NULL)
501 #define mdvi_config_one(d,x,y) mdvi_configure((d), (x), (y), MDVI_PARAM_LAST)
502 #define mdvi_set_dpi(d,x) mdvi_config_one((d), MDVI_SET_DPI, (x))
503 #define mdvi_set_xdpi(d,x) mdvi_config_one((d), MDVI_SET_XDPI, (x))
504 #define mdvi_set_ydpi(d,x) mdvi_config_one((d), MDVI_SET_YDPI, (x))
505 #define mdvi_set_hshrink(d,h) mdvi_config_one((d), MDVI_SET_XSHRINK, (h))
506 #define mdvi_set_vshrink(d,h) mdvi_config_one((d), MDVI_SET_YSHRINK, (h))
507 #define mdvi_set_gamma(d,g) mdvi_config_one((d), MDVI_SET_GAMMA, (g))
508 #define mdvi_set_density(d,x) mdvi_config_one((d), MDVI_SET_DENSITY, (x))
509 #define mdvi_set_drift(d,x) mdvi_config_one((d), MDVI_SET_DRIFT, (x))
510 #define mdvi_set_hdrift(d,h) mdvi_config_one((d), MDVI_SET_HDRIFT, (h))
511 #define mdvi_set_vdrift(d,v) mdvi_config_one((d), MDVI_SET_VDRIFT, (v))
512 #define mdvi_set_mag(d,m) \
513 mdvi_config_one((d), MDVI_SET_MAGNIFICATION, (m))
514 #define mdvi_set_foreground(d,x) \
515 mdvi_config_one((d), MDVI_SET_FOREGROUND, (x))
516 #define mdvi_set_background(d,x) \
517 mdvi_config_one((d), MDVI_SET_BACKGROUND, (x))
518 #define mdvi_set_orientation(d,x) \
519 mdvi_config_one((d), MDVI_SET_ORIENTATION, (x))
520 #define mdvi_set_shrink(d,h,v) \
521 mdvi_configure((d), MDVI_SET_XSHRINK, (h), \
522 MDVI_SET_YSHRINK, (v), MDVI_PARAM_LAST)
544 #define MDVI_FONTSEL_BITMAP (1 << 0)
545 #define MDVI_FONTSEL_GREY (1 << 1)
546 #define MDVI_FONTSEL_GLYPH (1 << 2)
548 #define FONTCHAR(font, code) \
549 (((code) < font->loc || (code) > font->hic || !(font)->chars) ? \
550 NULL : &font->chars[(code) - (font)->loc])
551 #define FONT_GLYPH_COUNT(font) ((font)->hic - (font)->loc + 1)
553 #define glyph_present(x) ((x) && (x)->offset)
558 const char *font_name,
562 Int32 scale_factor));
597 #define font_free_glyph(dev, font, code) \
598 font_reset_one_glyph((dev), \
599 FONTCHAR((font), (code)), MDVI_FONTSEL_GLYPH)
619 #define mdvi_stop_logging(x) mdvi_set_logstream(NULL)
623 extern char* mdvi_getenv
__PROTO((
const char *));