gobject-introspection 3.3.8 → 3.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gobject-introspection/extconf.rb +4 -4
  3. data/ext/gobject-introspection/gobject_introspection.def +2 -1
  4. data/ext/gobject-introspection/rb-gi-arg-info.c +33 -1
  5. data/ext/gobject-introspection/rb-gi-argument.c +384 -3291
  6. data/ext/gobject-introspection/rb-gi-arguments-in.c +2229 -0
  7. data/ext/gobject-introspection/rb-gi-arguments-out.c +929 -0
  8. data/ext/gobject-introspection/rb-gi-arguments.c +850 -0
  9. data/ext/gobject-introspection/rb-gi-array-type.c +54 -0
  10. data/ext/gobject-introspection/rb-gi-callback.c +242 -0
  11. data/ext/gobject-introspection/rb-gi-conversions.h +0 -43
  12. data/ext/gobject-introspection/rb-gi-direction.c +36 -0
  13. data/ext/gobject-introspection/rb-gi-field-info.c +172 -81
  14. data/ext/gobject-introspection/rb-gi-function-info.c +15 -1404
  15. data/ext/gobject-introspection/rb-gi-private-arg-info.h +24 -0
  16. data/ext/gobject-introspection/rb-gi-private-arguments-in.h +26 -0
  17. data/ext/gobject-introspection/rb-gi-private-arguments-out.h +28 -0
  18. data/ext/gobject-introspection/rb-gi-private-arguments.h +107 -0
  19. data/ext/gobject-introspection/rb-gi-private-array-type.h +26 -0
  20. data/ext/gobject-introspection/rb-gi-private-callback.h +41 -0
  21. data/ext/gobject-introspection/rb-gi-private-direction.h +24 -0
  22. data/ext/gobject-introspection/rb-gi-private-transfer.h +24 -0
  23. data/ext/gobject-introspection/rb-gi-private.h +11 -5
  24. data/ext/gobject-introspection/rb-gi-struct-info.c +2 -0
  25. data/ext/gobject-introspection/rb-gi-transfer.c +36 -0
  26. data/ext/gobject-introspection/rb-gi-type-info.c +1 -13
  27. data/ext/gobject-introspection/rb-gobject-introspection.c +4 -1
  28. data/ext/gobject-introspection/rb-gobject-introspection.h +5 -23
  29. data/lib/gobject-introspection/arg-info.rb +2 -0
  30. data/lib/gobject-introspection/callable-info.rb +1 -1
  31. data/lib/gobject-introspection/loader.rb +0 -39
  32. data/lib/gobject-introspection/type-tag.rb +39 -2
  33. metadata +21 -5
