(sticky maybe?)
For anyone interested in writing Plus! plugins in Delphi, there has been the
Delphi Template kindly provided by Whacko. However, while writing several plugins I noted the same pattern over and over again, and got tired of it. So today I wrote a framework for Delphi plugins, and I'm releasing it as open-source...
So what's so special about it? Well, here goes:
- Full translation of the latest SDK C++ source, including some corrections over Whacko's version
- Object Orientated way of writing plugins
- Several wrapper functions for formatting your output, including smart TColor to Plus! color conversion
And what is missing:
- Implementation of Unicode functions (due to a lack of experience in that area)
The way it's implemented you must create a class descending from TMPPlugin and call RegisterPlugin in the DLL's entry point (the default begin-end you get when creating a DLL project). Override the Initialize function, register your commands (including tags or notifications) and the framework will take over from there, adding your commands to the Plus! plugins menu, calling your callback functions when a command is found. Need more processing? Override the various Execute methods to tap into the processing since all functions are declared as virtual!
Didn't understand a word I was just saying? Not to worry, I've included a demo project showing a plugin with two commands, one tag and a notification.
The advantage of this framework is you no longer have to copy and paste all the code to keep it C++-compatible, the framework takes care of that. No worrying about exports, pointers, correct calling conventions or returning strings longer than the Plus! buffers can handle... all taken care of
Before I start to sound like a Tel-Sell comercial, I'll just attach the demo plugin, Plus! SDK conversion and framework. Hope it helps someone as much as it helps me
Any feedback, bugs, fixes or Unicode implementations are of course appreciated, what else did I open-source it for eh?