AbiWord 2.0 - The Next Step
(Toward World Domination)
Martin Sevior and Dominic Lachowicz
New features in 2.0
AbiWord 2.0 has many new features not present in the 1.0 release. There are features that provide improvements to the AbiWord User Interface and those that increase the richness of the Word Processing document. The following table lists new Word Processing features and the file formats the feature is exported to and imported from. Of course all features are supported by the AbiWord native XML file format.

Feature	Imported from	Exported to.	
Tables	MS Word, RTF, WordPerfect, HTML, OpenOffice.org, DocBook, (other XML formats)	RTF, HTML, Latex, DocBook, (other XML formats)	
Footnotes	RTF,MSWord, WordPerfect	RTF, Latex	
Endnotes	RTF, MSWord, WordPerfect	RTF, Latex	
Revision Marks			
MailMerge			

The Table feature in AbiWord is very powerful. Cells within tables can be merged either horizontally or vertically via an easy-to-use non-modal dialog. Rows and Columns heights and widths can be adjusted interactively by dragging ruler controls or table lines. The unix build includes a powerful automatic table insert widget which allows tables dimensions to be created interactively. We also have the ability to nest tables to arbitrary depth. This feature is not available in either Word Perfect or Open Office.

Feature	Platform	
Automatic Font detection	New to Unix for 2.0	
Anti-aliased text	New to Unix for 2.0	
Gtk 2.0 GUI elements	New to Unix for 2.0	
Gnome 2 integration	The Gnome Intergration features include:
•	Drag and drop images from Nautilus
•	Embed AbiWord in Nautilus
•	Drag and drop URL's and images from Galeon/Epihany/Mozilla into AbiWord
•	Embed AbiWord in Evolution 2
•	Use GIMP plugin to edit images within AbiWord
•	Use of the GNOME-DB database interface for mail-merge or plugin.
	
Drag images interactively	All	
Resize images interactively	All	
Selection colour is based on Theme	Unix, Windows	
Font preview from drop down list	All	
Drag and drop text editing	All	
Many improvements in import/export filters	All	

The start of the 2.0 cycle.
The long term goal of AbiWord has always been to provide the best Word Processor in the World and to make it available on every interesting computing platform. Our first stable release, 1.0, has sufficient features and ease of use to be useful for a large number of ordinary users. In the minds of the developers we kept the idea of "The Church Secretary" as being our target user. Someone with limited interest in computers and who just wants to get their work done. 

To this end the original AbiWord developers (who have almost completely ceased contributing to development) imagined a program rather similar to MicroSoft Word. We have followed this vision and created a genuine WYSIWYG application.  

I think we largely succeeded in this goal and the feature of the 1.0 series has most of the features needed for simple home use. However, we were clearly a long way from fulfilling the needs of everyone who uses Word Processors. In particular, one of the authors, has the ambition to use AbiWord as the only Word Processor he and his family needs at work, home, School and for a micro-business. To fulfill our long term goal of being the World Best's Word processing software we clearly needed more features and better usability. To this end we started the development of 2.0 with the aim of overcoming many of existing limitations in the 1.0 codebase while keeping as much of the code we hard worked so hard to develop.

To this end, we made many long term investments in the AbiWord code base. These include:

•	Changed the internal text representation to unsigned 32 bit (from unsigned 16 bit). This allows us to represent a very large fraction the World's language characters as a single, uniquely addressable word.
•	A major refactoring of the text layout classes to allows us to represent complex text structures like tables, footnotes and endnotes.
•	Enhancements to our PieceTable (which is the model of our document in our Model-View-Controller, MVC) to allow advanced structures like tables, Revision Marks, Hidden text and Mail-Merge.
•	Move to the GTK 2 toolkit.
•	Use of fontconfig and XFT2 drawing to allow automatic font detection and anti-aliased text drawing.
•	Refactoring of the cross application architecture to remove duplicated code and to share more code between different platforms.
•	Use of an abstract text layout architecture which guarantees 100% WYSIWYG text layout at all resolutions and for all printers.
•	Move to the new GNOME2 architecture in particular the use of Bonobo-2 to allow AbiWord to be easily embedded in Nautilus-2, Evolution-1.4 and any other application that needs a Word Processor.
•	Move to HIG-compliant dialogs
•	and of course lots and lots of code to actually enable all the new features.
It is worth emphasizing that a huge amount of the code we wrote for 2.0 is basic infrastructure that will be leveraged in future releases as we add more features. With this infrastructure in place the project can now be developed at a much faster pace. 
Features of 2.0 in detail. 

