gir_ffi-pretty_printer 0.0.5 → 0.0.6

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: c346ce23207ab223f046057633ad6d2f4c969a2151fca51747d13f1b777b7468
4
- data.tar.gz: 7cbcbbefd9f2fade71c6136593a7aba803c3f6e7895df8a806a58acf0892c852
3
+ metadata.gz: 3d0fc11fd4281cb14d017863b1699ac66cfead04720d69705a701958f3cebf4c
4
+ data.tar.gz: 41e373fd878e96af0810c95092a76ca55fa9028ba5050341ae1ca25285524a91
5
5
  SHA512:
6
- metadata.gz: eb03da9ee6610b517c0858904e2deb0eb5d812a61047065cfbf60f5a2b140ca549a7982bd5bb733b746b4e6c4951d0bb170a9d29206c36745fbe54c67f293e7d
7
- data.tar.gz: 5ffe6f64d3080d14686f733e696007411ffe8b634d8496fdb1821d6c6dfd08af5dfaf67a0b117ab613d3d9c44a0fc434c26bc9879ff9ce44c69b31569c1daa20
6
+ metadata.gz: 833dc6e8dd480e1fe745e26559cab214b45c11cfc9b94b0e148873d851db0f83d1ec73b550775ffec73444d3e0f171061c4b2b53f83c180808a0decf741e2ccf
7
+ data.tar.gz: ffc845f003d7343fc162b4b437d2d3efc0120713176338ca6076d6fc4767d0da5b7abb71350fbc7c0011d404f15ac30242215ae4b5d41585c5a7a8287020bd3a
@@ -6,8 +6,8 @@ module GLib
6
6
  ffi_type = GirFFI::TypeMap.type_specification_to_ffi_type(type)
7
7
  FFI.type_size(ffi_type)
8
8
  end
9
- def self.from_enumerable(elmtype, it)
10
- new(elmtype).tap { |arr| arr.append_vals(it) }
9
+ def self.from_enumerable(elmtype, arr)
10
+ new(elmtype).tap { |it| it.append_vals(arr) }
11
11
  end
12
12
  def ==(other)
13
13
  (to_a == other.to_a)
@@ -491,14 +491,14 @@ module GLib
491
491
  end
492
492
  end
493
493
  class GLib::Bytes < GirFFI::BoxedBase
494
- def self.from(it)
495
- case it
494
+ def self.from(obj)
495
+ case obj
496
496
  when self then
497
- it
497
+ obj
498
498
  when FFI::Pointer then
499
- wrap(it)
499
+ wrap(obj)
500
500
  else
501
- new(it)
501
+ new(obj)
502
502
  end
503
503
  end
504
504
  def self.new(*args, &block)
@@ -1159,6 +1159,11 @@ module GLib
1159
1159
  _v1 = GLib::Lib.g_date_time_get_seconds(self)
1160
1160
  return _v1
1161
1161
  end
1162
+ def get_timezone
1163
+ _v1 = GLib::Lib.g_date_time_get_timezone(self)
1164
+ _v2 = GLib::TimeZone.wrap_copy(_v1)
1165
+ return _v2
1166
+ end
1162
1167
  def get_timezone_abbreviation
1163
1168
  _v1 = GLib::Lib.g_date_time_get_timezone_abbreviation(self)
1164
1169
  _v2 = _v1.to_utf8
@@ -1349,11 +1354,11 @@ module GLib
1349
1354
  E = 2.718282
1350
1355
  # XXX: Don't know how to print callback
1351
1356
  class GLib::Error < GirFFI::BoxedBase
1352
- def self.from(it)
1353
- from_exception(it)
1357
+ def self.from(obj)
1358
+ from_exception(obj)
1354
1359
  end
1355
- def self.from_exception(ex)
1356
- new_literal(GIR_FFI_DOMAIN, 0, ex.message)
1360
+ def self.from_exception(exception)
1361
+ new_literal(GIR_FFI_DOMAIN, 0, exception.message)
1357
1362
  end
1358
1363
  def self.new_literal(*args, &block)
1359
1364
  raise(NoMethodError) unless (self == GLib::Error)
@@ -1525,6 +1530,16 @@ module GLib
1525
1530
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
1526
1531
  GLib::Lib.g_hash_table_steal_all(_v1)
1527
1532
  end
1533
+ def self.steal_extended(hash_table, lookup_key = nil)
1534
+ _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
1535
+ _v2 = lookup_key
1536
+ _v3 = FFI::MemoryPointer.new(:pointer)
1537
+ _v4 = FFI::MemoryPointer.new(:pointer)
1538
+ _v5 = GLib::Lib.g_hash_table_steal_extended(_v1, _v2, _v3, _v4)
1539
+ _v6 = _v3.get_pointer(0)
1540
+ _v7 = _v4.get_pointer(0)
1541
+ return [_v5, _v6, _v7]
1542
+ end
1528
1543
  def self.unref(hash_table)
1529
1544
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
1530
1545
  GLib::Lib.g_hash_table_unref(_v1)
@@ -1610,10 +1625,13 @@ module GLib
1610
1625
  end
1611
1626
  class GLib::Hmac < GirFFI::StructBase
1612
1627
 
