~ubuntu-branches/debian/wheezy/cuneiform/wheezy

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rfrmt/h/creatertf.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-07-10 17:58:10 UTC
  • Revision ID: james.westby@ubuntu.com-20090710175810-rqc89d2i3tki9m89
Tags: upstream-0.7.0+dfsg
ImportĀ upstreamĀ versionĀ 0.7.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (c) 1993-2008, Cognitive Technologies
 
3
All rights reserved.
 
4
 
 
5
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½,
 
6
ļæ½ļæ½ļæ½ ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½:
 
7
 
 
8
      * ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
9
        ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
10
        ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
 
11
      * ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½
 
12
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
13
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½
 
14
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
 
15
      * ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ Cognitive Technologies, ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½
 
16
        ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
17
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
18
        ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
 
19
 
 
20
ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ "ļæ½ļæ½ļæ½
 
21
ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½" ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½-ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
 
22
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ ļæ½ļæ½
 
23
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½. ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
24
ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½
 
25
ļæ½ļæ½ŃØļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½
 
26
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
27
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ (ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
 
28
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½-ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
29
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½/ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½,
 
30
ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½), ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½
 
31
ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½.
 
32
 
 
33
Redistribution and use in source and binary forms, with or without modification,
 
34
are permitted provided that the following conditions are met:
 
35
 
 
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.
 
44
 
 
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.
 
55
*/
 
56
 
 
57
// ============================================================================
 
58
// Written by Shahverdiev  Alik
 
59
// This file cration date: 12.08.99
 
60
//
 
61
// CreateRtf.h
 
62
//
 
63
// ============================================================================
 
64
 
 
65
#ifndef __CreateRtf_h__
 
66
#define __CreateRtf_h__
 
67
 
 
68
#include "rtfedwrite.h"
 
69
#include "recdefs.h"
 
70
#include "compat_defs.h"
 
71
 
 
72
#define TIRE                  0x97        //'-'
 
73
 
 
74
//Fragment output types
 
75
#define FOT_SINGLE            0
 
76
#define FOT_FRAME             1
 
77
#define FOT_SINGLE_IN_COLUMN  2
 
78
 
 
79
//Fragment types
 
80
#define FT_TEXT               0
 
81
#define FT_FRAME              1
 
82
#define FT_TABLE              2
 
83
#define FT_PICTURE            3
 
84
 
 
85
//HorizontalColumn types
 
86
#define HC_SingleTerminal     0
 
87
#define HC_AllTerminal        1
 
88
#define HC_FrameAndColumn     2
 
89
#define HC_AllFrame           3
 
90
#define HC_ONLY_PICTURE_TABLE 4
 
91
 
 
92
#define MaxFontSize           72
 
93
#define DefFontSize           24
 
94
#define MAX_BUFFER_SIZE       2048
 
95
#define ChangedKeglSize       6
 
96
 
 
97
//       wFont bits
 
98
#define TG_EDW_SERIF          1      //ļæ½ļæ½ļæ½ļæ½ļæ½.
 
99
#define TG_EDW_GELV           2      //ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½.
 
100
#define TG_EDW_BOLD           4
 
101
#define TG_EDW_ITALIC         16
 
102
#define TG_EDW_UNDERLINE      64
 
103
#define TG_EDW_NARROW         128     // user defined
 
104
 
 
105
#define NOBOLD                0x0004
 
106
#define NOCURSIV              0x0008
 
107
#define NOSIZE                0x0020
 
108
 
 
109
// Formatting Mode
 
110
#define USE_NONE              0x0040   // no formatting
 
111
#define USE_FRAME_AND_COLUMN  0x0001   // use columns & frames
 
112
#define USE_FRAME             0x0002   // use only frames
 
113
 
 
114
// Size A4
 
115
#define DefaultWidthPage      11906
 
116
#define DefaultHeightPage     16838
 
117
 
 
118
#define DefMargL              1800 // Left   margin in twips    (the default is 1800).
 
119
#define DefMargR              1800 // Right  margin in twips    (the default is 1800).
 