@@ -0,0 +1,24 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ G_GNUC_INTERNAL gboolean
24
+ rb_gi_arg_info_is_output_buffer(GIArgInfo *info);
@@ -0,0 +1,26 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ G_GNUC_INTERNAL void
24
+ rb_gi_arguments_in_init(RBGIArguments *args);
25
+ G_GNUC_INTERNAL void
26
+ rb_gi_arguments_in_clear(RBGIArguments *args);
@@ -0,0 +1,28 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ G_GNUC_INTERNAL void
24
+ rb_gi_arguments_out_init(RBGIArguments *args);
25
+ G_GNUC_INTERNAL void
26
+ rb_gi_arguments_out_clear(RBGIArguments *args);
27
+ G_GNUC_INTERNAL VALUE
28
+ rb_gi_arguments_out_to_ruby(RBGIArguments *args);
@@ -0,0 +1,107 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ typedef struct {
24
+ GICallableInfo *info;
25
+ const gchar *namespace;
26
+ const gchar *name;
27
+ VALUE rb_receiver;
28
+ gpointer receiver_type_class;
29
+ VALUE rb_args;
30
+ void **raw_args;
31
+ gboolean rb_mode_p;
32
+ GArray *in_args;
33
+ GArray *out_args;
34
+ GPtrArray *metadata;
35
+ } RBGIArguments;
36
+
37
+ typedef void (*RBGIArgFreeFunc)(RBGIArguments *args,
38
+ RBGIArgMetadata *metadata,
39
+ gpointer user_data);
40
+
41
+ typedef struct {
42
+ GITypeInfo *info;
43
+ GITypeTag tag;
44
+ GIBaseInfo *interface_info;
45
+ GIInfoType interface_type;
46
+ GType interface_gtype;
47
+ } RBGIArgMetadataType;
48
+
49
+ struct RBGIArgMetadata_ {
50
+ GICallableInfo *callable_info;
51
+ GIArgInfo arg_info;
52
+ const gchar *name;
53
+ RBGIArgMetadataType type;
54
+ RBGIArgMetadataType element_type;
55
+ RBGIArgMetadataType key_type;
56
+ RBGIArgMetadataType value_type;
57
+ GIScopeType scope_type;
58
+ GIDirection direction;
59
+ GITransfer transfer;
60
+ gboolean callback_p;
61
+ gboolean closure_p;
62
+ gboolean destroy_p;
63
+ gboolean array_p;
64
+ gboolean array_length_p;
65
+ gboolean interface_p;
66
+ gboolean may_be_null_p;
67
+ gboolean pointer_p;
68
+ gboolean caller_allocates_p;
69
+ gboolean zero_terminated_p;
70
+ gboolean output_buffer_p;
71
+ GIArrayType array_type;
72
+ gint index;
73
+ gint in_arg_index;
74
+ gint closure_in_arg_index;
75
+ gint destroy_in_arg_index;
76
+ gint rb_arg_index;
77
+ gint out_arg_index;
78
+ GIArgument *in_arg;
79
+ GIArgument *out_arg;
80
+ VALUE rb_arg;
81
+ RBGIArgMetadata *array_metadata;
82
+ RBGIArgMetadata *array_length_metadata;
83
+ GIArgument *array_length_arg;
84
+ RBGIArgFreeFunc free_func;
85
+ gpointer free_func_data;
86
+ };
87
+
88
+ G_GNUC_INTERNAL void
89
+ rb_gi_arguments_init(RBGIArguments *args,
90
+ GICallableInfo *info,
91
+ VALUE rb_receiver,
92
+ VALUE rb_args,
93
+ void **raw_args);
94
+ G_GNUC_INTERNAL void
95
+ rb_gi_arguments_clear(RBGIArguments *args);
96
+
97
+ G_GNUC_INTERNAL VALUE
98
+ rb_gi_arguments_get_rb_out_args(RBGIArguments *args);
99
+
100
+ G_GNUC_INTERNAL VALUE
101
+ rb_gi_arguments_get_rb_return_value(RBGIArguments *args,
102
+ GIArgument *return_value);
103
+
104
+ G_GNUC_INTERNAL void
105
+ rb_gi_arguments_fill_raw_results(RBGIArguments *args,
106
+ VALUE rb_results,
107
+ gpointer raw_return_value);
@@ -0,0 +1,26 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ G_GNUC_INTERNAL void
24
+ rb_gi_array_type_init(VALUE rb_mGI);
25
+ G_GNUC_INTERNAL const gchar *
26
+ rb_gi_array_type_to_string(GIArrayType type);
@@ -0,0 +1,41 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ typedef struct RBGICallback_ {
24
+ GIArgInfo *arg_info;
25
+ GITypeInfo *type_info;
26
+ GICallbackInfo *callback_info;
27
+ ffi_cif cif;
28
+ ffi_closure *closure;
29
+ } RBGICallback;
30
+
31
+ G_GNUC_INTERNAL void
32
+ rb_gi_callback_init(VALUE rb_mGI);
33
+
34
+ G_GNUC_INTERNAL gpointer
35
+ rb_gi_callback_find(GIArgInfo *info);
36
+
37
+ G_GNUC_INTERNAL RBGICallbackData *
38
+ rb_gi_callback_data_new(RBGIArguments *args,
39
+ RBGICallback *callback,
40
+ RBGIArgMetadata *metadata);
41
+
@@ -0,0 +1,24 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ G_GNUC_INTERNAL const gchar *
24
+ rb_gi_direction_to_string(GIDirection type);
@@ -0,0 +1,24 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ G_GNUC_INTERNAL const gchar*
24
+ rb_gi_transfer_to_string(GITransfer transfer);
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2012-2019 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2012-2019 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -18,8 +18,7 @@
18
18
  * MA 02110-1301 USA