1613
- def get_digest(buffer, digest_len)
1614
- _v1 = buffer
1615
- _v2 = digest_len
1616
- GLib::Lib.g_hmac_get_digest(self, _v1, _v2)
1628
+ def get_digest(buffer)
1629
+ digest_len = buffer.nil? ? (0) : (buffer.length)
1630
+ _v1 = FFI::MemoryPointer.new(:uint64)
1631
+ _v1.put_uint64(0, digest_len)
1632
+ _v2 = GirFFI::SizedArray.from(:guint8, -1, buffer)
1633
+ GLib::Lib.g_hmac_get_digest(self, _v2, _v1)
1634
+ _v3 = _v1.get_uint64(0)
1617
1635
  end
1618
1636
  def get_string
1619
1637
  _v1 = GLib::Lib.g_hmac_get_string(self)
@@ -2723,7 +2741,7 @@ module GLib
2723
2741
  MININT32 = -2147483648
2724
2742
  MININT64 = -9223372036854775808
2725
2743
  MININT8 = -128
2726
- MINOR_VERSION = 56
2744
+ MINOR_VERSION = 58
2727
2745
  MODULE_SUFFIX = "so"
2728
2746
  class GLib::MainContext < GirFFI::BoxedBase
2729
2747
  def self.default
@@ -2853,10 +2871,10 @@ module GLib
2853
2871
  end
2854
2872
  end
2855
2873
  class GLib::MainLoop < GirFFI::BoxedBase
2856
- def self.handle_exception(ex)
2874
+ def self.handle_exception(exception)
2857
2875
  current_loop = RUNNING_LOOPS.last
2858
- raise(ex) unless current_loop
2859
- (EXCEPTIONS << ex)
2876
+ raise(exception) unless current_loop
2877
+ (EXCEPTIONS << exception)
2860
2878
  current_loop.quit
2861
2879
  end
2862
2880
  def self.new(*args, &block)
@@ -2885,9 +2903,9 @@ module GLib
2885
2903
  ThreadEnabler.instance.setup_idle_handler if (RUBY_ENGINE == "ruby")
2886
2904
  (RUNNING_LOOPS << self)
2887
2905
  result = run_without_thread_enabler
2888
- ex = EXCEPTIONS.shift
2906
+ exception = EXCEPTIONS.shift
2889
2907
  RUNNING_LOOPS.pop
2890
- raise(ex) if ex
2908
+ raise(exception) if exception
2891
2909
  result
2892
2910
  end
2893
2911
  def unref
@@ -3595,8 +3613,8 @@ module GLib
3595
3613
  def self.add(array, data)
3596
3614
  array.add(data)
3597
3615
  end
3598
- def self.from_enumerable(type, it)
3599
- new(type).tap { |arr| arr.add_array(it) }
3616
+ def self.from_enumerable(type, arr)
3617
+ new(type).tap { |it| it.add_array(arr) }
3600
3618
  end
3601
3619
  def ==(other)
3602
3620
  (to_a == other.to_a)
@@ -5597,6 +5615,12 @@ module GLib
5597
5615
  obj.__send__(:initialize_local, *args, &block)
5598
5616
  obj
5599
5617
  end
5618
+ def self.new_offset(*args, &block)
5619
+ raise(NoMethodError) unless (self == GLib::TimeZone)
5620
+ obj = allocate
5621
+ obj.__send__(:initialize_offset, *args, &block)
5622
+ obj
5623
+ end
5600
5624
  def self.new_utc(*args, &block)
5601
5625
  raise(NoMethodError) unless (self == GLib::TimeZone)
5602
5626
  obj = allocate
@@ -5621,6 +5645,11 @@ module GLib
5621
5645
  _v3 = _v2.to_utf8
5622
5646
  return _v3
5623
5647
  end
5648
+ def get_identifier
5649
+ _v1 = GLib::Lib.g_time_zone_get_identifier(self)
5650
+ _v2 = _v1.to_utf8
5651
+ return _v2
5652
+ end
5624
5653
  def get_offset(interval)
5625
5654
  _v1 = interval
5626
5655
  _v2 = GLib::Lib.g_time_zone_get_offset(self, _v1)
@@ -5631,6 +5660,12 @@ module GLib
5631
5660
  store_pointer(_v1)
5632
5661
  @struct.owned = true
5633
5662
  end
5663
+ def initialize_offset(seconds)
5664
+ _v1 = seconds
5665
+ _v2 = GLib::Lib.g_time_zone_new_offset(_v1)
5666
+ store_pointer(_v2)
5667
+ @struct.owned = true
5668
+ end
5634
5669
  def initialize_utc
5635
5670
  _v1 = GLib::Lib.g_time_zone_new_utc
5636
5671
  store_pointer(_v1)
@@ -6884,6 +6919,41 @@ module GLib
6884
6919
  _v3 = GLib::Lib.g_atomic_pointer_xor(_v1, _v2)
6885
6920
  return _v3
6886
6921
  end
