Skip to content

Commit 04b51fc

Browse files
committed
Reformat using ocamlformat.0.20.1
1 parent 5b078ca commit 04b51fc

File tree

97 files changed

+2728
-2623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2728
-2623
lines changed

.ocamlformat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = 0.26.2

bindings/Arg_info.ml

Lines changed: 72 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
(** The direction of a Arg_info. *)
2020
type direction =
21-
| In (** in argument. *)
22-
| Out (** out argument. *)
23-
| InOut (** in and out argument. *)
21+
| In (** in argument. *)
22+
| Out (** out argument. *)
23+
| InOut (** in and out argument. *)
2424

2525
let string_of_direction = function
2626
| In -> "In"
@@ -35,23 +35,25 @@ let string_of_direction = function
3535
complete. In case of a containing type such as a list, an array or a hash
3636
table the container itself is specified differently from the items within
3737
the container itself. Each container is freed differently, check the
38-
documentation for the types themselves for information on how to free them.*)
38+
documentation for the types themselves for information on how to free them. *)
3939

4040
type transfer =
41-
| Nothing (** transfer nothing from the callee (function or the type
42-
instance the property belongs to) to the caller. The callee
43-
retains the ownership of the transfer and the caller doesn't
44-
need to do anything to free up the resources of this transfer. *)
45-
| Container (** transfer the container (list, array, hash table) from the
46-
callee to the caller. The callee retains the ownership of
47-
the individual items in the container and the caller has to
48-
free up the container resources (g_list_free()/
49-
g_hash_table_destroy() etc) of this transfer. *)
50-
| Everything (** transfer everything, eg the container and its contents from
51-
the callee to the caller. This is the case when the callee
52-
creates a copy of all the data it returns. The caller is
53-
responsible for cleaning up the container and item resources
54-
of this transfer. *)
41+
| Nothing
42+
(** transfer nothing from the callee (function or the type instance
43+
the property belongs to) to the caller. The callee retains the
44+
ownership of the transfer and the caller doesn't need to do
45+
anything to free up the resources of this transfer. *)
46+
| Container
47+
(** transfer the container (list, array, hash table) from the callee
48+
to the caller. The callee retains the ownership of the individual
49+
items in the container and the caller has to free up the
50+
container resources (g_list_free()/ g_hash_table_destroy() etc)
51+
of this transfer. *)
52+
| Everything
53+
(** transfer everything, eg the container and its contents from the
54+
callee to the caller. This is the case when the callee creates a
55+
copy of all the data it returns. The caller is responsible for
56+
cleaning up the container and item resources of this transfer. *)
5557

5658
let string_of_transfert = function
5759
| Nothing -> "Nothing"
@@ -62,54 +64,67 @@ let string_of_transfert = function
6264
callback is invoked and is used to decided when the invoke structs can be
6365
freed. *)
6466
type scope_type =
65-
| Invalid (** The argument is not of callback type. *)
66-
| Call (** The callback and associated user_data is only used during the
67-
call to this function. *)
68-
| Async (** The callback and associated user_data is only used until the
69-
callback is invoked, and the callback. is invoked always
70-
exactly once. *)
71-
| Notified (** The callback and and associated user_data is used until the
72-
caller is notfied via the destroy_notify. *)
67+
| Invalid (** The argument is not of callback type. *)
68+
| Call
69+
(** The callback and associated user_data is only used during the
70+
call to this function. *)
71+
| Async
72+
(** The callback and associated user_data is only used until the
73+
callback is invoked, and the callback. is invoked always exactly
74+
once. *)
75+
| Notified
76+
(** The callback and and associated user_data is used until the
77+
caller is notfied via the destroy_notify. *)
7378

7479
let string_of_scope_type = function
7580
| Invalid -> "Invalid"
7681
| Call -> "Call"
7782
| Async -> "Async"
7883
| Notified -> "Notified"
7984

80-
module Enums = functor (T : Cstubs.Types.TYPE) -> struct
81-
let gi_direction_in = T.constant "GI_DIRECTION_IN" T.int64_t
82-
let gi_direction_out = T.constant "GI_DIRECTION_OUT" T.int64_t
83-
let gi_direction_inout = T.constant "GI_DIRECTION_INOUT" T.int64_t
85+
module Enums =
86+
functor
87+
(T : Cstubs.Types.TYPE)
88+
->
89+
struct
90+
let gi_direction_in = T.constant "GI_DIRECTION_IN" T.int64_t
91+
let gi_direction_out = T.constant "GI_DIRECTION_OUT" T.int64_t
92+
let gi_direction_inout = T.constant "GI_DIRECTION_INOUT" T.int64_t
8493