Here is a screen shot of AbiWord-2.0 being used to prepare this document.

The Table feature.
Compared to the 1.0 release there are two obvious differences.

The first is there is now a table entry on the menu bar.

The second is extra toolbar used for table controls. 

As mentioned earlier our table feature is quite rich and powerful.

Cells within tables can be merged across both multiple rows and multiple columns.  		

We accomplish this in AbiWord by using a unique non-modal dialog as shown below.

     	Merge Cells Feature

With this dialog one places the cursor in the cell to be merged then clicks on the appropriate button to merge to the left, right, above or below as desired.

With each click, the user immediately sees the result of each merge. If a merge is not desired, it can be immediately corrected by clicking the global undo button. 

Being non-modal the dialog can stay up and active as the user otherwise types.	

Other Table Features
Tables, Rows and Columns can be added or deleted at any time via the menu's or toolbar controls. Each of the lines around every cell can be turned or off and the colour of each line can be set via a powerful, non-modal format table dialog. Since the dialog is non-modal adjusting the look of  a table is an easy and interactive experience for the user. In addition the background colour of each cell can also be set to whatever is desired. Tables can be nested to arbitrary depth. Large tables automatically break across pages and correctly take account of  footnotes placed on each page. (An example of this is shown on the first page of this document.) A rather extravagantly configured table is show below.   

						
	Here is a nested table in a region of merged cells.

This table can itself  contain merged cells									

			More merged cells. Here we explicitly show how cells are merged vertically	

Finally the toolbar contains a powerful widget which allows tables of the required dimensions to be interactively configured and inserted by dragging a mouse.

Footnotes and Endnotes

   Version 2.0 of AbiWord has a complete Footnotes and Endnotes feature. Footnotes  and Endnotes can be defined in one of twelve different styles which include numerical, alphabetic and Roman numerals. The numbering of footnotes can be restarted on each page, on each section or continued though a the whole document. Footnotes references are guaranteed to be on the same page as the text of the footnote. Of course footnotes are automatically correctly numbered in the order they appear in the document. The Footnote text is also automatically placed on pages in the same order as the Footnotes appear in the document. The numbering and placing of text is done automatically and immediately upon inserting the Footnote. 

Endnotes can also be one of the twelve different styles. The Endnote text can be placed at either the of a section or at the end of the document. The numbering the Endnotes can be restarted at each section and the initial value of the Endnotes can be set as required.

All these features can be adjusted and changed any time by using the Format Footnotes and Endnotes dialog.		
   
Footnotes and Endnotes can be copied, cut and pasted at will though out the document. They are exported and imported correctly to the RTF format and from MSWord and WordPerfect formats.	The Footnote and Endnote styles available in 2.0	

Revision Marks
Revision marks are a vital tool for the collaborative creation of documents. They provide a very good way to propose document changes to collaborative authors. The feature woks very similarly to MS Word. Each author is given their own colour as a marker for their text. The authors changes are shown as their color ext as the document is updated. Deleted text is shown as a line of the same color through the text. 
Mail Merge
Mail Merge is the feature that allows the creation of automated documents like mass personalized mailings, envelope printing and for the creation of standard documents. The AbiWord interface to this feature is both powerful and easy to use. 

The idea is to combine data sources with document templates and then perform actions on the resulting document(s).

We do this by entering mail merge fields. which then connected to data sources. This is accomplished via an easy to use non-modal dialog that presents the user with a choice of potential fields which are available in the data source. 

The inputs to this are:
•	An AbiWord document template
•	The DataSource which can be any of:
•	CSV flat text file.
•	Tab delimited text
•	An XML file
•	GnomeDB database
The outputs are:
•	New document(s) if used in conjunction with --to command line argument.
•	Printed document(s), if used in conjunction with --print command line argument