6922
+ def self.atomic_rc_box_acquire(mem_block)
6923
+ _v1 = mem_block
6924
+ _v2 = GLib::Lib.g_atomic_rc_box_acquire(_v1)
6925
+ return _v2
6926
+ end
6927
+ def self.atomic_rc_box_alloc(block_size)
6928
+ _v1 = block_size
6929
+ _v2 = GLib::Lib.g_atomic_rc_box_alloc(_v1)
6930
+ return _v2
6931
+ end
6932
+ def self.atomic_rc_box_alloc0(block_size)
6933
+ _v1 = block_size
6934
+ _v2 = GLib::Lib.g_atomic_rc_box_alloc0(_v1)
6935
+ return _v2
6936
+ end
6937
+ def self.atomic_rc_box_dup(block_size, mem_block)
6938
+ _v1 = block_size
6939
+ _v2 = mem_block
6940
+ _v3 = GLib::Lib.g_atomic_rc_box_dup(_v1, _v2)
6941
+ return _v3
6942
+ end
6943
+ def self.atomic_rc_box_get_size(mem_block)
6944
+ _v1 = mem_block
6945
+ _v2 = GLib::Lib.g_atomic_rc_box_get_size(_v1)
6946
+ return _v2
6947
+ end
6948
+ def self.atomic_rc_box_release(mem_block)
6949
+ _v1 = mem_block
6950
+ GLib::Lib.g_atomic_rc_box_release(_v1)
6951
+ end
6952
+ def self.atomic_rc_box_release_full(mem_block, &clear_func)
6953
+ _v1 = mem_block
6954
+ _v2 = GLib::DestroyNotify.from(clear_func)
6955
+ GLib::Lib.g_atomic_rc_box_release_full(_v1, _v2)
6956
+ end
6887
6957
  def self.base64_decode(text)
6888
6958
  _v1 = GirFFI::InPointer.from_utf8(text)
6889
6959
  _v2 = FFI::MemoryPointer.new(:uint64)
@@ -7025,6 +7095,13 @@ module GLib
7025
7095
  _v1 = array
7026
7096
  GLib::Lib.g_byte_array_unref(_v1)
7027
7097
  end
7098
+ def self.canonicalize_filename(filename, relative_to = nil)
7099
+ _v1 = filename
7100
+ _v2 = relative_to
7101
+ _v3 = GLib::Lib.g_canonicalize_filename(_v1, _v2)
7102
+ _v4 = GirFFI::AllocationHelper.free_after(_v3, &:to_utf8)
7103
+ return _v4
7104
+ end
7028
7105
  def self.chdir(path)
7029
7106
  _v1 = path
7030
7107
  _v2 = GLib::Lib.g_chdir(_v1)
@@ -7551,10 +7628,11 @@ module GLib
7551
7628
  _v2 = GLib::Strv.wrap(_v1)
7552
7629
  return _v2
7553
7630
  end
7554
- def self.get_filename_charsets(charsets)
7555
- _v1 = GirFFI::InPointer.from_utf8(charsets)
7631
+ def self.get_filename_charsets
7632
+ _v1 = FFI::MemoryPointer.new(:pointer)
7556
7633
  _v2 = GLib::Lib.g_get_filename_charsets(_v1)
7557
- return _v2
7634
+ _v3 = GLib::Strv.wrap(_v1.get_pointer(0))
7635
+ return [_v2, _v3]
7558
7636
  end
7559
7637
  def self.get_home_dir
7560
7638
  _v1 = GLib::Lib.g_get_home_dir
@@ -7571,6 +7649,12 @@ module GLib
7571
7649
  _v2 = GLib::Strv.wrap(_v1)
7572
7650
  return _v2
7573
7651
  end
7652
+ def self.get_language_names_with_category(category_name)
7653
+ _v1 = GirFFI::InPointer.from_utf8(category_name)
7654
+ _v2 = GLib::Lib.g_get_language_names_with_category(_v1)
7655
+ _v3 = GLib::Strv.wrap(_v2)
7656
+ return _v3
7657
+ end
7574
7658
  def self.get_locale_variants(locale)
7575
7659
  _v1 = GirFFI::InPointer.from_utf8(locale)
7576
7660
  _v2 = GLib::Lib.g_get_locale_variants(_v1)
@@ -7722,6 +7806,16 @@ module GLib
7722
7806
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
7723
7807
  GLib::Lib.g_hash_table_steal_all(_v1)
7724
7808
  end
7809
+ def self.hash_table_steal_extended(hash_table, lookup_key = nil)
7810
+ _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
7811
+ _v2 = lookup_key
7812
+ _v3 = FFI::MemoryPointer.new(:pointer)
7813
+ _v4 = FFI::MemoryPointer.new(:pointer)
7814
+ _v5 = GLib::Lib.g_hash_table_steal_extended(_v1, _v2, _v3, _v4)
7815
+ _v6 = _v3.get_pointer(0)
7816
+ _v7 = _v4.get_pointer(0)
7817
+ return [_v5, _v6, _v7]
7818
+ end
7725
7819
  def self.hash_table_unref(hash_table)
7726
7820
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
7727
7821
  GLib::Lib.g_hash_table_unref(_v1)
@@ -8233,6 +8327,41 @@ module GLib
8233
8327
  _v1 = seed
8234
8328
  GLib::Lib.g_random_set_seed(_v1)
8235
8329
  end
