geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

demoplugin.c File Reference
#include "geanyplugin.h"
#include "Scintilla.h"
Include dependency graph for demoplugin.c:

Go to the source code of this file.

Functions

static gboolean on_editor_notify (GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data)
 
static void item_activate (GtkMenuItem *menuitem, gpointer gdata)
 
static gboolean demo_init (GeanyPlugin *plugin, 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)
 
void geany_load_module (GeanyPlugin *plugin)
 Called by Geany when a plugin library is loaded. More...
 

Variables

static GtkWidget * main_menu_item = NULL
 Demo plugin - example of a basic plugin for Geany. More...
 
static gchar * welcome_text = NULL
 
static PluginCallback demo_callbacks []
 

Function Documentation

◆ demo_cleanup()

static void demo_cleanup ( GeanyPlugin plugin,
gpointer  data 
)
static

Definition at line 208 of file demoplugin.c.

References main_menu_item, and welcome_text.

Referenced by geany_load_module().

◆ demo_configure()

static GtkWidget * demo_configure ( GeanyPlugin plugin,
GtkDialog *  dialog,
gpointer  data 
)
static

◆ demo_init()

◆ geany_load_module()

void geany_load_module ( GeanyPlugin plugin)

Called by Geany when a plugin library is loaded.

This is the original entry point. Implement and export this function to be loadable at all. Then fill in GeanyPlugin::info and GeanyPlugin::funcs of the passed plugin. Finally GEANY_PLUGIN_REGISTER() and specify a minimum supported API version.

For all glory details please read Plugin HowTo.

Because the plugin is not yet enabled by the user you may not call plugin API functions inside this function, except for the API functions below which are required for proper registration.

API functions which are allowed to be called within this function:

Parameters
pluginThe unique plugin handle to your plugin. You must set some fields here.
Since
1.26 (API 225)
See also
Plugin HowTo

Definition at line 216 of file demoplugin.c.

References _, PluginInfo::author, GeanyPluginFuncs::callbacks, GeanyPluginFuncs::cleanup, GeanyPluginFuncs::configure, demo_callbacks, demo_cleanup(), demo_configure(), demo_init(), PluginInfo::description, GeanyPlugin::funcs, GEANY_PLUGIN_REGISTER, GETTEXT_PACKAGE, GeanyPluginFuncs::help, GeanyPlugin::info, GeanyPluginFuncs::init, main_locale_init(), PluginInfo::name, NULL, and PluginInfo::version.

◆ item_activate()

static void item_activate ( GtkMenuItem *  menuitem,
gpointer  gdata 
)
static

◆ on_configure_response()

static void on_configure_response ( GtkDialog *  dialog,
gint  response,
gpointer  user_data 
)
static

Definition at line 157 of file demoplugin.c.

References entry, and welcome_text.

Referenced by demo_configure().

◆ on_editor_notify()

static gboolean on_editor_notify ( GObject *  object,
GeanyEditor editor,
SCNotification nt,
gpointer  data 
)
static

Variable Documentation

◆ demo_callbacks

PluginCallback demo_callbacks[]
static
Initial value:
=
{
{ "editor-notify", (GCallback) &on_editor_notify, FALSE, NULL },
{ NULL, NULL, FALSE, NULL }
}
static gboolean on_editor_notify(GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data)
Definition: demoplugin.c:42
#define NULL
Definition: rbtree.h:150

Definition at line 92 of file demoplugin.c.

Referenced by geany_load_module().

◆ main_menu_item

GtkWidget* main_menu_item = NULL
static

Demo plugin - example of a basic plugin for Geany.

Adds a menu item to the Tools menu.

Note: This is not installed by default, but (on *nix) you can build it as follows: cd plugins make demoplugin.so

Then copy or symlink the plugins/demoplugin.so file to ~/.config/geany/plugins

  • it will be loaded at next startup.

Definition at line 37 of file demoplugin.c.

Referenced by demo_cleanup(), and demo_init().

◆ welcome_text

gchar* welcome_text = NULL
static