gir_ffi-pretty_printer 0.0.4 → 0.0.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
- SHA1:
3
- metadata.gz: 4c481aeb056ea0a64713491930d13b9c4c1c13e5
4
- data.tar.gz: 36d985bf34db0f3d4a9c3ce21cdc49f8cde5ba60
2
+ SHA256:
3
+ metadata.gz: c346ce23207ab223f046057633ad6d2f4c969a2151fca51747d13f1b777b7468
4
+ data.tar.gz: 7cbcbbefd9f2fade71c6136593a7aba803c3f6e7895df8a806a58acf0892c852
5
5
  SHA512:
6
- metadata.gz: f0dd2c910c25f8202b6b98b55fd856a10ba884fba5f3c9018f852e7a0ef3f04393e251f6ff9c4a32c6ffe1ae331c735058674d1e7bce5ee004190ac79bd1a988
7
- data.tar.gz: dbdd6f4eadbb724c5c0e0335d514a52b7b07e8f6bf8b24c60f2567d964221b9127e014107e5369c7711b90bc174aa008dbd4bc3ab80060c9eb9d75e2ccea25b4
6
+ metadata.gz: eb03da9ee6610b517c0858904e2deb0eb5d812a61047065cfbf60f5a2b140ca549a7982bd5bb733b746b4e6c4951d0bb170a9d29206c36745fbe54c67f293e7d
7
+ data.tar.gz: 5ffe6f64d3080d14686f733e696007411ffe8b634d8496fdb1821d6c6dfd08af5dfaf67a0b117ab613d3d9c44a0fc434c26bc9879ff9ce44c69b31569c1daa20
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake/clean'
2
4
  require 'bundler/gem_tasks'
3
5
  require 'rake/testtask'
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gir_ffi-pretty_printer/pretty_printer'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GirFFI
2
4
  # Pretty-prints classes
3
5
  class ClassPrettyPrinter
@@ -33,9 +35,8 @@ module GirFFI
33
35
  end
34
36
 
35
37
  def pretty_print_alias(meth)
36
- if meth.name != meth.original_name
37
- "alias_method '#{meth.name}', '#{meth.original_name}'"
38
- end
38
+ return if meth.name == meth.original_name
39
+ "alias_method '#{meth.name}', '#{meth.original_name}'"
39
40
  end
40
41
 
41
42
  def pretty_print_method(meth)
@@ -45,11 +46,15 @@ module GirFFI
45
46
 
46
47
  def method_source(meth)
47
48
  if meth.arity == -1
48
- unless @klass.setup_instance_method meth.name.to_s
49
+ name = meth.name.to_s
50
+
51
+ if @klass.gir_info.find_instance_method name
52
+ @klass.setup_instance_method name
53
+ elsif name == '_'
49
54
  @klass.setup_instance_method ''
50
55
  end
51
56
 
52
- meth = @klass.instance_method meth.name
57
+ meth = @klass.instance_method name
53
58
  end
54
59
 
55
60
  begin
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'live_ast/full'
2
4
  require 'live_ast/to_ruby'
3
5
  require 'gir_ffi'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  class SimpleClass
@@ -21,11 +23,11 @@ class ComplexAlias < SimpleClass
21
23
  end
22
24
 
23
25
  describe GirFFI::ClassPrettyPrinter do
24
- let(:instance) { GirFFI::ClassPrettyPrinter.new klass }
26
+ let(:instance) { GirFFI::ClassPrettyPrinter.new printed_class }
25
27
 
26
28
  describe '#pretty_print' do
27
29
  describe 'for a class with a simple method definition' do
28
- let(:klass) { SimpleClass }
30
+ let(:printed_class) { SimpleClass }
29
31
  it 'pretty-prints the class' do
30
32
  expected = <<-RUBY.reset_indentation.chomp
31
33
  class SimpleClass < Object
@@ -42,7 +44,7 @@ describe GirFFI::ClassPrettyPrinter do
42
44
  end
43
45
 
44
46
  describe 'for a class with a simple aliased method' do
45
- let(:klass) { SimpleAlias }
47
+ let(:printed_class) { SimpleAlias }
46
48
  it 'pretty-prints the class' do
47
49
  expected = <<-RUBY.reset_indentation.chomp
48
50
  class SimpleAlias < SimpleClass
@@ -57,7 +59,7 @@ describe GirFFI::ClassPrettyPrinter do
57
59
  end
58
60
 
59
61
  describe 'for a class with an alias chain' do
60
- let(:klass) { ComplexAlias }
62
+ let(:printed_class) { ComplexAlias }
61
63
  it 'pretty-prints the class' do