8330
+ def self.rc_box_acquire(mem_block)
8331
+ _v1 = mem_block
8332
+ _v2 = GLib::Lib.g_rc_box_acquire(_v1)
8333
+ return _v2
8334
+ end
8335
+ def self.rc_box_alloc(block_size)
8336
+ _v1 = block_size
8337
+ _v2 = GLib::Lib.g_rc_box_alloc(_v1)
8338
+ return _v2
8339
+ end
8340
+ def self.rc_box_alloc0(block_size)
8341
+ _v1 = block_size
8342
+ _v2 = GLib::Lib.g_rc_box_alloc0(_v1)
8343
+ return _v2
8344
+ end
8345
+ def self.rc_box_dup(block_size, mem_block)
8346
+ _v1 = block_size
8347
+ _v2 = mem_block
8348
+ _v3 = GLib::Lib.g_rc_box_dup(_v1, _v2)
8349
+ return _v3
8350
+ end
8351
+ def self.rc_box_get_size(mem_block)
8352
+ _v1 = mem_block
8353
+ _v2 = GLib::Lib.g_rc_box_get_size(_v1)
8354
+ return _v2
8355
+ end
8356
+ def self.rc_box_release(mem_block)
8357
+ _v1 = mem_block
8358
+ GLib::Lib.g_rc_box_release(_v1)
8359
+ end
8360
+ def self.rc_box_release_full(mem_block, &clear_func)
8361
+ _v1 = mem_block
8362
+ _v2 = GLib::DestroyNotify.from(clear_func)
8363
+ GLib::Lib.g_rc_box_release_full(_v1, _v2)
8364
+ end
8236
8365
  def self.realloc(mem, n_bytes)
8237
8366
  _v1 = mem
8238
8367
  _v2 = n_bytes
@@ -8246,6 +8375,40 @@ module GLib
8246
8375
  _v4 = GLib::Lib.g_realloc_n(_v1, _v2, _v3)
8247
8376
  return _v4
8248
8377
  end
8378
+ def self.ref_string_acquire(str)
8379
+ _v1 = GirFFI::InPointer.from_utf8(str)
8380
+ _v2 = GLib::Lib.g_ref_string_acquire(_v1)
8381
+ _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8382
+ return _v3
8383
+ end
8384
+ def self.ref_string_length(str)
8385
+ _v1 = GirFFI::InPointer.from_utf8(str)
8386
+ _v2 = GLib::Lib.g_ref_string_length(_v1)
8387
+ return _v2
8388
+ end
8389
+ def self.ref_string_new(str)
8390
+ _v1 = GirFFI::InPointer.from_utf8(str)
8391
+ _v2 = GLib::Lib.g_ref_string_new(_v1)
8392
+ _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8393
+ return _v3
8394
+ end
8395
+ def self.ref_string_new_intern(str)
8396
+ _v1 = GirFFI::InPointer.from_utf8(str)
8397
+ _v2 = GLib::Lib.g_ref_string_new_intern(_v1)
8398
+ _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8399
+ return _v3
8400
+ end
8401
+ def self.ref_string_new_len(str, len)
8402
+ _v1 = GirFFI::InPointer.from_utf8(str)
8403
+ _v2 = len
8404
+ _v3 = GLib::Lib.g_ref_string_new_len(_v1, _v2)
8405
+ _v4 = GirFFI::AllocationHelper.free_after(_v3, &:to_utf8)
8406
+ return _v4
8407
+ end
8408
+ def self.ref_string_release(str)
8409
+ _v1 = GirFFI::InPointer.from_utf8(str)
8410
+ GLib::Lib.g_ref_string_release(_v1)
8411
+ end
8249
8412
  def self.regex_check_replacement(replacement)
8250
8413
  _v1 = GirFFI::InPointer.from_utf8(replacement)
8251
8414
  _v2 = FFI::MemoryPointer.new(GirFFI::Boolean)
@@ -8484,6 +8647,23 @@ module GLib
8484
8647
  _v10 = _v7.get_int32(0)
8485
8648
  return [_v9, _v10]
8486
8649
  end
8650
+ def self.spawn_async_with_fds(working_directory, argv, envp, flags, stdin_fd, stdout_fd, stderr_fd, &child_setup)
8651
+ _v1 = working_directory
8652
+ _v2 = GLib::Strv.from(argv)
8653
+ _v3 = GLib::Strv.from(envp)
8654
+ _v4 = flags
8655
+ _v5 = GLib::SpawnChildSetupFunc.from(child_setup)
8656
+ _v6 = GirFFI::ArgHelper.store(_v5)
8657
+ _v7 = FFI::MemoryPointer.new(:int32)
8658
+ _v8 = stdin_fd
8659
+ _v9 = stdout_fd
8660
+ _v10 = stderr_fd
8661
+ _v11 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
8662
+ _v12 = GLib::Lib.g_spawn_async_with_fds(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11)
8663
+ GirFFI::ArgHelper.check_error(_v11)
8664
+ _v13 = _v7.get_int32(0)
8665
+ return [_v12, _v13]
8666
+ end
8487
8667
  def self.spawn_async_with_pipes(working_directory, argv, envp, flags, &child_setup)
8488
8668
  _v1 = working_directory
8489
8669
  _v2 = GLib::Strv.from(argv)
@@ -847,18 +847,6 @@ module GObject
847
847
  _v3 = GirFFI::SizedArray.from(GObject::Value, -1, values)
848
848
  GObject::Lib.g_object_getv(self, _v1, _v2, _v3)
849
849
  end
