Revision: 5053 http://geany.svn.sourceforge.net/geany/?rev=5053&view=rev Author: ntrel Date: 2010-06-18 17:15:28 +0000 (Fri, 18 Jun 2010)
Log Message: ----------- Add API signal "build-start" (patch by Ji?\197?\153?\195?\173 Techet, thanks).
Modified Paths: -------------- trunk/ChangeLog trunk/doc/plugins.dox trunk/src/build.c trunk/src/geanyobject.c trunk/src/geanyobject.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-06-18 17:03:35 UTC (rev 5052) +++ trunk/ChangeLog 2010-06-18 17:15:28 UTC (rev 5053) @@ -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>
Modified: trunk/doc/plugins.dox =================================================================== --- trunk/doc/plugins.dox 2010-06-18 17:03:35 UTC (rev 5052) +++ trunk/doc/plugins.dox 2010-06-18 17:15:28 UTC (rev 5053) @@ -253,6 +253,18 @@ * @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,
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2010-06-18 17:03:35 UTC (rev 5052) +++ trunk/src/build.c 2010-06-18 17:15:28 UTC (rev 5053) @@ -1243,6 +1243,8 @@ 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))
Modified: trunk/src/geanyobject.c =================================================================== --- trunk/src/geanyobject.c 2010-06-18 17:03:35 UTC (rev 5052) +++ trunk/src/geanyobject.c 2010-06-18 17:15:28 UTC (rev 5053) @@ -286,12 +286,20 @@ /* 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 (
Modified: trunk/src/geanyobject.h =================================================================== --- trunk/src/geanyobject.h 2010-06-18 17:03:35 UTC (rev 5052) +++ trunk/src/geanyobject.h 2010-06-18 17:15:28 UTC (rev 5053) @@ -45,6 +45,7 @@ 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 @@ 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); };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.