gobject-introspection 4.2.4 → 4.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49e5222f7c984b0eebce13f19a04226893d9e768fb80a3f473b9ced83fd9adb4
4
- data.tar.gz: cf3e563695a4afe3df79bdaa9e25f20b24bec24a28a4612c7d4e309883f6e258
3
+ metadata.gz: 35271806b1d69784715f1d2b32cec3e9c522156e322b28e67d88153f4b114373
4
+ data.tar.gz: 7ff88d676bf1cf71281ec663526986ff97f1555b3613be9845cc35006333ffc9
5
5
  SHA512:
6
- metadata.gz: f38460961ce556431c16dcdc24853d67b794de52d2b32c49064ee7b67354ddd9371d15fc10abc4bff84967539a9d47cc8fc484e3eaddee761fd0f2f15a41ca91
7
- data.tar.gz: e71bd1165a0fdbd2a7532efc4db7e2b8048f37ae0023f3989acf913fb16535517a534dac21d4d6f121a416a40f0df1f6d435c4e25b9fae0fd5c40fb8a65a4c58
6
+ metadata.gz: 86f9733cabb3d7dca03feef1db7888f3e4cce4b80f514e5b8e0c83fec98187564a841a0313309e31168a96f59f58612447493a046293b7b66066f139f2c3f80e
7
+ data.tar.gz: 64a2cf9fedcf690184727f4da0d2cfbc76162febeec36bebf92d4179741b324710546a3716f9fb43d94efb3d18f43cb17a4a82017782099f571c201fd90984b3
data/Rakefile CHANGED
@@ -17,10 +17,10 @@
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
19
  $LOAD_PATH.unshift("./../glib2/lib")
20
- require "gnome2/rake/package-task"
20
+ require "gnome/rake/package-task"
21
21
 
22
22
  package_name = File.basename(__dir__)
23
23
  spec = Gem::Specification.load("#{package_name}.gemspec")
24
24
 
25
- GNOME2::Rake::PackageTask.define(spec, __dir__) do |package|
25
+ GNOME::Rake::PackageTask.define(spec, __dir__) do |package|
26
26
  end
@@ -103,14 +103,20 @@ rb_gi_arguments_out_free_array_c_interface(RBGIArguments *args,
103
103
  g_free(*target);
104
104
  break;
105
105
  case GI_TRANSFER_EVERYTHING:
106
- default:
107
- rb_raise(rb_eNotImpError,
108
- "TODO: [%s] %s free GIArgument(%s/%s)[%s]",
109
- metadata->name,
110
- rb_gi_direction_to_string(metadata->direction),
111
- g_type_tag_to_string(metadata->type.tag),
112
- rb_gi_array_type_to_string(metadata->array_type),
113
- rb_gi_transfer_to_string(metadata->transfer));
106
+ if (metadata->element_type.interface_gtype == G_TYPE_NONE) {
107
+ /* This assumes that this memory was allocated by
108
+ * g_new0(MyStruct, n). */
109
+ g_free(*target);
110
+ } else {
111
+ rb_raise(rb_eNotImpError,
112
+ "TODO: [%s] %s free GIArgument(%s/%s)[%s]",
113
+ metadata->name,
114
+ rb_gi_direction_to_string(metadata->direction),
115
+ g_type_tag_to_string(metadata->type.tag),
116
+ rb_gi_array_type_to_string(metadata->array_type),
117
+ rb_gi_transfer_to_string(metadata->transfer));
118
+ }
119
+ break;
114
120
  }
115
121
  xfree(target);
116
122
  }