62
64
  expected = <<-RUBY.reset_indentation.chomp
63
65
  class ComplexAlias < SimpleClass
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
  describe GirFFI::PrettyPrinter do
3
5
  describe '#pretty_print' do
@@ -298,21 +298,23 @@ module GLib
298
298
  _v2 = GLib::Lib.g_bookmark_file_has_item(self, _v1)
299
299
  return _v2
300
300
  end
301
- def load_from_data(data, length)
302
- _v1 = GirFFI::InPointer.from_utf8(data)
303
- _v2 = length
301
+ def load_from_data(data)
302
+ length = data.nil? ? (0) : (data.length)
303
+ _v1 = length
304
+ _v2 = GirFFI::SizedArray.from(:guint8, -1, data)
304
305
  _v3 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
305
- _v4 = GLib::Lib.g_bookmark_file_load_from_data(self, _v1, _v2, _v3)
306
+ _v4 = GLib::Lib.g_bookmark_file_load_from_data(self, _v2, _v1, _v3)
306
307
  GirFFI::ArgHelper.check_error(_v3)
307
308
  return _v4
308
309
  end
309
- def load_from_data_dirs(file, full_path = nil)
310
+ def load_from_data_dirs(file)
310
311
  _v1 = file
311
- _v2 = full_path
312
+ _v2 = FFI::MemoryPointer.new(:filename)
312
313
  _v3 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
313
314
  _v4 = GLib::Lib.g_bookmark_file_load_from_data_dirs(self, _v1, _v2, _v3)
314
315
  GirFFI::ArgHelper.check_error(_v3)
315
- return _v4
316
+ _v5 = GirFFI::AllocationHelper.free_after(_v2.get_filename(0), &:to_utf8)
317
+ return [_v4, _v5]
316
318
  end
317
319
  def load_from_file(filename)
318
320
  _v1 = filename
@@ -373,11 +375,12 @@ module GLib
373
375
  _v2 = GirFFI::InPointer.from_utf8(description)
374
376
  GLib::Lib.g_bookmark_file_set_description(self, _v1, _v2)
375
377
  end
376
- def set_groups(uri, groups, length)
378
+ def set_groups(uri, groups = nil)
377
379
  _v1 = GirFFI::InPointer.from_utf8(uri)
378
- _v2 = GirFFI::InPointer.from_utf8(groups)
379
- _v3 = length
380
- GLib::Lib.g_bookmark_file_set_groups(self, _v1, _v2, _v3)
380
+ length = groups.nil? ? (0) : (groups.length)
381
+ _v2 = length
382
+ _v3 = GirFFI::SizedArray.from(:utf8, -1, groups)
383
+ GLib::Lib.g_bookmark_file_set_groups(self, _v1, _v3, _v2)
381
384
  end
382
385
  def set_icon(uri, href, mime_type)
383
386
  _v1 = GirFFI::InPointer.from_utf8(uri)
@@ -416,8 +419,8 @@ module GLib
416
419
  _v3 = GLib::Lib.g_bookmark_file_to_data(self, _v1, _v2)
417
420
  GirFFI::ArgHelper.check_error(_v2)
418
421
  _v4 = _v1.get_uint64(0)
419
- _v5 = GirFFI::AllocationHelper.free_after(_v3, &:to_utf8)
420
- return [_v5, _v4]
422
+ _v5 = GirFFI::SizedArray.wrap(:guint8, _v4, _v3)
423
+ return _v5
421
424
  end
422
425
  def to_file(filename)
423
426
  _v1 = filename
@@ -616,6 +619,7 @@ module GLib
616
619
  # XXX: Don't know how to print callback
617
620
  # XXX: Don't know how to print callback
618
621
  # XXX: Don't know how to print callback
622
+ # XXX: Don't know how to print callback
619
623
  class GLib::Cond < GirFFI::StructBase
620
624
 
621
625
  def broadcast
@@ -658,8 +662,8 @@ module GLib
658
662
  DATE_BAD_DAY = 0
659
663
  DATE_BAD_JULIAN = 0
660
664
  DATE_BAD_YEAR = 0
661
- DIR_SEPARATOR = 92
662
- DIR_SEPARATOR_S = "\\"
665
+ DIR_SEPARATOR = 47
666
+ DIR_SEPARATOR_S = "/"
663
667
  class GLib::Data < GirFFI::StructBase
664
668
 
665
669
 
@@ -770,6 +774,11 @@ module GLib
770
774
  _v2 = GLib::Lib.g_date_compare(self, _v1)
