Class: Tgui::Outline

Inherits:
ExternObject show all
Defined in:
lib/white_gold/dsl/outline.rb,
lib/white_gold/generated/tgui-abi-loader.gf.rb

Instance Attribute Summary

Attributes inherited from ExternObject

#pointer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ExternObject

abi_attr, abi_bit_enum, abi_def, abi_enum, #abi_pack, abi_signal, abi_static, #abi_unpack, callback_storage, callback_storage=, data_storage=, finalizer, global_callback_storage, global_callback_storage=, #initialized, self_abi_def, self_abi_def_setter

Methods included from Packer

#abi_pack, #abi_packer, #abi_packer_method_name

Methods included from Unpacker

#abi_unpack, #abi_unpacker, #abi_unpacker_method_name

Methods included from BangDef

#def!

Constructor Details

#initialize(*a, pointer: nil) ⇒ Outline

Returns a new instance of Outline.



814
# File 'lib/white_gold/generated/tgui-abi-loader.gf.rb', line 814

def initialize(*a, pointer: nil);    Abi.call_arg_map! a; super(pointer: pointer || Abi.ABI_Outline_new(*a)); initialized(); end

Class Method Details

.from(*arg) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/white_gold/dsl/outline.rb', line 6

def self.from *arg
  case arg.size
  when 1
    a = arg.first
    case a
    when Outline
      return a
    when String, Numeric
      o = arg * 4
    else raise "Unsupported argument #{arg}"
    end
  when 2
    o = [arg[0], arg[0], arg[1], arg[1]]
  when 3
    o = [arg[0], arg[1], arg[2], arg[2]]
  when 4
    o = arg
  else raise "Unsupported argument #{arg}"
  end
  o = o.map do |v|
    case v
    when Numeric then Unit.nominate(v)
    when String then v
    else raise "Unsupported arguments #{arg}"
    end
  end
  Outline.new *o
end

Instance Method Details

#_abi_get_bottom(*a) ⇒ Object



818
# File 'lib/white_gold/generated/tgui-abi-loader.gf.rb', line 818

def _abi_get_bottom(*a);    Abi.call_arg_map! a; Abi.ABI_Outline_getBottom(@pointer, *a); end

#_abi_get_left(*a) ⇒ Object



815
# File 'lib/white_gold/generated/tgui-abi-loader.gf.rb', line 815

def _abi_get_left(*a);    Abi.call_arg_map! a; Abi.ABI_Outline_getLeft(@pointer, *a); end

#_abi_get_right(*a) ⇒ Object



816
# File 'lib/white_gold/generated/tgui-abi-loader.gf.rb', line 816

def _abi_get_right(*a);    Abi.call_arg_map! a; Abi.ABI_Outline_getRight(@pointer, *a); end

#_abi_get_top(*a) ⇒ Object



817
# File 'lib/white_gold/generated/tgui-abi-loader.gf.rb', line 817

def _abi_get_top(*a);    Abi.call_arg_map! a; Abi.ABI_Outline_getTop(@pointer, *a); end

#inspectObject



48
49
50
# File 'lib/white_gold/dsl/outline.rb', line 48

def inspect
  to_s
end

#to_aObject



40
41
42
# File 'lib/white_gold/dsl/outline.rb', line 40

def to_a
  [left, right, top, bottom]
end

#to_sObject



44
45
46
# File 'lib/white_gold/dsl/outline.rb', line 44

def to_s
  "(#{to_a.join(", ")})"
end