Module: Rabbit::Renderer::Display::Graffiti

Extended by:
Forwardable
Included in:
ClutterEmbed, DrawingAreaBase
Defined in:
lib/rabbit/renderer/display/graffiti.rb

Instance Method Summary collapse

Instance Method Details

#attach_to(window, container = nil) ⇒ Object


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

def attach_to(window, container=nil)
  super
  graffiti_mode_action.active = false
end

#can_undo_graffiti?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/rabbit/renderer/display/graffiti.rb', line 36

def can_undo_graffiti?
  @graffiti.can_undo?
end

#change_graffiti_colorObject


61
62
63
64
65
# File 'lib/rabbit/renderer/display/graffiti.rb', line 61

def change_graffiti_color
  @graffiti.change_color do
    redraw
  end
end

#clear_graffitiObject


49
50
51
52
53
# File 'lib/rabbit/renderer/display/graffiti.rb', line 49

def clear_graffiti
  @graffiti.clear
  Action.update_graffiti_action_status(@canvas)
  @area.queue_draw
end

#graffiti_mode?Boolean

Returns:

  • (Boolean)

28
29
30
# File 'lib/rabbit/renderer/display/graffiti.rb', line 28

def graffiti_mode?
  graffiti_mode_action.active?
end

#have_graffiti?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/rabbit/renderer/display/graffiti.rb', line 32

def have_graffiti?
  @graffiti.have_graffiti?
end

#initialize(*args, &block) ⇒ Object


18
19
20
21
# File 'lib/rabbit/renderer/display/graffiti.rb', line 18

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

#toggle_graffiti_modeObject


40
41
42
43
44
45
46
47
# File 'lib/rabbit/renderer/display/graffiti.rb', line 40

def toggle_graffiti_mode
  if graffiti_mode?
    update_cursor(:pencil)
  else
    restore_cursor(nil)
  end
  update_menu
end

#undo_graffitiObject


55
56
57
58
59
# File 'lib/rabbit/renderer/display/graffiti.rb', line 55

def undo_graffiti
  @graffiti.undo
  Action.update_graffiti_action_status(@canvas)
  @area.queue_draw
end