771
775
  return _v2
772
776
  end
777
+ def copy
778
+ _v1 = GLib::Lib.g_date_copy(self)
779
+ _v2 = GLib::Date.wrap_own(_v1)
780
+ return _v2
781
+ end
773
782
  def day
774
783
  _v1 = (@struct.to_ptr + 12)
775
784
  _v2 = _v1.get_uint32(0)
@@ -984,6 +993,12 @@ module GLib
984
993
  obj.__send__(:initialize, *args, &block)
985
994
  obj
986
995
  end
996
+ def self.new_from_iso8601(*args, &block)
997
+ raise(NoMethodError) unless (self == GLib::DateTime)
998
+ obj = allocate
999
+ obj.__send__(:initialize_from_iso8601, *args, &block)
1000
+ obj
1001
+ end
987
1002
  def self.new_from_timeval_local(*args, &block)
988
1003
  raise(NoMethodError) unless (self == GLib::DateTime)
989
1004
  obj = allocate
@@ -1175,6 +1190,13 @@ module GLib
1175
1190
  _v6 = _v3.get_int32(0)
1176
1191
  return [_v4, _v5, _v6]
1177
1192
  end
1193
+ def initialize_from_iso8601(text, default_tz = nil)
1194
+ _v1 = GirFFI::InPointer.from_utf8(text)
1195
+ _v2 = GLib::TimeZone.from(default_tz)
1196
+ _v3 = GLib::Lib.g_date_time_new_from_iso8601(_v1, _v2)
1197
+ store_pointer(_v3)
1198
+ @struct.owned = true
1199
+ end
1178
1200
  def initialize_from_timeval_local(tv)
1179
1201
  _v1 = GLib::TimeVal.from(tv)
1180
1202
  _v2 = GLib::Lib.g_date_time_new_from_timeval_local(_v1)
@@ -1828,26 +1850,6 @@ module GLib
1828
1850
  end
1829
1851
  end
1830
1852
  # XXX: Don't know how to print callback
1831
- class GLib::IConv < GirFFI::StructBase
1832
- def self.open(to_codeset, from_codeset)
1833
- to_ptr = GirFFI::InPointer.from_utf8(to_codeset)
1834
- from_ptr = GirFFI::InPointer.from_utf8(from_codeset)
1835
- result_ptr = Lib.g_iconv_open(to_ptr, from_ptr)
1836
- wrap(result_ptr)
1837
- end
1838
- def _(inbuf, inbytes_left, outbuf, outbytes_left)
1839
- _v1 = GirFFI::InPointer.from_utf8(inbuf)
1840
- _v2 = inbytes_left
1841
- _v3 = GirFFI::InPointer.from_utf8(outbuf)
1842
- _v4 = outbytes_left
1843
- _v5 = GLib::Lib.g_iconv(self, _v1, _v2, _v3, _v4)
1844
- return _v5
1845
- end
1846
- def close
1847
- _v1 = GLib::Lib.g_iconv_close(self)
1848
- return _v1
1849
- end
1850
- end
1851
1853
  IEEE754_DOUBLE_BIAS = 1023
1852
1854
  IEEE754_FLOAT_BIAS = 127
1853
1855
  class GLib::IOChannel < GirFFI::BoxedBase
@@ -2002,6 +2004,11 @@ module GLib
2002
2004
  _v3 = GLib::String.wrap(_v2)
2003
2005
  _v3
2004
2006
  end
2007
+ def read_cd
2008
+ _v1 = (@struct.to_ptr + 24)
2009
+ _v2 = _v1.get_pointer(0)
2010
+ _v2
2011
+ end
2005
2012
  def read_chars
2006
2013
  count = buf.nil? ? (0) : (buf.length)
2007
2014
  _v1 = count
@@ -2155,6 +2162,11 @@ module GLib
2155
2162
  _v3 = GLib::String.wrap(_v2)
2156
2163
  _v3
2157
2164
  end
2165
+ def write_cd
2166
+ _v1 = (@struct.to_ptr + 32)
2167
+ _v2 = _v1.get_pointer(0)
2168
+ _v2
2169
+ end
2158
2170
  def write_chars(buf, count)
2159
2171
  _v1 = GirFFI::SizedArray.from(:guint8, -1, buf)
2160
2172
  _v2 = count
@@ -2222,6 +2234,7 @@ module GLib
2222
2234
  end
2223
2235
  end
2224
2236
  # XXX: Don't know how to print enum
2237
+ KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX = "Desktop Action"
2225
2238
  KEY_FILE_DESKTOP_GROUP = "Desktop Entry"
