[Solved] Adding New macro language to OpenOffice/LibreOffice
Posted: Wed Jan 22, 2014 7:23 pm
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
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