120
#define DefMargT              1440 // Top    margin in twips    (the default is 1440).
 
121
#define DefMargB              1440 // Bottom margin in twips    (the default is 1440).
 
122
 
 
123
#define RTF_TP_LEFT_ALLIGN           0 //- ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½
 
124
#define RTF_TP_RIGHT_ALLIGN          1 //- ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½
 
125
#define RTF_TP_LEFT_AND_RIGHT_ALLIGN 2 //- ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
126
#define RTF_TP_CENTER                3 //- ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
127
#define RTF_TP_ONE                   4 //- ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½, ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½ ļæ½ļæ½ļæ½ļæ½
 
128
#define RTF_TP_TYPE_LINE             5 //- ļæ½ļæ½ļæ½ļæ½ļæ½ļæ½
 
129
 
 
130
class  CRtfSector;
 
131
class  CRtfFragment;
 
132
class  CRtfHorizontalColumn;
 
133
class  CRtfVerticalColumn;
 
134
class  CRtfParagraph;
 
135
class  CRtfString;
 
136
class  CRtfWord;
 
137
class  CRtfChar;
 
138
 
 
139
struct RtfPageElementCount
 
140
{
 
141
 WORD  RtfSectors;
 
142
 WORD  RtfTextFragments;
 
143
        WORD  RtfFrameTextFragments;
 
144
 WORD  RtfPictureFragments;
 
145
 WORD  RtfTableFragments;
 
146
 WORD  RtfStrings;
 
147
 WORD  RtfWords;
 
148
 WORD  RtfChars;
 
149
};
 
150
 
 
151
typedef struct tagKEGL {
 
152
   Int16 OldKegl;
 
153
   Int16 NewKegl;
 
154
                        Int16 Count;
 
155
} KEGL;
 
156
 
 
157
#define FONT struct h_font
 
158
FONT { char *family;
 
159
       char *name;
 
160
       Int16 Bold,Italic,Underline;
 
161
     };
 
162
typedef struct hfont_cod {const char *name,*family;} FONT_COD;
 
163
 
 
164
typedef struct RTFLETTER
 
165
{
 
166
                        unsigned char    alternative;          //  ASCII code.  >= ' '.
 
167
                        unsigned char    probability;
 
168
} RTF_LETTER;
 
169
 
 
170
/////////////////////////////////////////////////////////////////////////////
 
171
// Page class
 
172
class CRtfPage //: public CObject
 