19
19
  */
20
20
 
21
- #ifndef RB_GI_PRIVATE_H
22
- #define RB_GI_PRIVATE_H
21
+ #pragma once
23
22
 
24
23
  #include <ruby.h>
25
24
  #include <rbgobject.h>
@@ -37,6 +36,15 @@
37
36
 
38
37
  #include "rb-gobject-introspection.h"
39
38
 
39
+ #include "rb-gi-private-arg-info.h"
40
+ #include "rb-gi-private-arguments.h"
41
+ #include "rb-gi-private-arguments-in.h"
42
+ #include "rb-gi-private-arguments-out.h"
43
+ #include "rb-gi-private-array-type.h"
44
+ #include "rb-gi-private-callback.h"
45
+ #include "rb-gi-private-direction.h"
46
+ #include "rb-gi-private-transfer.h"
47
+
40
48
  #ifndef RB_TYPE_P
41
49
  # define RB_TYPE_P(object, type) (TYPE(object) == type)
42
50
  #endif
@@ -114,5 +122,3 @@ VALUE rb_gi_struct_info_to_ruby(GIStructInfo *info,
114
122
  gboolean is_pointer);
115
123
  gpointer rb_gi_struct_info_from_ruby(GIStructInfo *info,
116
124
  VALUE rb_object);
117
-
118
- #endif
@@ -94,6 +94,8 @@ rb_gi_struct_get_raw(VALUE rb_struct, GType gtype)
94
94
  &rb_gi_struct_type,
95
95
  data);
96
96
  raw_struct = data->instance;
97
+ } else if (gtype == G_TYPE_VARIANT) {
98
+ raw_struct = rbg_variant_from_ruby(rb_struct);
97
99
  } else {
98
100
  raw_struct = RVAL2BOXED(rb_struct, gtype);
99
101
  }
@@ -0,0 +1,36 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2017-2019 Ruby-GNOME Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rb-gi-private.h"
22
+
23
+ const gchar *
24
+ rb_gi_transfer_to_string(GITransfer transfer)
25
+ {
26
+ switch(transfer) {
27
+ case GI_TRANSFER_NOTHING:
28
+ return "nothing";
29
+ case GI_TRANSFER_CONTAINER:
30
+ return "container";
31
+ case GI_TRANSFER_EVERYTHING:
32
+ return "everything";
33
+ default:
34
+ return "unknown";
35
+ }
36
+ }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2012 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2012-2019 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -35,16 +35,6 @@ gi_type_info_get_type(void)
35
35
  return type;
36
36
  }
37
37
 
38
- VALUE
39
- rb_gi_array_type_to_ruby(GIArrayType type)
40
- {
41
- if (type == (GIArrayType)-1) {
42
- return Qnil;
43
- } else {
44
- return GENUM2RVAL(type, G_TYPE_I_ARRAY_TYPE);
45
- }
46
- }
47
-
48
38
  static VALUE
49
39
  rg_pointer_p(VALUE self)
50
40
  {
@@ -138,6 +128,4 @@ rb_gi_type_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
138
128
  RG_DEF_METHOD(array_type, 0);
139
129
 
140
130
  rb_undef_method(RG_TARGET_NAMESPACE, "name");
141
-
142
- G_DEF_CLASS(G_TYPE_I_ARRAY_TYPE, "ArrayType", rb_mGI);
143
131
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2012-2019 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2012-2019 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -52,8 +52,11 @@ Init_gobject_introspection(void)
52
52
 
53
53
  rb_gi_argument_init();
54
54
 
55
+ rb_gi_array_type_init(RG_TARGET_NAMESPACE);
55
56
  rb_gi_type_tag_init(RG_TARGET_NAMESPACE);
56
57
  rb_gi_base_info_init(RG_TARGET_NAMESPACE);
57
58
  rb_gi_repository_init(RG_TARGET_NAMESPACE);
58
59
  rb_gi_loader_init(RG_TARGET_NAMESPACE);
60
+
61
+ rb_gi_callback_init(RG_TARGET_NAMESPACE);
59
62
  }