Class: Rabbit::Front
- Inherits:
-
Object
- Object
- Rabbit::Front
- Includes:
- MonitorMixin
- Defined in:
- lib/rabbit/front.rb
Defined Under Namespace
Modules: PublicLevel
Constant Summary collapse
- AVAILABLE_INTERFACES =
[]
Instance Attribute Summary collapse
-
#image_type ⇒ Object
readonly
Returns the value of attribute image_type.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#public_level ⇒ Object
readonly
Returns the value of attribute public_level.
Instance Method Summary collapse
- #accept_move? ⇒ Boolean
- #append_comment(comment) ⇒ Object
- #available_interfaces ⇒ Object
- #comments ⇒ Object
- #current_slide_image ⇒ Object
- #current_slide_number ⇒ Object
- #current_slide_rd ⇒ Object
- #current_slide_text ⇒ Object
- #first_slide? ⇒ Boolean
- #have_next? ⇒ Boolean
- #have_next_slide? ⇒ Boolean
- #have_previous? ⇒ Boolean
- #have_previous_slide? ⇒ Boolean
-
#initialize(canvas, public_level = nil) ⇒ Front
constructor
A new instance of Front.
- #last_slide? ⇒ Boolean
- #slide_title ⇒ Object
- #title ⇒ Object
- #total_slide_number ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(canvas, public_level = nil) ⇒ Front
Returns a new instance of Front.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rabbit/front.rb', line 57 def initialize(canvas, public_level=nil) super() @canvas = canvas @image_type = "png" @public_level = public_level || PublicLevel::STRICT @previous_width = @canvas.width @previous_height = @canvas.height setup_public_interface clean end |
Instance Attribute Details
#image_type ⇒ Object (readonly)
Returns the value of attribute image_type.
55 56 57 |
# File 'lib/rabbit/front.rb', line 55 def image_type @image_type end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
55 56 57 |
# File 'lib/rabbit/front.rb', line 55 def last_modified @last_modified end |
#public_level ⇒ Object (readonly)
Returns the value of attribute public_level.
55 56 57 |
# File 'lib/rabbit/front.rb', line 55 def public_level @public_level end |
Instance Method Details
#accept_move? ⇒ Boolean
133 134 135 |
# File 'lib/rabbit/front.rb', line 133 def accept_move? not (@public_level & Front::PublicLevel::MOVE).zero? end |
#append_comment(comment) ⇒ Object
137 138 139 140 141 142 143 |
# File 'lib/rabbit/front.rb', line 137 def append_comment(comment) GLib::Idle.add do @canvas.append_comment(comment) false end true end |
#available_interfaces ⇒ Object
123 124 125 126 127 |
# File 'lib/rabbit/front.rb', line 123 def available_interfaces AVAILABLE_INTERFACES.collect do |name, level, need_clear_cache| [name, level, @canvas.method(name).arity] end end |
#comments ⇒ Object
145 146 147 |
# File 'lib/rabbit/front.rb', line 145 def comments @canvas.comments end |
#current_slide_image ⇒ Object
68 69 70 71 |
# File 'lib/rabbit/front.rb', line 68 def update_images_if_need @images[@canvas.current_index] end |
#current_slide_number ⇒ Object
95 96 97 |
# File 'lib/rabbit/front.rb', line 95 def @canvas.current_index end |
#current_slide_rd ⇒ Object
78 79 80 81 |
# File 'lib/rabbit/front.rb', line 78 def = @canvas. ? .to_rd : "" end |
#current_slide_text ⇒ Object
73 74 75 76 |
# File 'lib/rabbit/front.rb', line 73 def = @canvas. ? .text : "" end |
#first_slide? ⇒ Boolean
99 100 101 |
# File 'lib/rabbit/front.rb', line 99 def @canvas. end |
#have_next? ⇒ Boolean
111 112 113 |
# File 'lib/rabbit/front.rb', line 111 def have_next? @canvas.have_next? end |
#have_next_slide? ⇒ Boolean
103 104 105 |
# File 'lib/rabbit/front.rb', line 103 def @canvas. end |
#have_previous? ⇒ Boolean
115 116 117 |
# File 'lib/rabbit/front.rb', line 115 def have_previous? @canvas.have_previous? end |
#have_previous_slide? ⇒ Boolean
107 108 109 |
# File 'lib/rabbit/front.rb', line 107 def @canvas. end |
#last_slide? ⇒ Boolean
119 120 121 |
# File 'lib/rabbit/front.rb', line 119 def @canvas. end |
#slide_title ⇒ Object
87 88 89 |
# File 'lib/rabbit/front.rb', line 87 def @canvas. end |
#title ⇒ Object
83 84 85 |
# File 'lib/rabbit/front.rb', line 83 def title @canvas.title end |
#total_slide_number ⇒ Object
91 92 93 |
# File 'lib/rabbit/front.rb', line 91 def @canvas. end |
#version ⇒ Object
129 130 131 |
# File 'lib/rabbit/front.rb', line 129 def version VERSION end |