diff --git a/ChangeLog b/ChangeLog index 275fc4f2..45aa35e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-08-14 Nick Treleaven + + * src/notebook.c: + Don't look up "scroll_arrow_hlength" and "scroll_arrow_vlength" + GtkWidget properties on GTK < 2.10. + * src/prefs.h, src/plugindata.h, src/plugins.c: + Rename api_version GEANY_API_VERSION. + Rename abi_version GEANY_ABI_VERSION. + Use enums for each of these so they can be used to initialize a + global variable, and add dox. + + 2008-08-13 Enrico Tröger * doc/geany.txt, doc/geany.html: diff --git a/src/plugindata.h b/src/plugindata.h index 3f4b2f1b..8085175b 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -28,20 +28,27 @@ * For detailed documentation of the plugin system please read the plugin * API documentation. **/ -/* Note: Remember to increment api_version (and abi_version if necessary) when making changes. */ +/* Note: Remember to increment GEANY_API_VERSION (and GEANY_ABI_VERSION if necessary) + * when making changes (see 'Keeping the plugin ABI stable' in the HACKING file). */ #ifndef PLUGINDATA_H #define PLUGINDATA_H -/* The API version should be incremented whenever any plugin data types below are - * modified or appended to. */ -static const gint api_version = 87; +/* Note: We use enum instead of 'static const gint' to allow its use in global variable + * initializing, otherwise we get errors like: + * error: initializer element is not constant */ +enum { + /** The Application Programming Interface (API) version, incremented + * whenever any plugin data types are modified or appended to. */ + GEANY_API_VERSION = 88, -/* The ABI version should be incremented whenever existing fields in the plugin - * data types below have to be changed or reordered. It should stay the same if fields - * are only appended, as this doesn't affect existing fields. */ -static const gint abi_version = 44; + /** The Application Binary Interface (ABI) version, incremented whenever + * existing fields in the plugin data types have to be changed or reordered. */ + /* This should usually stay the same if fields are only appended, assuming only pointers to + * structs and not structs themselves are declared by plugins. */ + GEANY_ABI_VERSION = 44 +}; /** Check the plugin can be loaded by Geany. * This performs runtime checks that try to ensure: @@ -50,9 +57,9 @@ static const gint abi_version = 44; #define PLUGIN_VERSION_CHECK(api_required) \ gint plugin_version_check(gint abi_ver) \ { \ - if (abi_ver != abi_version) \ + if (abi_ver != GEANY_ABI_VERSION) \ return -1; \ - if (api_version < (api_required)) \ + if (GEANY_API_VERSION < (api_required)) \ return (api_required); \ else return 0; \ } @@ -376,14 +383,15 @@ EncodingFuncs; struct GeanyKeyGroup; -typedef void (*_KeyCallback) (guint key_id); +/* avoid including keybindings.h */ +typedef void (*_GeanyKeyCallback) (guint key_id); /* See keybindings.h */ typedef struct KeybindingFuncs { void (*send_command) (guint group_id, guint key_id); void (*set_item) (struct GeanyKeyGroup *group, gsize key_id, - _KeyCallback callback, guint key, GdkModifierType mod, + _GeanyKeyCallback callback, guint key, GdkModifierType mod, gchar *name, gchar *label, GtkWidget *menu_item); } KeybindingFuncs; diff --git a/src/plugins.c b/src/plugins.c index 67497a23..23193b03 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -365,7 +365,7 @@ plugin_check_version(GModule *module) } else { - gint result = version_check(abi_version); + gint result = version_check(GEANY_ABI_VERSION); if (result < 0) { diff --git a/src/prefs.h b/src/prefs.h index 55017196..0f9b3498 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -24,8 +24,7 @@ #ifndef GEANY_PREFS_H #define GEANY_PREFS_H 1 -/* General Preferences dialog settings. - * Remember to increment abi_version in plugindata.h if you have to change an item. */ +/* General Preferences dialog settings. */ typedef struct GeanyPrefs { gboolean load_session;