-
Notifications
You must be signed in to change notification settings - Fork 13
/
Readme_APILookup
217 lines (161 loc) · 6.95 KB
/
Readme_APILookup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
The GTK binding is generated by the girtod utility using APILookup
files and the GIR files from GObject Introspection.
The girtod utility parses APILookup.txt which tells it what to do/parse
using the commands listed below.
There to two types of commands key value pairs and block commands which are denoted with
"command: start" and "command: end".
Top level commands:
-------------------
Top level commands can only be set once and apply to everything.
includeComments: (true/false)
If true the generated code includes comments/documentation
for the classes, functions, etc.
license: (block)
Sets the license text used at the top of the generated files.
outputRoot: path
Directory where the generated code is stored.
Global commands:
----------------
Global commands can be set more than once, but also affect everything.
srcDir only affects the packages that come after it.
alias: ctype dtype
Replace ctype with dtype in the generated code.
copy: filename
Copies filename from inputRoot to outputRoot/srcDir.
dependency DEP: skip
When generating code don't assume dependency DEB is available.
dependency DEP: (block)
Apply the lookup definitions in this block to the dependency
before generating any code.
lookup: filename
Continue parsing in filename.
srcDir: directory
The source for the following packages is placed in this directory.
version X.XX: command: value
Only include the command if the version specified in the Gir file is >= X.XX.
An OS identifier can also be used as the version.
Currently supported are: Windows, OSX, Linux and Posix.
The OS versions can de negated.
version X.XX: (block)
The same as above but applies to all commands in the block.
The version can optionaly be used at the end of the block.
wrap: packageName
Starts wrapping a package, and uses packageName as it's name.
After this command and until wrap is used again, all commands
only affect the current package.
When inside a dependency wrap only sets the package name.
Package commands:
-----------------
These commands apply to the package set with wrap.
addAliases: (block)
Add the contained text to the alias section of the c definitions.
addConstants: (block)
Add the contained text to the constant section of the c definitions.
addEnums: (block)
Add the contained text to the enum section of the c definitions.
addFuncts: (block)
Add the contained text to the function/callback section of the c definitions.
addStructs: (block)
Add the contained text to the struct section of the c definitions.
file: girFilename.
Parse the a GIR file, this command can be used multiple times
to combine different GIR files. girtod will detect the gir directory.
move: src dest [new_name]
Move function src to struct dest. Optionaly set a new name for the function.
dest will be created if it doesn't exist.
You can list the global functions that haven't been moved by running
girtod with the --print-free argument.
noAlias: name
Don't generate any code for alias name.
name should be the name specified in the GIR file.
noConstant: name
Don't generate any code for constant name.
name should be the name specified in the GIR file.
noEnum: name
Don't generate any code for enum name.
name should be the name specified in the GIR file.
noCallback: name
Don't generate any code for callback name.
name should be the name specified in the GIR file.
struct: name
Sets the struct to which the following commands apply.
If the struct doesn't exist it will be created.
The name can be left blank, in which case class and interface can
be used to create a new class or interface.
Struct commands:
----------------
These commands apply to the struct set with struct.
class and interface will create a struct if it is not set.
alias: ctype dtype
Replace ctype with dtype in the generated code for the current struct.
array: field length_field
Set length_field as the length for the field property.
And handle field as an array and keep the length_field in sync with the actual length.
class: name
Overwrite the settings in the gir file and generate this struct as a class
using the specified name.
Or create a new class if the struct isn't set.
code: (block)
Add the contained code/text the generated struct/class.
cType: type
Override the cType used in the GIR file.
extend: base_class
Explicitly set the base class for this class. base_class should match the name used
in the GIR files eg: GObject.Object.
implements: interface
Explicitly set an interface implemented by this class.
This command can be used more than once.
import: package.module
Explicitly add imports to the generated file.
interface: name
Overwrite the settings in the gir file and generate this struct as a interface
using the specified name.
Or create a new interface if the struct isn't set.
interfaceCode: (block)
Add the contained code/text the generated interface.
merge: name
merge struct 'name' with the struct set by struct:.
namespace: name
Put the functions in a struct that is used as a namespace.
name can be blank to generate the functions in module scope.
noCode: name
Don't generate any code for function name.
name should be the name specified in the GIR file.
noCode: true
Don't generate any code for the struct set by struct:
noExternal: true
Don't generate the c declaration for the struct set by struct:
noProperty: name
Don't generate a property for field name.
name should be the name specified in the GIR file.
noSignal: name
Don't generate any code for signal name.
name should be the name specified in the GIR file.
noStruct: true
Don't generate the struct declaration for the struct set by struct:
structWrap: ctype dtype
Wrap ctype as dtype, instead of what's defined by the GIR files.
Function commands:
------------------
The Function commands apply to functions of the currently set struct.
They generaly take the function they apply to as there first argument.
array: func_name param_array [param_length]
Override the GIR file and handle param_array of function func_name
as an array whose length is specified by param_length.
If param_length isn't specified the wrapper assumes the array is zero terminated.
"Return" can be used for either param_array or param_length for when
one of them is returned by the function.
in: func_name param_name
Override the GIR file and don't generate the specified
parameter of func_name as out or ref.
out: func_name param_name
Override the GIR file and generate the specified
parameter of func_name as out.
override: func_name
Explicitly add the override attribute to function func_name.
func_name should be the name specified in the GIR file.
ref: func_name param_name
Override the GIR file and generate the specified
parameter of func_name as ref.
inout: func_name param_name
Ditto, Deprecated.