173
{
 
174
public:
 
175
         CRtfPage();
 
176
 ~CRtfPage();
 
177
 
 
178
                void                 CRtfPageDelFragments(void);
 
179
  CRtfFragment*        GetNextFragment();
 
180
  BOOL                 ReadInternalFile(FILE *FileNameIn);
 
181
                BOOL                 OpenOutputFile(const char* FileNameOut);
 
182
                void                 CloseOutputFile(void);
 
183
  void                 SetTwips(void);
 
184
                BOOL                 FindPageTree(FILE *FileNameIn, const char* FileNameOut);
 
185
         void                 ReCalcPageWidthAndHeight();
 
186
                BOOL                 WriteHeaderRtf(void);
 
187
         void                 CorrectKegl(void);
 
188
  void                 ChangeKegl(void);
 
189
                void                 AddNewKegl( Int16 OldKegl, Int16 NewKegl );
 
190
  Int16                GetNewKegl( Int16 OldKegl );
 
191
  Int16                GetMinKegl( Int16 OldKegl );
 
192
                void                 AddPictures(void);
 
193
                void                 AddTables(void);
 
194
                void                 AddLines(void);
 
195
                void                 SortUserNumber(void);
 
196
  BOOL                  Write(const char* FileNameOut );
 
197
         BOOL                   Write_USE_NONE( void );
 
198
         BOOL                   Write_USE_FRAME( void );
 
199
         BOOL                   Write_USE_FRAME_AND_COLUMN( void );
 
200
        Int16                   GetFlagAndNumberFragment( BYTE* FragmentType, Int16* CurrentSectorNumber );
 
201
  void                 WriteSectorsHeader(Int16 i);
 
202
  void                 ToPlacePicturesAndTables(void);
 
203
  void                 Rtf_CED_CreatePage(void);
 
204
  void                 Rtf_CED_WriteFormattedEd( const char* FileNameOut, Handle* );
 
205
  WORD                 GetFreeSpaceBetweenSectors(CRtfSector* pRtfSector, CRtfSector* pRtfNextSector);
 
206
  void                 SetPaperSize(Int32 LeftPos,Int32 RightPos,Int32 TopPos,Int32 BottomPos,Int32* PaperW,Int32* PaperH,
 
207
                                                                                                                                                                                                                                        Int32* MargL,Int32* MargR,Int32* MargT,Int32* MargB);
 
208
 
 
209
  /*CObArray*/std::vector<CRtfFragment*>                    m_arFragments;
 
210
  /*CObArray*/std::vector<CRtfSector*>              m_arSectors;
 
211
  /*CArray <KEGL,KEGL>*/std::vector<KEGL>   arKegls;
 
212
 
 
213
                RtfPageElementCount  Count;
 
214
         WORD                 m_wDpi;
 
215
                float                m_fTwips;
 
216
  RECT                 m_rect;
 
217
  RECT                 m_rectReal;
 
218
  Int32                PaperW;
 
219
                Int32                PaperH;
 
220
                Int32                MargL;
 
221
                Int32                MargR;
 
222
                Int32                MargT;
 
223
                Int32                MargB;
 
224
 
 
225
                Int32                InitMargL;
 
226
                Int32                InitMargR;
 
227
                Int32                InitMargT;
 
228
                Int32                InitMargB;
 
229
 
 
230
                BYTE                 FlagBadColumn;
 
231
  int                           m_nIndex;
 
232
  int                  m_nCurSectorNumber;
 
233
  int                  m_nPrevSectorNumber;
 
234
  Handle               m_hED;
 
235
};
 
236
 
 
237
/////////////////////////////////////////////////////////////////////////////
 
238
// Fragment class
 
239
class CRtfFragment//:public CObject
 
