1
0
mirror of https://github.com/GNOME/gedit synced 2024-06-30 23:15:01 +00:00
gedit/docs/how-to-write-a-gedit-plugin.md
Sébastien Wilmet 2918c45b3f docs: add C++ to the list of possible languages to write a plugin
Should be feasible, but it's a little going off the beaten tracks (the
same for Rust, I guess).
2020-10-13 12:34:32 +02:00

1.7 KiB

How to write a gedit plugin

The gedit-development-getting-started.md documentation is a good start.

Programming language for a gedit plugin

The preferred language is the C language, that way the code can be easily refactored to be included in a library.

Rust, C++ and Vala plugins are possible too since they are equivalent to C.

Python plugins are possible too.

What if I prefer to write in Ruby/JS/Scheme/Perl/C#/modula-2/Oz/whatever…

While GObject allows you to use many other languages, using more than one interpreter in the same process is not possible, not only because of bloat and performance, but also because different interpreted languages cannot manage garbage collections of GObjects at the same time: see this email.

The gedit developers have chosen Python as the interpreted language.

API reference

Build gedit with -D gtk_doc=true, you can then browse the API reference in the Devhelp application.

To know how to write a plugin, refer to the libpeas documentation as well.

More documentation and tips

More documentation, for example a tutorial, would be useful. In the meantime, the recommended thing to do is to see how core gedit plugins are implemented.

Unofficial documentation and tutorials (may be outdated)