API changes for gedit plugins

There is no API stability guarantees for plugins. Of course we try to not break the API, but sometimes it is needed. gedit is a quite old piece of software (created in 1998, at the beginnings of the GNOME project), and as every software, the code evolves during its lifetime. But normally the API changes should not affect all plugins at once, and the new APIs are normally an improvement.

For gedit 3.8

Python plugins must be ported to Python 3 to work on gedit 3.8 and above. Usually this is not hard.

For gedit 3.12

Due to the new design of gedit, some plugins need to be ported.

  • There is a new menu system, see this commit for an example on how to port a plugin. See this file for the sections of the menus you can use.

  • The search and replace API in GeditDocument was deprecated, and has been removed in gedit 3.12. Use the GtkSourceView API (the GtkSourceSearchContext and GtkSourceSearchSettings classes).

For gedit 3.14

Due to a new file loading and saving API in GtkSourceView, there are some changes in the gedit API, mainly in GeditDocument.

If your plugin relies on some of the removed API, and if it is not possible to use GtkSourceFile, explain your use case and we'll see what we can do.

  • GeditEncoding has been removed, use GtkSourceEncoding instead.

  • New functions:
    • gedit_document_get_file()
    • gedit_commands_save_document_async()
    • gedit_commands_save_document_finish()
  • The following GeditDocument functions have been removed:

    • gedit_document_load()
    • gedit_document_load_stream()
    • gedit_document_load_cancel()
    • gedit_document_save()
    • gedit_document_save_as()
  • The GeditDocumentCompressionType and GeditDocumentNewlineType enums have been removed, use the enums available in GtkSourceFile instead.

  • The GeditDocument "loading" and "saving" signals (used for progress info) have been removed.

  • All the parameters of the GeditDocument "load" and "save" signals have been removed.

  • The error parameters of the GeditDocument "loaded" and "saved" signals have been removed. For saving a document and get the result of the operation, you can use gedit_commands_save_document_async() and gedit_commands_save_document_finish().

  • The following properties in GeditDocument have been removed: "compression-type", "newline-type", "encoding" and "location".

  • The following functions are deprecated:
    • gedit_document_get_location()
    • gedit_document_set_location()
    • gedit_document_get_encoding()
    • gedit_document_get_newline_type()
    • gedit_document_get_compression_type()

Apps/Gedit/API-Changes (last edited 2014-11-29 17:08:22 by SébastienWilmet)