Embeddable AbiWord
AbiWord-2.0 is an embeddable bonobo component. It works well with Nautilus to enable users to view their files directly within the Nautilus shell. It is also usable by Evolution and as a browser plugin via the really cool mozilla-bonobo plugin. A screenshot of the AbiWord embedded in Nautilus is shown below.

AbiWord embedded in Nautilus

The Command Line: A powerful interface into AbiWord
Wordprocessors have traditionally only been used on client workstations. However by combining the power of unix-style servers with an easy-to-use document preparation tool like AbiWord, businesses can achieve substantial productivity improvements. AbiWord has a powerful set of command line features which enable it to be used on servers
Some examples of AbiWord "Back Office" usage are:

•	As a Document conversion server
•	eg: serve up MS Word documents to web browsers as HTML
•	As a Print server:
•	Do Mail Merge and generate postscript for printing on the fly.
•	Convert documents to PNG
•	Manipulate AbiWord programmatically via a console-like interface (AbiCommand plugin)
•	No need for a running X server!								
Extensible AbiWord - plugins
AbiWord has an easy to use plugin framework that enables the application to be extended without modification of the code-base. A list of plugins and their uses is shown below. Plugins can be dynamically loaded and unloaded during operation or loading immediately upon startup. New menu items are added for each plugin if needed.

aiksaurus	A powerful and unique thesaurus. Right click on a word, choose from the list of words of similar meaning by clicking on the entry and the word is replaced.	
abigimp	Use the GIMP image processing software to manipulate images within AbiWord. 	
Text Summarizer	Choose this option to summarize the text of your document. The compression factor can be adjusted to amount of reading you want to do.	
Wikkipedia	Select some text and search the wikkipedia online encyclopedia for references and information.	
freetranslation	Select some text and query the online translator to automatically translate your text into the language of your choice. 	
google	Select text in AbiWord and have google search on it for you.	
abicommand	Powerful and extensible command line interface to AbiWord. You can use this develop scripts to automate document production.	
gypsython	Use a python interface to interface directly AbiWord's internal API. Use this to develop powerful scripts in python.	
urldict	Select a word and then search an online dictionary for it's meaning. 	
gda	Interface into the GNOME database program Mergeant which enables data selection from a variety of sources (Gnumeric spreadsheets, Evolution Addressbook and a number of database programs)	
scripthappy	Run external programs and scripts from within AbiWord, pipe the results into the document.	
import/export filters	filters for applix,bzip2 AbiWord files, clarisworks, coquille, docbook, eml, Human readable ascii text, html, kword, latex, mif, OpenWriter, pdb (Palm), psion, pw (Pathetic writer), sdw, t602, wml, wordperfect,xhtml, xsl-fo	

It is very easy to write a plugin and is a great way to get into AbiWord coding. To get started, just take an existing plugin, (like aiksaurus), copy all the well documented boiler plate code and get coding. Of course feel free to ask for help from the very friendly AbiWord developers.
Post 2.0
There are many additional features that we intend to add to AbiWord. The ones I can think of now are listed below.

1.	Handle equations and maths.
2.	Additional table features (Select columns, split cells, sort tables, text to tables, repeated rows on pages, copy and paste rows and columns).
3.	Do genuine text wrapping around objects.
4.	Position objects on pages.
5.	Positioned Text frames.
6.	Paragraph borders.
7.	Paragraph Shading
8.	Table of Contents
9.	Draw on top on background images.
10.	More sophisticated Lists.
11.	Embedded bonobo and (maybe mozilla) objects.
12.	Genuine Scalable Graphics support.
13.	More and improved import/export filters. (Martin Sevior intends to build a latex importer)
14.	Finish HIG compliance.
15.	Use libgsf which will enable use to use the large variety of gnome-vfs backends. With this in place we can stream documents to and from AbiWord using a variety of internet protocols.

Which of these features will make it into the next stable release of AbiWord is not clear at this point. Martin is very keen to add Equation support via the excellent GtkMathView project led by Luca Padovan. We intend to integrate this closely with AbiWord so that equations can be edited in place in the document rather than using the MSWord COM approach.

Of the other features, all the Table features are straight forward, but were left out of 2.0 simply because of lack of time. Drawing on images is also straight forward and requires just some straight forward refactoring and additional graphics classes and methods. The Scalable Graphics support requires a proper mechanism to print at all resolutions.  

