70 dialog = gtk_message_dialog_new(
72 GTK_DIALOG_DESTROY_WITH_PARENT,
75 _(
"The following files were dropped:"));
76 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
dialog),
79 gtk_dialog_run(GTK_DIALOG(
dialog));
80 gtk_widget_destroy(
dialog);
110 dialog = gtk_message_dialog_new(
112 GTK_DIALOG_DESTROY_WITH_PARENT,
116 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
dialog),
117 _(
"(From the %s plugin)"), plugin->
info->
name);
119 gtk_dialog_run(GTK_DIALOG(
dialog));
120 gtk_widget_destroy(
dialog);
127 GtkWidget *demo_item;
131 demo_item = gtk_menu_item_new_with_mnemonic(
_(
"_Demo Plugin"));
132 gtk_widget_show(demo_item);
134 g_signal_connect(demo_item,
"activate", G_CALLBACK(
item_activate), plugin);
160 if (response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY)
163 GtkWidget *
entry = GTK_WIDGET(user_data);
185 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
188 label = gtk_label_new(
_(
"Welcome text to show:"));
189 gtk_misc_set_alignment(GTK_MISC(
label), 0, 0.5);
190 entry = gtk_entry_new();
223 plugin->
info->
author =
_(
"The Geany developer team");
Interface to the edit control.
static PluginCallback demo_callbacks[]
static gboolean on_editor_notify(GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data)
static void on_configure_response(GtkDialog *dialog, gint response, gpointer user_data)
static GtkWidget * demo_configure(GeanyPlugin *plugin, GtkDialog *dialog, gpointer data)
static void demo_cleanup(GeanyPlugin *plugin, gpointer data)
static gboolean demo_init(GeanyPlugin *plugin, gpointer data)
static GtkWidget * main_menu_item
Demo plugin - example of a basic plugin for Geany.
void geany_load_module(GeanyPlugin *plugin)
Called by Geany when a plugin library is loaded.
static gchar * welcome_text
static void item_activate(GtkMenuItem *menuitem, gpointer gdata)
Single include for plugins.
void main_locale_init(const gchar *locale_dir, const gchar *package)
Initialises the gettext translation system.
void geany_plugin_set_data(GeanyPlugin *plugin, gpointer data, GDestroyNotify free_func)
Add additional data that corresponds to the plugin.
#define GEANY_PLUGIN_REGISTER(plugin, min_api_version)
Convenience macro to register a plugin.
const GeanyData * geany_data
Geany owned data pointers.
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
gtk_widget_show_all(dialog)
This contains pointers to global variables owned by Geany for plugins to use.
struct GeanyMainWidgets * main_widgets
Important widgets in the main window.
Editor-owned fields for each document.
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)
GtkWidget *(* configure)(GeanyPlugin *plugin, GtkDialog *dialog, gpointer pdata)
plugins configure dialog, optional (can be NULL)
PluginCallback * callbacks
Array of plugin-provided signal handlers.
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().
GeanyPluginFuncs * funcs
Functions implemented by the plugin, set in geany_load_module()
Callback array entry type used with the plugin_callbacks symbol.
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.
void ui_add_document_sensitive(GtkWidget *widget)
Adds a widget to the list of widgets that should be set sensitive/insensitive when some documents are...
void ui_set_statusbar(gboolean log, const gchar *format,...)
Displays text on the statusbar.