module Rabbit::Renderer::Display::Graffiti
Public Class Methods
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 33 def initialize(*args, &block) super init_graffiti end
Calls superclass method
Public Instance Methods
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 46 def can_undo_graffiti? @graffiti.can_undo? end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 70 def change_graffiti_color @graffiti.change_color do redraw end end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 60 def clear_graffiti @graffiti.clear @area.queue_draw end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 38 def graffiti_mode? @graffiti_mode end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 42 def have_graffiti? @graffiti.have_graffiti? end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 50 def toggle_graffiti_mode @graffiti_mode = !@graffiti_mode if graffiti_mode? update_cursor(:pencil) else restore_cursor(nil) end update_menu end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 65 def undo_graffiti @graffiti.undo @area.queue_draw end
Private Instance Methods
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 117 def draw_graffiti @graffiti.draw_all_segment(self) end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 121 def graffiti_mode_action @canvas.action("ToggleGraffitiMode") end
Source
# File lib/rabbit/renderer/display/graffiti.rb, line 77 def init_graffiti @graffiti = Rabbit::Graffiti::Processor.new @graffiti_mode = false pressed_button = nil target_button = 1 add_button_press_hook do |event| pressed_button = event.button if graffiti_mode? and event.button == target_button @graffiti.button_press(event.x, event.y, width, height) true else false end end add_button_release_hook do |event, last_button_press_event| pressed_button = nil if graffiti_mode? and event.button == target_button @graffiti.button_release(event.x, event.y, width, height) true else false end end add_motion_notify_hook do |x, y| if graffiti_mode? and @graffiti.dragging? and pressed_button == target_button @graffiti.button_motion(x, y, width, height) redraw true else false end end end