Re: Embedding AbiWord


Subject: Re: Embedding AbiWord
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Fri Aug 03 2001 - 08:24:22 CDT


On Thu, 2 Aug 2001, David Mandelin wrote:

> Brief intro: I am working on a application for transcribing and
> analyzing audio/video data. We are using Python and wxWindows, and the
> app will be cross-platform and open-source. We need a word-processing
> component for the transcription part and are interested in AbiWord.
>
> Does anyone have any advice on embedding AbiWord? Are there projects
> underway? Is there anyone else that needs this?
>

We and I am very interested in embedding AbiWord. I'm particularly
interested in using it as an Bonobo component.

> I know that there are plans to support Bonobo, but we want to be
> cross-platform. I've thought of a few possibilities: Bonobo for Gnome,
> COM for Win32, ??? for Mac; write a replacement for the App class, write
> libraries to send messages to AbiWord; embed a socket server. Using
> Bonobo/COM/whatever seems the closest to the AbiWord philosophy, at
> least as this newbie sees it.

yes. The best thing to do would be to develop an abstract class that is
actually implemented using platform specfic code.

If you know anything about COM it might be useful to design a such an
abstract class as a set of pure virtual functions to implement the needed
methods.

Given that bonobo was based on OLE and COM it may not be too hard to
implement these methods in the GNOME front end.

AbiWord actually has nice hooks in place to expose all it's methods to out
of process calls. If you look though

abi/src/wp/ap/xp/ap_EditMethods.cpp

you'll see that every one of the Word Processor function is addressable as
a static function. In addition we have a class

EV_EditMethodContainer

(See abi/src/af/ev/xp/ev_EditMethod.cpp)

That gives direct access to these functions. In particular the method

EV_EditMethodContainer::findEditMethodByName(const char * szName)

will return a pointer to the ap_EditMethod with the name defined by
the string szName.

So once you have a pointer to EV_EditMethodContainer, you can generate
pointers to all the function used by abiword.

In addition in connection between events from outside AbiWord and inside
is also defined to traverse an abstract interface. See ev_EditBinding.cpp.

So it should be possible to easily redirect any sort of events into the
methods invoked by the AbiWord.

Finally we have an abstract drawing class, defined in gr_Graphics.cpp,
that can be implemented in what ever mannor you wish. This makes it
possible to draw into whatever graphics context you wish.

>
> Anyway, my employer is quite willing to pay me to work on open-source
> software. But first we need some idea of what this will involve. If
> anyone would give us a hint, or a pointer in the right direction, we'd
> be most grateful.
>

OK well I hope I've shown you that a lot of what you need for a cross
platform embeddable application already exists in AbiWord. We made some
baby steps towards making AbiWord an embeddable component within gnome
with the code in AbiWidget.cpp. In addition you might want to look at
src/wp/ap/xp/ap_Preview_Abi.cpp to see how we embed full AbiWord WP canvas
in a cross platform graphics context. (See the Styles dialog to see this
in action.)

I'm personally extremely interested in making AbiWord an embeddable
component. Unfortunately I have more than enough other things to do with
AbiWord to keep me busy for the next month or 3.

On the other hand I'm very happy to offer as much advice and help as I am
able.

Good Luck with your project. I'm looking forward to seeing patches!

Cheers

Martin



This archive was generated by hypermail 2b25 : Fri Aug 03 2001 - 08:24:29 CDT