Class: Fzeet::Windows::SIZE

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/fzeet/windows/core/Size.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](cx, cy) ⇒ Object Also known as: from



10
# File 'lib/fzeet/windows/core/Size.rb', line 10

def self.[](cx, cy) new.set(cx, cy) end

Instance Method Details

#==(other) ⇒ Object



26
# File 'lib/fzeet/windows/core/Size.rb', line 26

def ==(other) self[:cx] == other[:cx] && self[:cy] == other[:cy] end

#clearObject



24
# File 'lib/fzeet/windows/core/Size.rb', line 24

def clear; set(0, 0) end

#dupObject



17
# File 'lib/fzeet/windows/core/Size.rb', line 17

def dup; self.class[self[:cx], self[:cy]] end

#getObject Also known as: to_a



19
# File 'lib/fzeet/windows/core/Size.rb', line 19

def get; [self[:cx], self[:cy]] end

#inflate(dx, dy) ⇒ Object



28
# File 'lib/fzeet/windows/core/Size.rb', line 28

def inflate(dx, dy) dup.inflate!(dx, dy) end

#inflate!(dx, dy) ⇒ Object



29
# File 'lib/fzeet/windows/core/Size.rb', line 29

def inflate!(dx, dy) tap { |s| s[:cx] += dx; s[:cy] += dy } end

#set(cx, cy) ⇒ Object



22
# File 'lib/fzeet/windows/core/Size.rb', line 22

def set(cx, cy) tap { |s| s[:cx], s[:cy] = cx, cy } end