85-
let direction = T.enum "GIDirection" ~typedef:true [
86-
In, gi_direction_in;
87-
Out, gi_direction_out;
88-
InOut, gi_direction_inout;
89-
]
90-
~unexpected:(Utils.unexpected_value_for "GIDirection")
94+
let direction =
95+
T.enum "GIDirection" ~typedef:true
96+
[
97+
(In, gi_direction_in);
98+
(Out, gi_direction_out);
99+
(InOut, gi_direction_inout);
100+
]
101+
~unexpected:(Utils.unexpected_value_for "GIDirection")
91102

92-
let gi_transfer_nothing = T.constant "GI_TRANSFER_NOTHING" T.int64_t
93-
let gi_transfer_container = T.constant "GI_TRANSFER_CONTAINER" T.int64_t
94-
let gi_transfer_everything = T.constant "GI_TRANSFER_EVERYTHING" T.int64_t
103+
let gi_transfer_nothing = T.constant "GI_TRANSFER_NOTHING" T.int64_t
104+
let gi_transfer_container = T.constant "GI_TRANSFER_CONTAINER" T.int64_t
105+
let gi_transfer_everything = T.constant "GI_TRANSFER_EVERYTHING" T.int64_t
95106

96-
let transfer = T.enum "GITransfer" ~typedef:true [
97-
Nothing, gi_transfer_nothing;
98-
Container, gi_transfer_container;
99-
Everything, gi_transfer_everything;
100-
]
101-
~unexpected:(Utils.unexpected_value_for "GITransfer")
107+
let transfer =
108+
T.enum "GITransfer" ~typedef:true
109+
[
110+
(Nothing, gi_transfer_nothing);
111+
(Container, gi_transfer_container);
112+
(Everything, gi_transfer_everything);
113+
]
114+
~unexpected:(Utils.unexpected_value_for "GITransfer")
102115

103-
let gi_scope_type_invalid = T.constant "GI_SCOPE_TYPE_INVALID" T.int64_t
104-
let gi_scope_type_call = T.constant "GI_SCOPE_TYPE_CALL" T.int64_t
105-
let gi_scope_type_async = T.constant "GI_SCOPE_TYPE_ASYNC" T.int64_t
106-
let gi_scope_type_notified = T.constant "GI_SCOPE_TYPE_NOTIFIED" T.int64_t
116+
let gi_scope_type_invalid = T.constant "GI_SCOPE_TYPE_INVALID" T.int64_t
117+
let gi_scope_type_call = T.constant "GI_SCOPE_TYPE_CALL" T.int64_t
118+
let gi_scope_type_async = T.constant "GI_SCOPE_TYPE_ASYNC" T.int64_t
119+
let gi_scope_type_notified = T.constant "GI_SCOPE_TYPE_NOTIFIED" T.int64_t
107120

108-
let scope_type = T.enum "GIScopeType" ~typedef:true [
109-
Invalid, gi_scope_type_invalid;
110-
Call, gi_scope_type_call;
111-
Async, gi_scope_type_async;
112-
Notified, gi_scope_type_notified;
113-
]
114-
~unexpected:(Utils.unexpected_value_for "GIScopeType")
115-
end
121+
let scope_type =
122+
T.enum "GIScopeType" ~typedef:true
123+
[
124+
(Invalid, gi_scope_type_invalid);
125+
(Call, gi_scope_type_call);
126+
(Async, gi_scope_type_async);
127+
(Notified, gi_scope_type_notified);
128+
]
129+
~unexpected:(Utils.unexpected_value_for "GIScopeType")
130+
end

bindings/Base_info.ml

Lines changed: 72 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,27 @@
1717
*)
1818