240
{
 
241
public:
 
242
  CRtfFragment();
 
243
 ~CRtfFragment();
 
244
 
 
245
  CRtfPage*            pRtfParent;
 
246
  CRtfString*          GetFirstString();
 
247
  CRtfString*          GetNextString();
 
248
  BOOL                 Write(RtfSectorInfo* SectorInfo);
 
249
  void                 InitFragment(RtfSectorInfo* SectorInfo);
 
250
  void                 SetFragmentAlignment(RtfSectorInfo* SectorInfo);
 
251
  void                 new_paragraph( BOOL OutPutType );
 
252
  BOOL                 FWriteText(Int16 NumberCurrentFragment,RtfSectorInfo* SectorInfo, BOOL OutPutType);
 
253
  BOOL                 FWriteTable(Int16 NumberCurrentFragment,RtfSectorInfo* SectorInfo, BOOL OutPutType);
 
254
  BOOL                 FWritePicture(Int16 NumberCurrentFragment,RtfSectorInfo* SectorInfo, BOOL OutPutType);
 
255
 
 
256
  BOOL                 ProcessingUseNoneMode(void);
 
257
  void                 Init(RtfSectorInfo* SectorInfo);
 
258
  void                 ReInit(RtfSectorInfo* SectorInfo, int beg, int end);
 
259
  BOOL                 ProcessingOverLayedFragment(RtfSectorInfo* SectorInfo);
 
260
  BOOL                 DeterminationOfCentreJustification(int beg, int end);
 
261
  BOOL                 DeterminationOfRightJustification(int beg, int end);
 
262
  BOOL                 DeterminationOfListType(int beg, int end);
 
263
  void                 Done(void);
 
264
 
 
265
  BOOL                 DeterminationOfMixedFragment(RtfSectorInfo* SectorInfo);
 
266
  void                 GetNextFragmentBegEnd(Int32* beg, Int32* end, BOOL* Flag);
 
267
 
 
268
  BOOL                 DeterminationOfLeftRightJustification(int beg, int end);
 
269
  BOOL                 CheckLeftRightJustification(int beg, int end);
 
270
  void                 SetFlagBeginParagraphForLeftRightJustification(int beg, int end);
 
271
  BOOL                 CheckStringForLeftRightJustification(int ns);
 
272
 
 
273
  BOOL                 DeterminationOfLeftJustification(int beg, int end, BOOL direct);
 
274
  BOOL                 CheckLeftJustification(int beg, int end);
 
275
  void                 SetFlagBeginParagraphForLeftJustification(int beg, int end);
 
276
  BOOL                 CheckStringForLeftJustification(int ns);
 
277
 
 
278
  void                 CheckOnceAgainImportancesFlagBeginParagraph(void);
 
279
  void                 DefineLineTransfer(void);
 
280
  int                  GetCountLine(int beg);
 
281
  void                 SetLineTransfer(int beg, int end);
 
282
  void                 SetFirstLeftAndRightIndentOfParagraph(void);
 
283
  void                 CorrectIndents(int beg, int end);
 
284
  void                 SetParagraphAlignment(int beg, int end, int AlignType);
 
285
  void                 CalculationLengthAndCount(CRtfString* pRtfString, Int32* CountChars, Int32* LengthChars);
 
286
  void                 GetCountEqual(int beg, int end, WORD* Count, int AlignType);
 
287
  BOOL                 GetFlagCarry(int beg, int end);
 
288
  BOOL                 GetFlagLeft(int beg, int end);
 
289
  BOOL                 GetFlagStrongLeft(int beg, int end);
 
290
  BOOL                 GetFlagRight(int beg, int end);
 
291
  BOOL                 GetFlagBigSpace(int beg, int end);
 
292
  BOOL                 CheckNumber(BYTE FirstChar);
 
293
 
 
294
  void                 PrintTheResult(const char*);
 
295
 
 
296
  /*CObArray*/std::vector<CRtfString*>             m_arStrings;
 
297
 
 
298
  WORD                     m_wStringsCount;
 
299
  WORD                 m_wIndex;
 
300
  RECT                 m_rect;
 
301
  RECT                 m_rectReal;
 
302
  RECT                m_rectFree;
 
303
  WORD                 m_wType;
 
304
  DWORD                m_wInternalNumber;
 
305
  DWORD                m_wUserNumber;
 
306
  DWORD                m_wUserNumberForFormattedMode;
 
307
  LONG                 m_LeftOffsetFragmentFromVerticalColumn;
 
308
  LONG                 m_RightOffsetFragmentFromVerticalColumn;
 
309
  WORD                 m_wOffsetFromPrevTextFragment;
 
310
 
 
311
  WORD                 m_wBegStr;
 
312
  WORD                 m_wEndStr;
 
313
 
 
314
  BOOL                 m_bFlagObjectInColumn;
 
315
  BOOL                 m_bFlagUsed;
 
316
  BOOL                 m_bOutPutType;
 
317
  BOOL                 m_bflag_new_column;
 
318
  BOOL                 m_bflag_new_parag;
 
319
  BOOL                 m_bflag_new_str;
 
320
  BOOL                 m_bflag_new_line;
 
321
  BOOL                 m_bflag_change;
 
322
  BOOL                 m_bflag_LineTransfer;
 
323
  WORD                 m_wprev_font_name;
 
324
  WORD                 m_wprev_Underline;
 
325
  WORD                 m_wprev_Bold;
 
326
  WORD                 m_wprev_Italic;
 
327
  WORD                 m_wprev_lang;
 
328
  WORD                 m_wprev_font_size;
 
329
  WORD                 m_wvid_parag;
 
330
 
 
331
  WORD                 m_CountLeftEqual;
 
332
  WORD                 m_CountRightEqual;
 
333
  WORD                 m_CountLeftRightEqual;
 
334
  WORD                 m_CountCentreEqual;
 
335
 
 
336
  Int16                m_l_fragment;
 
337
  Int16                m_r_fragment;
 
338
  Int16                m_l_fragmentLocal;
 
339
  Int16                m_r_fragmentLocal;
 
340
 
 
341
  Int16                m_LengthStringInTwips;
 
342
  Int16                m_WidthVerticalColumn;
 
343
 
 
344
  Int16                m_posx;
 
345
  Int16                m_posy;
 
346
  Int16                m_absw;
 
347
  Int16                m_absh;
 
348
 
 
349
  Int16                m_tmp_fi;
 
350
  Int16                m_li;
 
351
  Int16                m_ri;
 
352
  Int16                m_fi;
 
353
  Int16                m_sb;
 
354
  Int16                m_sa;
 
355
  Int16                m_sl;
 
356
 
 
357
  Int16                m_max_dist;
 
358
  BYTE                 m_Attr;
 
359
  BYTE                 m_FlagCarry;
 
360
  BYTE                 m_FlagLeft;
 
361
  BYTE                 m_FlagStrongLeft;
 
362
  BYTE                 m_FlagRight;
 
363
  BYTE                 m_FlagBigSpace;
 
364
  DWORD                m_Flag;
 
365
};
 