2226
2239
  KEY_FILE_DESKTOP_KEY_ACTIONS = "Actions"
2227
2240
  KEY_FILE_DESKTOP_KEY_CATEGORIES = "Categories"
@@ -2351,6 +2364,14 @@ module GLib
2351
2364
  _v6 = GLib::Strv.wrap(_v4)
2352
2365
  return [_v6, _v5]
2353
2366
  end
2367
+ def get_locale_for_key(group_name, key, locale = nil)
2368
+ _v1 = GirFFI::InPointer.from_utf8(group_name)
2369
+ _v2 = GirFFI::InPointer.from_utf8(key)
2370
+ _v3 = GirFFI::InPointer.from_utf8(locale)
2371
+ _v4 = GLib::Lib.g_key_file_get_locale_for_key(self, _v1, _v2, _v3)
2372
+ _v5 = GirFFI::AllocationHelper.free_after(_v4, &:to_utf8)
2373
+ return _v5
2374
+ end
2354
2375
  def get_locale_string(group_name, key, locale = nil)
2355
2376
  _v1 = GirFFI::InPointer.from_utf8(group_name)
2356
2377
  _v2 = GirFFI::InPointer.from_utf8(key)
@@ -2617,7 +2638,7 @@ module GLib
2617
2638
  LN2 = 0.693147
2618
2639
  LOG_2_BASE_10 = 0.30103
2619
2640
  LOG_DOMAIN = 0
2620
- LOG_FATAL_MASK = 0
2641
+ LOG_FATAL_MASK = 5
2621
2642
  LOG_LEVEL_USER_SHIFT = 8
2622
2643
  class GLib::List < GirFFI::StructBase
2623
2644
  def self.from_enumerable(type, arr)
@@ -2702,7 +2723,7 @@ module GLib
2702
2723
  MININT32 = -2147483648
2703
2724
  MININT64 = -9223372036854775808
2704
2725
  MININT8 = -128
2705
- MINOR_VERSION = 54
2726
+ MINOR_VERSION = 56
2706
2727
  MODULE_SUFFIX = "so"
2707
2728
  class GLib::MainContext < GirFFI::BoxedBase
2708
2729
  def self.default
@@ -4028,8 +4049,8 @@ module GLib
4028
4049
  # XXX: Don't know how to print enum
4029
4050
  # XXX: Don't know how to print callback
4030
4051
  # XXX: Don't know how to print flags
4031
- SEARCHPATH_SEPARATOR = 59
4032
- SEARCHPATH_SEPARATOR_S = ";"
4052
+ SEARCHPATH_SEPARATOR = 58
4053
+ SEARCHPATH_SEPARATOR_S = ":"
4033
4054
  SIZEOF_LONG = 8
4034
4055
  SIZEOF_SIZE_T = 8
4035
4056
  SIZEOF_SSIZE_T = 8
@@ -5389,6 +5410,7 @@ module GLib
5389
5410
  end
5390
5411
  end
5391
5412
  # XXX: Don't know how to print enum
5413
+ # XXX: Don't know how to print enum
5392
5414
  # XXX: Don't know how to print flags
5393
5415
  class GLib::TestSuite < GirFFI::StructBase
5394
5416
 
@@ -6881,21 +6903,6 @@ module GLib
6881
6903
  _v5 = GirFFI::SizedArray.wrap(:guint8, _v4, _v2.get_pointer(0))
6882
6904
  return [_v3, _v5]
6883
6905
  end
6884
- def self.base64_decode_step(in_, state, save)
6885
- len = in_.nil? ? (0) : (in_.length)
6886
- _v1 = len
6887
- _v2 = FFI::MemoryPointer.new(:pointer)
6888
- _v3 = FFI::MemoryPointer.new(:int32)
6889
- _v3.put_int32(0, state)
6890
- _v4 = FFI::MemoryPointer.new(:uint32)
6891
- _v4.put_uint32(0, save)
6892
- _v5 = GirFFI::SizedArray.from(:guint8, -1, in_)
6893
- _v6 = GLib::Lib.g_base64_decode_step(_v5, _v1, _v2, _v3, _v4)
6894
- _v7 = GirFFI::SizedArray.wrap(:guint8, -1, _v2.get_pointer(0))
6895
- _v8 = _v3.get_int32(0)
6896
- _v9 = _v4.get_uint32(0)
6897
- return [_v6, _v7, _v8, _v9]
6898
- end
6899
6906
  def self.base64_encode(data)
6900
6907
  len = data.nil? ? (0) : (data.length)
6901
6908
  _v1 = len
