girtod 0.23.2
A binding generator for libraries supporting gobject-introspection.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
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: funcname paramarray [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: funcname paramname
Override the GIR file and don't generate the specified
parameter of func_name as out or ref.
out: funcname paramname
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: funcname paramname
Override the GIR file and generate the specified
parameter of func_name as ref.
inout: funcname paramname
Ditto, Deprecated.
- Registered by Mike Wey
- 0.23.2 released 9 months ago
- gtkd-developers/gir-to-d
- gtkd.org
- LGPL-3.0
- Dependencies:
- none
- Versions:
-
0.23.2 2024-Feb-13 0.23.1 2023-Apr-17 0.23.0 2022-Mar-23 0.22.0 2021-Jan-24 0.21.0 2020-Jan-14 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
3 downloads this month
-
128 downloads total
-
- Score:
- 1.4
- Short URL:
- girtod.dub.pm