850
- def initialize_with_automatic_gtype(properties = {})
851
- names = []
852
- values = []
853
- properties.each do |name, value|
854
- name = name.to_s
855
- gvalue = gvalue_for_property(name)
856
- gvalue.set_value(value)
857
- (names << name)
858
- (values << gvalue)
859
- end
860
- initialize_without_automatic_gtype(self.class.gtype, names, values)
861
- end
862
850
  def initializev(object_type, parameters)
863
851
  _v1 = object_type
864
852
  n_parameters = parameters.nil? ? (0) : (parameters.length)
@@ -6,8 +6,8 @@ module GLib
6
6
  ffi_type = GirFFI::TypeMap.type_specification_to_ffi_type(type)
7
7
  FFI.type_size(ffi_type)
8
8
  end
9
- def self.from_enumerable(elmtype, it)
10
- new(elmtype).tap { |arr| arr.append_vals(it) }
9
+ def self.from_enumerable(elmtype, arr)
10
+ new(elmtype).tap { |it| it.append_vals(arr) }
11
11
  end
12
12
  def ==(other)
13
13
  (to_a == other.to_a)
@@ -491,14 +491,14 @@ module GLib
491
491
  end
492
492
  end
493
493
  class GLib::Bytes < GirFFI::BoxedBase
494
- def self.from(it)
495
- case it
494
+ def self.from(obj)
495
+ case obj
496
496
  when self then
497
- it
497
+ obj
498
498
  when FFI::Pointer then
499
- wrap(it)
499
+ wrap(obj)
500
500
  else
501
- new(it)
501
+ new(obj)
502
502
  end
503
503
  end
504
504
  def self.new(*args, &block)
@@ -1159,6 +1159,11 @@ module GLib
1159
1159
  _v1 = GLib::Lib.g_date_time_get_seconds(self)
1160
1160
  return _v1
1161
1161
  end
1162
+ def get_timezone
1163
+ _v1 = GLib::Lib.g_date_time_get_timezone(self)
1164
+ _v2 = GLib::TimeZone.wrap_copy(_v1)
1165
+ return _v2
1166
+ end
1162
1167
  def get_timezone_abbreviation
1163
1168
  _v1 = GLib::Lib.g_date_time_get_timezone_abbreviation(self)
1164
1169
  _v2 = _v1.to_utf8
@@ -1349,11 +1354,11 @@ module GLib
1349
1354
  E = 2.718282
1350
1355
  # XXX: Don't know how to print callback
1351
1356
  class GLib::Error < GirFFI::BoxedBase
1352
- def self.from(it)
1353
- from_exception(it)
1357
+ def self.from(obj)
1358
+ from_exception(obj)
1354
1359
  end
1355
- def self.from_exception(ex)
1356
- new_literal(GIR_FFI_DOMAIN, 0, ex.message)
1360
+ def self.from_exception(exception)
1361
+ new_literal(GIR_FFI_DOMAIN, 0, exception.message)
1357
1362
  end
1358
1363
  def self.new_literal(*args, &block)
1359
1364
  raise(NoMethodError) unless (self == GLib::Error)
@@ -1525,6 +1530,16 @@ module GLib
1525
1530
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
1526
1531
  GLib::Lib.g_hash_table_steal_all(_v1)
1527
1532
  end
1533
+ def self.steal_extended(hash_table, lookup_key = nil)
1534
+ _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
1535
+ _v2 = lookup_key
1536
+ _v3 = FFI::MemoryPointer.new(:pointer)
1537
+ _v4 = FFI::MemoryPointer.new(:pointer)
1538
+ _v5 = GLib::Lib.g_hash_table_steal_extended(_v1, _v2, _v3, _v4)
1539
+ _v6 = _v3.get_pointer(0)
1540
+ _v7 = _v4.get_pointer(0)
1541
+ return [_v5, _v6, _v7]
1542
+ end
1528
1543
  def self.unref(hash_table)
1529
1544
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
1530
1545
  GLib::Lib.g_hash_table_unref(_v1)
@@ -1610,10 +1625,13 @@ module GLib
1610
1625
  end
1611
1626
  class GLib::Hmac < GirFFI::StructBase
1612
1627
 
1613
- def get_digest(buffer, digest_len)
1614
- _v1 = buffer
1615
- _v2 = digest_len
1616
- GLib::Lib.g_hmac_get_digest(self, _v1, _v2)
1628
+ def get_digest(buffer)
1629
+ digest_len = buffer.nil? ? (0) : (buffer.length)
1630
+ _v1 = FFI::MemoryPointer.new(:uint64)
1631
+ _v1.put_uint64(0, digest_len)
1632
+ _v2 = GirFFI::SizedArray.from(:guint8, -1, buffer)
1633
+ GLib::Lib.g_hmac_get_digest(self, _v2, _v1)
1634
+ _v3 = _v1.get_uint64(0)
1617
1635
  end
1618
1636
  def get_string
1619
1637
  _v1 = GLib::Lib.g_hmac_get_string(self)
@@ -2723,7 +2741,7 @@ module GLib
2723
2741
  MININT32 = -2147483648
2724
2742
  MININT64 = -9223372036854775808
2725
2743
  MININT8 = -128
2726
- MINOR_VERSION = 56
2744
+ MINOR_VERSION = 58
2727
2745
  MODULE_SUFFIX = "so"
