Add API signal "build-start" (patch by Jiří Techet, thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5053 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2010-06-18 17:15:28 +00:00
parent aca9e894fc
commit 6b4ba38e6d
5 changed files with 27 additions and 1 deletions

View File

@ -11,6 +11,8 @@
Improve documentation for PLUGIN_VERSION_CHECK().
* plugins/filebrowser.c:
Allow Find in Files when no items are selected.
* src/build.c, src/geanyobject.c, src/geanyobject.h, doc/plugins.dox:
Add API signal "build-start" (patch by Jiří Techet, thanks).
2010-06-17 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -253,6 +253,18 @@ PluginCallback plugin_callbacks[] =
* @param user_data user data.
* @endsignaldef
*
* @signaldef build-start
* @signalproto
* void user_function(GObject *obj, gpointer user_data);
* @endsignalproto
* @signaldesc
* Sent before build is started. Plugins can use this signal e.g. to save the opened documents
* before the build starts.
*
* @param obj a GeanyObject instance, should be ignored.
* @param user_data user data.
* @endsignaldef
*
* @signaldef update-editor-menu
* @signalproto
* void user_function(GObject *obj, const gchar *word, gint pos, GeanyDocument *doc,

View File

@ -1243,6 +1243,8 @@ static void on_build_menu_item(GtkWidget *w, gpointer user_data)
gint grp = GPOINTER_TO_GRP(user_data);
gint cmd = GPOINTER_TO_CMD(user_data);
g_signal_emit_by_name(geany_object, "build-start");
if (doc && doc->changed)
document_save_file(doc, FALSE);
if (grp == GEANY_GBG_NON_FT && cmd == GBO_TO_CMD(GEANY_GBO_CUSTOM))

View File

@ -286,12 +286,20 @@ static void create_signals(GObjectClass *g_object_class)
/* General signals */
geany_object_signals[GCB_GEANY_STARTUP_COMPLETE] = g_signal_new (
"geany-startup-complete",
G_OBJECT_CLASS_TYPE (g_object_class),
G_OBJECT_CLASS_TYPE (g_object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GeanyObjectClass, geany_startup_complete),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
geany_object_signals[GCB_BUILD_START] = g_signal_new (
"build-start",
G_OBJECT_CLASS_TYPE (g_object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GeanyObjectClass, build_start),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/* Core-only signals */
geany_object_signals[GCB_SAVE_SETTINGS] = g_signal_new (

View File

@ -45,6 +45,7 @@ typedef enum
GCB_UPDATE_EDITOR_MENU,
GCB_EDITOR_NOTIFY,
GCB_GEANY_STARTUP_COMPLETE,
GCB_BUILD_START,
GCB_SAVE_SETTINGS,
GCB_LOAD_SETTINGS,
GCB_MAX
@ -90,6 +91,7 @@ struct _GeanyObjectClass
void (*update_editor_menu)(const gchar *word, gint click_pos, GeanyDocument *doc);
gboolean (*editor_notify)(GeanyEditor *editor, gpointer scnt);
void (*geany_startup_complete)(void);
void (*build_start)(void);
void (*save_settings)(GKeyFile *keyfile);
void (*load_settings)(GKeyFile *keyfile);
};