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.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/rabbit/front.rb', line 78 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.
76 77 78 |
# File 'lib/rabbit/front.rb', line 76 def image_type @image_type end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
76 77 78 |
# File 'lib/rabbit/front.rb', line 76 def last_modified @last_modified end |
#public_level ⇒ Object (readonly)
Returns the value of attribute public_level.
76 77 78 |
# File 'lib/rabbit/front.rb', line 76 def public_level @public_level end |
Instance Method Details
#accept_move? ⇒ Boolean
154 155 156 |
# File 'lib/rabbit/front.rb', line 154 def accept_move? not (@public_level & Front::PublicLevel::MOVE).zero? end |
#append_comment(comment) ⇒ Object
158 159 160 161 162 163 164 |
# File 'lib/rabbit/front.rb', line 158 def append_comment(comment) GLib::Idle.add do @canvas.append_comment(comment) false end true end |
#available_interfaces ⇒ Object
144 145 146 147 148 |
# File 'lib/rabbit/front.rb', line 144 def available_interfaces AVAILABLE_INTERFACES.collect do |name, level, need_clear_cache| [name, level, @canvas.method(name).arity] end end |
#comments ⇒ Object
166 167 168 |
# File 'lib/rabbit/front.rb', line 166 def comments @canvas.comments end |
#current_slide_image ⇒ Object
89 90 91 92 |
# File 'lib/rabbit/front.rb', line 89 def update_images_if_need @images[@canvas.current_index] end |
#current_slide_number ⇒ Object
116 117 118 |
# File 'lib/rabbit/front.rb', line 116 def @canvas.current_index end |
#current_slide_rd ⇒ Object
99 100 101 102 |
# File 'lib/rabbit/front.rb', line 99 def = @canvas. ? .to_rd : "" end |
#current_slide_text ⇒ Object
94 95 96 97 |
# File 'lib/rabbit/front.rb', line 94 def = @canvas. ? .text : "" end |
#first_slide? ⇒ Boolean
120 121 122 |
# File 'lib/rabbit/front.rb', line 120 def @canvas. end |
#have_next? ⇒ Boolean
132 133 134 |
# File 'lib/rabbit/front.rb', line 132 def have_next? @canvas.have_next? end |
#have_next_slide? ⇒ Boolean
124 125 126 |
# File 'lib/rabbit/front.rb', line 124 def @canvas. end |
#have_previous? ⇒ Boolean
136 137 138 |
# File 'lib/rabbit/front.rb', line 136 def have_previous? @canvas.have_previous? end |
#have_previous_slide? ⇒ Boolean
128 129 130 |
# File 'lib/rabbit/front.rb', line 128 def @canvas. end |
#last_slide? ⇒ Boolean
140 141 142 |
# File 'lib/rabbit/front.rb', line 140 def @canvas. end |
#slide_title ⇒ Object
108 109 110 |
# File 'lib/rabbit/front.rb', line 108 def @canvas. end |
#title ⇒ Object
104 105 106 |
# File 'lib/rabbit/front.rb', line 104 def title @canvas.title end |
#total_slide_number ⇒ Object
112 113 114 |
# File 'lib/rabbit/front.rb', line 112 def @canvas. end |
#version ⇒ Object
150 151 152 |
# File 'lib/rabbit/front.rb', line 150 def version VERSION end |