1919
type info_type =
20-
| Invalid (** invalid type *)
21-
| Function (** function, see Function_info *)
22-
| Callback (** callback, see Function_info *)
23-
| Struct (** struct, see Struct_info *)
24-
| Boxed (** boxed, see Struct_info or Union_info *)
25-
| Enum (** enum, see Enum_info *)
26-
| Flags (** flags, see Enum_info *)
27-
| Object (** object, see Object_info *)
28-
| Interface (** interface, see Interface_info *)
29-
| Constant (** contant, see Constant_info *)
30-
| Invalid_0 (** deleted, used to be GI_INFO_TYPE_ERROR_DOMAIN. *)
31-
| Union (** union, see Union_info *)
32-
| Value (** enum value, see Value_info *)
33-
| Signal (** signal, see Signal_info *)
34-
| Vfunc (** virtual function, see VFunc_info *)
35-
| Property (** GObject property, see Property_info *)
36-
| Field (** struct or union field, see Field_info *)
37-
| Arg (** argument of a function or callback, see Arg_info *)
38-
| Type (** type information, see Type_info *)
39-
| Unresolved (** unresolved type, a type which is not present in the typelib, or any of its dependencies. *)
20+
| Invalid (** invalid type *)
21+
| Function (** function, see Function_info *)
22+
| Callback (** callback, see Function_info *)
23+
| Struct (** struct, see Struct_info *)
24+
| Boxed (** boxed, see Struct_info or Union_info *)
25+
| Enum (** enum, see Enum_info *)
26+
| Flags (** flags, see Enum_info *)
27+
| Object (** object, see Object_info *)
28+
| Interface (** interface, see Interface_info *)
29+
| Constant (** contant, see Constant_info *)
30+
| Invalid_0 (** deleted, used to be GI_INFO_TYPE_ERROR_DOMAIN. *)
31+
| Union (** union, see Union_info *)
32+
| Value (** enum value, see Value_info *)
33+
| Signal (** signal, see Signal_info *)
34+
| Vfunc (** virtual function, see VFunc_info *)
35+
| Property (** GObject property, see Property_info *)
36+
| Field (** struct or union field, see Field_info *)
37+
| Arg (** argument of a function or callback, see Arg_info *)
38+
| Type (** type information, see Type_info *)
39+
| Unresolved
40+
(** unresolved type, a type which is not present in the typelib, or any of its dependencies. *)
4041

4142
let string_of_info_type = function
4243
| Invalid -> "Invalid"
@@ -60,49 +61,55 @@ let string_of_info_type = function
6061
| Type -> "Type"
6162
| Unresolved -> "Unresolved "
6263

63-
module Enums = functor (T : Cstubs.Types.TYPE) -> struct
64-
let gi_info_type_invalid = T.constant "GI_INFO_TYPE_INVALID" T.int64_t
65-
let gi_info_type_function = T.constant "GI_INFO_TYPE_FUNCTION" T.int64_t
66-
let gi_info_type_callback = T.constant "GI_INFO_TYPE_CALLBACK" T.int64_t
67-
let gi_info_type_struct = T.constant "GI_INFO_TYPE_STRUCT" T.int64_t
68-
let gi_info_type_boxed = T.constant "GI_INFO_TYPE_BOXED" T.int64_t
69-
let gi_info_type_enum = T.constant "GI_INFO_TYPE_ENUM" T.int64_t
70-
let gi_info_type_flags = T.constant "GI_INFO_TYPE_FLAGS" T.int64_t
71-
let gi_info_type_object = T.constant "GI_INFO_TYPE_OBJECT" T.int64_t
72-
let gi_info_type_interface = T.constant "GI_INFO_TYPE_INTERFACE" T.int64_t
73-
let gi_info_type_constant = T.constant "GI_INFO_TYPE_CONSTANT" T.int64_t
74-
let gi_info_type_invalid_0 = T.constant "GI_INFO_TYPE_INVALID_0" T.int64_t
75-
let gi_info_type_union = T.constant "GI_INFO_TYPE_UNION" T.int64_t
76-
let gi_info_type_value = T.constant "GI_INFO_TYPE_VALUE" T.int64_t
77-
let gi_info_type_signal = T.constant "GI_INFO_TYPE_SIGNAL" T.int64_t
78-
let gi_info_type_vfunc = T.constant "GI_INFO_TYPE_VFUNC" T.int64_t
79-
let gi_info_type_property = T.constant "GI_INFO_TYPE_PROPERTY" T.int64_t
80-
let gi_info_type_field = T.constant "GI_INFO_TYPE_FIELD" T.int64_t
81-
let gi_info_type_arg = T.constant "GI_INFO_TYPE_ARG" T.int64_t
82-
let gi_info_type_type = T.constant "GI_INFO_TYPE_TYPE" T.int64_t
83-
let gi_info_type_unresolved = T.constant "GI_INFO_TYPE_UNRESOLVED" T.int64_t
64+
module Enums =
65+
functor
66+
(T : Cstubs.Types.TYPE)
67+
->
68+
struct
69+
let gi_info_type_invalid = T.constant "GI_INFO_TYPE_INVALID" T.int64_t
70+
let gi_info_type_function = T.constant "GI_INFO_TYPE_FUNCTION" T.int64_t
71+
let gi_info_type_callback = T.constant "GI_INFO_TYPE_CALLBACK" T.int64_t
72+
let gi_info_type_struct = T.constant "GI_INFO_TYPE_STRUCT" T.int64_t
73+
let gi_info_type_boxed = T.constant "GI_INFO_TYPE_BOXED" T.int64_t
74+
let gi_info_type_enum = T.constant "GI_INFO_TYPE_ENUM" T.int64_t
75+
let gi_info_type_flags = T.constant "GI_INFO_TYPE_FLAGS" T.int64_t
76+
let gi_info_type_object = T.constant "GI_INFO_TYPE_OBJECT" T.int64_t
77+
let gi_info_type_interface = T.constant "GI_INFO_TYPE_INTERFACE" T.int64_t
78+
let gi_info_type_constant = T.constant "GI_INFO_TYPE_CONSTANT" T.int64_t
79+
let gi_info_type_invalid_0 = T.constant "GI_INFO_TYPE_INVALID_0" T.int64_t
80+
let gi_info_type_union = T.constant "GI_INFO_TYPE_UNION" T.int64_t
81+
let gi_info_type_value = T.constant "GI_INFO_TYPE_VALUE" T.int64_t
82+
let gi_info_type_signal = T.constant "GI_INFO_TYPE_SIGNAL" T.int64_t
83+
let gi_info_type_vfunc = T.constant "GI_INFO_TYPE_VFUNC" T.int64_t
84+
let gi_info_type_property = T.constant "GI_INFO_TYPE_PROPERTY" T.int64_t
85+
let gi_info_type_field = T.constant "GI_INFO_TYPE_FIELD" T.int64_t
86+
let gi_info_type_arg = T.constant "GI_INFO_TYPE_ARG" T.int64_t
87+
let gi_info_type_type = T.constant "GI_INFO_TYPE_TYPE" T.int64_t
88+
let gi_info_type_unresolved = T.constant "GI_INFO_TYPE_UNRESOLVED" T.int64_t
8489

