2
Copyright (c) 1993-2008, Cognitive Technologies
5
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½,
6
ļæ½ļæ½ļæ½ ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½:
8
* ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
9
ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
10
ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
11
* ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½
12
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
13
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½
14
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
15
* ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ Cognitive Technologies, ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½
16
ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
17
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
18
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
20
ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ "ļæ½ļæ½ļæ½
21
ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½" ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½-ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
22
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ ļæ½ļæ½
23
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½. ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
24
ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½
25
ļæ½ļæ½ŃØļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½
26
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
27
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ (ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
28
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½-ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
29
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
30
ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½), ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½
31
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
33
Redistribution and use in source and binary forms, with or without modification,
34
are permitted provided that the following conditions are met:
36
* Redistributions of source code must retain the above copyright notice,
37
this list of conditions and the following disclaimer.
38
* Redistributions in binary form must reproduce the above copyright notice,
39
this list of conditions and the following disclaimer in the documentation
40
and/or other materials provided with the distribution.
41
* Neither the name of the Cognitive Technologies nor the names of its
42
contributors may be used to endorse or promote products derived from this
43
software without specific prior written permission.
45
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
49
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
52
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61
#define RTF_DEBUG 0 // 0-off, 1-print, 2-additional lines to ED
68
//*****************************************************************************
69
#define NATURAL unsigned INT
70
#define BYTE unsigned char
73
/* Scan codes for keyboard */
74
#define BACK_SPACE 0x0e
78
#define LEFT_ARROW 0x4b
79
#define RIGHT_ARROW 0x4d
80
#define DOWN_ARROW 0x50
89
typedef struct sheet_disk_descr SDD; // Header of ED-file
90
typedef struct fragm_disk_descr FDD; // Fragment descriptor in header of file
91
typedef struct fragm_disk FD; // Begin-of-fragment record
92
typedef struct line_beg LB; // Begin_of_line record
93
typedef struct bit_map_ref BMR; // Bitmap reference record
95
//*****************************************************************************
100
#define VERT 0x01 // vertical splitting
101
#define HOR 0x02 // horisontal splitting
102
#define NONSP 0x04 // nonsplittable part
103
#define TERM 0x08 // terminal part
104
#define NEW 0x20 // not yet splitted
105
#define NONREST 0x40 // not yet restructed
106
INT x,w,y,h; // coordinates and sizes
107
struct d_dp *parent; // encompassing part
108
struct d_dp *next; // next and previsious parts
109
struct d_dp *prev; // of the same level
110
struct d_dp *first; // first and last subparts
111
struct d_dp *last; // (if not terminal)
112
INT npart; // number of subparts
113
struct d_df *fr1; // first fragment
114
struct d_df *fr2; // next of last fragment
115
INT nfrag; // number of fragments;
118
//*****************************************************************************
119
// Fragment descriptor in memory
122
struct d_df* next; // Next fragment in the chain
123
struct d_df* prev; // Prev fragment in the chain
124
INT x,w; // Horizontal position of alignement borders in TIF
125
INT y,h; // Vertical position
126
FDD* fdd; // FDD address
127
struct d_dl* line1; // First line address
128
struct d_dl* line2; // Last line address
129
struct d_dp* part; // Terminal part adress
130
INT num; // Number of fragment givet automatically
131
INT user_num; // Number of fragment given by user
132
INT lplain; // Width of fragment in ED text mode
134
#define ONE_LINE 0x0001
135
#define LEFT_ALLIGN 0x0002
136
#define RIGHT_ALLIGN 0x0004
137
#define CENTER 0x0008
138
#define POS_INDENT 0x0010
139
#define NEG_INDENT 0x0020
140
#define BULLET 0x0040
142
#define LN_SPACE 0x0100
143
#define NOT_RECOG 0x0200
144
#define BORDER 0x0400
145
#define BRACKET 0x8000
146
#define MCOL_BEG (BRACKET|0x1000)
147
#define NEW_COL (BRACKET|0x2000)
148
#define MCOL_END (BRACKET|0x3000)
149
#define TAB_BEG (BRACKET|0x4000)
150
#define NEW_ROW (BRACKET|0x5000)
151
#define DEL (NOT_RECOG|BORDER)
152
#define FICT_FR_FLAGS (BORDER|BRACKET)
154
INT base; // Regular margin from 'x'
155
INT xmin; // Calculated minimum x-coord for fragment
156
struct d_df *rel_fr; // for centered fragment - centered parent
157
// TAB_BEG - list of cells sizes (x,w)
158
INT pnum; // if TAB_BEG | MCOL_BEG - number of cells/columns
161
#define fict_fr(a) (a->type & (FICT_FR_FLAGS))
166
struct d_dl*next; // Adress of the next line in the column
167
struct d_dl*prev; // Adress of the prev line in the column
168
INT baseline; // 3d baseline position (ideal)
169
INT upper; // Upper boundary of the line
170
BYTE height; // Height beetween 2nd and 3rd baselines
171
BYTE pitch; // Pitch - number of plain characters per inch or 0.
172
INT x,w; // Horizontal position
175
#define NEW_PAR 0x1 // new paragraph
176
#define BUL_PAR 0x2 // paragraph with bullet
177
INT indent; // size of indent (only if paragraph)
178
INT bulind; // size of bullet indent (only if bullet)
179
WORD type; // 0 for deleted line
180
#define DL_HUGE_XW 0x1 // XW changed due to huge letter
181
#define DL_HUGE 0x2 // Huge letter
182
#define DL_ASSEMBLY 0x4 // Line assembled from pieces
183
#define DL_SINGLE 0x8 // Single-letter line
185
BYTE* edbeg; // Address of the ED-text
186
INT edlth; // It's length
187
INT npieces; // Number of original pieces within line - 1
188
INT lplain; // Number of print characters including spaces
191
// RTF segment header
192
// typedef struct d_seg
194
// void* next; // Next segment
195
// void* begtext; // Begin of used space in the segment
196
// void* endtext; // End of used space in the segment
198
// #define SEG_MALLOC 1 // Segment was created by malloc
203
struct line_ref * next;
204
struct line_ref * prev;
213
WORD type; // Copy of fragment's type
217
typedef struct line_ref LREF;
220
//*****************************************************************************
223
INT dpi; // Resolution of scanner in dots per inch
224
INT turn; // Turn of page: turn=(xideal-xreal)/yreal*2048=
225
// =(yreal-yideal)/xreal*2048
226
// Symbol substitutions
227
CHAR subst_bad; // Subst. for not recognized character
228
CHAR subst_dash[3]; // Subst. for dash
231
INT edfile; // ED-file handle
232
BYTE *edbeg; // Begin address of the ED file
233
BYTE *edcur; // Current address in the ED-file
234
BYTE *edfree; // End ptr to ED-file
235
SDD* psdd; // ED header
236
INT font; // Font properties as in ED struct font_kegle
238
#define FONT_SERIFIC 1
239
#define FONT_HELVETIC 2
242
#define FONT_ITALIC 16
243
#define FONT_STRAIGHT 32
244
#define FONT_UNDERLINE 64
247
DP* part; // Table of parts
250
DF* frag; // Table of fragments
251
DF* pf; // Current frag address
252
INT nf; // It's number
253
INT nfrag; // No of fragments
256
DL* line; // Table of lines
257
DL* pl; // Current line desc address
258
INT nl; // It's number
259
INT qlines; // No of lines
261
// Graph of fragments
262
INT* graph; // Array of exits
263
INT qgr; // No of used elements in array
267
INT debug; // 1-debug activated
268
FILE *prt; // Debug print file
270
// External memory pool
274
// Control of dynamic memory taken by malloc's
275
DWORD dynmem_size; // Total count of dynamic memory size
276
INT tables_in_dynamic_memory; // Flag =1 if tables are in dynamic mem
277
INT ed_in_dynamic_memory; // Flag =1 if ED is in dynalic memory
280
// Follow coordinates in TIFF
281
WORD page_pix_width; // page width in pixels
282
WORD page_width; // page width in twips
283
WORD column_width; // current column width
284
WORD column_width_save; // column width saved
285
WORD columns_quant; // number of columns
288
PWORD cells_w; // cell widthes array
289
PWORD cells_x; // x of cells
290
PWORD cells_g; // gaps of cells
291
WORD cells_quant; // number of cells
292
WORD current_cell; // current cell number
293
BYTE section_fill; // non empty section flag
294
BYTE table_flag; // table flag
296
// ED save working area
297
INT Xmin; // Minimal left coordinate of all fragments
298
INT Xmax; // Maximal right coordinate of all fragments
299
PWORD char_tab; // Tabulation table pointer
300
DF ** sort_frag; // List of sorted by upper fragment
301
WORD cn; // Local fragment counter for sortlist
302
INT cy; // Current 'y' for plank
303
INT finy; // Minimal of rows to finish active lines
304
LREF * cfirst; // First fictive element in lines chain
305
LREF * clast; // Last fictive element in lines chain
306
LREF * cfree; // Free lines reference chain start
307
LREF * collect; // Pointer to collect line
309
// Line RTF buffer uses memory for graph during scan of ED file
310
BYTE *rtfbeg; // Address of buffer= address of graph
311
BYTE *rtfcur; // Pointer to free space in the buffer
312
LONG rtflth; // Length of text in buffer
318
BYTE rtf_hugelist[2];
319
#define RTF_LINE_BUF_SIZE sizeof(L.graph)
321
PBYTE hyp_buff; // Pointer to hyphination buffer start
322
PBYTE hyp_ptr; // Pointer to current place in that buffer
323
PBYTE hyp_in_rtf; // Pointer to defis in RTF file if it is last in a string
324
PBYTE hyp_last; // Pointer to last defis in RTF file
325
PBYTE hyp_line_start; // Pointer to first character of a line in RTF file
329
//*****************************************************************************
332
BOOL (*func_spec)(PBYTE p, INT lth),
333
BOOL (*func_char)(PBYTE p, INT lth),
334
PBYTE start, PBYTE end);
339
#define MSG(s) if(L.debug)fprintf(L.prt,"\n" PGM s)
340
#define MSG2(s1,s2) if(L.debug)fprintf(L.prt,"\n" PGM s1,s2)
341
#define MSG3(s1,s2,s3) if(L.debug)fprintf(L.prt,"\n" PGM s1,s2,s3)
342
#define MSG4(s1,s2,s3,s4) if(L.debug)fprintf(L.prt,"\n" PGM s1,s2,s3,s4)
343
#define MSG5(s1,s2,s3,s4,s5) if(L.debug)fprintf(L.prt,"\n" PGM s1,s2,s3,s4,s5)
346
#define MSG2(s1,s2) /* */
347
#define MSG3(s1,s2,s3) /* */
348
#define MSG4(s1,s2,s3,s4) /* */
349
#define MSG5(s1,s2,s3,s4,s5) /* */
351
//*****************************************************************************
352
#define msg_6_1 "RTF: Open error in RTF-file."
353
#define msg_6_2 "RTF: Write error in RTF-file."
354
#define msg_6_3 "RTF: Out of memory." /**/
356
#define msg_6_5 "RTF: Open error in ED-file."
357
#define msg_6_6 "RTF: Read error in ED-file." /**/
358
#define msg_6_7 "RTF: Incorect length of ED-file header."
359
#define msg_6_8 "RTF: Too many lines."
360
#define msg_6_9 "RTF: ED-file is corrupted."
361
#define msg_6_10 "RTF: Too long line."
362
#define msg_6_11 "RTF: Write error in ED-file."
363
#define msg_6_12 "RTF: Too many fragments."
364
#define msg_6_13 "RTF: More fragments in ED-file than shown in header."
365
#define msg_6_14 "RTF: Duplicated fragment in table."