366
 
 
367
/////////////////////////////////////////////////////////////////////////////
 
368
// Sector class
 
369
class CRtfSector//:public CObject
 
370
{
 
371
public:
 
372
         CRtfSector();
 
373
 ~CRtfSector();
 
374
 
 
375
         CRtfPage             *m_PagePtr;
 
376
 
 
377
  BOOL                  Write(void);
 
378
  void                 WriteTerminalColumns(void);
 
379
  void                 WriteNonTerminalColumns(void);
 
380
  void                 WriteTerminalColumnsTablesAndPictures(void);
 
381
  void                 CalcSector(void);
 
382
  Int32                GetCountAndRightBoundVTerminalColumns(void);
 
383
  void                 ToPlacePicturesAndTables(CRtfFragment* Frament);
 
384
  void                 FillingSectorInfo(void);
 
385
 
 
386
  /*CObArray*/std::vector<CRtfHorizontalColumn*>                    m_arHorizontalColumns;
 
387
                vectorWord/*CWordArray*/           m_arHTerminalColumnsIndex;
 
388
                vectorWord/*CWordArray*/           m_arRightBoundTerminalColumns;
 
389
                vectorWord/*CWordArray*/           m_arWidthTerminalColumns;
 
390
  RtfSectorInfo        SectorInfo;
 
391
 
 
392
  WORD                     m_wHorizontalColumnsCount;
 
393
  WORD                     m_wFragmentsCount;
 
394
  WORD                     m_wTextFragmentsCount;
 
395
  WORD                     m_wPictureFragmentsCount;
 
396
  WORD                     m_wTableFragmentsCount;
 
397
  WORD                  m_wIndex;
 
398
  RECT                 m_rect;
 
399
  RECT                 m_rectReal;
 
400
  WORD                  m_wType;
 
401
  Handle               m_hEDSector;
 
402
                BOOL                 m_FlagOneString;
 
403
                BOOL                 m_bFlagLine;
 
404
        Int32                   m_VTerminalColumnNumber;
 
405
};
 
406
 
 
407
/////////////////////////////////////////////////////////////////////////////
 
408
// HorizontalColumn class
 
409
class CRtfHorizontalColumn//:public CObject
 
