GIDL metadata format#
This section describes the format of .metadata files as used by vapigen as additional information for .vapi file generation. Some of the information specified in the metadata can be used to set Attributes as well.
Other Lines#
Every non-comment line in the file is made of up two sections: the specifier, and the parameters.
The specifier is the first text to appear on the line, and it specifies what the rest of the line will be modifying.
The parameters are a space separated list of a parameter name, followed by an equals sign and the value enclosed in quotes.
For example, this line sets parameter1 and parameter2 on foo.bar:
foo.bar parameter1="value" parameter2="value"
Specifiers#
Specifiers always use the C name for whatever it is you are modifying.
For example if your namespace is Foo, and the Vala name for the type
is Bar, then you would use FooBar
.
Specifiers may also use wildcards, and all items that partially match the specifier will be selected. For example:
*.klass hidden="1"
will hide the klass field in all types.
Specifying Different Things#
To specify a:
Function |
|
Type |
|
Property |
|
Signal |
|
Field |
|
Parameter (Function) |
|
Parameter (Delegate) |
|
Parameter (Signal) |
|
For example, hiding a symbol:
Type |
|
Function |
|
Field |
|
Properties Reference#
The format for the entries will be like so
Name |
Applies To |
Values |
Description |
---|---|---|---|
|
Signal, Function, Class, Struct, etc |
The acceptable values |
The description goes here. |
And in alphabetical order:
Name |
Applies To |
Values |
Description |
---|---|---|---|
|
Class, Function |
0, 1 |
|
|
Property |
0, 1 |
|
|
Field |
C identifier |
|
|
Parameter (Function) |
Double (position between two Vala parameters) |
Sets the position of the length for the parameter, length needs to be hidden separately. |
|
Parameter (Function), Function (returning an array), Field |
C type |
|
|
Function (returning an array), Parameter (Function), Field |
0, 1 |
|
|
Function |
0, 1 |
Force async function, even if it doesn’t end in |
|
Class |
C type |
Marks the base class for the type |
|
Struct |
Vala type |
Marks the struct as inheriting |
|
Anything (except parameters) |
Header include path |
Compiler will add the specified header when thing is used. |
|
Enum |
String |
Removes a common prefix from enumeration values |
|
Class (non-GObject) |
C type |
|
|
Class (non-GObject) |
C function |
|
|
Module |
String |
|
|
Parameter (Function), Field |
C type |
|
|
Parameter (Function) |
Any Vala value that would be valid for the type |
Sets the default value for a parameter. |
|
Parameter (Function) |
Double (position between two Vala parameters) |
|
|
Anything (except parameters) |
0, 1 |
Marks the thing as deprecated |
|
Anything (except parameters) |
Version |
Marks the thing as deprecated |
|
Function |
0, 1 |
Marks that the function has a variable argument list |
|
Enum |
0, 1 |
Marks the enumeration as a GError domain |
|
Function |
C function name |
Sets custom asynchronous finish function |
|
Class (non-GObject) |
C function name |
Sets a free function for the struct |
|
Module |
String |
|
|
Module |
Version |
|
|
Struct |
0, 1 |
marks the struct as having a copy function |
|
Struct |
0, 1 |
|
|
Signal |
0, 1 |
|
|
Delegate |
0, 1 |
|
|
Class, Enum, Struct |
0, 1 |
Marks whether a GType is registered for this thing |
|
Anything |
0, 1 |
Causes the selected thing to not be output in the vapi file. |
|
Struct |
0, 1 |
Marks the struct as immutable |
|
Delegate (Position between two Vala parameters) |
Double |
|
|
Function (returning an array), Parameter, Field |
0, 1 |
Marks the thing as an array |
|
Class (non-GObject) |
0, 1 |
|
|
Class (non-GObject) |
0, 1 |
|
|
Parameter |
0, 1 |
Marks the parameter as “out” |
|
Parameter |
0, 1 |
Marks the parameter as “ref” |
|
Struct, Union |
0, 1 |
Marks type as a value type (aka struct) |
|
Module |
String |
|
|
Interface |
String |
|
|
Any Type, Function, Signal |
Vala identifier |
Changes the name of the thing, does not change namespace |
|
Any Type |
String |
Changes the namespace of the thing |
|
Signal Parameter |
String |
Specify the namespace of the parameter type indicated with type_name |
|
Function (returning an array), Parameter (Function, Delegate) |
0, 1 |
Does not implicitly pass/return array length to/from function |
|
Function (having a return value), Parameter |
0, 1 |
Marks the value as nullable |
|
Property |
0, 1 |
|
|
Any module member |
String (Namespace) |
Strip namespace prefix from symbol and put it into given sub-namespace |
|
Function |
0, 1 |
|
|
Struct |
Integer |
|
|
Class (non-GObject) |
C function name |
|
|
Class (non-GObject) |
0, 1 |
|
|
Any Type |
Vala |
Renames the identifier type to something else, ie fooFloat to float (not exactly the same as |
|
Anything (except parameters) |
The thing that replaces this |
Specifies a replacement for a deprecated symbol |
|
Function (with ellipsis) |
C value |
The sentinel value marking the end of the vararg list |
|
Struct |
0, 1 |
Marks the struct as being a simple type, like int | |
|
Parameter (Function, Delegate) |
0, 1 |
|
|
Function |
0, 1 |
Marks that the function should use an out parameter instead of throwing an error |
|
Enum |
C function name |
|
|
Function/Delegate/Signal (having a return value), Parameter Signal) |
0, 1 |
Transfers ownership of the value |
|
Function/Delegate/Signal (having a return value), Property, Field, Parameter |
Vala types, comma separated |
Restricts the generic type of the thing |
|
Class (GObject) |
C function/macro name |
|
|
Struct, Class (GObject) |
C macro |
|
|
Function (having a return value), Property, Parameter, Field |
Vala type name |
Changes the type of the selected thing. Overwrites old type, so “type_name” must be before any other type modifying metadata |
|
Delegate, Class (non-GObject) |
Vala generic type parameters, e.g. T, comma separated |
|
|
Class (non-GObject) |
C function name |
|
|
Parameter (Function) |
0, 1 |
|
|
Function |
C function pointer name |
|
|
Function |
0, 1 |
|
|
Field |
0, 1 |
Marks the field as weak |
Examples#
Demonstrating…
// ...
Comments#
Comments start with a
#
and end at the end of a line. For example:# this is a comment