@@ -7118,54 +7125,48 @@ module GLib
7118
7125
  _v7 = GirFFI::AllocationHelper.free_after(_v6, &:to_utf8)
7119
7126
  return _v7
7120
7127
  end
7121
- def self.convert(str, len, to_codeset, from_codeset)
7122
- _v1 = GirFFI::InPointer.from_utf8(str)
7123
- _v2 = len
7124
- _v3 = GirFFI::InPointer.from_utf8(to_codeset)
7125
- _v4 = GirFFI::InPointer.from_utf8(from_codeset)
7128
+ def self.convert(str, to_codeset, from_codeset)
7129
+ len = str.nil? ? (0) : (str.length)
7130
+ _v1 = len
7131
+ _v2 = GirFFI::InPointer.from_utf8(to_codeset)
7132
+ _v3 = GirFFI::InPointer.from_utf8(from_codeset)
7133
+ _v4 = FFI::MemoryPointer.new(:uint64)
7126
7134
  _v5 = FFI::MemoryPointer.new(:uint64)
7127
- _v6 = FFI::MemoryPointer.new(:uint64)
7135
+ _v6 = GirFFI::SizedArray.from(:guint8, -1, str)
7128
7136
  _v7 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
7129
- _v8 = GLib::Lib.g_convert(_v1, _v2, _v3, _v4, _v5, _v6, _v7)
7137
+ _v8 = GLib::Lib.g_convert(_v6, _v1, _v2, _v3, _v4, _v5, _v7)
7130
7138
  GirFFI::ArgHelper.check_error(_v7)
7131
- _v9 = _v5.get_uint64(0)
7132
- _v10 = _v6.get_uint64(0)
7133
- _v11 = GirFFI::AllocationHelper.free_after(_v8, &:to_utf8)
7134
- return [_v11, _v9, _v10]
7139
+ _v9 = _v4.get_uint64(0)
7140
+ _v10 = _v5.get_uint64(0)
7141
+ _v11 = GirFFI::SizedArray.wrap(:guint8, _v10, _v8)
7142
+ return [_v11, _v9]
7135
7143
  end
7136
7144
  def self.convert_error_quark
7137
7145
  _v1 = GLib::Lib.g_convert_error_quark
7138
7146
  return _v1
7139
7147
  end
7140
- def self.convert_with_fallback(str, len, to_codeset, from_codeset, fallback, bytes_read, bytes_written)
7141
- _v1 = GirFFI::InPointer.from_utf8(str)
7142
- _v2 = len
7143
- _v3 = GirFFI::InPointer.from_utf8(to_codeset)
7144
- _v4 = GirFFI::InPointer.from_utf8(from_codeset)
7145
- _v5 = GirFFI::InPointer.from_utf8(fallback)
7146
- _v6 = bytes_read
7147
- _v7 = bytes_written
7148
+ def self.convert_with_fallback(str, to_codeset, from_codeset, fallback)
7149
+ len = str.nil? ? (0) : (str.length)
7150
+ _v1 = len
7151
+ _v2 = GirFFI::InPointer.from_utf8(to_codeset)
7152
+ _v3 = GirFFI::InPointer.from_utf8(from_codeset)
7153
+ _v4 = GirFFI::InPointer.from_utf8(fallback)
7154
+ _v5 = FFI::MemoryPointer.new(:uint64)
7155
+ _v6 = FFI::MemoryPointer.new(:uint64)
7156
+ _v7 = GirFFI::SizedArray.from(:guint8, -1, str)
7148
7157
  _v8 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
7149
- _v9 = GLib::Lib.g_convert_with_fallback(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8)
7158
+ _v9 = GLib::Lib.g_convert_with_fallback(_v7, _v1, _v2, _v3, _v4, _v5, _v6, _v8)
7150
7159
  GirFFI::ArgHelper.check_error(_v8)
7151
- _v10 = GirFFI::AllocationHelper.free_after(_v9, &:to_utf8)
7152
- return _v10
7160
+ _v10 = _v5.get_uint64(0)
7161
+ _v11 = _v6.get_uint64(0)
7162
+ _v12 = GirFFI::SizedArray.wrap(:guint8, _v11, _v9)
7163
+ return [_v12, _v10]
7153
7164
  end
