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:
parent
98e127d3bd
commit
80a8939612
@ -8,6 +8,10 @@
|
|||||||
p_plugin->add_toolbar_item(...).
|
p_plugin->add_toolbar_item(...).
|
||||||
Note: For now, building on Windows or with Waf needs genapi.py to be
|
Note: For now, building on Windows or with Waf needs genapi.py to be
|
||||||
run manually when adding plugin API functions.
|
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>
|
2008-12-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
#include "ui_utils.h"
|
#include "ui_utils.h"
|
||||||
|
|
||||||
#include "plugindata.h" /* this defines the plugin API */
|
#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. */
|
/* 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
|
/* Check that the running Geany supports the plugin API used below, and check
|
||||||
* for binary compatibility. */
|
* for binary compatibility. */
|
||||||
PLUGIN_VERSION_CHECK(100)
|
PLUGIN_VERSION_CHECK(112)
|
||||||
|
|
||||||
/* All plugins must set name, description, version and author. */
|
/* All plugins must set name, description, version and author. */
|
||||||
PLUGIN_SET_INFO(_("Demo"), _("Example plugin."), VERSION, _("The Geany developer team"))
|
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);
|
g_signal_connect(demo_item, "activate", G_CALLBACK(item_activate), NULL);
|
||||||
|
|
||||||
/* make the menu item sensitive only when documents are open */
|
/* 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 */
|
/* keep a pointer to the menu item, so we can remove it when the plugin is unloaded */
|
||||||
main_menu_item = demo_item;
|
main_menu_item = demo_item;
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
#ifndef GEANY_FUNCTIONS_H
|
||||||
|
#define GEANY_FUNCTIONS_H
|
||||||
|
|
||||||
|
#include "pluginmacros.h"
|
||||||
|
|
||||||
#define plugin_add_toolbar_item \
|
#define plugin_add_toolbar_item \
|
||||||
p_plugin->add_toolbar_item
|
p_plugin->add_toolbar_item
|
||||||
#define document_new_file \
|
#define document_new_file \
|
||||||
@ -218,3 +223,5 @@
|
|||||||
p_main->reload_configuration
|
p_main->reload_configuration
|
||||||
#define main_locale_init \
|
#define main_locale_init \
|
||||||
p_main->locale_init
|
p_main->locale_init
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@ -63,9 +63,13 @@ if __name__ == "__main__":
|
|||||||
sys.exit("No function names read!")
|
sys.exit("No function names read!")
|
||||||
|
|
||||||
f = open(outfile, 'w')
|
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:
|
for fname in fnames:
|
||||||
ptr, name = get_api_tuple(fname)
|
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
|
f.close
|
||||||
|
|
||||||
print 'Generated ' + outfile
|
print 'Generated ' + outfile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user