57 gchar *key = g_strdup_printf(
"item%d", i++);
64 item = gtk_menu_item_new_with_label(
text);
65 gtk_widget_show(item);
67 gtk_widget_set_sensitive(item, FALSE);
83 dialog = gtk_message_dialog_new(
85 GTK_DIALOG_DESTROY_WITH_PARENT,
89 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
dialog),
90 _(
"(From the %s plugin)"), plugin->
info->
name);
92 gtk_dialog_run(GTK_DIALOG(
dialog));
93 gtk_widget_destroy(
dialog);
101 g_slist_free_full(data->
menu_items, (GDestroyNotify) gtk_widget_destroy);
110 gboolean
match = FALSE;
115 if (fgets(linebuf,
sizeof(linebuf), f) !=
NULL)
124 const gchar *
filename, gpointer pdata)
129 file = g_key_file_new();
130 result = g_key_file_load_from_file(file,
filename, 0,
NULL);
152 g_key_file_free(file);
161 g_free((gchar *)plugin->
info->
name);
166 g_key_file_free(data->
file);
174 const gchar *extensions[] = {
"ini",
"px",
NULL };
196 plugin->
info->
author =
_(
"The Geany developer team");
static gint demoproxy_probe(GeanyPlugin *proxy, const gchar *filename, gpointer pdata)
static gboolean demoproxy_init(GeanyPlugin *plugin, gpointer pdata)
static void proxy_help(GeanyPlugin *plugin, gpointer pdata)
static void demoproxy_cleanup(GeanyPlugin *plugin, gpointer data)
static void demoproxy_unload(GeanyPlugin *proxy, GeanyPlugin *plugin, gpointer load_data, gpointer pdata)
static gboolean proxy_init(GeanyPlugin *plugin, gpointer pdata)
G_MODULE_EXPORT void geany_load_module(GeanyPlugin *plugin)
Called by Geany when a plugin library is loaded.
static void proxy_cleanup(GeanyPlugin *plugin, gpointer pdata)
static gpointer demoproxy_load(GeanyPlugin *proxy, GeanyPlugin *plugin, const gchar *filename, gpointer pdata)
static bool match(const unsigned char *line, const char *word)
Single include for plugins.
@ GEANY_PROXY_IGNORE
The proxy is not responsible at all, and Geany or other plugins are free to probe it.
@ GEANY_PROXY_MATCH
The proxy is responsible for this file, and creates a plugin for it.
#define GEANY_PLUGIN_REGISTER_FULL(plugin, min_api_version, pdata, free_func)
Convenience macro to register a plugin with data.
gint geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensions)
Register the plugin as a proxy for other plugins.
#define GEANY_PLUGIN_REGISTER(plugin, min_api_version)
Convenience macro to register a plugin.
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
struct GeanyMainWidgets * main_widgets
Important widgets in the main window.
GtkWidget * window
Main window.
GtkWidget * tools_menu
Most plugins add menu items to the Tools menu.
gboolean(* init)(GeanyPlugin *plugin, gpointer pdata)
Called to initialize the plugin, when the user activates it (must not be NULL)
void(* help)(GeanyPlugin *plugin, gpointer pdata)
Called when the plugin should show some help, optional (can be NULL)
void(* cleanup)(GeanyPlugin *plugin, gpointer pdata)
Called when the plugin is disabled or when Geany exits (must not be NULL)
Basic information for the plugin and identification.
GeanyData * geany_data
Pointer to global GeanyData intance.
PluginInfo * info
Fields set in plugin_set_info().
GeanyProxyFuncs * proxy_funcs
Hooks implemented by the plugin if it wants to act as a proxy Must be set prior to calling geany_plug...
GeanyPluginFuncs * funcs
Functions implemented by the plugin, set in geany_load_module()
void(* unload)(GeanyPlugin *proxy, GeanyPlugin *subplugin, gpointer load_data, gpointer pdata)
Called when the user initiates unloading of a plugin, e.g.
gint(* probe)(GeanyPlugin *proxy, const gchar *filename, gpointer pdata)
Called to determine whether the proxy is truly responsible for the requested plugin.
gpointer(* load)(GeanyPlugin *proxy, GeanyPlugin *subplugin, const gchar *filename, gpointer pdata)
Called after probe(), to perform the actual job of loading the plugin.
Demo proxy - example of a basic proxy plugin for Geany.
const gchar * version
The version of the plugin.
const gchar * description
The description of the plugin.
const gchar * name
The name of the plugin.
const gchar * author
The author of the plugin.
gboolean utils_str_equal(const gchar *a, const gchar *b)
NULL-safe string comparison.