class Fzeet::Windows::POINT
Public Class Methods
[](x, y)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 10 def self.[](x, y) new.set(x, y) end
Also aliased as: from
Public Instance Methods
==(other)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 26 def ==(other) self[:x] == other[:x] && self[:y] == other[:y] end
clear()
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 24 def clear; set(0, 0) end
client(window)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 33 def client(window) dup.client!(window) end
client!(window)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 34 def client!(window) tap { |pt| Windows.Detonate(0, :ScreenToClient, window.handle, pt) } end
dup()
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 17 def dup; self.class[self[:x], self[:y]] end
get()
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 19 def get; [self[:x], self[:y]] end
Also aliased as: to_a
inside?(r)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 27 def inside?(r) r.include?(self) end
offset(dx, dy)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 30 def offset(dx, dy) dup.offset!(dx, dy) end
offset!(dx, dy)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 31 def offset!(dx, dy) tap { |pt| pt[:x] += dx; pt[:y] += dy } end
outside?(r)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 28 def outside?(r) !inside?(r) end
screen(window)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 36 def screen(window) dup.screen!(window) end
screen!(window)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 37 def screen!(window) tap { |pt| Windows.Detonate(0, :ClientToScreen, window.handle, pt) } end
set(x, y)
click to toggle source
# File lib/fzeet/windows/core/Point.rb, line 22 def set(x, y) tap { |pt| pt[:x], pt[:y] = x, y } end