2007-06-26 16:17:16 +00:00
|
|
|
/*
|
|
|
|
* plugins.c - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
|
|
|
* Copyright 2007 Enrico Tröger <enrico.troeger@uvena.de>
|
|
|
|
* Copyright 2007 Nick Treleaven <nick.treleaven@btinternet.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
* MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Code to manage, load and unload plugins. */
|
|
|
|
|
|
|
|
#include "geany.h"
|
|
|
|
|
|
|
|
#ifdef HAVE_PLUGINS
|
|
|
|
|
2007-07-28 17:44:02 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2007-08-03 15:05:53 +00:00
|
|
|
#ifndef PLAT_GTK
|
|
|
|
# define PLAT_GTK 1 // needed for ScintillaWidget.h
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Scintilla.h"
|
|
|
|
#include "ScintillaWidget.h"
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
#include "plugins.h"
|
|
|
|
#include "plugindata.h"
|
|
|
|
#include "support.h"
|
|
|
|
#include "utils.h"
|
2007-07-04 11:32:33 +00:00
|
|
|
#include "document.h"
|
|
|
|
#include "templates.h"
|
|
|
|
#include "sciwrappers.h"
|
2007-07-13 14:54:11 +00:00
|
|
|
#include "ui_utils.h"
|
2007-08-03 15:05:53 +00:00
|
|
|
#include "editor.h"
|
2007-08-10 16:11:17 +00:00
|
|
|
#include "geanyobject.h"
|
2007-06-26 16:17:16 +00:00
|
|
|
|
2007-07-28 17:44:02 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
# define PLUGIN_EXT "dll"
|
|
|
|
#else
|
|
|
|
# define PLUGIN_EXT "so"
|
|
|
|
#endif
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
typedef struct Plugin
|
2007-06-26 16:17:16 +00:00
|
|
|
{
|
2007-07-23 15:41:08 +00:00
|
|
|
GModule *module;
|
|
|
|
gchar *filename; // plugin filename (/path/libname.so)
|
|
|
|
PluginFields fields;
|
|
|
|
|
|
|
|
PluginInfo* (*info) (); /* Returns plugin name, description */
|
2007-07-27 10:37:22 +00:00
|
|
|
void (*init) (GeanyData *data); /* Called when the plugin is enabled */
|
2007-07-23 15:41:08 +00:00
|
|
|
void (*cleanup) (); /* Called when the plugin is disabled or when Geany exits */
|
2007-07-04 11:32:33 +00:00
|
|
|
}
|
|
|
|
Plugin;
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
static GList *plugin_list = NULL;
|
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
|
2007-07-13 11:22:47 +00:00
|
|
|
static DocumentFuncs doc_funcs = {
|
2007-07-23 15:41:08 +00:00
|
|
|
&document_new_file,
|
2007-07-24 11:43:46 +00:00
|
|
|
&document_get_cur_idx,
|
|
|
|
&document_get_current
|
2007-07-13 14:54:11 +00:00
|
|
|
};
|
2007-07-04 11:32:33 +00:00
|
|
|
|
2007-07-13 11:22:47 +00:00
|
|
|
static ScintillaFuncs sci_funcs = {
|
2007-08-03 15:05:53 +00:00
|
|
|
&scintilla_send_message,
|
|
|
|
&sci_cmd,
|
|
|
|
&sci_start_undo_action,
|
|
|
|
&sci_end_undo_action,
|
2007-07-23 15:41:08 +00:00
|
|
|
&sci_set_text,
|
|
|
|
&sci_insert_text,
|
2007-07-24 11:43:46 +00:00
|
|
|
&sci_get_text,
|
|
|
|
&sci_get_length,
|
2007-08-03 15:05:53 +00:00
|
|
|
&sci_get_current_position,
|
|
|
|
&sci_set_current_position,
|
|
|
|
&sci_get_col_from_position,
|
|
|
|
&sci_get_line_from_position,
|
|
|
|
&sci_get_position_from_line,
|
2007-07-24 11:43:46 +00:00
|
|
|
&sci_replace_sel,
|
|
|
|
&sci_get_selected_text,
|
2007-08-03 15:05:53 +00:00
|
|
|
&sci_get_selected_text_length,
|
|
|
|
&sci_get_selection_start,
|
|
|
|
&sci_get_selection_end,
|
|
|
|
&sci_get_selection_mode,
|
|
|
|
&sci_set_selection_mode,
|
|
|
|
&sci_set_selection_start,
|
|
|
|
&sci_set_selection_end,
|
|
|
|
&sci_get_text_range,
|
|
|
|
&sci_get_line,
|
|
|
|
&sci_get_line_length,
|
|
|
|
&sci_get_line_count,
|
|
|
|
&sci_get_line_is_visible,
|
|
|
|
&sci_ensure_line_is_visible,
|
|
|
|
&sci_scroll_caret,
|
|
|
|
&sci_find_bracematch
|
2007-07-13 14:54:11 +00:00
|
|
|
};
|
2007-07-04 11:32:33 +00:00
|
|
|
|
2007-07-13 11:22:47 +00:00
|
|
|
static TemplateFuncs template_funcs = {
|
|
|
|
&templates_get_template_fileheader
|
2007-07-13 14:54:11 +00:00
|
|
|
};
|
2007-07-04 11:32:33 +00:00
|
|
|
|
2007-07-13 11:22:47 +00:00
|
|
|
static UtilsFuncs utils_funcs = {
|
|
|
|
&utils_str_equal,
|
2007-07-24 11:43:46 +00:00
|
|
|
&utils_str_replace,
|
|
|
|
&utils_get_file_list
|
2007-07-13 14:54:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static UIUtilsFuncs uiutils_funcs = {
|
|
|
|
&ui_dialog_vbox_new,
|
|
|
|
&ui_frame_new_with_alignment
|
|
|
|
};
|
2007-07-04 11:32:33 +00:00
|
|
|
|
2007-08-03 15:05:53 +00:00
|
|
|
static SupportFuncs support_funcs = {
|
|
|
|
&lookup_widget
|
|
|
|
};
|
|
|
|
|
2007-07-27 10:37:22 +00:00
|
|
|
|
|
|
|
static GeanyData geany_data = {
|
2007-07-26 12:06:12 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2007-08-03 15:05:53 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2007-07-26 12:06:12 +00:00
|
|
|
|
|
|
|
&doc_funcs,
|
|
|
|
&sci_funcs,
|
|
|
|
&template_funcs,
|
|
|
|
&utils_funcs,
|
|
|
|
&uiutils_funcs,
|
2007-08-03 15:05:53 +00:00
|
|
|
&support_funcs
|
2007-07-26 12:06:12 +00:00
|
|
|
};
|
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
|
|
|
|
static void
|
2007-07-26 12:06:12 +00:00
|
|
|
geany_data_init()
|
2007-07-04 11:32:33 +00:00
|
|
|
{
|
2007-07-26 12:06:12 +00:00
|
|
|
geany_data.app = app;
|
|
|
|
geany_data.tools_menu = lookup_widget(app->window, "tools1_menu");
|
|
|
|
geany_data.doc_array = doc_array;
|
2007-08-03 15:05:53 +00:00
|
|
|
geany_data.filetypes = filetypes;
|
|
|
|
geany_data.editor_prefs = &editor_prefs;
|
2007-07-04 11:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
/* Prevent the same plugin filename being loaded more than once.
|
|
|
|
* Note: g_module_name always returns the .so name, even when Plugin::filename
|
|
|
|
* is an .la file. */
|
|
|
|
static gboolean
|
|
|
|
plugin_loaded(GModule *module)
|
|
|
|
{
|
2007-08-04 16:25:13 +00:00
|
|
|
gchar *basename_module, *basename_loaded;
|
2007-06-26 16:17:16 +00:00
|
|
|
GList *item;
|
|
|
|
|
2007-08-04 16:25:13 +00:00
|
|
|
basename_module = g_path_get_basename(g_module_name(module));
|
2007-06-26 16:17:16 +00:00
|
|
|
for (item = plugin_list; item != NULL; item = g_list_next(item))
|
|
|
|
{
|
2007-08-04 16:25:13 +00:00
|
|
|
basename_loaded = g_path_get_basename(
|
|
|
|
g_module_name(((Plugin*)item->data)->module));
|
2007-06-26 16:17:16 +00:00
|
|
|
|
2007-08-04 16:25:13 +00:00
|
|
|
if (utils_str_equal(basename_module, basename_loaded))
|
|
|
|
{
|
|
|
|
g_free(basename_loaded);
|
|
|
|
g_free(basename_module);
|
2007-06-26 16:17:16 +00:00
|
|
|
return TRUE;
|
2007-08-04 16:25:13 +00:00
|
|
|
}
|
|
|
|
g_free(basename_loaded);
|
2007-06-26 16:17:16 +00:00
|
|
|
}
|
2007-08-04 16:25:13 +00:00
|
|
|
g_free(basename_module);
|
2007-06-26 16:17:16 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_check_version(GModule *module)
|
|
|
|
{
|
|
|
|
gint (*version_check)(gint) = NULL;
|
|
|
|
gint result;
|
|
|
|
|
|
|
|
g_module_symbol(module, "version_check", (void *) &version_check);
|
|
|
|
|
|
|
|
if (version_check)
|
|
|
|
{
|
|
|
|
result = version_check(abi_version);
|
|
|
|
if (result < 0)
|
|
|
|
{
|
|
|
|
geany_debug("Plugin \"%s\" is not binary compatible with this "
|
|
|
|
"release of Geany - recompile it.", g_module_name(module));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (result > 0)
|
|
|
|
{
|
|
|
|
geany_debug("Plugin \"%s\" requires a newer version of Geany (API >= v%d).",
|
|
|
|
g_module_name(module), result);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-10 16:11:17 +00:00
|
|
|
// TODO: disconnect the callbacks when the plugin is unloaded.
|
|
|
|
static void add_callbacks(GeanyCallback *callbacks)
|
|
|
|
{
|
|
|
|
GeanyCallback *cb;
|
|
|
|
guint i = 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
cb = &callbacks[i];
|
|
|
|
if (!cb->signal_name || !cb->callback)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (cb->after)
|
|
|
|
g_signal_connect_after(geany_object, cb->signal_name, cb->callback, cb->user_data);
|
|
|
|
else
|
|
|
|
g_signal_connect(geany_object, cb->signal_name, cb->callback, cb->user_data);
|
|
|
|
i++;
|
|
|
|
} while (TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
static Plugin*
|
|
|
|
plugin_new(const gchar *fname)
|
|
|
|
{
|
|
|
|
Plugin *plugin;
|
|
|
|
GModule *module;
|
2007-06-27 15:56:42 +00:00
|
|
|
PluginInfo* (*info)();
|
2007-07-23 15:41:08 +00:00
|
|
|
PluginFields **plugin_fields;
|
2007-07-27 10:37:22 +00:00
|
|
|
GeanyData **p_geany_data;
|
2007-08-10 16:11:17 +00:00
|
|
|
GeanyCallback *callbacks;
|
2007-06-26 16:17:16 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail(fname, NULL);
|
|
|
|
g_return_val_if_fail(g_module_supported(), NULL);
|
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
/* Don't use G_MODULE_BIND_LAZY otherwise we can get unresolved symbols at runtime,
|
2007-07-23 15:41:08 +00:00
|
|
|
* causing a segfault. Without that flag the module will safely fail to load.
|
|
|
|
* G_MODULE_BIND_LOCAL also helps find undefined symbols e.g. app when it would
|
|
|
|
* otherwise not be detected due to the shadowing of Geany's app variable.
|
|
|
|
* Also without G_MODULE_BIND_LOCAL calling info() in a plugin will be shadowed. */
|
|
|
|
module = g_module_open(fname, G_MODULE_BIND_LOCAL);
|
2007-06-26 16:17:16 +00:00
|
|
|
if (! module)
|
|
|
|
{
|
|
|
|
g_warning("%s", g_module_error());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (plugin_loaded(module))
|
|
|
|
{
|
|
|
|
geany_debug("Plugin \"%s\" already loaded.", fname);
|
|
|
|
|
|
|
|
if (! g_module_close(module))
|
|
|
|
g_warning("%s: %s", fname, g_module_error());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! plugin_check_version(module))
|
|
|
|
{
|
|
|
|
if (! g_module_close(module))
|
|
|
|
g_warning("%s: %s", fname, g_module_error());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-06-27 15:56:42 +00:00
|
|
|
g_module_symbol(module, "info", (void *) &info);
|
|
|
|
if (info == NULL)
|
|
|
|
{
|
|
|
|
geany_debug("Unknown plugin info for \"%s\"!", fname);
|
|
|
|
|
|
|
|
if (! g_module_close(module))
|
|
|
|
g_warning("%s: %s", fname, g_module_error());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
geany_debug("Initializing plugin '%s' (%s)",
|
|
|
|
info()->name, info()->description);
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
plugin = g_new0(Plugin, 1);
|
2007-06-27 15:56:42 +00:00
|
|
|
plugin->info = info;
|
2007-06-26 16:17:16 +00:00
|
|
|
plugin->filename = g_strdup(fname);
|
|
|
|
plugin->module = module;
|
|
|
|
|
2007-07-27 10:37:22 +00:00
|
|
|
g_module_symbol(module, "geany_data", (void *) &p_geany_data);
|
|
|
|
if (p_geany_data)
|
|
|
|
*p_geany_data = &geany_data;
|
2007-07-23 15:41:08 +00:00
|
|
|
g_module_symbol(module, "plugin_fields", (void *) &plugin_fields);
|
|
|
|
if (plugin_fields)
|
|
|
|
*plugin_fields = &plugin->fields;
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
g_module_symbol(module, "init", (void *) &plugin->init);
|
|
|
|
g_module_symbol(module, "cleanup", (void *) &plugin->cleanup);
|
2007-07-25 11:59:34 +00:00
|
|
|
if (plugin->init != NULL && plugin->cleanup == NULL)
|
|
|
|
{
|
|
|
|
if (app->debug_mode)
|
|
|
|
g_warning("Plugin '%s' has no cleanup() function - there may be memory leaks!",
|
|
|
|
info()->name);
|
|
|
|
}
|
2007-06-26 16:17:16 +00:00
|
|
|
|
|
|
|
if (plugin->init)
|
2007-07-26 12:06:12 +00:00
|
|
|
plugin->init(&geany_data);
|
2007-06-26 16:17:16 +00:00
|
|
|
|
2007-07-23 15:41:08 +00:00
|
|
|
if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE)
|
|
|
|
{
|
|
|
|
gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) ? TRUE : FALSE;
|
|
|
|
gtk_widget_set_sensitive(plugin->fields.menu_item, enable);
|
|
|
|
}
|
|
|
|
|
2007-08-10 16:11:17 +00:00
|
|
|
g_module_symbol(module, "geany_callbacks", (void *) &callbacks);
|
|
|
|
if (callbacks)
|
|
|
|
add_callbacks(callbacks);
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
geany_debug("Loaded: %s (%s)", fname,
|
2007-06-27 15:56:42 +00:00
|
|
|
NVL(plugin->info()->name, "<Unknown>"));
|
2007-06-26 16:17:16 +00:00
|
|
|
return plugin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
plugin_free(Plugin *plugin)
|
|
|
|
{
|
|
|
|
g_return_if_fail(plugin);
|
|
|
|
g_return_if_fail(plugin->module);
|
|
|
|
|
|
|
|
if (plugin->cleanup)
|
|
|
|
plugin->cleanup();
|
|
|
|
|
|
|
|
if (! g_module_close(plugin->module))
|
|
|
|
g_warning("%s: %s", plugin->filename, g_module_error());
|
|
|
|
else
|
|
|
|
geany_debug("Unloaded: %s", plugin->filename);
|
|
|
|
|
|
|
|
g_free(plugin->filename);
|
|
|
|
g_free(plugin);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-26 12:06:12 +00:00
|
|
|
static void
|
2007-07-28 11:47:56 +00:00
|
|
|
load_plugins(const gchar *path)
|
2007-06-26 16:17:16 +00:00
|
|
|
{
|
|
|
|
GSList *list, *item;
|
2007-07-28 17:44:02 +00:00
|
|
|
gchar *fname, *tmp;
|
|
|
|
Plugin *plugin;
|
2007-06-26 16:17:16 +00:00
|
|
|
|
|
|
|
list = utils_get_file_list(path, NULL, NULL);
|
|
|
|
|
|
|
|
for (item = list; item != NULL; item = g_slist_next(item))
|
|
|
|
{
|
2007-07-28 17:44:02 +00:00
|
|
|
tmp = strrchr(item->data, '.');
|
|
|
|
if (tmp == NULL || strcasecmp(tmp, "." PLUGIN_EXT) != 0)
|
|
|
|
continue;
|
2007-06-26 16:17:16 +00:00
|
|
|
|
2007-07-28 17:44:02 +00:00
|
|
|
fname = g_strconcat(path, G_DIR_SEPARATOR_S, item->data, NULL);
|
2007-06-26 16:17:16 +00:00
|
|
|
plugin = plugin_new(fname);
|
|
|
|
if (plugin != NULL)
|
|
|
|
{
|
|
|
|
plugin_list = g_list_append(plugin_list, plugin);
|
|
|
|
}
|
|
|
|
g_free(fname);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_foreach(list, (GFunc) g_free, NULL);
|
|
|
|
g_slist_free(list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-28 17:44:02 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
static gchar *get_plugin_path()
|
|
|
|
{
|
|
|
|
gchar *install_dir = g_win32_get_package_installation_directory("geany", NULL);
|
|
|
|
gchar *path;
|
|
|
|
|
|
|
|
path = g_strconcat(install_dir, "\\plugins", NULL);
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2007-08-10 16:11:17 +00:00
|
|
|
static void load_plugin_paths()
|
2007-07-26 12:06:12 +00:00
|
|
|
{
|
2007-07-28 17:44:02 +00:00
|
|
|
gchar *path;
|
2007-07-27 11:34:16 +00:00
|
|
|
|
2007-07-28 17:44:02 +00:00
|
|
|
path = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "plugins", NULL);
|
2007-07-28 11:47:56 +00:00
|
|
|
// first load plugins in ~/.geany/plugins/, then in $prefix/lib/geany
|
2007-07-28 17:44:02 +00:00
|
|
|
load_plugins(path);
|
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
g_free(path);
|
|
|
|
path = get_plugin_path();
|
|
|
|
load_plugins(path);
|
|
|
|
#else
|
2007-07-28 11:47:56 +00:00
|
|
|
load_plugins(PACKAGE_LIB_DIR G_DIR_SEPARATOR_S "geany");
|
2007-07-28 17:44:02 +00:00
|
|
|
#endif
|
2007-07-28 11:47:56 +00:00
|
|
|
|
2007-07-28 17:44:02 +00:00
|
|
|
g_free(path);
|
2007-07-26 12:06:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-10 16:11:17 +00:00
|
|
|
void plugins_init()
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
geany_data_init();
|
|
|
|
geany_object = geany_object_new();
|
|
|
|
|
|
|
|
widget = gtk_separator_menu_item_new();
|
|
|
|
gtk_container_add(GTK_CONTAINER(geany_data.tools_menu), widget);
|
|
|
|
|
|
|
|
load_plugin_paths();
|
|
|
|
|
|
|
|
if (g_list_length(plugin_list) > 0)
|
|
|
|
gtk_widget_show(widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
void plugins_free()
|
|
|
|
{
|
2007-08-10 16:11:17 +00:00
|
|
|
g_object_unref(geany_object);
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
if (plugin_list != NULL)
|
|
|
|
{
|
|
|
|
g_list_foreach(plugin_list, (GFunc) plugin_free, NULL);
|
|
|
|
g_list_free(plugin_list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-23 15:41:08 +00:00
|
|
|
void plugins_update_document_sensitive(gboolean enabled)
|
|
|
|
{
|
|
|
|
GList *item;
|
|
|
|
|
|
|
|
for (item = plugin_list; item != NULL; item = g_list_next(item))
|
|
|
|
{
|
|
|
|
Plugin *plugin = item->data;
|
|
|
|
|
|
|
|
if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE)
|
|
|
|
gtk_widget_set_sensitive(plugin->fields.menu_item, enabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-26 16:17:16 +00:00
|
|
|
#endif
|