OpenOffice.org
Development digest
week 8 (2004)
by C.P. Hennessy
translation available thanks to .
- Development snapshot m26 available
- New cvs module scp2 instead of scp
- N steps to adding a new menu entry
- Other development news
- This weeks Issuezilla summary
- This weeks CVS highlights
Development snapshot m26 available
The latest development snapshot m26 has many improvements including : Allow creation of dialogs via a UNO service, Provide example scripts in all languages, Macro Security, Add Python Scripting Runtime to installset, Implement API functionality for creating new Charts from spreadsheets.New cvs module scp2 instead of scp
wrote to the dev@porting mailing list to tell them about the replacement of an old core module with a new module.
Why these changes?
The new scp structure allows the creation of difference scp files in which you can define and undefine scp defintions to describe the difference of two products.
Example: To undefine the defintion of gid_File_Abc you only need to add
in the scp project the following code line:
UnFile gid_File_Abc
and the file defined with gid_File_Abc is no longer part of the product.
There is another big advantage. Because of the undefining mechanism it is no longer necessary to use product defines like #ifdef OSL_PRODUCT inside the scp files. Therefore every scp file will only be built once, leading to a dramatic decrease of build time for the scp2 project compared with the old scp project. The removal of product defines inside scp files also leads to more simplicity of this files.
A more detailed documentation of the new scp can be found here
N steps to adding a new menu entry
(from the scripting project) recently was working on add a new menu entry for a scripting need. I asked him to summarize the steps necessary as it may be of interest to others. He kindly responded with :So, say for example I want to add an entry, "Script organizer", below the entry "macro..." in the Tools->Macro sub-menu.
The first step is define a new "slot" that links the menu entry to the code that it will execute. these are defined in sfx2/inc/sfxsids.hrc. I define a new slot SID_SCRIPTORGANIZER to be same value as the existing SID_SFX_free_START, and incremented the SID_SFX_free_START by one.
Next I define the link between the slot, and the code that handles it. For my slot, the application code should handle the execution so this is done in sfx2/sdi/appslots.sdi. See also other files in this directory, or similar sdi directories in other modules (eg basctl).
In the section that starts "shell SfxApplication" I add the lines:
SID_SCRIPTORGANIZER [ ExecMethod = OfaExec_Impl; ]which means that my slot will be handled by the method
SfxApplication::OfaExec_Impl.Then in sfx2/source/appl/appserv.cxx I add code to the method SfxApplication::OfaExec_Impl to handle the case for the new slot.
In sfx2/sdi/sfx.sdi, I duplicate the SID_BASICCHOOSER entry, and change
"MacroDialog" to "ScriptOrganizer", and SID_BASICCHOOSER to
SID_SCRIPTORGANIZER.
This is the slot definition file
where attributes for a slot can be defined, like this is a user
interface command which can be customized to tool bars, menus and
accelerators. You can define if the slot is a state, a function or both.
You can add parameters and define the type of a state slot. Don't ask me
what the entries mean!!
In sfx2/sdi/sfxslots.src, added an SfxSlotInfo for the slot. These are the localized names for the slot.
Build & delivered in sfx2. We now have the back end, handling the execution.
The actual menu entries are defined in a number of places. For things that are duplicated across several apps, such as the Tools->Macros submenu, we find the definition in svx/inc/globlmn.hrc. Here I add a new menuItem for the new slot to the ITEM_TOOLS_MACROS (using the existing entries as a template). The identifier and helpid are the SID, the command is .uno:ScriptOrganizer. The command name is what we will see if we record a macro that uses this slot.
Run the built & deliver commands in svx. The globlnm.hrc is included in offmgr/inc/offmenu.hrc, so we must build & deliver this project too. And then rebuild each of the application projects (sw, sc...). This is necessary to deliver the slot.ilb files which are merged from lower libraries. And finally build in instsetoo and install the rebuild app with your new menu entry!!
Other development news
Oasis Open Office file format status
The Oasis Technical committee on Open Office XML Formats had a meeting on Feburary 16th and the meeting minutes are available. The specifictaion is at draft 6 at this stage, os it is getting very close to a final 1.0 release.Interesting LinuxJournal feature articles
In the March 2004 issue of Linux Journal there are several features which may be of interest to OOo develoeprs including :A common file format lets apps compete on features and ease of use.
XML and Ruby let your scripts and your office suite handle the same files.
Encouraging more developers
During a conversation on the discuss mailing list I asked what people thought would be of interest to prospective developers to help them understand and use OpenOffice.org APIs. replied with:- Simplify the Python bindings. There seems to be a lot of unnecessary work that could be done behind the scenes.
- Create Ruby bindings (Ruby is a fantastic language, imagie taking the best bits of Perl and Python and then making it better).
(steps 1 and 2 would make it easier to develop for OOo).
- Write tutorials that walk the reader through making simple extensions using Ruby or Python.
- How-To make your first plug-in
- From SXW to XHTML - a XSLT Tutorial
- Launching a calculator software from OpenCalc
- Explaining VCL - How OOo interface really work
- Make OOo your publishing app - OODocuments
- Transform your OOo aplication into your RSS blog feeder XML-RPC and XSLT
This weeks Issuezilla summary
Many bugs have been worked on and resolved (as of Monday Feb 23 2004 ):No this week | Change from last week | |
---|---|---|
Total issues submitted in the week | 2434 |
0 |
Issues submitted in the week resolved or closed | 261 |
-42 |
Issues which have the status UNCONFIRMED | 257 |
-22 |
Issues which have the status NEW | 1080 |
34 |
Issues which have the status STARTED | 1087 |
5 |
Issues which have the status FIXED | 7994 |
88 |
Some of the more interesting CVS developments over the last week include:
week 8 (2004):- Canvas module is split into primarily UNO canvas implementations, and cppcanvas, a C++ wrapper canvas
- word 2003 and other filtering strangeness
- simplify coding tasks for Java developers using UNO, by providing appropriate wrapper APIs
- lots more compatability and writer speedups
- Rhino debugger(from mozilla.org) integrated
- Impress slide sorter panel
- improvements to editing numbering
- GTK
- lots of MacOSX build fixes
- KDE
- Word and Excel XSLT
- flash plugin support
- Java configuration service
- 64 bit porting work - mostly for SPARC V9
- layout manager getting close to merge ready state ?
- rich text control added