source: git/src/avenprcore.h @ 0ce89a4

RELEASE/1.0RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Last change on this file since 0ce89a4 was 311d011, checked in by Olly Betts <olly@…>, 20 years ago

layout structure and functions which work on it turned into a proper class.

Remove "Orientation" radiobox, replacing it with "Plan" and "Elevation"
buttons (which don't yet work).

Sorted out info box on printouts of elevations, tilted views, and extend
elevations.

git-svn-id: file:///home/survex-svn/survex/trunk@2720 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/* avenprcore.h
2 * Header file for printer independent parts of Survex printer drivers
3 * Copyright (C) 1994-2002,2004 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21#include "img.h"
22
23extern bool fBlankPage;
24
25typedef struct {
26   long x_min, y_min, x_max, y_max;
27} border;
28
29#define PR_FONT_DEFAULT 0
30#define PR_FONT_LABELS  1
31
32#define PR_COLOUR_TEXT          0
33#define PR_COLOUR_LABELS        1
34#define PR_COLOUR_FRAME         2
35#define PR_COLOUR_LEG           3
36#define PR_COLOUR_CROSS         4
37#define PR_COLOUR_SURFACE_LEG   5
38
39#define PR_FLAG_NOFILEOUTPUT    1
40#define PR_FLAG_NOINI           2
41#define PR_FLAG_CALIBRATE       4
42
43/* 1:<DEFAULT_SCALE> is the default scale */
44#define DEFAULT_SCALE 500
45
46/* Store everything describing the page layout */
47class layout {
48public:
49    /* caller modifiable bits */
50    bool Labels;
51    bool Crosses;
52    bool Shots;
53    bool Surface;
54    bool SkipBlank;
55    bool Border;
56    bool Cutlines;
57    bool Raw;
58    char *title;
59    char *datestamp;
60    double Scale;
61    int rot, tilt;
62    enum {PLAN, ELEV, TILT, EXTELEV} view;
63
64    /* internal data, but may be accessed */
65    double scX, scY;
66    double xMin, xMax, yMin, yMax;
67    double PaperWidth, PaperDepth;
68    int pagesX, pagesY, pages;
69    double xOrg, yOrg;
70    const char* footer;
71
72    layout();
73#if 0
74    void make_calibration();
75#endif
76    double pick_scale(int x, int y);
77    void pages_required();
78};
79
80/* things for a back end */
81void drawticks(border clip, int tick_size, int x, int y);
82
83int as_int(const char *v, char *p, int min_val, int max_val);
84unsigned long as_colour(const char *v, char *p);
85int as_bool(const char *v, char *p);
86double as_double(const char *v, char *p, double min_val, double max_val);
87int as_escstring(const char *v, char *s);
88char *as_string(const char *v, char *p);
89
90#if 0
91class MainFrm;
92void print_all(MainFrm *m_parent, layout *l, device *pri);
93void print_page(MainFrm *m_parent, layout *l, int page, int pass, int cPasses);
94int next_page(int *pstate, char **q, int pageLim);
95#endif
Note: See TracBrowser for help on using the repository browser.