85-
let info_type = T.enum "GIInfoType" ~typedef:true [
86-
Invalid, gi_info_type_invalid;
87-
Function, gi_info_type_function;
88-
Callback, gi_info_type_callback;
89-
Struct, gi_info_type_struct;
90-
Boxed, gi_info_type_boxed;
91-
Enum, gi_info_type_enum;
92-
Flags, gi_info_type_flags;
93-
Object, gi_info_type_object;
94-
Interface, gi_info_type_interface;
95-
Constant, gi_info_type_constant;
96-
Invalid_0, gi_info_type_invalid_0;
97-
Union, gi_info_type_union;
98-
Value, gi_info_type_value;
99-
Signal, gi_info_type_signal;
100-
Vfunc, gi_info_type_vfunc;
101-
Property, gi_info_type_property;
102-
Field, gi_info_type_field;
103-
Arg, gi_info_type_arg;
104-
Type, gi_info_type_type;
105-
Unresolved, gi_info_type_unresolved;
106-
]
107-
~unexpected:(Utils.unexpected_value_for "GIInfoType")
108-
end
90+
let info_type =
91+
T.enum "GIInfoType" ~typedef:true
92+
[
93+
(Invalid, gi_info_type_invalid);
94+
(Function, gi_info_type_function);
95+
(Callback, gi_info_type_callback);
96+
(Struct, gi_info_type_struct);
97+
(Boxed, gi_info_type_boxed);
98+
(Enum, gi_info_type_enum);
99+
(Flags, gi_info_type_flags);
100+
(Object, gi_info_type_object);
101+
(Interface, gi_info_type_interface);
102+
(Constant, gi_info_type_constant);
103+
(Invalid_0, gi_info_type_invalid_0);
104+
(Union, gi_info_type_union);
105+
(Value, gi_info_type_value);
106+
(Signal, gi_info_type_signal);
107+
(Vfunc, gi_info_type_vfunc);
108+
(Property, gi_info_type_property);
109+
(Field, gi_info_type_field);
110+
(Arg, gi_info_type_arg);
111+
(Type, gi_info_type_type);
112+
(Unresolved, gi_info_type_unresolved);
113+
]
114+
~unexpected:(Utils.unexpected_value_for "GIInfoType")
115+
end

