Add header guards for geanyfunctions.h and include pluginmacros.h

temporarily.
Update Demo plugin.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3306 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-12-02 17:05:50 +00:00
parent 98e127d3bd
commit 80a8939612
4 changed files with 19 additions and 4 deletions

View File

@ -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>

View File

@ -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 @@ GeanyFunctions *geany_functions;
/* 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 @@ void plugin_init(GeanyData *data)
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;

View File

@ -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

View File

@ -63,9 +63,13 @@ if __name__ == "__main__":
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