Page 1 of 1

[Solved] Adding New macro language to OpenOffice/LibreOffice

Posted: Wed Jan 22, 2014 7:23 pm
by harryspier
I'd like to try to add the language Racket (previously called PLT Scheme) http://www.racket-lang.org/ as a new macro language to OpenOffice for an application I'm writing on a windows computer. Racket has a "foreign function interface" that allows it to call functions from a DLL compiled from C. To do so it needs to know the name of the DLL that contains the functions its calling and the C representation of the parameters of the function. My application calls only a very very few UNO functions (initial setup, moving a cursor, getting text from a cursor and inserting text at a cursor. I only need to set it up to use these functions only.

The functions I'm using are: (here are the python calls to them)
import uno
ctx = uno.getComponentContext()
desktop = ctx.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", ctx )
oDoc = desktop.getCurrentComponent()
oText = oDoc.Text
oVC = oDoc.CurrentController.getViewCursor()
oInsertCursor = oText.createTextCursorByRange(oVC.Start)
selection = oDoc.CurrentController.getSelection()
oEnd_of_selection = oText.createTextCursorByRange(oVC.End)
oEnd_of_text = oText.End
----------------------------------

If someone could tell me:
1) the name of the dll in the OpenOffice distribution to windows that contains these functions.
2) How to use the cunomaker tool ( http://www.openoffice.org/udk/cpp/man/s ... _spec.html ) to get the c representation of these function calls
3)Once I create an executable (.exe file) if I can attach this to a button in the toolbar by the "tools->customize" menu option or do I do this another way?

With this information I think I can probably get this working.
Thanks,
Harry Spier

Re: Adding new macro language to OpenOffice/LibreOffice

Posted: Wed Jan 22, 2014 10:01 pm
by Villeroy
http://en.wikipedia.org/wiki/Universal_Network_Objects
This is not how it works. You call all the functions from a listening instance of the running office suite.

Re: Adding new macro language to OpenOffice/LibreOffice

Posted: Fri Jan 24, 2014 2:26 am
by harryspier
Thanks Villeroy I'll go through this documentation.

[SOLVED] Adding new macro language to OpenOffice/LibreOffice

Posted: Fri Jan 24, 2014 5:17 am
by harryspier
This OpenOffice link gives detailed instructions in how to add a new macro language to Openoffice
https://wiki.openoffice.org/wiki/Docume ... om_Scratch