[geany/geany] cfa913: Remove deprecated symbols: plugindata.h (PR #3072)
xiota
git-noreply at geany.org
Tue May 3 05:36:22 UTC 2022
Branch: refs/heads/master
Author: xiota <xiota at users.noreply.github.com>
Committer: GitHub <noreply at github.com>
Date: Tue, 03 May 2022 05:36:22 UTC
Commit: cfa913d0d4a4bd78eff330cd8916c43c182ee228
https://github.com/geany/geany/commit/cfa913d0d4a4bd78eff330cd8916c43c182ee228
Log Message:
-----------
Remove deprecated symbols: plugindata.h (PR #3072)
This PR removes remaining deprecated symbols from plugindata.h. (See #3019 for overview of currently deprecated symbols.)
- GeanyFunctions
- GeanyKeyGroupInfo
- PluginFields
- PluginFlags
- PLUGIN_KEY_GROUP
- document_reload_file
- DOC_IDX(doc_ptr)
- DOC_IDX_VALID(doc_idx)
- GEANY_WINDOW_MINIMAL_HEIGHT
- GEANY_WINDOW_MINIMAL_WIDTH
The multiterm plugin, which currently doesn't compile because of GTK2-related dependencies, refers to the following symbols: PluginFlags, PluginFields, document_reload_file
The other symbols removed in this PR are not used by any known plugins.
Modified Paths:
--------------
src/plugindata.h
src/pluginprivate.h
src/plugins.c
Modified: src/plugindata.h
73 lines changed, 0 insertions(+), 73 deletions(-)
===================================================================
@@ -31,7 +31,6 @@
#ifndef GEANY_PLUGIN_DATA_H
#define GEANY_PLUGIN_DATA_H 1
-#include "geany.h" /* for GEANY_DEPRECATED */
#include "build.h" /* GeanyBuildGroup, GeanyBuildSource, GeanyBuildCmdEntries enums */
#include "document.h" /* GeanyDocument */
#include "editor.h" /* GeanyEditor, GeanyIndentType */
@@ -386,78 +385,6 @@ struct GeanyProxyFuncs
gint geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensions);
-/* Deprecated aliases */
-#ifndef GEANY_DISABLE_DEPRECATED
-
-/* This remains so that older plugins that contain a `GeanyFunctions *geany_functions;`
- * variable in their plugin - as was previously required - will still compile
- * without changes. */
-typedef struct GeanyFunctionsUndefined GeanyFunctions GEANY_DEPRECATED;
-
-/** @deprecated - use plugin_set_key_group() instead.
- * @see PLUGIN_KEY_GROUP() macro. */
-typedef struct GeanyKeyGroupInfo
-{
- const gchar *name; /**< Group name used in the configuration file, such as @c "html_chars" */
- gsize count; /**< The number of keybindings the group will hold */
-}
-GeanyKeyGroupInfo GEANY_DEPRECATED_FOR(plugin_set_key_group);
-
-/** @deprecated - use plugin_set_key_group() instead.
- * Declare and initialise a keybinding group.
- * @code GeanyKeyGroup *plugin_key_group; @endcode
- * You must then set the @c plugin_key_group::keys[] entries for the group in plugin_init(),
- * normally using keybindings_set_item().
- * The @c plugin_key_group::label field is set by Geany after @c plugin_init()
- * is called, to the name of the plugin.
- * @param group_name A unique group name (without quotes) to be used in the
- * configuration file, such as @c html_chars.
- * @param key_count The number of keybindings the group will hold. */
-#define PLUGIN_KEY_GROUP(group_name, key_count) \
- /* We have to declare this as a single element array.
- * Declaring as a pointer to a struct doesn't work with g_module_symbol(). */ \
- GeanyKeyGroupInfo plugin_key_group_info[1] = \
- { \
- {G_STRINGIFY(group_name), key_count} \
- };\
- GeanyKeyGroup *plugin_key_group = NULL;
-
-/** @deprecated Use @ref ui_add_document_sensitive() instead.
- * Flags to be set by plugins in PluginFields struct. */
-typedef enum
-{
- /** Whether a plugin's menu item should be disabled when there are no open documents */
- PLUGIN_IS_DOCUMENT_SENSITIVE = 1 << 0
-}
-PluginFlags;
-
-/** @deprecated Use @ref ui_add_document_sensitive() instead.
- * Fields set and owned by the plugin. */
-typedef struct PluginFields
-{
- /** Bitmask of @c PluginFlags. */
- PluginFlags flags;
- /** Pointer to a plugin's menu item which will be automatically enabled/disabled when there
- * are no open documents and @c PLUGIN_IS_DOCUMENT_SENSITIVE is set.
- * This is required if using @c PLUGIN_IS_DOCUMENT_SENSITIVE, ignored otherwise */
- GtkWidget *menu_item;
-}
-PluginFields GEANY_DEPRECATED_FOR(ui_add_document_sensitive);
-
-#define document_reload_file document_reload_force
-
-/** @deprecated - copy into your plugin code if needed.
- * @c NULL-safe way to get the index of @a doc_ptr in the documents array. */
-#define DOC_IDX(doc_ptr) \
- (doc_ptr ? doc_ptr->index : -1)
-#define DOC_IDX_VALID(doc_idx) \
- ((doc_idx) >= 0 && (guint)(doc_idx) < documents_array->len && documents[doc_idx]->is_valid)
-
-#define GEANY_WINDOW_MINIMAL_WIDTH 550
-#define GEANY_WINDOW_MINIMAL_HEIGHT GEANY_DEFAULT_DIALOG_HEIGHT
-
-#endif /* GEANY_DISABLE_DEPRECATED */
-
G_END_DECLS
#endif /* GEANY_PLUGIN_DATA_H */
Modified: src/pluginprivate.h
1 lines changed, 0 insertions(+), 1 deletions(-)
===================================================================
@@ -55,7 +55,6 @@ typedef struct GeanyPluginPrivate
void (*configure_single) (GtkWidget *parent); /* plugin configure dialog, optional and deprecated */
/* extra stuff */
- PluginFields fields;
GeanyKeyGroup *key_group;
GeanyAutoSeparator toolbar_separator;
GArray *signal_ids; /* SignalConnection's to disconnect when unloading */
Modified: src/plugins.c
49 lines changed, 0 insertions(+), 49 deletions(-)
===================================================================
@@ -274,44 +274,6 @@ static void add_callbacks(Plugin *plugin, PluginCallback *callbacks)
}
-static void read_key_group(Plugin *plugin)
-{
- GeanyKeyGroupInfo *p_key_info;
- GeanyKeyGroup **p_key_group;
- GModule *module = plugin->proxy_data;
-
- g_module_symbol(module, "plugin_key_group_info", (void *) &p_key_info);
- g_module_symbol(module, "plugin_key_group", (void *) &p_key_group);
- if (p_key_info && p_key_group)
- {
- GeanyKeyGroupInfo *key_info = p_key_info;
-
- if (*p_key_group)
- geany_debug("Ignoring plugin_key_group symbol for plugin '%s' - "
- "use plugin_set_key_group() instead to allocate keybindings dynamically.",
- plugin->info.name);
- else
- {
- if (key_info->count)
- {
- GeanyKeyGroup *key_group =
- plugin_set_key_group(&plugin->public, key_info->name, key_info->count, NULL);
- if (key_group)
- *p_key_group = key_group;
- }
- else
- geany_debug("Ignoring plugin_key_group_info symbol for plugin '%s' - "
- "count field is zero. Maybe use plugin_set_key_group() instead?",
- plugin->info.name);
- }
- }
- else if (p_key_info || p_key_group)
- geany_debug("Ignoring only one of plugin_key_group[_info] symbols defined for plugin '%s'. "
- "Maybe use plugin_set_key_group() instead?",
- plugin->info.name);
-}
-
-
static gint cmp_plugin_names(gconstpointer a, gconstpointer b)
{
const Plugin *pa = a;
@@ -551,7 +513,6 @@ plugin_load(Plugin *plugin)
{
GeanyPlugin **p_geany_plugin;
PluginInfo **p_info;
- PluginFields **plugin_fields;
GModule *module = plugin->proxy_data;
/* set these symbols before plugin_init() is called
* we don't set geany_data since it is set directly by plugin_new() */
@@ -561,19 +522,9 @@ plugin_load(Plugin *plugin)
g_module_symbol(module, "plugin_info", (void *) &p_info);
if (p_info)
*p_info = &plugin->info;
- g_module_symbol(module, "plugin_fields", (void *) &plugin_fields);
- if (plugin_fields)
- *plugin_fields = &plugin->fields;
- read_key_group(plugin);
/* Legacy plugin_init() cannot fail. */
plugin->cbs.init(&plugin->public, plugin->cb_data);
-
- /* now read any plugin-owned data that might have been set in plugin_init() */
- if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE)
- {
- ui_add_document_sensitive(plugin->fields.menu_item);
- }
}
else
{
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list