2728
2746
  class GLib::MainContext < GirFFI::BoxedBase
2729
2747
  def self.default
@@ -2853,10 +2871,10 @@ module GLib
2853
2871
  end
2854
2872
  end
2855
2873
  class GLib::MainLoop < GirFFI::BoxedBase
2856
- def self.handle_exception(ex)
2874
+ def self.handle_exception(exception)
2857
2875
  current_loop = RUNNING_LOOPS.last
2858
- raise(ex) unless current_loop
2859
- (EXCEPTIONS << ex)
2876
+ raise(exception) unless current_loop
2877
+ (EXCEPTIONS << exception)
2860
2878
  current_loop.quit
2861
2879
  end
2862
2880
  def self.new(*args, &block)
@@ -2885,9 +2903,9 @@ module GLib
2885
2903
  ThreadEnabler.instance.setup_idle_handler if (RUBY_ENGINE == "ruby")
2886
2904
  (RUNNING_LOOPS << self)
2887
2905
  result = run_without_thread_enabler
2888
- ex = EXCEPTIONS.shift
2906
+ exception = EXCEPTIONS.shift
2889
2907
  RUNNING_LOOPS.pop
2890
- raise(ex) if ex
2908
+ raise(exception) if exception
2891
2909
  result
2892
2910
  end
2893
2911
  def unref
@@ -3595,8 +3613,8 @@ module GLib
3595
3613
  def self.add(array, data)
3596
3614
  array.add(data)
3597
3615
  end
3598
- def self.from_enumerable(type, it)
3599
- new(type).tap { |arr| arr.add_array(it) }
3616
+ def self.from_enumerable(type, arr)
3617
+ new(type).tap { |it| it.add_array(arr) }
3600
3618
  end
3601
3619
  def ==(other)
3602
3620
  (to_a == other.to_a)
@@ -5597,6 +5615,12 @@ module GLib
5597
5615
  obj.__send__(:initialize_local, *args, &block)
5598
5616
  obj
5599
5617
  end
5618
+ def self.new_offset(*args, &block)
5619
+ raise(NoMethodError) unless (self == GLib::TimeZone)
5620
+ obj = allocate
5621
+ obj.__send__(:initialize_offset, *args, &block)
5622
+ obj
5623
+ end
5600
5624
  def self.new_utc(*args, &block)
5601
5625
  raise(NoMethodError) unless (self == GLib::TimeZone)
5602
5626
  obj = allocate
@@ -5621,6 +5645,11 @@ module GLib
5621
5645
  _v3 = _v2.to_utf8
5622
5646
  return _v3
5623
5647
  end
5648
+ def get_identifier
5649
+ _v1 = GLib::Lib.g_time_zone_get_identifier(self)
5650
+ _v2 = _v1.to_utf8
5651
+ return _v2
5652
+ end
5624
5653
  def get_offset(interval)
5625
5654
  _v1 = interval
5626
5655
  _v2 = GLib::Lib.g_time_zone_get_offset(self, _v1)
@@ -5631,6 +5660,12 @@ module GLib
5631
5660
  store_pointer(_v1)
5632
5661
  @struct.owned = true
5633
5662
  end
5663
+ def initialize_offset(seconds)
5664
+ _v1 = seconds
5665
+ _v2 = GLib::Lib.g_time_zone_new_offset(_v1)
5666
+ store_pointer(_v2)
5667
+ @struct.owned = true
5668
+ end
5634
5669
  def initialize_utc
5635
5670
  _v1 = GLib::Lib.g_time_zone_new_utc
5636
5671
  store_pointer(_v1)
@@ -6884,6 +6919,41 @@ module GLib
6884
6919
  _v3 = GLib::Lib.g_atomic_pointer_xor(_v1, _v2)
6885
6920
  return _v3
6886
6921
  end
6922
+ def self.atomic_rc_box_acquire(mem_block)
6923
+ _v1 = mem_block
6924
+ _v2 = GLib::Lib.g_atomic_rc_box_acquire(_v1)
6925
+ return _v2
6926
+ end
6927
+ def self.atomic_rc_box_alloc(block_size)
6928
+ _v1 = block_size
6929
+ _v2 = GLib::Lib.g_atomic_rc_box_alloc(_v1)
6930
+ return _v2
6931
+ end
6932
+ def self.atomic_rc_box_alloc0(block_size)
6933
+ _v1 = block_size
6934
+ _v2 = GLib::Lib.g_atomic_rc_box_alloc0(_v1)
6935
+ return _v2
6936
+ end
6937
+ def self.atomic_rc_box_dup(block_size, mem_block)
6938
+ _v1 = block_size
6939
+ _v2 = mem_block
6940
+ _v3 = GLib::Lib.g_atomic_rc_box_dup(_v1, _v2)
6941
+ return _v3
6942
+ end
6943
+ def self.atomic_rc_box_get_size(mem_block)
6944
+ _v1 = mem_block
6945
+ _v2 = GLib::Lib.g_atomic_rc_box_get_size(_v1)
6946
+ return _v2
6947
+ end
6948
+ def self.atomic_rc_box_release(mem_block)
6949
+ _v1 = mem_block
6950
+ GLib::Lib.g_atomic_rc_box_release(_v1)
6951
+ end
6952
+ def self.atomic_rc_box_release_full(mem_block, &clear_func)
6953
+ _v1 = mem_block
6954
+ _v2 = GLib::DestroyNotify.from(clear_func)
6955
+ GLib::Lib.g_atomic_rc_box_release_full(_v1, _v2)
6956
+ end
6887
6957
  def self.base64_decode(text)