7154
- def self.convert_with_iconv(str, len, converter, bytes_read, bytes_written)
7155
- _v1 = GirFFI::InPointer.from_utf8(str)
7156
- _v2 = len
7157
- _v3 = GLib::IConv.from(converter)
7158
- _v4 = bytes_read
7159
- _v5 = bytes_written
7160
- _v6 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
7161
- _v7 = GLib::Lib.g_convert_with_iconv(_v1, _v2, _v3, _v4, _v5, _v6)
7162
- GirFFI::ArgHelper.check_error(_v6)
7163
- _v8 = GirFFI::AllocationHelper.free_after(_v7, &:to_utf8)
7164
- return _v8
7165
- end
7166
- def self.datalist_clear(datalist)
7165
+ def self.datalist_foreach(datalist, &func)
7167
7166
  _v1 = GLib::Data.from(datalist)
7168
- GLib::Lib.g_datalist_clear(_v1)
7167
+ _v2 = GLib::DataForeachFunc.from(func)
7168
+ _v3 = GirFFI::ArgHelper.store(_v2)
7169
+ GLib::Lib.g_datalist_foreach(_v1, _v2, _v3)
7169
7170
  end
7170
7171
  def self.datalist_get_data(datalist, key)
7171
7172
  _v1 = GLib::Data.from(datalist)
@@ -7184,33 +7185,6 @@ module GLib
7184
7185
  _v3 = GLib::Lib.g_datalist_id_get_data(_v1, _v2)
7185
7186
  return _v3
7186
7187
  end
7187
- def self.datalist_id_remove_no_notify(datalist, key_id)
7188
- _v1 = GLib::Data.from(datalist)
7189
- _v2 = key_id
7190
- _v3 = GLib::Lib.g_datalist_id_remove_no_notify(_v1, _v2)
7191
- return _v3
7192
- end
7193
- def self.datalist_id_replace_data(datalist, key_id, oldval = nil, newval = nil, &destroy)
7194
- _v1 = GLib::Data.from(datalist)
7195
- _v2 = key_id
7196
- _v3 = oldval
7197
- _v4 = newval
7198
- _v5 = GLib::DestroyNotify.from(destroy)
7199
- _v6 = GLib::DestroyNotify.from(old_destroy)
7200
- _v7 = GLib::Lib.g_datalist_id_replace_data(_v1, _v2, _v3, _v4, _v5, _v6)
7201
- return _v7
7202
- end
7203
- def self.datalist_id_set_data_full(datalist, key_id, data = nil, &destroy_func)
7204
- _v1 = GLib::Data.from(datalist)
7205
- _v2 = key_id
7206
- _v3 = data
7207
- _v4 = GLib::DestroyNotify.from(destroy_func)
7208
- GLib::Lib.g_datalist_id_set_data_full(_v1, _v2, _v3, _v4)
7209
- end
7210
- def self.datalist_init(datalist)
7211
- _v1 = GLib::Data.from(datalist)
7212
- GLib::Lib.g_datalist_init(_v1)
7213
- end
7214
7188
  def self.datalist_set_flags(datalist, flags)
7215
7189
  _v1 = GLib::Data.from(datalist)
7216
7190
  _v2 = flags
@@ -7225,25 +7199,18 @@ module GLib
7225
7199
  _v1 = dataset_location
7226
7200
  GLib::Lib.g_dataset_destroy(_v1)
7227
7201
  end
7228
- def self.dataset_id_get_data(dataset_location, key_id)
7202
+ def self.dataset_foreach(dataset_location, &func)
7229
7203
  _v1 = dataset_location
7230
- _v2 = key_id
7231
- _v3 = GLib::Lib.g_dataset_id_get_data(_v1, _v2)
7232
- return _v3
7204
+ _v2 = GLib::DataForeachFunc.from(func)
7205
+ _v3 = GirFFI::ArgHelper.store(_v2)
7206
+ GLib::Lib.g_dataset_foreach(_v1, _v2, _v3)
7233
7207
  end
7234
- def self.dataset_id_remove_no_notify(dataset_location, key_id)
7208
+ def self.dataset_id_get_data(dataset_location, key_id)
7235
7209
  _v1 = dataset_location
7236
7210
  _v2 = key_id
7237
- _v3 = GLib::Lib.g_dataset_id_remove_no_notify(_v1, _v2)
7211
+ _v3 = GLib::Lib.g_dataset_id_get_data(_v1, _v2)
7238
7212
  return _v3
7239
7213
  end
7240
- def self.dataset_id_set_data_full(dataset_location, key_id, data = nil, &destroy_func)
7241
- _v1 = dataset_location
7242
- _v2 = key_id
7243
- _v3 = data
7244
- _v4 = GLib::DestroyNotify.from(destroy_func)
7245
- GLib::Lib.g_dataset_id_set_data_full(_v1, _v2, _v3, _v4)
7246
- end
7247
7214
  def self.date_get_days_in_month(month, year)