The improvements to the List feature is also straightforward as is paragraph shading once we can draw on top of images. The features apart from Maths which will require the most thought are text wrapping around objects and text frames. In both these cases layout will depend where on the page the text is placed and placing the text will depend on placing the object. This requires a two pass layout algorithm, which is different from how AbiWord currently does text layout.

Never-the-less even this change is not as radical as the surgery AbiWord underwent in the version jump from 1.0 to 2.0. There is every chance that AbiWord one year hence will have a large fraction of the additional features listed above.

Some technical details.
AbiWord uses the Model-View-Control paradigm. It was explicitly designed from the outset to utilize both a cross platform and cross application architecture. As a result extra care was taken make the GUI aspects of the code independent of the backend. This has resulted in a stable and easy to maintain code base.

A diagram showing how the MVC works in AbiWord is shown below.

The AbiWord PieceTable is collection of objects which can have arbitrary numbers of attributes and values associated with these. These objects, called "Fragments" can represent runs of text with contiguous properties, (all the same font, size, underlining). The attributes of the Fragments describe the text, (Font, size, colour, underlining). Fragments also represent fields, pictures, and structures for text like paragraphs, section, tables and cells. The attributes and their values are stored as const char * strings. The Layout classes interpret these attributes and turn them into text presented on screen or paper. All changes to the PieceTable generate "Change Record" objects. The change record objects are stored in stack and used for undo/redo actions. In addition they are broadcast to all the views attached to PieceTable. The Views interpret the "Change Record" objects and update their state accordingly. Thus the simple action of pressing a key is propagated down into the PieceTable through the controller. The PieceTable inserts a character into a fragment. It generates a Change Record, which it saves and broadcasts this Change Record to the views. 

The Process of undo simply pops the last change record off the stack, computes the inverse change record and broadcasts that to the Views. All of the AbiWord PieceTable manipulations are 100% reversible in this way.

Unfortunately time and space does not permit a fuller explanation. Interested reader should read the /docs subdirectory in the source files and feel free to ask question of the developers.   
The AbiWord Team.
Developers who have contributed to the  2.0 release.

Developer	Development Platform	Contributions	
Dom Lachowicz	Linux	GTK 2.0 port, Mail Merge, Single units fix, Code refactoring, gnome-print, Drag and drop from Nautilus, Selection Color based on GTK theme, Bonobo component, Table import/export to HTML, Docbook, Text Summerizer plugin, Many many bug fixes	
Martin Sevior	Linux	Layout class refactoring for tables etc, Piecetable Refactoring, Tables, Footnotes, Endnotes, GTK front end issues, abiwidget fixes, Bonobo component, HTML export, lots and lots of bug fixes.	
Tomas Frydrych	Win32	Revision Marks, single units, Bidirectional Text, RTF import/export improvements, Selection Color choice, MS Word import improvements, 32 bit internal text characters, Win32 fixes, Many, Many bug fixes	
Jordi Mas	Win32	Win32 Maintainer. Many, many Win32 fixes. Catalan Translations, Other fixes	
Marc Maurer	Linux	Gladification of dialogs. HIGification of dialogs, Auto font preview, Image drag and drop, Image resizing, Word Perfect Importer	
Pat Lam	Linux	Footnotes, Cool new cursor class, Single Units work, bug fixes	
Hubert Figuiere	OSX, PPC Linux	OSX port. RTF fixes, Bug Fixes	
Will Lachance	Linux	Word Perfect Importer. OpenOffice.org export, GTK front end work, Refactoring of cross platform architecture, Bug Fixes	
Francis Franklin	OSX, PPC Linux	Lots of build builds, tweaks and improvments. Table fixes, HTML exporter.	
Joaquín Cuenca Abela	Linux,Win32	XFT2 anti-aliased Text and fontconfig font recognition, Totally cool Insert Table Widget, Win32 Printing fixes, Icons.	
David Chart	PPC Linux	Documentation Maintainer, Lots of bug reports, Change Log scribe	
David Glassy	Win32	MinGW build maestro	
Andrew Dunbar	win32	Massive numbers of C++ cast fixes. Barbarisms support, Internationaliser	
Jeremey Davis	win32	Win32 fixes and improvements.	
Jesper Skov	linux	AbiWord Weekly News. Spell Check fixes. Other Bug fixes	
Kian	Beos	Revive BeOS port.	
Mike Cooper	win32	Win32 fixes.	
Mark Gilbert	Linux	Lots and lots of build tweaks. Bug fixes.	
Mike Pritchett	Win32	Win32 fixes, Memory Bug fixes	
Paul Rohr	Win32	Some usability tweaks and Internationalization support.	
Johann Bjork	qnx,QSX	QNX maintainer. Contributer to OSX port.	
Pierre Abbat	Linux	Translation co-maintainer	
Rui M. Silva Seabra	Linux	Translation co-maintainer	
row	Win32	MS Word import fixes.	
Sam TH	Linux	Build fixes, bug fixes.	
Eric A. Zen	Linux	AbiWord Weekly News. Supplier of mind altering substances	
Ruud Vring	Win32	Import of Tables from MS Word, bug fixes.	
Christian Biesinger	Linux	StarOffice/Open Office import	
Mike Nordell	Win32	Windows Fixes	
Stephen Viles		PieceTable fix	
Alberto Cabello Sánchez		Latex Export fixes	

