Fix severe security issues
[external/pango1.0.git] / pango-view / viewer-render.h
1 /* viewer-render.c: Common code for rendering in viewers
2  *
3  * Copyright (C) 1999, 2004 Red Hat Software
4  * Copyright (C) 2001 Sun Microsystems
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 #ifndef VIEWER_RENDER_H
22 #define VIEWER_RENDER_H
23
24 #include <pango/pango-layout.h>
25
26 #include "viewer.h"
27
28 typedef enum {
29   HINT_DEFAULT,
30   HINT_NONE,
31   HINT_AUTO,
32   HINT_FULL
33 } HintMode;
34
35 typedef void (*RenderCallback) (PangoLayout *layout,
36                                 int          x,
37                                 int          y,
38                                 gpointer     cb_context,
39                                 gpointer     cb_data);
40 typedef void (*TransformCallback) (PangoContext *context,
41                                    PangoMatrix  *transform,
42                                    gpointer      cb_context,
43                                    gpointer      cb_data);
44
45 void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN;
46
47 void   parse_options      (int               argc,
48                            char             *argv[]);
49 void   do_output          (PangoContext     *context,
50                            RenderCallback    render_cb,
51                            TransformCallback transform_cb,
52                            gpointer          cb_context,
53                            gpointer          cb_data,
54                            int              *width,
55                            int              *height);
56 void   finalize           (void);
57 gchar *get_options_string (void);
58
59 extern const char *prog_name;
60
61 /* handled by viewer-render.c */
62 extern const char *opt_font;
63 extern gboolean opt_header;
64 extern int opt_margin;
65 extern int opt_markup;
66 extern gboolean opt_rtl;
67 extern double opt_rotate;
68 extern gboolean opt_auto_dir;
69 extern const char *opt_text;
70 extern gboolean opt_waterfall;
71 extern int opt_width;
72 extern int opt_indent;
73 extern PangoEllipsizeMode opt_ellipsize;
74 extern const char *opt_pangorc;
75
76 /* handled by viewer-main.c */
77 extern gboolean opt_display;
78 extern const char *opt_output;
79 extern int opt_runs;
80 extern const PangoViewer *opt_viewer;
81
82 /* handled by backend-specific code */
83 extern int opt_dpi;
84 extern HintMode opt_hinting;
85 extern PangoColor opt_fg_color;
86 extern guint16 opt_fg_alpha;
87 extern gboolean opt_bg_set;
88 extern PangoColor opt_bg_color;
89 extern guint16 opt_bg_alpha;
90
91 #endif /* VIEWER_RENDER_H */