Skip to content

Commit 1408f0f

Browse files
committed
Change the format of "binding.xml" to toml
This is easier for humans to edit. This is a purely mechanical change, with no incidence on the generated code. Part of #20
1 parent 61b851f commit 1408f0f

5 files changed

Lines changed: 11471 additions & 5636 deletions

File tree

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ generate:
132132
--gir-file=contrib/Gdk-3.0.gir \
133133
--gir-file=contrib/Pango-1.0.gir \
134134
--gir-file=contrib/Gio-2.0.gir \
135-
--xml-file=contrib/binding.xml \
135+
--toml-file=contrib/binding.toml \
136136
--ada-output=src/generated/tmp.ada \
137137
--c-output=src/misc_generated.c
138138
cd src/generated; gnatchop -gnat05 -q -w tmp.ada

contrib/adaformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def replace_type(x):
11051105

11061106
# get_package might have been called before we had the XML node
11071107
# from the Gir file, and therefore no doc for the package. We can
1108-
# now override it, unless it came from binding.xml
1108+
# now override it, unless it came from binding.toml
11091109

11101110
subp = re.compile(r"([\S_]+)\(\)")
11111111
doc = subp.sub(lambda x: naming.adamethod_name(x.group(1)), doc)

contrib/binding.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def __repr__(self):
372372
@staticmethod
373373
def parse(node, gtkmethod, pkg=None, ignore_return=False):
374374
"""Parse the parameter info and return type info from the XML
375-
GIR node, overriding with binding.xml.
375+
GIR node, overriding with binding.toml.
376376
gtkmethod is the GtkAdaMethod that contains the overriding for the
377377
various method attributes.
378378
If pkg is specified, with statements are added as necessary.
@@ -931,7 +931,7 @@ def _handle_function_internal(self, section, node, cname,
931931
This returns None if no binding was made, an instance of Subprogram
932932
otherwise.
933933
`adaname' is the name of the generated Ada subprograms. By default,
934-
it is computed automatically from either binding.xml or the "name"
934+
it is computed automatically from either binding.toml or the "name"
935935
attribute of `node'.
936936
`profile' is an instance of SubprogramProfile
937937
"""
@@ -1645,7 +1645,7 @@ def _virtual_methods(self):
16451645
self.pkg.add_with('Glib.Object')
16461646

16471647
def _globals(self):
1648-
funcs = self.gtkpkg.get_global_functions() # List of binding.xml nodes
1648+
funcs = self.gtkpkg.get_global_functions() # List of binding.toml entries
16491649
if funcs:
16501650
section = self.pkg.section("Functions") # Make sure section exists
16511651
for f in funcs:
@@ -2912,9 +2912,9 @@ def generate(self, gir):
29122912
dest="gir_file",
29132913
metavar="FILE")
29142914
parser.add_option(
2915-
"--xml-file",
2916-
help="input GtkAda binding.xml file",
2917-
dest="xml_file",
2915+
"--toml-file",
2916+
help="input GtkAda binding.toml file",
2917+
dest="toml_file",
29182918
metavar="FILE")
29192919
parser.add_option(
29202920
"--ada-output",
@@ -2933,16 +2933,16 @@ def generate(self, gir):
29332933
missing_files = []
29342934
if options.gir_file is None:
29352935
missing_files.append("GIR file")
2936-
if options.xml_file is None:
2937-
missing_files.append("binding.xml file")
2936+
if options.toml_file is None:
2937+
missing_files.append("binding.toml file")
29382938
if options.ada_outfile is None:
29392939
missing_files.append("Ada output file")
29402940
if options.c_outfile is None:
29412941
missing_files.append("C output file")
29422942
if missing_files:
29432943
parser.error('Must specify files:\n\t' + ', '.join(missing_files))
29442944

2945-
gtkada = GtkAda(options.xml_file)
2945+
gtkada = GtkAda(options.toml_file)
29462946
gir = GIR(options.gir_file)
29472947

29482948
Package.copyright_header = \

0 commit comments

Comments
 (0)