[Geany-Devel] Adding a plugin
rbooth at xxxxx
Sat Jun 8 09:54:38 UTC 2013
On 06/08/2013 02:31 AM, Chow Loong Jin wrote:
> On Sat, Jun 08, 2013 at 05:59:51PM +1000, Lex Trotman wrote:
>> "for non autotools experts" I said, that includes not knowing how to
>> program in m4 :-)
>> Unless you are telling me just cut and paste of the code fragments in
>> hacking is all thats needed?
> Actually cutting and pasting the code fragments in HACKING should be enough for
> most cases. There are also plenty of examples (other plugins) to look at if
> anything extra needs to be done.
> Devel mailing list
> Devel at lists.geany.org
The example below is what I came up with after a few minutes checking
out your documentation.
It didn't take me long to create this basic plugin. However, I reserve
the right to bitch about the level of documentation for the data types
GeanyPlugin, GeanyData and GeanyFunctions, although GeanyFunctions seems
really transparent, just exposing Geany functions (maybe thats how its
file name was decided).
As a nit, I don't understand why the plugin_init function is passed the
GeanyData parameter. Seems superfluous to me. Note that I ignore it in
the example, and in all plugins I've written to date. Is it not the same
as the global *geany_data? If not, then I'd say that needs documentation.
One thing I could ask for is a reference in the docs to where I can find
the correspondence between api and abi. Maybe thats the wrong question,
but anyway, how do i know which abi version I need? This is in regards
---------------- main.cpp -----------------------------
PLUGIN_SET_INFO("Hello World", "Just another tool to say hello world",
"1.0", "Joe Doe <joe.doe at example.org>");
extern "C" void plugin_init(GeanyData *)
extern "C" void plugin_cleanup(void)
------------ makefile -----------------------------
@echo Creating library
@gcc -o debug/helloworld.so -shared `pkg-config --libs geany`
@g++ -o debug/main.o -c ../src/main.cpp -I../src -std=gnu++0x -fPIC
`pkg-config --cflags geany` -g -ggdb -ggdb3 -ansi -W -Wall -Wundef -O2
-MT debug/main.o -MF debug/main.o.d -MMD
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel