aboutsummaryrefslogtreecommitdiffstats
path: root/docs/design/areas.xml
blob: 11e991834f9b3df98b2ab584b0047f45e3f68eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?xml version = "1.0" encoding = "UTF-8"?>
<section id="areatree">
 <title>Area Tree</title>
	<para>
The code to implement the area tree will attempt to match the areas
defined in the specification. A number of optimisations may be possible
for similar areas and groups of areas.
  </para>
  <para>
Since the area tree will be used during the layout by the layout managers
it will need to store information that affects the layout. The information
such as spacing and keeps will be held in such a way that it can be
discarded once the layout is finalised.
  </para>

<section>
 <title>The Area Tree</title>
  <para>
The area tree is a root element that has a list of page-viewport-areas.
Each page viewport has a page-reference-area which holds the contents of
the page. To handle the processing better FOP does not maintain a list
at the root level but lets another class handle each page as it is added.
  </para>
</section>

<section>
 <title>Page</title>
  <para>
A page is made up of five area regions. These are before, start, body,
end and after. Each region has a viewport and contains the areas
produced from the children in the FO object heirarchy.
  </para>
  <para>
For the body area there are more subdivisions for before floats,
footnotes and the main reference area. The main reference area is
made from span areas which have normal flow reference areas as
children. The flow areas are then created inside these normal flow
reference areas.
  </para>
  <para>
Since the layout is done inside a page, the page is created from the
pagemaster with all the appropriate areas. The layout manager then
uses the page to add areas into the normal flow reference areas
and floats and footnotes. After the layout of the body region
is complete then the other regions can be done.
  </para>
</section>

<section>
 <title>Block Areas</title>
  <para>
Block areas are created and/or returned by all top level elements
in the flow. These areas have keep and spacing information that
needs to be retained until the page is finalised. A block area
is stacked with other block areas in a particular direction, it
has a size and it contains either line areas made from a group
of inline areas or block areas.
  </para>
  <para>
A block area can also be split into two block areas by splitting
between two line areas or splitting between two block areas (or
groups) that are stacked in the block progression direction of
the page. The split may also be in a child block area.
  </para>
</section>

<section>
 <title>Line Areas</title>
  <para>
A line areas is simply a collection of inline areas that are stacked
in the inline progression direction. A line area has a height and
width. It also contains information about floats and footnotes
that are associated with the inline areas.
  </para>
  <para>
A line area gets a set of inline areas added until complete then
it is justified and vertically aligned. If the line area contains
unresolved areas it will retain the justification information
until all areas are resolved.
  </para>
</section>

<section>
 <title>Inline Areas</title>
  <para>
There are a few different types of inline areas. All inline areas
have a height. Their width may be variable until the line is
finalised.
  </para>
  <para>
Unresolved areas can reserve some space to allow for possible
sizes once it is resolved. Then the line can be re-justified
and finalised.
  </para>
</section>

<section>
 <title>Cloning</title>
  <para>
Any subtree of the area tree should be cloneable so that for
areas that are repeated the area tree can simply be copied rather
than going through the layout again. This will only work if the
width is the same.
  </para>
  <para>
Resolveable areas may be converted into an unresolved form.
  </para>
</section>

<section>
 <title>Classes</title>
  <para>
The following class structure will be used to represent the area
tree.
  </para>
  <para>

  </para>
<section>
 <title>Page Area Classes</title>
  <para>
The page area classes hold the top level layout of a page. The
areas are created by the page master and should be ready to have
flow areas added.
  </para>
</section>
<section>
 <title>Block Area Classes</title>
  <para>
The block areas typically hold either a set of line areas or a set of
block areas. The child areas are usually stacked in a particular
direction.
  </para>
  <para>
Areas for tables and lists have their child block areas stacked
in different ways. Lists also can have spacing between the block
areas.
  </para>
</section>
<section>
 <title>Inline Area Classes</title>
  <para>
The inline areas are used to make up a line area. An inline area
typically has a height, width and some content. The alignment is
used for block progression direction displacement and to determine
the height of a line.
  </para>
</section>

</section>

<section>
 <title>Rendering Area Tree</title>
  <para>
The rendering of an area tree is done by rendering each page
to a suitable output. The regions are rendered in order and each
region is contained by a viewport.
  </para>
  <para>
The relevent structures that will need to be rendered are:
Page
Viewport
Region
Span
Block
Line
Inline
  </para>
  <para>
The renderer will need to be able to:
       <itemizedlist>
       <listitem><para>
render each individual page
       </para></listitem>
       <listitem><para>
clip and align child areas to a viewport
       </para></listitem>
       <listitem><para>
handle all types of inline area, text, image etc.
       </para></listitem>
       <listitem><para>
draw various lines and rectangles
       </para></listitem>
       </itemizedlist>
  </para>
  <para>  
An abstract renderer will be able to handle the generic positioning
of child areas, iterating through areas that have child areas.
  </para>
</section>

</section>