SF.net SVN: geany:[3306] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Dec 2 17:05:53 UTC 2008


Revision: 3306
          http://geany.svn.sourceforge.net/geany/?rev=3306&view=rev
Author:   ntrel
Date:     2008-12-02 17:05:50 +0000 (Tue, 02 Dec 2008)

Log Message:
-----------
Add header guards for geanyfunctions.h and include pluginmacros.h
temporarily.
Update Demo plugin.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/plugins/demoplugin.c
    trunk/plugins/geanyfunctions.h
    trunk/plugins/genapi.py

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-12-02 16:34:32 UTC (rev 3305)
+++ trunk/ChangeLog	2008-12-02 17:05:50 UTC (rev 3306)
@@ -8,6 +8,10 @@
    p_plugin->add_toolbar_item(...).
    Note: For now, building on Windows or with Waf needs genapi.py to be
    run manually when adding plugin API functions.
+ * plugins/geanyfunctions.h, plugins/demoplugin.c, plugins/genapi.py:
+   Add header guards for geanyfunctions.h and include pluginmacros.h
+   temporarily.
+   Update Demo plugin.
 
 
 2008-12-01  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/plugins/demoplugin.c
===================================================================
--- trunk/plugins/demoplugin.c	2008-12-02 16:34:32 UTC (rev 3305)
+++ trunk/plugins/demoplugin.c	2008-12-02 17:05:50 UTC (rev 3306)
@@ -40,7 +40,7 @@
 #include "ui_utils.h"
 
 #include "plugindata.h"		/* this defines the plugin API */
-#include "pluginmacros.h"	/* some useful macros to save typing */
+#include "geanyfunctions.h"	/* this wraps geany_functions function pointers */
 
 
 /* These items are set by Geany before plugin_init() is called. */
@@ -51,7 +51,7 @@
 
 /* Check that the running Geany supports the plugin API used below, and check
  * for binary compatibility. */
-PLUGIN_VERSION_CHECK(100)
+PLUGIN_VERSION_CHECK(112)
 
 /* All plugins must set name, description, version and author. */
 PLUGIN_SET_INFO(_("Demo"), _("Example plugin."), VERSION, _("The Geany developer team"))
@@ -95,7 +95,7 @@
 	g_signal_connect(demo_item, "activate", G_CALLBACK(item_activate), NULL);
 
 	/* make the menu item sensitive only when documents are open */
-	p_ui->add_document_sensitive(demo_item);
+	ui_add_document_sensitive(demo_item);
 	/* keep a pointer to the menu item, so we can remove it when the plugin is unloaded */
 	main_menu_item = demo_item;
 

Modified: trunk/plugins/geanyfunctions.h
===================================================================
--- trunk/plugins/geanyfunctions.h	2008-12-02 16:34:32 UTC (rev 3305)
+++ trunk/plugins/geanyfunctions.h	2008-12-02 17:05:50 UTC (rev 3306)
@@ -1,3 +1,8 @@
+#ifndef GEANY_FUNCTIONS_H
+#define GEANY_FUNCTIONS_H
+
+#include "pluginmacros.h"
+
 #define plugin_add_toolbar_item \
 	p_plugin->add_toolbar_item
 #define document_new_file \
@@ -218,3 +223,5 @@
 	p_main->reload_configuration
 #define main_locale_init \
 	p_main->locale_init
+
+#endif

Modified: trunk/plugins/genapi.py
===================================================================
--- trunk/plugins/genapi.py	2008-12-02 16:34:32 UTC (rev 3305)
+++ trunk/plugins/genapi.py	2008-12-02 17:05:50 UTC (rev 3306)
@@ -63,9 +63,13 @@
 		sys.exit("No function names read!")
 
 	f = open(outfile, 'w')
+	print >>f, '#ifndef GEANY_FUNCTIONS_H'
+	print >>f, '#define GEANY_FUNCTIONS_H\n'
+	print >>f, '#include "pluginmacros.h"\n'
 	for fname in fnames:
 		ptr, name = get_api_tuple(fname)
-		print >>f, '#define ' + fname + ' \\\n\t' + ptr + '->' + name
+		print >>f, '#define %s \\\n\t%s->%s' % (fname, ptr, name)
+	print >>f, '\n#endif'
 	f.close
 
 	print 'Generated ' + outfile


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list