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_SLIGHT, |
33 | HINT_MEDIUM, |
34 | HINT_FULL |
35 | } HintMode; |
36 | |
37 | typedef enum { |
38 | SUBPIXEL_DEFAULT, |
39 | SUBPIXEL_RGB, |
40 | SUBPIXEL_BGR, |
41 | SUBPIXEL_VRGB, |
42 | SUBPIXEL_VBGR |
43 | } SubpixelOrder; |
44 | |
45 | typedef enum { |
46 | ANTIALIAS_DEFAULT, |
47 | ANTIALIAS_NONE, |
48 | ANTIALIAS_GRAY, |
49 | ANTIALIAS_SUBPIXEL |
50 | } Antialias; |
51 | |
52 | typedef enum { |
53 | HINT_METRICS_DEFAULT, |
54 | HINT_METRICS_ON, |
55 | HINT_METRICS_OFF |
56 | } HintMetrics; |
57 | |
58 | typedef void (*RenderCallback) (PangoLayout *layout, |
59 | int x, |
60 | int y, |
61 | gpointer cb_context, |
62 | gpointer cb_data); |
63 | typedef void (*TransformCallback) (PangoContext *context, |
64 | PangoMatrix *transform, |
65 | gpointer cb_context, |
66 | gpointer cb_data); |
67 | |
68 | void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN; |
69 | |
70 | void parse_options (int argc, |
71 | char *argv[]); |
72 | void do_output (PangoContext *context, |
73 | RenderCallback render_cb, |
74 | TransformCallback transform_cb, |
75 | gpointer cb_context, |
76 | gpointer cb_data, |
77 | int *width, |
78 | int *height); |
79 | void finalize (void); |
80 | gchar *get_options_string (void); |
81 | |
82 | extern const char *prog_name; |
83 | |
84 | /* handled by viewer-render.c */ |
85 | extern const char *opt_font; |
86 | extern gboolean ; |
87 | extern int opt_margin; |
88 | extern int opt_markup; |
89 | extern gboolean opt_rtl; |
90 | extern double opt_rotate; |
91 | extern gboolean opt_auto_dir; |
92 | extern const char *opt_text; |
93 | extern gboolean opt_waterfall; |
94 | extern int opt_width; |
95 | extern int opt_indent; |
96 | extern PangoEllipsizeMode opt_ellipsize; |
97 | |
98 | /* handled by viewer-main.c */ |
99 | extern gboolean opt_display; |
100 | extern const char *opt_output; |
101 | extern int opt_runs; |
102 | extern const PangoViewer *opt_viewer; |
103 | |
104 | /* handled by backend-specific code */ |
105 | extern int opt_dpi; |
106 | extern HintMode opt_hinting; |
107 | extern SubpixelOrder opt_subpixel_order; |
108 | extern Antialias opt_antialias; |
109 | extern HintMetrics opt_hint_metrics; |
110 | extern gboolean opt_subpixel_positions; |
111 | extern PangoColor opt_fg_color; |
112 | extern guint16 opt_fg_alpha; |
113 | extern gboolean opt_bg_set; |
114 | extern PangoColor opt_bg_color; |
115 | extern guint16 opt_bg_alpha; |
116 | |
117 | #endif /* VIEWER_RENDER_H */ |
118 | |