]>
git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/scripts/c_tools.py
11 def __init__(self
, doxyparse
, outputdir
):
12 self
.doxyparser
= doxyparse
13 self
.output_dir
= outputdir
15 def make_bindings(self
):
16 output_dir
= os
.path
.abspath(os
.path
.join(self
.output_dir
, "c"))
17 if not os
.path
.exists(output_dir
):
18 os
.makedirs(output_dir
)
20 for aclass
in self
.doxyparser
.classes
:
21 # This bit doesn't work, because the aclass.name is not the same as
22 # those listed in common
23 if aclass
.name
in excluded_classes
:
24 #print "Skipping %s" % aclass.name
27 self
.make_c_header(output_dir
, aclass
)
30 def make_c_header(self
, output_dir
, aclass
):
31 filename
= os
.path
.join(output_dir
, aclass
.name
[2:].lower() + ".hh")
32 enums_text
= make_enums(aclass
)
33 method_text
= self
.make_c_methods(aclass
)
34 class_name
= aclass
.name
[2:].capitalize()
40 """ % (enums_text
, method_text
)
42 afile
= open(filename
, "wb")
47 def make_c_methods(self
, aclass
):
50 wxc_classname
= 'wxC' + aclass
.name
[2:].capitalize()
52 for amethod
in aclass
.constructors
:
56 """ % (amethod
.brief_description
, wxc_classname
+ '* ' + wxc_classname
+ '_' + amethod
.name
, amethod
.argsstring
)
58 for amethod
in aclass
.methods
:
59 if amethod
.name
.startswith('m_'):
60 # for some reason, public members are listed as methods
63 args
= '(' + wxc_classname
+ '* obj'
64 if amethod
.argsstring
.find('()') != -1:
67 args
+= ', ' + amethod
.argsstring
[1:].strip()
72 """ % (amethod
.detailed_description
, amethod
.return_type
, wxc_classname
+ '_' + amethod
.name
, args
)