6888
6958
  _v1 = GirFFI::InPointer.from_utf8(text)
6889
6959
  _v2 = FFI::MemoryPointer.new(:uint64)
@@ -7025,6 +7095,13 @@ module GLib
7025
7095
  _v1 = array
7026
7096
  GLib::Lib.g_byte_array_unref(_v1)
7027
7097
  end
7098
+ def self.canonicalize_filename(filename, relative_to = nil)
7099
+ _v1 = filename
7100
+ _v2 = relative_to
7101
+ _v3 = GLib::Lib.g_canonicalize_filename(_v1, _v2)
7102
+ _v4 = GirFFI::AllocationHelper.free_after(_v3, &:to_utf8)
7103
+ return _v4
7104
+ end
7028
7105
  def self.chdir(path)
7029
7106
  _v1 = path
7030
7107
  _v2 = GLib::Lib.g_chdir(_v1)
@@ -7551,10 +7628,11 @@ module GLib
7551
7628
  _v2 = GLib::Strv.wrap(_v1)
7552
7629
  return _v2
7553
7630
  end
7554
- def self.get_filename_charsets(charsets)
7555
- _v1 = GirFFI::InPointer.from_utf8(charsets)
7631
+ def self.get_filename_charsets
7632
+ _v1 = FFI::MemoryPointer.new(:pointer)
7556
7633
  _v2 = GLib::Lib.g_get_filename_charsets(_v1)
7557
- return _v2
7634
+ _v3 = GLib::Strv.wrap(_v1.get_pointer(0))
7635
+ return [_v2, _v3]
7558
7636
  end
7559
7637
  def self.get_home_dir
7560
7638
  _v1 = GLib::Lib.g_get_home_dir
@@ -7571,6 +7649,12 @@ module GLib
7571
7649
  _v2 = GLib::Strv.wrap(_v1)
7572
7650
  return _v2
7573
7651
  end
7652
+ def self.get_language_names_with_category(category_name)
7653
+ _v1 = GirFFI::InPointer.from_utf8(category_name)
7654
+ _v2 = GLib::Lib.g_get_language_names_with_category(_v1)
7655
+ _v3 = GLib::Strv.wrap(_v2)
7656
+ return _v3
7657
+ end
7574
7658
  def self.get_locale_variants(locale)
7575
7659
  _v1 = GirFFI::InPointer.from_utf8(locale)
7576
7660
  _v2 = GLib::Lib.g_get_locale_variants(_v1)
@@ -7722,6 +7806,16 @@ module GLib
7722
7806
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
7723
7807
  GLib::Lib.g_hash_table_steal_all(_v1)
7724
7808
  end
7809
+ def self.hash_table_steal_extended(hash_table, lookup_key = nil)
7810
+ _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
7811
+ _v2 = lookup_key
7812
+ _v3 = FFI::MemoryPointer.new(:pointer)
7813
+ _v4 = FFI::MemoryPointer.new(:pointer)
7814
+ _v5 = GLib::Lib.g_hash_table_steal_extended(_v1, _v2, _v3, _v4)
7815
+ _v6 = _v3.get_pointer(0)
7816
+ _v7 = _v4.get_pointer(0)
7817
+ return [_v5, _v6, _v7]
7818
+ end
7725
7819
  def self.hash_table_unref(hash_table)
7726
7820
  _v1 = GLib::HashTable.from([[:pointer, :void], [:pointer, :void]], hash_table)
7727
7821
  GLib::Lib.g_hash_table_unref(_v1)
@@ -8233,6 +8327,41 @@ module GLib
8233
8327
  _v1 = seed
8234
8328
  GLib::Lib.g_random_set_seed(_v1)
8235
8329
  end
8330
+ def self.rc_box_acquire(mem_block)
8331
+ _v1 = mem_block
8332
+ _v2 = GLib::Lib.g_rc_box_acquire(_v1)
8333
+ return _v2
8334
+ end
8335
+ def self.rc_box_alloc(block_size)
8336
+ _v1 = block_size
8337
+ _v2 = GLib::Lib.g_rc_box_alloc(_v1)
8338
+ return _v2
8339
+ end
8340
+ def self.rc_box_alloc0(block_size)
8341
+ _v1 = block_size
8342
+ _v2 = GLib::Lib.g_rc_box_alloc0(_v1)
8343
+ return _v2
8344
+ end
8345
+ def self.rc_box_dup(block_size, mem_block)
8346
+ _v1 = block_size
8347
+ _v2 = mem_block
8348
+ _v3 = GLib::Lib.g_rc_box_dup(_v1, _v2)
8349
+ return _v3
8350
+ end
8351
+ def self.rc_box_get_size(mem_block)
8352
+ _v1 = mem_block
8353
+ _v2 = GLib::Lib.g_rc_box_get_size(_v1)
8354
+ return _v2
8355
+ end
8356
+ def self.rc_box_release(mem_block)
8357
+ _v1 = mem_block
8358
+ GLib::Lib.g_rc_box_release(_v1)
8359
+ end
8360
+ def self.rc_box_release_full(mem_block, &clear_func)
8361
+ _v1 = mem_block
8362
+ _v2 = GLib::DestroyNotify.from(clear_func)
8363
+ GLib::Lib.g_rc_box_release_full(_v1, _v2)
8364
+ end
8236
8365
  def self.realloc(mem, n_bytes)