The Translation Team

Translator	Language	
Tim Allen	Indonesian	
Takeshi Aihana	Japanese	
Masayuki Hatta	Japanese	
Jesus Bravo Alvarez	Galician	
Ramón Flores	Galician	
Henrik Berg	Swedish	
Linus G Larsson 	Swedish	
Per Larsson	Swedish	
Frédéric Cella	French	
Philippe Duperron	French	
Jesús Corrius	Catalan	
Jordi Mas	Catalan	
Joaquín Cuenca Abela	Spanish	
Javier Yáñez	Spanish	
Luis Miguel García	Spanish	
Tamas Decsi	Hungarian	
Vadim Frolov	Ukrainian	
Olexij Tkatchenko	Ukrainian	
Martin Willemoes Hansen	Danish	
Birger Langkjer	Danish	
Rasmus Toftdahl Olesen	Danish	
Kenneth Christiansen	Danish	
Alan Horkan	Irish (Gaelic)	
Alan Horkan	British English	
Alan Horkan	Irish English (Yes I didn't know there was a difference either)	
Chih-Wei Huang	Chinese (zh-TW)	
Anothy Fok	Chinese (zh-TW),(zh-CN)	
Mauro Colorio	Italian	
Marco Innocenti	Italian	
Jarmo Karvonen	Finnish	
Mantas Kriauciunas	Lithuanian	
Gediminas Paulauskas	Lithuanian	
Michl Ladislav	Czech	
Zbynek Miksa	Czech	
Karl Ove Hufthammer	Norwegian (Nynorsk)	
Gro Elin Hansen	Norwegian (Bokmål)	
Edouard Lafargue	Norwegian (Bokmål)	
Kjartan Maraas	Norwegian (Bokmål)	
Karl Trygve Kalleberg	Norwegian (Bokmål)	
Marc Maurer	Dutch	
John Profic	Russian	
Piotr Banski	Polish	
Andrzej Pruszynski	Polish	
Eutanazy Sercxemulo	Polish	
Giovanni dos Reis Nunes	Portugese (Brazil)	
Rui M. Silva Seabra	Portugese (Portugal)	
Tânia M. G. Ferreira	Portugese (Portugal)	
Martin Lacko	Slovenian	
Andraz Tori	Slovenian	
Christian Neumair	German	
Christian Terboven	German	
Damon Allen Davison	German	
Owen Thomas	Welsh	
Rhoslyn Prys	Welsh	
Alper	Turkish	
Nikos Niktaris	Greek	
Daniel Yacob	Amharic	
Pierre Abbat	Lojban	
Alfredo Barrainkua Zallo	Basque	
Mugurel Tudor	Romanian	
Ivica Bogosavljevic	Serbian	
pclouds	Vietnamese	
Sharuzzaman Ahmat Raslan	Malay	
Raphael Finkel	Yiddish	
Besnik Bleta	Albanian	
Alberto Cabello Sánchez	Sardinian??	

References