bindings/Field_info.ml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,21 @@
1818

1919
(** Flags for a Field_info. *)
2020
type flags =
21-
| Is_readable (** field is readable. *)
22-
| Is_writable (** field is writable. *)
21+
| Is_readable (** field is readable. *)
22+
| Is_writable (** field is writable. *)
2323

2424
let string_of_flag = function
2525
| Is_readable -> "Is_readable"
2626
| Is_writable -> "Is_writable"
2727

28-
module Flags = functor (T : Cstubs.Types.TYPE) -> struct
29-
let gi_field_is_readable = T.constant "GI_FIELD_IS_READABLE" T.int64_t
30-
let gi_field_is_writable = T.constant "GI_FIELD_IS_WRITABLE" T.int64_t
28+
module Flags =
29+
functor
30+
(T : Cstubs.Types.TYPE)
31+
->
32+
struct
33+
let gi_field_is_readable = T.constant "GI_FIELD_IS_READABLE" T.int64_t
34+
let gi_field_is_writable = T.constant "GI_FIELD_IS_WRITABLE" T.int64_t
3135

32-
let flags = T.enum "GIFieldInfoFlags" ~typedef:true [] ~unexpected:(fun x -> x)
33-
end
36+
let flags =
37+
T.enum "GIFieldInfoFlags" ~typedef:true [] ~unexpected:(fun x -> x)
38+
end

bindings/Function_info.ml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
(** Flags for a Function_info struct. *)
2020
type flags =
21-
| Is_method (** is a method. *)
22-
| Is_constructor (** is a constructor. *)
23-
| Is_getter (** is a getter of a Property_info. *)
24-
| Is_setter (** is a setter of a Property_info. *)
25-
| Wraps_vfunc (** represents a virtual function. *)
26-
| Throws (** the function may throw an error. *)
21+
| Is_method (** is a method. *)
22+
| Is_constructor (** is a constructor. *)
23+
| Is_getter (** is a getter of a Property_info. *)
24+
| Is_setter (** is a setter of a Property_info. *)
25+
| Wraps_vfunc (** represents a virtual function. *)
26+
| Throws (** the function may throw an error. *)
2727

2828
let string_of_flag = function
2929
| Is_method -> "Is_method"
@@ -33,12 +33,21 @@ let string_of_flag = function
3333
| Wraps_vfunc -> "Wraps_vfunc"
3434
| Throws -> "Throws"
3535

36-
module Flags = functor (T : Cstubs.Types.TYPE) -> struct
37-
let gi_function_is_method = T.constant "GI_FUNCTION_IS_METHOD" T.int64_t
38-
let gi_function_is_constructor = T.constant "GI_FUNCTION_IS_CONSTRUCTOR" T.int64_t
39-
let gi_function_is_getter = T.constant "GI_FUNCTION_IS_GETTER" T.int64_t
40-
let gi_function_is_setter = T.constant "GI_FUNCTION_IS_SETTER" T.int64_t
41-
let gi_function_wraps_vfunc = T.constant "GI_FUNCTION_WRAPS_VFUNC" T.int64_t
42-
let gi_function_throws = T.constant "GI_FUNCTION_THROWS" T.int64_t
43-
let flags = T.enum "GIFunctionInfoFlags" ~typedef:true [] ~unexpected:(fun x -> x)
44-
end
36+
module Flags =
37+
functor
38+
(T : Cstubs.Types.TYPE)
39+
->
40+
struct
41+
let gi_function_is_method = T.constant "GI_FUNCTION_IS_METHOD" T.int64_t
42+
43+
let gi_function_is_constructor =
44+
T.constant "GI_FUNCTION_IS_CONSTRUCTOR" T.int64_t
45+
46+
let gi_function_is_getter = T.constant "GI_FUNCTION_IS_GETTER" T.int64_t
47+
let gi_function_is_setter = T.constant "GI_FUNCTION_IS_SETTER" T.int64_t
48+
let gi_function_wraps_vfunc = T.constant "GI_FUNCTION_WRAPS_VFUNC" T.int64_t
49+
let gi_function_throws = T.constant "GI_FUNCTION_THROWS" T.int64_t
50+
51+
let flags =
52+
T.enum "GIFunctionInfoFlags" ~typedef:true [] ~unexpected:(fun x -> x)
53+
end

0 commit comments

Comments
 (0)