Module: Rabbit::Renderer::Display::HookHandler

Included in:
InfoWindow, Base
Defined in:
lib/rabbit/renderer/display/hook-handler.rb

Instance Method Summary collapse

Instance Method Details

#add_button_press_hook(hook = nil, &block) ⇒ Object



32
33
34
35
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 32

def add_button_press_hook(hook=nil, &block)
  hook ||= Proc.new(&block)
  @button_press_hook_procs << hook
end

#add_button_release_hook(hook = nil, &block) ⇒ Object



41
42
43
44
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 41

def add_button_release_hook(hook=nil, &block)
  hook ||= Proc.new(&block)
  @button_release_hook_procs << hook
end

#add_motion_notify_hook(hook = nil, &block) ⇒ Object



14
15
16
17
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 14

def add_motion_notify_hook(hook=nil, &block)
  hook ||= Proc.new(&block)
  @motion_notify_hook_procs << hook
end

#add_scroll_hook(hook = nil, &block) ⇒ Object



23
24
25
26
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 23

def add_scroll_hook(hook=nil, &block)
  hook ||= Proc.new(&block)
  @scroll_hook_procs << hook
end

#call_hook_procs(procs, *args) ⇒ Object



10
11
12
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 10

def call_hook_procs(procs, *args)
  procs.any? {|proc| proc.call(*args)}
end

#clear_button_press_hookObject



37
38
39
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 37

def clear_button_press_hook
  @button_press_hook_procs.clear
end

#clear_button_release_hookObject



46
47
48
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 46

def clear_button_release_hook
  @button_release_hook_procs.clear
end

#clear_hooksObject



50
51
52
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 50

def clear_hooks
  init_hook_handler
end

#clear_motion_notify_hookObject



19
20
21
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 19

def clear_motion_notify_hook
  @motion_notify_hook_procs.clear
end

#clear_scroll_hookObject



28
29
30
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 28

def clear_scroll_hook
  @scroll_hook_procs.clear
end

#initialize(*args, &block) ⇒ Object



5
6
7
8
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 5

def initialize(*args, &block)
  super
  init_hook_handler
end