7248
7215
  _v1 = month
7249
7216
  _v2 = year
@@ -7394,15 +7361,15 @@ module GLib
7394
7361
  end
7395
7362
  def self.environ_getenv(envp, variable)
7396
7363
  _v1 = GLib::Strv.from(envp)
7397
- _v2 = GirFFI::InPointer.from_utf8(variable)
7364
+ _v2 = variable
7398
7365
  _v3 = GLib::Lib.g_environ_getenv(_v1, _v2)
7399
7366
  _v4 = _v3.to_utf8
7400
7367
  return _v4
7401
7368
  end
7402
7369
  def self.environ_setenv(envp, variable, value, overwrite)
7403
7370
  _v1 = GLib::Strv.from(envp)
7404
- _v2 = GirFFI::InPointer.from_utf8(variable)
7405
- _v3 = GirFFI::InPointer.from_utf8(value)
7371
+ _v2 = variable
7372
+ _v3 = value
7406
7373
  _v4 = overwrite
7407
7374
  _v5 = GLib::Lib.g_environ_setenv(_v1, _v2, _v3, _v4)
7408
7375
  _v6 = GLib::Strv.wrap(_v5)
@@ -7410,7 +7377,7 @@ module GLib
7410
7377
  end
7411
7378
  def self.environ_unsetenv(envp, variable)
7412
7379
  _v1 = GLib::Strv.from(envp)
7413
- _v2 = GirFFI::InPointer.from_utf8(variable)
7380
+ _v2 = variable
7414
7381
  _v3 = GLib::Lib.g_environ_unsetenv(_v1, _v2)
7415
7382
  _v4 = GLib::Strv.wrap(_v3)
7416
7383
  return _v4
@@ -7500,8 +7467,8 @@ module GLib
7500
7467
  GirFFI::ArgHelper.check_error(_v5)
7501
7468
  _v7 = _v3.get_uint64(0)
7502
7469
  _v8 = _v4.get_uint64(0)
7503
- _v9 = GirFFI::SizedArray.wrap(:guint8, _v8, _v6)
7504
- return [_v9, _v7]
7470
+ _v9 = GirFFI::AllocationHelper.free_after(_v6, &:to_utf8)
7471
+ return [_v9, _v7, _v8]
7505
7472
  end
7506
7473
  def self.filename_to_uri(filename, hostname = nil)
7507
7474
  _v1 = filename
@@ -7679,7 +7646,7 @@ module GLib
7679
7646
  return _v3
7680
7647
  end
7681
7648
  def self.getenv(variable)
7682
- _v1 = GirFFI::InPointer.from_utf8(variable)
7649
+ _v1 = variable
7683
7650
  _v2 = GLib::Lib.g_getenv(_v1)
7684
7651
  _v3 = _v2.to_utf8
7685
7652
  return _v3
@@ -7818,15 +7785,6 @@ module GLib
7818
7785
  _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
7819
7786
  return _v3
7820
7787
  end
7821
- def self.iconv(converter, inbuf, inbytes_left, outbuf, outbytes_left)
7822
- _v1 = GLib::IConv.from(converter)
7823
- _v2 = GirFFI::InPointer.from_utf8(inbuf)
7824
- _v3 = inbytes_left
7825
- _v4 = GirFFI::InPointer.from_utf8(outbuf)
7826
- _v5 = outbytes_left
7827
- _v6 = GLib::Lib.g_iconv(_v1, _v2, _v3, _v4, _v5)
7828
- return _v6
7829
- end
7830
7788
  def self.idle_add(priority, &function)
7831
7789
  _v1 = priority
7832
7790
  _v2 = GLib::SourceFunc.from(function)
@@ -7924,19 +7882,20 @@ module GLib
7924
7882
  GirFFI::ArgHelper.check_error(_v5)
7925
7883
  _v7 = _v3.get_uint64(0)
7926
7884
  _v8 = _v4.get_uint64(0)
7927
- _v9 = GirFFI::AllocationHelper.free_after(_v6, &:to_utf8)
7928
- return [_v9, _v7, _v8]
7885
+ _v9 = GirFFI::SizedArray.wrap(:guint8, _v8, _v6)
7886
+ return [_v9, _v7]
7929
7887
  end
7930
- def self.locale_to_utf8(opsysstring, len)
7931
- _v1 = GirFFI::InPointer.from_utf8(opsysstring)
7932
- _v2 = len
7888
+ def self.locale_to_utf8(opsysstring)
7889
+ len = opsysstring.nil? ? (0) : (opsysstring.length)
7890
+ _v1 = len
7891
+ _v2 = FFI::MemoryPointer.new(:uint64)
7933
7892
  _v3 = FFI::MemoryPointer.new(:uint64)