8237
8366
  _v1 = mem
8238
8367
  _v2 = n_bytes
@@ -8246,6 +8375,40 @@ module GLib
8246
8375
  _v4 = GLib::Lib.g_realloc_n(_v1, _v2, _v3)
8247
8376
  return _v4
8248
8377
  end
8378
+ def self.ref_string_acquire(str)
8379
+ _v1 = GirFFI::InPointer.from_utf8(str)
8380
+ _v2 = GLib::Lib.g_ref_string_acquire(_v1)
8381
+ _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8382
+ return _v3
8383
+ end
8384
+ def self.ref_string_length(str)
8385
+ _v1 = GirFFI::InPointer.from_utf8(str)
8386
+ _v2 = GLib::Lib.g_ref_string_length(_v1)
8387
+ return _v2
8388
+ end
8389
+ def self.ref_string_new(str)
8390
+ _v1 = GirFFI::InPointer.from_utf8(str)
8391
+ _v2 = GLib::Lib.g_ref_string_new(_v1)
8392
+ _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8393
+ return _v3
8394
+ end
8395
+ def self.ref_string_new_intern(str)
8396
+ _v1 = GirFFI::InPointer.from_utf8(str)
8397
+ _v2 = GLib::Lib.g_ref_string_new_intern(_v1)
8398
+ _v3 = GirFFI::AllocationHelper.free_after(_v2, &:to_utf8)
8399
+ return _v3
8400
+ end
8401
+ def self.ref_string_new_len(str, len)
8402
+ _v1 = GirFFI::InPointer.from_utf8(str)
8403
+ _v2 = len
8404
+ _v3 = GLib::Lib.g_ref_string_new_len(_v1, _v2)
8405
+ _v4 = GirFFI::AllocationHelper.free_after(_v3, &:to_utf8)
8406
+ return _v4
8407
+ end
8408
+ def self.ref_string_release(str)
8409
+ _v1 = GirFFI::InPointer.from_utf8(str)
8410
+ GLib::Lib.g_ref_string_release(_v1)
8411
+ end
8249
8412
  def self.regex_check_replacement(replacement)
8250
8413
  _v1 = GirFFI::InPointer.from_utf8(replacement)
8251
8414
  _v2 = FFI::MemoryPointer.new(GirFFI::Boolean)
@@ -8484,6 +8647,23 @@ module GLib
8484
8647
  _v10 = _v7.get_int32(0)
8485
8648
  return [_v9, _v10]
8486
8649
  end
8650
+ def self.spawn_async_with_fds(working_directory, argv, envp, flags, stdin_fd, stdout_fd, stderr_fd, &child_setup)
8651
+ _v1 = working_directory
8652
+ _v2 = GLib::Strv.from(argv)
8653
+ _v3 = GLib::Strv.from(envp)
8654
+ _v4 = flags
8655
+ _v5 = GLib::SpawnChildSetupFunc.from(child_setup)
8656
+ _v6 = GirFFI::ArgHelper.store(_v5)
8657
+ _v7 = FFI::MemoryPointer.new(:int32)
8658
+ _v8 = stdin_fd
8659
+ _v9 = stdout_fd
8660
+ _v10 = stderr_fd
8661
+ _v11 = FFI::MemoryPointer.new(:pointer).write_pointer(nil)
8662
+ _v12 = GLib::Lib.g_spawn_async_with_fds(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11)
8663
+ GirFFI::ArgHelper.check_error(_v11)
8664
+ _v13 = _v7.get_int32(0)
8665
+ return [_v12, _v13]
8666
+ end
8487
8667
  def self.spawn_async_with_pipes(working_directory, argv, envp, flags, &child_setup)
8488
8668
  _v1 = working_directory
8489
8669
  _v2 = GLib::Strv.from(argv)
@@ -847,18 +847,6 @@ module GObject
847
847
  _v3 = GirFFI::SizedArray.from(GObject::Value, -1, values)
848
848
  GObject::Lib.g_object_getv(self, _v1, _v2, _v3)
849
849
  end
850
- def initialize_with_automatic_gtype(properties = {})
851
- names = []
852
- values = []
853
- properties.each do |name, value|
854
- name = name.to_s
855
- gvalue = gvalue_for_property(name)
856
- gvalue.set_value(value)
857
- (names << name)
858
- (values << gvalue)
859
- end
860
- initialize_without_automatic_gtype(self.class.gtype, names, values)
861
- end
862
850
  def initializev(object_type, parameters)
863
851
  _v1 = object_type
864
852
  n_parameters = parameters.nil? ? (0) : (parameters.length)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-pretty_printer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-25 00:00:00.000000000 Z
11
+ date: 2018-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.12.0
33
+ version: 0.13.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.12.0
40
+ version: 0.13.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mvz-live_ast
43
43
  requirement: !ruby/object:Gem::Requirement