<?xml version="1.0"?>
<abiword version="0.7.9">
<!-- =====================================================================  -->
<!-- This file is an AbiWord document.                                      -->
<!-- AbiWord is a free, Open Source word processor.                         -->
<!-- You may obtain more information about AbiWord at www.abisource.com     -->
<!-- You should not edit this file by hand.                                 -->
<!-- =====================================================================  -->

<!--         Build_ID          = (none) -->
<!--         Build_Version     = 0.7.9 -->
<!--         Build_Options     = LicensedTrademarks:On Debug:Off Gnome:Off -->
<!--         Build_Target      = /var/tmp/builds/0956890453/tmp/abi-0.7.9/src/Linux_2.2.14-5.0_i386_OBJ/obj -->
<!--         Build_CompileTime = 21:58:58 -->
<!--         Build_CompileDate = Apr 27 2000 -->

<section column_gap="0.25in" num_columns="1" props="columns:1">
<p props="text-align:center"><c props="font-size:24pt; font-weight:bold">AbiWord Layout Engine Design Overview</c></p>
<p props="text-align:center"><c props="font-size:11pt">Copyright (C) 1999 AbiSource, Inc. All Rights Reserved.</c></p>
<p props="text-align:center"><c props="font-style:italic">Eric W. Sink</c>, <c props="font-family:courier">eric@abisource.com</c></p>
<p props="text-align:center">AbiSource, Inc.</p>
<p></p>
<p><c props="font-weight:bold">Introduction</c></p>
<p>This document gives an overview of the architecture and design of the AbiWord text layout engine. <c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">The sources for the engine live in the src/text/fmt/xp directory.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p></p>
<p><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">The layout engine manages two hierarchies, one of the actual document content (logical/content) and one of spatial objects which reprepresent the layout of a document (physical/layout) in a certain context (view).</c></p>
<p>This division is reflected in the class and filenames using prefixes:</p>
<p></p>
<p>fb_: Functions working on blocks [how to build the layout based on content rules?]</p>
<p>fg_: Graphical representation [images?]</p>
<p>fl_: Part of the logical hierarchy</p>
<p>fp_: Part of the physical hierarchy</p>
<p>fv_: View [describing the user's interaction-context with the document?]</p>
<p></p>
<p>The terms/components in these hierarchies are described below in this form:</p>
<p><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">&lt;term&gt; (class/filename): &lt;description&gt;</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p></p>
<p><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Document (fp_DocLayout): The formatted representation of a PD_Document for a specific GR_Graphics context. This class is the root of both hierarchies for a given document.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:bold; text-decoration:none; text-position:normal">Content Hierarchy</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in">[how is a document split up in these sub-constituents? Why?]</p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Document (fp_DocLayout): Contains a list of fl_SectionLayout objects.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Section (fl_SectionLayout): A Section is a portion of a document.  It contains one or more blocks.  </c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Block (fl_BlockLayout): A Block is a paragraph [of text].</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:bold; text-decoration:none; text-position:normal">Layout Hierarchy</c></p>
<p></p>
<p><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Document (fl_DocLayout): A DocLayout contains one or more Pages.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Page (fp_Page): A Page represents a physical sheet of paper.  Its dimensions are fixed (defined by fp_PageSize).  A Page contains one or more Columns.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Column (fp_Column): A Column is a container into which text can be flowed.  It is rectangular.  A Column contains one or more Lines.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"><c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">Line  (fp_Line): A Line is a single line of text.  A Line contains one or more Runs.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in">Run (fp_Run): <c props="color:000000; font-family:Times New Roman; font-size:12pt; font-style:normal; font-weight:normal; text-decoration:none; text-position:normal">A Run is a piece of content.  Currently, all Runs contain text.  All text within a Run must be of the same font and formatting information.</c></p>
<p props="line-height:1.000000; margin-bottom:0.0000in; margin-left:0.0000in; margin-right:0.0000in; margin-top:0.0000in; text-align:left; text-indent:0.0000in"></p>
<p></p>
<p><c props="font-weight:bold">Multiple Columns</c></p>
<p>AbiWord supports multiple columns using a very simple model.  Each Section specifies its column model as the number of columns, and the gap spacing between them.  That model will be used for all content in the Section.</p>
<p></p>
</section>
</abiword>