410
{
 
411
public:
 
412
         CRtfHorizontalColumn();
 
413
 ~CRtfHorizontalColumn();
 
414
 
 
415
         CRtfPage             *m_PagePtr;
 
416
 
 
417
  BOOL                  Write(/*CWordArray*/vectorWord* arRightBoundTerminalColumns, Int32* VTerminalColumnNumber);
 
418
  void                 WriteTerminalColumns(/*CWordArray*/vectorWord* arRightBoundTerminalColumns,
 
419
                                                          Int32* VTerminalColumnNumber,
 
420
                                                                                                                                                                                                                                                                                                                                                                Int32  CountVTerminalColumns,
 
421
                                                                                                                                                                                                                                                                                                                                                                RtfSectorInfo* SectorInfo);
 
422
  void                 WriteFramesInTerminalColumn(RtfSectorInfo* SectorInfo,BOOL FlagFirstTerminalFragment,Int32 TopPositionFirstTerminalFragment);
 
423
                void                 WriteNonTerminalColumns(RtfSectorInfo* SectorInfo);
 
424
  void                 WriteTerminalColumnsTablesAndPictures(RtfSectorInfo *SectorInfo);
 
425
  void                 CalcHorizontalColumn(void);
 
426
  Int32                GetCountAndRightBoundVTerminalColumns(/*CWordArray*/vectorWord* arRightBoundTerminalColumns,vectorWord/*CWordArray*/* arWidthTerminalColumns);
 
427
  void                 FindHeadingAndSetFrameFlag(void);
 
428
  void                 DefineTerminalProperty(void);
 
429
  void                 FillingVTerminalColumnsIndex(void);
 
430
  void                 ToPlacePicturesAndTables(CRtfFragment* Frament);
 
431
  BOOL                  CheckTermColumn(void);
 
432
  void                 SortFragments(void);
 
433
  WORD                 GetFreeSpaceBetweenPrevAndCurrentFragments(int TopPosCurFrag, RtfSectorInfo *SectorInfo);
 
434
  WORD                 GetOffsetFromPrevTextFragment(CRtfFragment *pRtfFragment);
 
435
  BOOL                 GetOverLayedFlag(int CurFragmentNumber);
 
436
  void                 SetFlagObjectInColumnForPageFragment( CRtfFragment* CurFragment );
 
437
 
 
438
  /*CObArray*/std::vector<CRtfVerticalColumn*>              m_arVerticalColumns;
 
439
  /*CObArray*/std::vector<vectorWord*>              m_arVTerminalColumnsGroup;
 
440
  /*CObArray*/std::vector<vectorWord*>              m_arVTerminalColumnsIndex;
 
441
  /*CWordArray*/vectorWord           m_arSpacePlace;
 
442
                /*CByteArray*/std::vector<BYTE>           m_arOrderingNumber;
 
443
 
 
444
  WORD                     m_wVerticalColumnsCount;
 
445
  WORD                  m_wIndex;
 
446
  RECT                 m_rect;
 
447
  RECT                 m_rectReal;
 
448
  WORD                  m_wType;
 
449
};
 
450
 
 
451
/////////////////////////////////////////////////////////////////////////////
 
452
// VerticalColumn class
 
453
class CRtfVerticalColumn//:public CObject
 
454
{
 
455
public:
 
456
         CRtfVerticalColumn();
 
457
 ~CRtfVerticalColumn();
 
458
 
 
459
  BOOL                  Write( BOOL OutPutType ,RtfSectorInfo* SectorInfo);
 
460
  void                 SetSpaceRect(CRtfFragment* CurrentFragment, RtfSectorInfo* SectorInfo);
 
461
 
 
462
  /*CObArray*/std::vector<CRtfFragment*>                    m_arFragments;
 
463
         CRtfPage             *m_PagePtr;
 
464
 
 
465
  WORD                     m_wFragmentsCount;
 
466
  WORD                  m_wIndex;
 
467
                BOOL                 m_bSortFlag;
 
468
  RECT                 m_rect;
 
469
  RECT                 m_rectReal;
 
470
  WORD                  m_wType;
 
471
  BOOL                 m_bFlagObjectInColumn;
 
472
                BOOL                 m_bFlagSmall;
 
473
};
 
474
 
 
475
/////////////////////////////////////////////////////////////////////////////
 
476
// String class
 
477
class CRtfString//:public CObject
 
