summaryrefslogtreecommitdiff
path: root/giscanner/scannermain.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/scannermain.py')
-rwxr-xr-xgiscanner/scannermain.py37
1 files changed, 34 insertions, 3 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index c3706f20..bca4a887 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -217,6 +217,21 @@ match the namespace prefix.""")
parser.add_option("", "--typelib-xml",
action="store_true", dest="typelib_xml",
help=optparse.SUPPRESS_HELP)
+ parser.add_option("", "--function-decoration",
+ action="append", dest="function_decoration", default=[],
+ help="Macro to decorate functions in generated code")
+ parser.add_option("", "--include-first-in-header",
+ action="append", dest="include_first_header", default=[],
+ help="Header to include first in generated header")
+ parser.add_option("", "--include-last-in-header",
+ action="append", dest="include_last_header", default=[],
+ help="Header to include after the other headers in generated header")
+ parser.add_option("", "--include-first-in-src",
+ action="append", dest="include_first_src", default=[],
+ help="Header to include first in generated sources")
+ parser.add_option("", "--include-last-in-src",
+ action="append", dest="include_last_src", default=[],
+ help="Header to include after the other headers in generated sources")
return parser
@@ -233,11 +248,22 @@ def passthrough_gir(path, f):
f.write(writer.get_xml())
-def test_codegen(optstring):
+def test_codegen(optstring,
+ function_decoration,
+ include_first_header,
+ include_last_header,
+ include_first_src,
+ include_last_src):
(namespace, out_h_filename, out_c_filename) = optstring.split(',')
if namespace == 'Everything':
from .testcodegen import EverythingCodeGenerator
- gen = EverythingCodeGenerator(out_h_filename, out_c_filename)
+ gen = EverythingCodeGenerator(out_h_filename,
+ out_c_filename,
+ function_decoration,
+ include_first_header,
+ include_last_header,
+ include_first_src,
+ include_last_src)
gen.write()
else:
_error("Invaild namespace %r" % (namespace, ))
@@ -450,7 +476,12 @@ def scanner_main(args):
if options.passthrough_gir:
passthrough_gir(options.passthrough_gir, sys.stdout)
if options.test_codegen:
- return test_codegen(options.test_codegen)
+ return test_codegen(options.test_codegen,
+ options.function_decoration,
+ options.include_first_header,
+ options.include_last_header,
+ options.include_first_src,
+ options.include_last_src)
if hasattr(options, 'filelist') and not options.filelist:
if len(args) <= 1: