1 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
2 
3     Copyright (C) 2007-2014 by Jin-Hwan Cho and Shunsaku Hirata,
4     the dvipdfmx project team.
5 
6     Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
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 _SPECIALS_H_
24 #define _SPECIALS_H_
25 
26 struct spc_env {
27   double x_user, y_user;
28   double mag;
29   long   pg;  /* current page in PDF */
30 };
31 
32 struct spc_arg {
33   const char  *curptr;
34   const char  *endptr;
35   const char  *base;
36 
37   const char  *command;
38 };
39 
40 typedef int  (*spc_handler_fn_ptr) (struct spc_env *, struct spc_arg *);
41 
42 struct spc_handler {
43   const char         *key;
44   spc_handler_fn_ptr  exec;
45 };
46 
47 /* This should not use pdf_. */
48 extern void    spc_set_verbose (void);
49 
50 #include <stdarg.h>
51 extern void    spc_warn (struct spc_env *spe, const char *fmt, ...);
52 
53 #include "pdfobj.h"
54 /* PDF parser shouldn't depend on this...
55  */
56 extern pdf_obj *spc_lookup_reference (const char *ident);
57 extern pdf_obj *spc_lookup_object    (const char *ident);
58 
59 extern int      spc_begin_annot   (struct spc_env *spe, pdf_obj *annot_dict);
60 extern int      spc_end_annot     (struct spc_env *spe);
61 extern int      spc_resume_annot  (struct spc_env *spe);
62 extern int      spc_suspend_annot (struct spc_env *spe);
63 
64 extern void     spc_push_object   (const char *key, pdf_obj *value);
65 extern void     spc_flush_object  (const char *key);
66 extern void     spc_clear_objects (void);
67 
68 extern int      spc_exec_at_begin_page     (void);
69 extern int      spc_exec_at_end_page       (void);
70 extern int      spc_exec_at_begin_document (void);
71 extern int      spc_exec_at_end_document   (void);
72 
73 extern int      spc_exec_special (const char *p, int32_t size,
74 				  double x_user, double y_user, double mag);
75 
76 #endif /* _SPECIALS_H_ */
77