Class: WinFFI::RECT

Inherits:
FFIStruct show all
Defined in:
lib/win-ffi/structs/rect.rb

Instance Method Summary collapse

Methods inherited from FFIStruct

layout

Instance Method Details

#areaObject

def initialize(left, top, right, bottom)

self.left, self.top, self.right, self.bottom = left, top, right, bottom

end



14
15
16
# File 'lib/win-ffi/structs/rect.rb', line 14

def area
  width * height
end

#heightObject



30
31
32
# File 'lib/win-ffi/structs/rect.rb', line 30

def height
  bottom - top
end

#height=(v) ⇒ Object



34
35
36
# File 'lib/win-ffi/structs/rect.rb', line 34

def height=(v)
  self.bottom = top + v
end

#perimeterObject



18
19
20
# File 'lib/win-ffi/structs/rect.rb', line 18

def perimeter
  2 * width + 2 * height
end

#to_sObject



38
39
40
# File 'lib/win-ffi/structs/rect.rb', line 38

def to_s
  "(left = #{left}, top = #{top}, width = #{width}, height = #{height})"
end

#widthObject



22
23
24
# File 'lib/win-ffi/structs/rect.rb', line 22

def width
  right - left
end

#width=(v) ⇒ Object



26
27
28
# File 'lib/win-ffi/structs/rect.rb', line 26

def width=(v)
  self.right = left + v
end