| 1 |
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. |
| 2 |
|
| 3 |
Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata, |
| 4 |
the dvipdfmx project team. |
| 5 |
|
| 6 |
Copyright (C) 1998, 1999 by Mark A. Wicks <[email protected]> |
| 7 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 2 of the License, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with this program; if not, write to the Free Software |
| 20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef _DVI_H_ |
| 24 |
#define _DVI_H_ |
| 25 |
|
| 26 |
#include "error.h" |
| 27 |
#include "numbers.h" |
| 28 |
/* spt_t */ |
| 29 |
#include "pdfdev.h" |
| 30 |
|
| 31 |
/* instantiated in dvipdfmx.c */ |
| 32 |
extern double paper_width, paper_height; |
| 33 |
extern int landscape_mode; |
| 34 |
extern int dvi_ptex_with_vert; |
| 35 |
|
| 36 |
extern double get_origin (int x); |
| 37 |
|
| 38 |
/* returns scale (dvi2pts) */ |
| 39 |
extern double dvi_init (char *dvi_filename, double mag); /* may append .dvi or .xdv to filename */ |
| 40 |
extern void dvi_close (void); /* Closes data structures created by dvi_open */ |
| 41 |
|
| 42 |
extern double dvi_tell_mag (void); |
| 43 |
extern double dvi_unit_size (void); |
| 44 |
extern double dvi_dev_xpos (void); |
| 45 |
extern double dvi_dev_ypos (void); |
| 46 |
extern unsigned int dvi_npages (void); |
| 47 |
extern const char *dvi_comment (void); |
| 48 |
|
| 49 |
extern void dvi_vf_init (int dev_font_id); |
| 50 |
extern void dvi_vf_finish (void); |
| 51 |
|
| 52 |
extern void dvi_set_font (int font_id); |
| 53 |
extern void dvi_set (int32_t ch); |
| 54 |
extern void dvi_rule (int32_t width, int32_t height); |
| 55 |
|
| 56 |
extern void dvi_right (int32_t x); |
| 57 |
extern void dvi_put (int32_t ch); |
| 58 |
extern void dvi_push (void); |
| 59 |
extern void dvi_pop (void); |
| 60 |
extern void dvi_w0 (void); |
| 61 |
extern void dvi_w (int32_t ch); |
| 62 |
extern void dvi_x0 (void); |
| 63 |
extern void dvi_x (int32_t ch); |
| 64 |
extern void dvi_down (int32_t y); |
| 65 |
extern void dvi_y (int32_t ch); |
| 66 |
extern void dvi_y0 (void); |
| 67 |
extern void dvi_z (int32_t ch); |
| 68 |
extern void dvi_z0 (void); |
| 69 |
extern void dvi_dirchg(unsigned char dir); |
| 70 |
|
| 71 |
extern void dvi_do_page (double paper_height, double x_offset, double y_offset); |
| 72 |
extern void dvi_scan_specials (int page_no, |
| 73 |
double *width, double *height, |
| 74 |
double *x_offset, double *y_offset, int *landscape, |
| 75 |
int *majorversion, int *minorversion, |
| 76 |
int *do_enc, int *keybits, int32_t *perm, |
| 77 |
char *opasswd, char *upasswd, int *has_id, unsigned char *id1, unsigned char *id2); |
| 78 |
extern int dvi_locate_font (const char *name, spt_t ptsize); |
| 79 |
|
| 80 |
/* link or nolink: |
| 81 |
* See dvipdfm (not x) user's manual on pdf:link and pdf:nolink. |
| 82 |
* This is workaround for preventing inclusion of pagenation artifact such as |
| 83 |
* footnote and page number in link annotation. |
| 84 |
*/ |
| 85 |
extern void dvi_link_annot (int flag); |
| 86 |
|
| 87 |
/* linkmode |
| 88 |
* To capture \phantom's, DVI "right" instructions are also taken into |
| 89 |
* account in calculation of annotaion rectangle. |
| 90 |
* Mode 1 for catching phantoms. |
| 91 |
* dvi_set_phantom_height() specifies the height of phantom box (default |
| 92 |
* is the current font size). |
| 93 |
*/ |
| 94 |
extern void dvi_set_linkmode (int mode); |
| 95 |
extern void dvi_set_phantom_height (double height, double depth); |
| 96 |
|
| 97 |
/* The followings are for calculating bounding box of text for annotation. |
| 98 |
* DVI uses push/pop to do line-feed-carriage-return. So line breaking is |
| 99 |
* handled by inspecting current depth of DVI register stack. |
| 100 |
*/ |
| 101 |
extern void dvi_tag_depth (void); |
| 102 |
extern void dvi_untag_depth (void); |
| 103 |
extern void dvi_compute_boxes (int flag); |
| 104 |
|
| 105 |
extern void dvi_do_special (const void *buffer, int32_t size); |
| 106 |
|
| 107 |
/* allow other modules (pdfdev) to ask whether we're collecting box areas */ |
| 108 |
extern int dvi_is_tracking_boxes(void); |
| 109 |
|
| 110 |
extern void dvi_set_compensation (double x, double y); |
| 111 |
|
| 112 |
#endif /* _DVI_H_ */ |