module Rabbit::Renderer::Display::HookHandler

Public Class Methods

new(*args, &block) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/display/hook-handler.rb, line 5
def initialize(*args, &block)
  super
  init_hook_handler
end

Public Instance Methods

add_button_press_hook(hook=nil, &block) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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_hook() click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 37
def clear_button_press_hook
  @button_press_hook_procs.clear
end
clear_button_release_hook() click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 46
def clear_button_release_hook
  @button_release_hook_procs.clear
end
clear_hooks() click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 50
def clear_hooks
  init_hook_handler
end
clear_motion_notify_hook() click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 19
def clear_motion_notify_hook
  @motion_notify_hook_procs.clear
end
clear_scroll_hook() click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 28
def clear_scroll_hook
  @scroll_hook_procs.clear
end

Private Instance Methods

init_hook_handler() click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 55
def init_hook_handler
  @motion_notify_hook_procs = []
  @scroll_hook_procs = []
  @button_press_hook_procs = []
  @button_release_hook_procs = []
end