478
{
 
479
public:
 
480
  CRtfString  ();
 
481
  ~CRtfString ();
 
482
 
 
483
  CRtfWord*            GetFirstWord           (void);
 
484
  CRtfWord*            GetNextWord            (void);
 
485
  BOOL                 Write                  (void);
 
486
  WORD                 get_max_font_size      (void);
 
487
  Int16                GetStringSizeInTwips   (void);
 
488
  WORD                 GetRealStringSize      (void);
 
489
 
 
490
  /*CObArray*/std::vector<CRtfWord*>             m_arWords;
 
491
 
 
492
  WORD                     m_wWordsCount;
 
493
  WORD                 m_wIndex;
 
494
  CRtfFragment*        m_Frag;
 
495
  RECT                 m_rect;
 
496
  WORD                 m_wType;
 
497
 
 
498
 
 
499
  Int32                m_LeftBorder;
 
500
  Int32                m_RightBorder;
 
501
  WORD                 m_wLeftIndent;
 
502
  WORD                 m_wRightIndent;
 
503
  WORD                 m_wCentre;
 
504
  WORD                 m_wFirstIndent;
 
505
  WORD                 m_wFlagBeginParagraph;
 
506
  WORD                 m_wAlignment;
 
507
  WORD                 m_wPrevAlignment;
 
508
  WORD                 m_LengthStringInTwips;
 
509
  WORD                 m_wSpaceBefore;
 
510
  BYTE                 m_wLeftBorderEqual;
 
511
  BYTE                 m_wRightBorderEqual;
 
512
  BYTE                 m_wCentreEqual;
 
513
  BYTE                 m_bLineTransfer;
 
514
  BYTE                 m_LastChar;
 
515
  BYTE                 m_FirstChar;
 
516
  BYTE                 m_Attr;
 
517
  BYTE                 m_FlagCarry;
 
518
  Word32               S_Flags; //NEGA_STR vmk 10-06-2001
 
519
};
 
520
 
 
521
/////////////////////////////////////////////////////////////////////////////
 
522
// Word class
 
523
class CRtfWord//:public CObject
 
524
{
 
525
public:
 
526
         CRtfWord();
 
527
 ~CRtfWord();
 
528
 
 
529
  CRtfChar*            GetFirstChar();
 
530
  CRtfChar*            GetNextChar();
 
531
  BOOL                  Write();
 
532
  void                 get_coordinates_and_probability(void);
 
533
 
 
534
  /*CObArray*/std::vector<CRtfChar*>             m_arChars;
 
535
 
 
536
                WORD                    m_wCharsCount;
 
537
  WORD                  m_wIndex;
 
538
  CRtfString*          m_String;
 
539
  RECT                 m_rect;
 
540
 
 
541
  Int16                m_wcl;
 
542
  Int16                m_wct;
 
543
  Int16                m_wcr;
 
544
  Int16                m_wcb;
 
545
  Int16                m_wcs;
 
546
  Int16                m_wcp;
 
547
 
 
548
  WORD                  m_wFontNumber;
 
549
  WORD                  m_wIdealFontPointSize;
 
550
  WORD                  m_wRealFontPointSize;
 
551
};
 
552
 
 
553
/////////////////////////////////////////////////////////////////////////////
 
554
// Char class
 
555
class CRtfChar//:public CObject
 
556
{
 
557
public:
 
558
         CRtfChar(){};
 
559
 ~CRtfChar(){};
 
560
  BOOL                  Write();
 
561
 
 
562
  struct
 
563
  {
 
564
  BYTE          m_bChar;
 
565
  BYTE          m_bProbability;
 
566
  } m_chrVersions[REC_MAX_VERS];//!!! Art
 
567
  RECT                 m_Idealrect;
 
568
  RECT                 m_Realrect;
 
569
                BYTE                 m_blanguage;
 
570
                BYTE                 m_bFlg_spell;
 
571
                BYTE                 m_bFlg_spell_nocarrying;
 
572
                BYTE                 m_bFlg_cup_drop;
 
573
         WORD                 m_wCountAlt;
 
574
         WORD                 m_wFontNumber;
 
575
  WORD                 m_wFontPointSize;
 
576
  WORD                  m_wIndex;
 
577
 };
 
578
 
 
579
#endif // __CreateRtf_h__