Revision: 386 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=386&view=rev Author: frlan Date: 2009-01-19 22:51:20 +0000 (Mon, 19 Jan 2009)
Log Message: ----------- GeanyLipsum: Added key bindings support
Modified Paths: -------------- trunk/geanylipsum/src/geanylipsum.c
Modified: trunk/geanylipsum/src/geanylipsum.c =================================================================== --- trunk/geanylipsum/src/geanylipsum.c 2009-01-19 21:21:36 UTC (rev 385) +++ trunk/geanylipsum/src/geanylipsum.c 2009-01-19 22:51:20 UTC (rev 386) @@ -65,6 +65,16 @@ static GtkWidget *main_menu_item = NULL;
+/* Doing some basic keybinding stuff */ +enum +{ + LIPSUM_KB_INSERT, + COUNT_KB +}; + +PLUGIN_KEY_GROUP(geanylipsum, COUNT_KB); + + void insert_string(gchar *string) { @@ -135,7 +145,12 @@
}
+static void kblipsum_insert(G_GNUC_UNUSED guint key_id) +{ + lipsum_activated(NULL, NULL); +}
+ /* Called by Geany to initialize the plugin */ void plugin_init(G_GNUC_UNUSED GeanyData *data) @@ -154,7 +169,13 @@ G_CALLBACK(lipsum_activated), NULL); gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_lipsum);
+ /* init keybindins */ + + keybindings_set_item(plugin_key_group, LIPSUM_KB_INSERT, kblipsum_insert, + 0, 0, "inster_lipsum", _("Insert Lipsum tex"), menu_lipsum); + main_menu_item = menu_lipsum; + }
/* Called by Geany before unloading the plugin. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.