7934
- _v4 = FFI::MemoryPointer.new(:uint64)
7893
+ _v4 = GirFFI::SizedArray.from(:guint8, -1, opsysstring)
7935
7894
  _v5 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
7936
- _v6 = GLib::Lib.g_locale_to_utf8(_v1, _v2, _v3, _v4, _v5)
7895
+ _v6 = GLib::Lib.g_locale_to_utf8(_v4, _v1, _v2, _v3, _v5)
7937
7896
  GirFFI::ArgHelper.check_error(_v5)
7938
- _v7 = _v3.get_uint64(0)
7939
- _v8 = _v4.get_uint64(0)
7897
+ _v7 = _v2.get_uint64(0)
7898
+ _v8 = _v3.get_uint64(0)
7940
7899
  _v9 = GirFFI::AllocationHelper.free_after(_v6, &:to_utf8)
7941
7900
  return [_v9, _v7, _v8]
7942
7901
  end
@@ -8407,8 +8366,8 @@ module GLib
8407
8366
  GLib::Lib.g_set_prgname(_v1)
8408
8367
  end
8409
8368
  def self.setenv(variable, value, overwrite)
8410
- _v1 = GirFFI::InPointer.from_utf8(variable)
8411
- _v2 = GirFFI::InPointer.from_utf8(value)
8369
+ _v1 = variable
8370
+ _v2 = value
8412
8371
  _v3 = overwrite
8413
8372
  _v4 = GLib::Lib.g_setenv(_v1, _v2, _v3)
8414
8373
  return _v4
@@ -8418,7 +8377,7 @@ module GLib
8418
8377
  return _v1
8419
8378
  end
8420
8379
  def self.shell_parse_argv(command_line)
8421
- _v1 = GirFFI::InPointer.from_utf8(command_line)
8380
+ _v1 = command_line
8422
8381
  _v2 = FFI::MemoryPointer.new(:int32)
8423
8382
  _v3 = FFI::MemoryPointer.new(:pointer)
8424
8383
  _v4 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
@@ -8428,13 +8387,13 @@ module GLib
8428
8387
  return [_v5, _v6]
8429
8388
  end
8430
8389
  def self.shell_quote(unquoted_string)
8431
- _v1 = GirFFI::InPointer.from_utf8(unquoted_string)
8390
+ _v1 = unquoted_string
8432
8391
  _v2 = GLib::Lib.g_shell_quote(_v1)
8433
8392
  _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8434
8393
  return _v3
8435
8394
  end
8436
8395
  def self.shell_unquote(quoted_string)
8437
- _v1 = GirFFI::InPointer.from_utf8(quoted_string)
8396
+ _v1 = quoted_string
8438
8397
  _v2 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
8439
8398
  _v3 = GLib::Lib.g_shell_unquote(_v1, _v2)
8440
8399
  GirFFI::ArgHelper.check_error(_v2)
@@ -8557,14 +8516,14 @@ module GLib
8557
8516
  GLib::Lib.g_spawn_close_pid(_v1)
8558
8517
  end
8559
8518
  def self.spawn_command_line_async(command_line)
8560
- _v1 = GirFFI::InPointer.from_utf8(command_line)
8519
+ _v1 = command_line
8561
8520
  _v2 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
8562
8521
  _v3 = GLib::Lib.g_spawn_command_line_async(_v1, _v2)
8563
8522
  GirFFI::ArgHelper.check_error(_v2)
8564
8523
  return _v3
8565
8524
  end
8566
8525
  def self.spawn_command_line_sync(command_line)
8567
- _v1 = GirFFI::InPointer.from_utf8(command_line)
8526
+ _v1 = command_line
8568
8527
  _v2 = FFI::MemoryPointer.new(:pointer)
8569
8528
  _v3 = FFI::MemoryPointer.new(:pointer)
8570
8529
  _v4 = FFI::MemoryPointer.new(:int32)
@@ -9421,7 +9380,7 @@ module GLib
9421
9380
  return _v2
9422
9381
  end
9423
9382
  def self.unsetenv(variable)
9424
- _v1 = GirFFI::InPointer.from_utf8(variable)
9383
+ _v1 = variable
9425
9384
  GLib::Lib.g_unsetenv(_v1)
9426
9385
  end
9427
9386
  def self.uri_escape_string(unescaped, reserved_chars_allowed, allow_utf8)