@@ -337,6 +343,7 @@ rb_gi_arguments_out_init_arg_array_c(RBGIArguments *args,
337
343
  break;
338
344
  case GI_TYPE_TAG_UTF8:
339
345
  argument->v_pointer = ALLOC(gchar **);
346
+ *((gchar **)(argument->v_pointer)) = NULL;
340
347
  metadata->free_func = rb_gi_arguments_out_free_array_c_string;
341
348
  break;
342
349
  case GI_TYPE_TAG_FILENAME:
@@ -349,6 +356,7 @@ rb_gi_arguments_out_init_arg_array_c(RBGIArguments *args,
349
356
  break;
350
357
  case GI_TYPE_TAG_INTERFACE:
351
358
  argument->v_pointer = ALLOC(gpointer *);
359
+ *((gpointer *)(argument->v_pointer)) = NULL;
352
360
  metadata->free_func = rb_gi_arguments_out_free_array_c_interface;
353
361
  break;
354
362
  case GI_TYPE_TAG_GLIST:
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2012-2022 Ruby-GNOME Project Team
3
+ * Copyright (C) 2012-2024 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
@@ -683,10 +683,10 @@ rb_gi_arguments_convert_arg_array_like_ensure(VALUE user_data)
683
683
  return Qnil;
684
684
  }
685
685
 
686
- static gint64
687
- rb_gi_arguments_convert_arg_array_body_extract_length(GIArgument *arg,
688
- RBGIArgMetadata *metadata,
689
- gboolean is_pointer)
686
+ gint64
687
+ rb_gi_argument_out_array_get_length(GIArgument *arg,
688
+ RBGIArgMetadata *metadata,
689
+ gboolean is_pointer)
690
690
  {
691
691
  switch (metadata->type.tag) {
692
692
  case GI_TYPE_TAG_VOID:
@@ -697,49 +697,49 @@ rb_gi_arguments_convert_arg_array_body_extract_length(GIArgument *arg,
697
697
  return -1;
698
698
  case GI_TYPE_TAG_INT8:
699
699
  if (is_pointer) {
700
- return *((gint8 *)arg->v_pointer);
700
+ return *((gint8 *)(arg->v_pointer));
701
701
  } else {
702
702
  return arg->v_int8;
703
703
  }
704
704
  case GI_TYPE_TAG_UINT8:
705
705
  if (is_pointer) {
706
- return *((guint8 *)arg->v_pointer);
706
+ return *((guint8 *)(arg->v_pointer));
707
707
  } else {
708
708
  return arg->v_uint8;
709
709
  }
710
710
  case GI_TYPE_TAG_INT16:
711
711
  if (is_pointer) {
712
- return *((gint16 *)arg->v_pointer);
712
+ return *((gint16 *)(arg->v_pointer));
713
713
  } else {
714
714
  return arg->v_int16;
715
715
  }
716
716
  case GI_TYPE_TAG_UINT16:
717
717
  if (is_pointer) {
718
- return *((guint16 *)arg->v_pointer);
718
+ return *((guint16 *)(arg->v_pointer));
719
719
  } else {
720
720
  return arg->v_uint16;
721
721
  }
722
722
  case GI_TYPE_TAG_INT32:
723
723
  if (is_pointer) {
724
- return *((gint32 *)arg->v_pointer);
724
+ return *((gint32 *)(arg->v_pointer));
725
725
  } else {
726
726
  return arg->v_int32;
727
727
  }
728
728
  case GI_TYPE_TAG_UINT32:
729
729
  if (is_pointer) {
730
- return *((guint32 *)arg->v_pointer);
730
+ return *((guint32 *)(arg->v_pointer));
731
731
  } else {
732
732
  return arg->v_uint32;
733
733
  }
734
734
  case GI_TYPE_TAG_INT64:
735
735
  if (is_pointer) {
736
- return *((gint64 *)arg->v_pointer);
736
+ return *((gint64 *)(arg->v_pointer));
737
737
  } else {
738
738
  return arg->v_int64;
739
739
  }
740
740
  case GI_TYPE_TAG_UINT64:
741
741
  if (is_pointer) {
742
- return *((guint64 *)arg->v_pointer);
742
+ return *((guint64 *)(arg->v_pointer));
743
743
  } else {
744
744
  return arg->v_uint64;
745
745
  }
@@ -789,10 +789,9 @@ rb_gi_arguments_convert_arg_array_body_get_length(ArrayLikeToRubyData *data)
789
789
  data->arg_metadata->struct_info,
790
790
  data->arg_metadata->struct_memory);
791
791
  int64_t length =
792
- rb_gi_arguments_convert_arg_array_body_extract_length(
793
- &value,
794
- &length_metadata,
795
- FALSE);
792
+ rb_gi_argument_out_array_get_length(&value,
793
+ &length_metadata,
794
+ FALSE);
796
795
  /* TODO: Use ensure */
797
796
  rb_gi_arg_metadata_clear(&length_metadata);
798
797
  g_base_info_unref(field_info);
@@ -816,20 +815,16 @@ rb_gi_arguments_convert_arg_array_body_get_length(ArrayLikeToRubyData *data)
816
815
  gboolean is_pointer =
817
816
  !(length_metadata->array_metadata &&
818
817
  length_metadata->array_metadata->output_buffer_p);
819
- return
820
- rb_gi_arguments_convert_arg_array_body_extract_length(
821
- length_arg,
822
- length_metadata,
823
- is_pointer);
818
+ return rb_gi_argument_out_array_get_length(length_arg,
819
+ length_metadata,
820
+ is_pointer);
824
821
  } else {
825
822
  length_arg = &g_array_index(data->args->in_args,
826
823
  GIArgument,
827
824
  length_metadata->in_arg_index);
828
- return
829
- rb_gi_arguments_convert_arg_array_body_extract_length(
830
- length_arg,
831
- length_metadata,
832
- FALSE);
825
+ return rb_gi_argument_out_array_get_length(length_arg,
826
+ length_metadata,
827
+ FALSE);
833
828
  }
834
829
  }
835
830
 
@@ -1105,26 +1100,116 @@ static VALUE
1105
1100
  rb_gi_arguments_convert_arg_array_body_c_fixed_size(ArrayLikeToRubyData *data,
1106
1101
  gint fixed_size)
1107
1102
  {
1108
- const char *array_c_type = "[fixed-size]";
1103
+ const char *array_c_type = "fixed-size";
1109
1104
  switch (data->element_type_tag) {
1110
1105
  case GI_TYPE_TAG_VOID:
1111
1106
  case GI_TYPE_TAG_BOOLEAN:
1107
+ rb_raise(rb_eNotImpError,
1108
+ "TODO: GIArgument(array)[c][%s][%s] -> Ruby",
1109
+ array_c_type,
1110
+ g_type_tag_to_string(data->element_type_tag));
1111
+ return Qnil;
1112
1112
  case GI_TYPE_TAG_INT8:
1113
+ {
1114
+ gint8 *array = (gint8 *)(data->arg->v_pointer);
1115
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1116
+ gint i;
1117
+ for (i = 0; i < fixed_size; i++) {
1118
+ rb_ary_push(rb_array, RB_INT2NUM(array[i]));
1119
+ }
1120
+ return rb_array;
1121
+ }
1113
1122
  case GI_TYPE_TAG_UINT8:
1123
+ {
1124
+ guint8 *array = (guint8 *)(data->arg->v_pointer);
1125
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1126
+ gint i;
1127
+ for (i = 0; i < fixed_size; i++) {
1128
+ rb_ary_push(rb_array, RB_UINT2NUM(array[i]));
1129
+ }
1130
+ return rb_array;
1131
+ }
1114
1132
  case GI_TYPE_TAG_INT16:
1133
+ {
1134
+ gint16 *array = (gint16 *)(data->arg->v_pointer);
1135
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1136
+ gint i;
1137
+ for (i = 0; i < fixed_size; i++) {
1138
+ rb_ary_push(rb_array, RB_INT2NUM(array[i]));
1139
+ }
1140
+ return rb_array;
1141
+ }
1115
1142
  case GI_TYPE_TAG_UINT16:
1143
+ {
1144
+ guint16 *array = (guint16 *)(data->arg->v_pointer);
1145
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1146
+ gint i;
1147
+ for (i = 0; i < fixed_size; i++) {
1148
+ rb_ary_push(rb_array, RB_UINT2NUM(array[i]));
1149
+ }
1150
+ return rb_array;
1151
+ }
1116
1152
  case GI_TYPE_TAG_INT32:
1153
+ {
1154
+ gint32 *array = (gint32 *)(data->arg->v_pointer);
1155
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1156
+ gint i;
1157
+ for (i = 0; i < fixed_size; i++) {
1158
+ rb_ary_push(rb_array, RB_INT2NUM(array[i]));
1159
+ }
1160
+ return rb_array;
1161
+ }
1117
1162
  case GI_TYPE_TAG_UINT32:
1163
+ {
1164
+ guint32 *array = (guint32 *)(data->arg->v_pointer);
1165
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1166
+ gint i;
1167
+ for (i = 0; i < fixed_size; i++) {
1168
+ rb_ary_push(rb_array, RB_UINT2NUM(array[i]));
1169
+ }
1170
+ return rb_array;
1171
+ }
1118
1172
  case GI_TYPE_TAG_INT64:
1173
+ {
1174
+ gint64 *array = (gint64 *)(data->arg->v_pointer);
1175
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1176
+ gint i;
1177
+ for (i = 0; i < fixed_size; i++) {
1178
+ rb_ary_push(rb_array, RB_LL2NUM(array[i]));
1179
+ }
1180
+ return rb_array;
1181
+ }
1119
1182
  case GI_TYPE_TAG_UINT64:
1183
+ {
1184
+ guint64 *array = (guint64 *)(data->arg->v_pointer);
1185
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1186
+ gint i;
1187
+ for (i = 0; i < fixed_size; i++) {
1188
+ rb_ary_push(rb_array, RB_ULL2NUM(array[i]));
1189
+ }
1190
+ return rb_array;
1191
+ }
1120
1192
  case GI_TYPE_TAG_FLOAT:
1193
+ {
1194
+ float *array = (float *)(data->arg->v_pointer);
1195
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1196
+ gint i;
1197
+ for (i = 0; i < fixed_size; i++) {
1198
+ rb_ary_push(rb_array, rb_float_new(array[i]));
1199
+ }
1200
+ return rb_array;
1201
+ }
1121
1202
  case GI_TYPE_TAG_DOUBLE:
1203
+ {
1204
+ double *array = (double *)(data->arg->v_pointer);
1205
+ VALUE rb_array = rb_ary_new_capa(fixed_size);
1206
+ gint i;
1207
+ for (i = 0; i < fixed_size; i++) {
1208
+ rb_ary_push(rb_array, rb_float_new(array[i]));
1209
+ }
1210
+ return rb_array;
1211
+ }
1122
1212
  case GI_TYPE_TAG_GTYPE:
1123
- rb_raise(rb_eNotImpError,
1124
- "TODO: GIArgument(array)[c][%s][%s] -> Ruby",
1125
- array_c_type,
1126
- g_type_tag_to_string(data->element_type_tag));
1127
- return Qnil;
1128
1213
  case GI_TYPE_TAG_UTF8:
1129
1214
  case GI_TYPE_TAG_FILENAME:
1130
1215
  case GI_TYPE_TAG_ARRAY:
@@ -101,6 +101,11 @@ rb_gi_arg_metadata_clear(RBGIArgMetadata *metadata);
101
101
  G_GNUC_INTERNAL void
102
102
  rb_gi_arg_metadata_free(RBGIArgMetadata *metadata);
103
103
 
104
+ G_GNUC_INTERNAL gint64
105
+ rb_gi_argument_out_array_get_length(GIArgument *arg,
106
+ RBGIArgMetadata *metadata,
107
+ gboolean is_pointer);
108
+
104
109
  G_GNUC_INTERNAL void
105
110
  rb_gi_arguments_init(RBGIArguments *args,
106
111
  GICallableInfo *info,
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobject-introspection
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.5
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - The Ruby-GNOME Project Team
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2024-09-23 00:00:00.000000000 Z
11
+ date: 2024-12-15 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: glib2
@@ -15,14 +16,14 @@ dependencies:
15
16
  requirements:
16
17
  - - '='
17
18
  - !ruby/object:Gem::Version
18
- version: 4.2.4
19
+ version: 4.2.5
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - '='
24
25
  - !ruby/object:Gem::Version
25
- version: 4.2.4
26
+ version: 4.2.5
26
27
  description: Ruby/GObjectIntrospection provides bindings of GObject Introspection
27
28
  and a loader module that can generate dynamically Ruby bindings of any GObject C
28
29
  libraries