1 | /* avenprcore.h |
---|
2 | * Header file for printer independent parts of Survex printer drivers |
---|
3 | * Copyright (C) 1994-2002,2004,2005 Olly Betts |
---|
4 | * Copyright (C) 2004 Philip Underwood |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 2 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program 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 |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef survex_included_avenprcore_h |
---|
22 | #define survex_included_avenprcore_h |
---|
23 | |
---|
24 | #include "img.h" |
---|
25 | |
---|
26 | extern bool fBlankPage; |
---|
27 | |
---|
28 | struct border { |
---|
29 | long x_min, y_min, x_max, y_max; |
---|
30 | }; |
---|
31 | |
---|
32 | #define PR_FONT_DEFAULT 0 |
---|
33 | #define PR_FONT_LABELS 1 |
---|
34 | |
---|
35 | #define PR_COLOUR_TEXT 0 |
---|
36 | #define PR_COLOUR_LABELS 1 |
---|
37 | #define PR_COLOUR_FRAME 2 |
---|
38 | #define PR_COLOUR_LEG 3 |
---|
39 | #define PR_COLOUR_CROSS 4 |
---|
40 | #define PR_COLOUR_SURFACE_LEG 5 |
---|
41 | |
---|
42 | #define PR_FLAG_NOFILEOUTPUT 1 |
---|
43 | #define PR_FLAG_NOINI 2 |
---|
44 | #define PR_FLAG_CALIBRATE 4 |
---|
45 | |
---|
46 | /* 1:<DEFAULT_SCALE> is the default scale */ |
---|
47 | #define DEFAULT_SCALE 500 |
---|
48 | |
---|
49 | /* Store everything describing the page layout */ |
---|
50 | class layout { |
---|
51 | public: |
---|
52 | /* caller modifiable bits */ |
---|
53 | bool Labels; |
---|
54 | bool Crosses; |
---|
55 | bool Shots; |
---|
56 | bool Surface; |
---|
57 | bool SkipBlank; |
---|
58 | bool Border; |
---|
59 | bool Cutlines; |
---|
60 | bool Raw; |
---|
61 | char *title; |
---|
62 | char *datestamp; |
---|
63 | double Scale; |
---|
64 | int rot, tilt; |
---|
65 | enum {PLAN, ELEV, TILT, EXTELEV} view; |
---|
66 | |
---|
67 | /* internal data, but may be accessed */ |
---|
68 | double scX, scY; |
---|
69 | double xMin, xMax, yMin, yMax; |
---|
70 | double PaperWidth, PaperDepth; |
---|
71 | int pagesX, pagesY, pages; |
---|
72 | double xOrg, yOrg; |
---|
73 | const char* footer; |
---|
74 | |
---|
75 | layout(wxPageSetupDialogData* data); |
---|
76 | #if 0 |
---|
77 | void make_calibration(); |
---|
78 | #endif |
---|
79 | void pick_scale(int x, int y); |
---|
80 | void pages_required(); |
---|
81 | }; |
---|
82 | |
---|
83 | /* things for a back end */ |
---|
84 | void drawticks(border clip, int tick_size, int x, int y); |
---|
85 | |
---|
86 | int as_int(const char *v, char *p, int min_val, int max_val); |
---|
87 | unsigned long as_colour(const char *v, char *p); |
---|
88 | int as_bool(const char *v, char *p); |
---|
89 | double as_double(const char *v, char *p, double min_val, double max_val); |
---|
90 | int as_escstring(const char *v, char *s); |
---|
91 | char *as_string(const char *v, char *p); |
---|
92 | |
---|
93 | #if 0 |
---|
94 | class MainFrm; |
---|
95 | void print_all(MainFrm *m_parent, layout *l, device *pri); |
---|
96 | void print_page(MainFrm *m_parent, layout *l, int page, int pass, int cPasses); |
---|
97 | int next_page(int *pstate, char **q, int pageLim); |
---|
98 | #endif |
---|
99 | |
---|
100 | #endif |
---|