Re: plug-ins, windows, interface, questions

From: <msevior_at_physics.unimelb.edu.au>
Date: Sun Mar 27 2005 - 14:32:37 CEST

>
> On 24 Mar 2005, at 10:16, michael leisner wrote:
>> I tried to subscribe to the mailing list but it didn't work (I don't
>> know why). Could you please send this message to the mailing list?
>> ----------
>>
>> I'm working on a project with AbiWord and I have some questions about
>> that.
>> I already asked some people but I had that much success yet.
>>

Hi Michael,
           Can you tell us a little about yourself? Is this project for a
commercial application or is it a studnet project?

Are you aware that the AbiWord license requires you to make the source
code to any development you do with AbiWord available to your clients and
that you cannot prvent your client from redistributing your code?

>> I'm working with the current version of AbiWord on WinXP SP2.
>>
>> Let me just explain my problems:
>>
>> 1. I have to split the AbiWord GUI from the AbiWord Engine.
>> I wasn't able to find out how to split these two parts yet.
>> What I found out, was to convert documents with the command-line
>> arguments.
>> What do I have to do to use this function separated from AbiWord with
>> any
>> other application (especially with a kind of a database system)?

It is certainly possible to do this. I have already done it for the Unix
Front End.

You will need to write a dummy graphics class that doesn't actually draw
anything. This has been implemented for Unix already.

It's called the XAP_UnixNullGraphics class which is found in

src/af/xap/unix/xap_UnixNullGraphics.cpp

If you *have* to use windows, you'll need to write the equivalent code for
the GR_Win32Graphics class.

In addition the Unix front end already has a plugin that sounds like it
does what you need. It's is called "AbiCommand". You can find the source
code for this in

abiword-plugins/tools/abicommand.

It is invoked from the command-line with

AbiWord-2.2 --plugin AbiCommand

You can find some example code for how to feed documents to a remote
AbiWord process using this feature in our System Design Kit here..

http://www.abisource.com/developers/sdk/index.phtml

>> Is the only way to solve this by hacking the sourcecode?
>>

Yes.

>> 2. GUI: What about the script-function of AbiWord? How far can this
>> be used?

AbiWord's actions can be accessed via const char * strings. If you look in
the AbiCommand plugin you can see examples of how to do this.

>> Can I use this function to create new menu bar folders
>> and new functions?

You can either write new plugins or modify the main AbiWord menu structure.
The default Abiword menu structure is defined in

src/wp/ap/xp/ap_Menu_Layouts_MainMenu.h

If you look at this file for a few minutes I'm sure you can workout how the
Menu structure is defined.

The best example of how to extend the AbiWord menu structure using plugin
is in the code:

abiword-plugins/tool/abimathview/AbiMathView.cpp

There is code inthe that gives an example of how to create a menu
substructure.

>> What toolkit was used to create the AbiWord GUI (for
>> Windows)?
>>

I believe that Abiword uses the native Windows API. Many of the windows
dialogs were designed with MicroSoft Visual C++.

>>
>> 3. Plugins:
>> Francis wrote, that a plugin just has to use these 3 C-functions:
>>
>> ABI_FAR_CALL int abi_plugin_register (XAP_ModuleInfo * mi);
>> ABI_FAR_CALL int abi_plugin_unregister (XAP_ModuleInfo * mi);
>> ABI_FAR_CALL int abi_plugin_supports_version (UT_uint32 major,
>> UT_uint32 minor, UT_uint32 release);
>>
>> ...and he also wrote:
>>
>> > When AbiWord finds a file that it thinks is a plug-in, it searches
>> for
>> > these 3 C functions. If these are found, then AbiWord calls
>> > abi_plugin_supports_version() to see whether the plug-in supports
>> the
>> > current version of AbiWord, and if so then it calls
>> > abi_plugin_register() to activate the plug-in. Later it will call
>> > abi_plugin_unregister() to de-activate the plug-in.
>>
>> > These are fairly simple little functions, and the best way to see
>> how
>> > to write them is to look at the source of other plug-ins (get the
>> > abiword-plugins source).
>>
>> OK, thank you for that, but what can plugins based on that 3
>> functions do?

Well nothing at all. Those function exist so that AbiWord can determine
the plugin sane and can be loaded.

>> Anything I want to do? Like creating a new menu-function (for example
>> an user-login or any dialog box I want to create,...) or do I have to
>> use scripts for that?
>>

Yes. All that and more. The AbiWord plugin system is extremely powerful.

>> 4. Another thing I want to do with AbiWord is to load XML-files
>> (docbookDTD-conform)
>> with AbiWord. Is this possible?

Yes we have a docbook importer already. You can find it in

abiword-plugins/wp/impexp/docbook

If you build this plugin you find Abiword does apretty good job of
importing docbook format xml files. However it is nowhere near complete
and we would appreciate help in making it better.

>> Mr Staudinger wrote that this is very simple by using an import-plugin
>> and change it as I need to. Well, as far as I know, I have to use a
>> mapping tool to
>> assimilate the tags of the two (AbiWord and docbook)
>> XML-files!?
>> Could I please have some more details about that?
>>

No you misunderstand. He meant we already can import docbook into Abiword.
It's not perfect, it might be good enough for your needs. If it isn't we
would appreciate help in making it better.

>> The main project I'm working on is to use the AbiWord GUI as a
>> client-application for a kind of a database-system. Therefor I first
>> need to create a new menu for an user-login dialog.
>> Next I want to load docbook-conform XML-files from this database in
>> AbiWord. AbiWord should display the files like a "normal" document (no
>> tags of course).

Right. As I said we already import (and export) docbook format. It sounds
like we have a lot of what you need already. If the feature is not yet
complete enough for your needs you will need to improve it. We would
greatly appreciate you doing this as it would improve Abiword as an
application.

It is pretty straight forward to write a plugin to extend the menu
structure as you wish. Build the Abiword plugins (well at least the ones
that work on windows). Look at some of the examples I've talked about
already.

>> When the user wants to save the file/document this should be saved
>> just as a xml-file to the database. The next time the user opens the
>> document, it should be displayed by AbiWord as it was displayed the
>> last time, with the same template.
>>
>> Well that's it for now, I hope anyone can help me.
>> Please please explain it in detail and easy to understand!
>> Maybe someone can answer my questions on German.

Well I think an experienced AbiWord developer could do what you need
within a week.

Good Luck!

Martin

>>
>> Thank you very much!
>>
>> Mike.
>>
>> Nutzen Sie Outlook für Lycos Mail! -
>> http://mail.lycos.de/app/lycosinside/setupLI.exe
>>
>>
>> --
>> This email has been verified as Virus free
>> Virus Protection and more available at http://www.plus.net
>>
>
>
Received on Sun Mar 27 14:36:21 2005

This archive was generated by hypermail 2.1.8 : Sun Mar 27 2005 - 14:36:24 CEST