Class: Rabbit::Canvas
- Inherits:
-
Object
- Object
- Rabbit::Canvas
- Extended by:
- Forwardable
- Includes:
- Enumerable, GetText
- Defined in:
- lib/rabbit/canvas.rb
Direct Known Subclasses
Constant Summary collapse
- INTERNAL_DPI =
96.0
Constants included from GetText
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
- #allotted_time ⇒ Object
-
#comment_theme ⇒ Object
Returns the value of attribute comment_theme.
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#font_resolution_ratio ⇒ Object
Returns the value of attribute font_resolution_ratio.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#max_n_comments ⇒ Object
Returns the value of attribute max_n_comments.
-
#migemo_dictionary_name ⇒ Object
Returns the value of attribute migemo_dictionary_name.
-
#migemo_dictionary_search_path ⇒ Object
Returns the value of attribute migemo_dictionary_search_path.
-
#output_html ⇒ Object
Returns the value of attribute output_html.
-
#output_index_html ⇒ Object
Returns the value of attribute output_index_html.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
-
#rss_base_uri ⇒ Object
Returns the value of attribute rss_base_uri.
- #saved_image_base_name ⇒ Object
-
#saved_image_type ⇒ Object
Returns the value of attribute saved_image_type.
-
#source_filename ⇒ Object
Returns the value of attribute source_filename.
-
#use_gl ⇒ Object
writeonly
Sets the attribute use_gl.
Instance Method Summary collapse
- #<<(slide) ⇒ Object
- #action(name) ⇒ Object
- #activate(name, &block) ⇒ Object
- #append_comment(comment) ⇒ Object
- #apply_theme(name = nil, &block) ⇒ Object
- #apply_timer ⇒ Object
- #applying? ⇒ Boolean
- #attach_to(frame, window, container = nil, &block) ⇒ Object
- #cache_all_slides ⇒ Object
- #change_current_index(new_index) ⇒ Object
- #current_index ⇒ Object
- #current_slide ⇒ Object
- #delete_on_comment_proc_by_name(name) ⇒ Object
- #detach ⇒ Object
- #each(&block) ⇒ Object
- #find_slide(pattern) ⇒ Object
- #first_slide? ⇒ Boolean
- #font_resolution ⇒ Object
- #front(public_level = nil) ⇒ Object
- #full_path(path) ⇒ Object
- #fullscreened ⇒ Object
- #have_next? ⇒ Boolean
- #have_next_slide? ⇒ Boolean
- #have_previous? ⇒ Boolean
- #have_previous_slide? ⇒ Boolean
- #iconified ⇒ Object
- #index_mode? ⇒ Boolean
-
#initialize(logger, renderer) ⇒ Canvas
constructor
A new instance of Canvas.
- #last_slide? ⇒ Boolean
- #merge_theme(name) ⇒ Object
- #move_to_first ⇒ Object
- #move_to_if_can(index) ⇒ Object
- #move_to_last ⇒ Object
- #move_to_next_if_can ⇒ Object
- #move_to_next_slide_if_can ⇒ Object
- #move_to_previous_if_can ⇒ Object
- #move_to_previous_slide_if_can ⇒ Object
- #need_reload_source? ⇒ Boolean
- #next_slide ⇒ Object
- #on_comment(name, &callback) ⇒ Object
- #parse(source = nil, callback = nil, &block) ⇒ Object
- #parsing? ⇒ Boolean
- #post_terminal ⇒ Object
- #pre_terminal ⇒ Object
- #print(&block) ⇒ Object
- #processing? ⇒ Boolean
- #quit ⇒ Object
- #quitted? ⇒ Boolean
- #reload_source(callback = nil, &block) ⇒ Object
- #reload_theme(&block) ⇒ Object
- #reset_timer ⇒ Object
- #rest_time ⇒ Object
- #save_as_image ⇒ Object
- #slide_index(pattern) ⇒ Object
- #slide_indexes(pattern) ⇒ Object
- #slide_size ⇒ Object
- #slide_text(index = current_index) ⇒ Object
- #slide_title(index = current_index) ⇒ Object
- #slides ⇒ Object
- #source ⇒ Object
- #source_force_modified(force_modified) {|@source| ... } ⇒ Object
- #start_auto_redraw_timer(interval) ⇒ Object
- #start_timer(limit) ⇒ Object
- #stop_auto_redraw_timer ⇒ Object
- #theme_name ⇒ Object
- #title ⇒ Object
- #title_slide ⇒ Object
- #tmp_dir_name ⇒ Object
- #to_pixbuf(i) ⇒ Object
- #toggle_index_mode ⇒ Object
- #unfullscreened ⇒ Object
- #update_index_slides ⇒ Object
- #use_gl? ⇒ Boolean
- #with_index_mode(new_value) ⇒ Object
Methods included from GetText
Constructor Details
#initialize(logger, renderer) ⇒ Canvas
Returns a new instance of Canvas.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/rabbit/canvas.rb', line 157 def initialize(logger, renderer) @logger = logger @frame = NullFrame.new @theme_name = nil @saved_image_base_name = nil @saved_image_type = "png" @processing = false @quitted = false @parse_request_queue = [] @apply_theme_request_queue = [] @auto_redraw_timer = nil @output_html = false @rss_base_uri = nil @source_filename = nil @migemo_dictionary_search_path = [] @migemo_dictionary_name = nil @limit_time = nil @use_gl = false @font_resolution_ratio = 1 @max_n_comments = 100 @allotted_time = nil @comment_theme = nil clear @renderer = renderer.new(self) @actions = Action.action_group(self) end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
145 146 147 |
# File 'lib/rabbit/canvas.rb', line 145 def actions @actions end |
#allotted_time ⇒ Object
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/rabbit/canvas.rb', line 658 def allotted_time time = @allotted_time if time.nil? and time = .allotted_time if time.nil? start_time = .start_time end_time = .end_time if start_time and end_time start_time = Time.parse(start_time) end_time = Time.parse(end_time) time = end_time - start_time end end end Utils.ensure_time(time) end |
#comment_theme ⇒ Object
Returns the value of attribute comment_theme.
155 156 157 |
# File 'lib/rabbit/canvas.rb', line 155 def comment_theme @comment_theme end |
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
145 146 147 |
# File 'lib/rabbit/canvas.rb', line 145 def comments @comments end |
#font_resolution_ratio ⇒ Object
Returns the value of attribute font_resolution_ratio.
154 155 156 |
# File 'lib/rabbit/canvas.rb', line 154 def font_resolution_ratio @font_resolution_ratio end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
144 145 146 |
# File 'lib/rabbit/canvas.rb', line 144 def last_modified @last_modified end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
144 145 146 |
# File 'lib/rabbit/canvas.rb', line 144 def logger @logger end |
#max_n_comments ⇒ Object
Returns the value of attribute max_n_comments.
155 156 157 |
# File 'lib/rabbit/canvas.rb', line 155 def max_n_comments @max_n_comments end |
#migemo_dictionary_name ⇒ Object
Returns the value of attribute migemo_dictionary_name.
153 154 155 |
# File 'lib/rabbit/canvas.rb', line 153 def migemo_dictionary_name @migemo_dictionary_name end |
#migemo_dictionary_search_path ⇒ Object
Returns the value of attribute migemo_dictionary_search_path.
153 154 155 |
# File 'lib/rabbit/canvas.rb', line 153 def migemo_dictionary_search_path @migemo_dictionary_search_path end |
#output_html ⇒ Object
Returns the value of attribute output_html.
151 152 153 |
# File 'lib/rabbit/canvas.rb', line 151 def output_html @output_html end |
#output_index_html ⇒ Object
Returns the value of attribute output_index_html.
151 152 153 |
# File 'lib/rabbit/canvas.rb', line 151 def output_index_html @output_index_html end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
144 145 146 |
# File 'lib/rabbit/canvas.rb', line 144 def renderer @renderer end |
#rss_base_uri ⇒ Object
Returns the value of attribute rss_base_uri.
150 151 152 |
# File 'lib/rabbit/canvas.rb', line 150 def rss_base_uri @rss_base_uri end |
#saved_image_base_name ⇒ Object
449 450 451 452 453 454 455 456 457 |
# File 'lib/rabbit/canvas.rb', line 449 def saved_image_base_name if @saved_image_base_name base_name = @saved_image_base_name.encode("UTF-8") else base_name = Filename.sanitize(title) end base_name << "-index" if index_mode? base_name end |
#saved_image_type ⇒ Object
Returns the value of attribute saved_image_type.
150 151 152 |
# File 'lib/rabbit/canvas.rb', line 150 def saved_image_type @saved_image_type end |
#source_filename ⇒ Object
Returns the value of attribute source_filename.
152 153 154 |
# File 'lib/rabbit/canvas.rb', line 152 def source_filename @source_filename end |
#use_gl=(value) ⇒ Object (writeonly)
Sets the attribute use_gl
148 149 150 |
# File 'lib/rabbit/canvas.rb', line 148 def use_gl=(value) @use_gl = value end |
Instance Method Details
#<<(slide) ⇒ Object
323 324 325 326 |
# File 'lib/rabbit/canvas.rb', line 323 def <<() .index = .size << end |
#action(name) ⇒ Object
639 640 641 642 643 644 645 646 647 |
# File 'lib/rabbit/canvas.rb', line 639 def action(name) act = @actions.get_action(name) if act act else logger.warn(_("Unknown action: %s") % name) false end end |
#activate(name, &block) ⇒ Object
629 630 631 632 633 634 635 636 637 |
# File 'lib/rabbit/canvas.rb', line 629 def activate(name, &block) act = action(name) if act and act.sensitive? act.activate(&block) true else false end end |
#append_comment(comment) ⇒ Object
612 613 614 615 616 617 618 619 620 621 622 623 |
# File 'lib/rabbit/canvas.rb', line 612 def append_comment(comment) @comments << comment @comments.shift if @comments.size > @max_n_comments @on_comment_callbacks.each do |name, callback| begin callback.call(comment) rescue logger.error($!) end end true end |
#apply_theme(name = nil, &block) ⇒ Object
328 329 330 |
# File 'lib/rabbit/canvas.rb', line 328 def apply_theme(name=nil, &block) _apply_theme(name, Object.new.__id__, &block) end |
#apply_timer ⇒ Object
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 |
# File 'lib/rabbit/canvas.rb', line 687 def apply_timer return unless start_time = .start_time end_time = .end_time return if start_time.nil? return if end_time.nil? start_time = Time.parse(start_time) end_time = Time.parse(end_time) return unless (start_time..end_time).cover?(Time.now) @allotted_time = end_time - start_time @limit_time = end_time end |
#applying? ⇒ Boolean
192 193 194 |
# File 'lib/rabbit/canvas.rb', line 192 def not @apply_theme_request_queue.empty? end |
#attach_to(frame, window, container = nil, &block) ⇒ Object
209 210 211 212 |
# File 'lib/rabbit/canvas.rb', line 209 def attach_to(frame, window, container=nil, &block) @frame = frame if frame @renderer.attach_to(window, container, &block) if window end |
#cache_all_slides ⇒ Object
571 572 573 574 575 |
# File 'lib/rabbit/canvas.rb', line 571 def process do @renderer. end end |
#change_current_index(new_index) ⇒ Object
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/rabbit/canvas.rb', line 295 def change_current_index(new_index) mode = @index_mode if mode index = @index_current_index @index_current_index = new_index else index = @current_index @current_index = new_index end if 0 <= current_index and current_index < yield end ensure if mode @index_current_index = index else @current_index = index end end |
#current_index ⇒ Object
287 288 289 290 291 292 293 |
# File 'lib/rabbit/canvas.rb', line 287 def current_index if @index_mode @index_current_index else @current_index end end |
#current_slide ⇒ Object
277 278 279 280 281 282 283 284 285 |
# File 'lib/rabbit/canvas.rb', line 277 def = [current_index] if else move_to_first .first end end |
#delete_on_comment_proc_by_name(name) ⇒ Object
606 607 608 609 610 |
# File 'lib/rabbit/canvas.rb', line 606 def delete_on_comment_proc_by_name(name) @on_comment_callbacks.reject! do |callback_name, callback| callback_name == name end end |
#detach ⇒ Object
214 215 216 217 |
# File 'lib/rabbit/canvas.rb', line 214 def detach @frame = NullFrame.new @renderer.detach end |
#each(&block) ⇒ Object
319 320 321 |
# File 'lib/rabbit/canvas.rb', line 319 def each(&block) .each(&block) end |
#find_slide(pattern) ⇒ Object
254 255 256 |
# File 'lib/rabbit/canvas.rb', line 254 def (pattern) .find {|| .match?(pattern)} end |
#first_slide? ⇒ Boolean
543 544 545 |
# File 'lib/rabbit/canvas.rb', line 543 def current_index.zero? end |
#font_resolution ⇒ Object
703 704 705 |
# File 'lib/rabbit/canvas.rb', line 703 def font_resolution INTERNAL_DPI * @font_resolution_ratio end |
#front(public_level = nil) ⇒ Object
205 206 207 |
# File 'lib/rabbit/canvas.rb', line 205 def front(public_level=nil) Front.new(self, public_level) end |
#full_path(path) ⇒ Object
395 396 397 |
# File 'lib/rabbit/canvas.rb', line 395 def full_path(path) @source and @source.full_path(path) end |
#fullscreened ⇒ Object
429 430 431 |
# File 'lib/rabbit/canvas.rb', line 429 def fullscreened @renderer.post_fullscreen end |
#have_next? ⇒ Boolean
565 566 567 568 569 |
# File 'lib/rabbit/canvas.rb', line 565 def have_next? return true if return !.last? if false end |
#have_next_slide? ⇒ Boolean
561 562 563 |
# File 'lib/rabbit/canvas.rb', line 561 def - 1 > current_index end |
#have_previous? ⇒ Boolean
555 556 557 558 559 |
# File 'lib/rabbit/canvas.rb', line 555 def have_previous? return true if return !.first? if false end |
#have_previous_slide? ⇒ Boolean
551 552 553 |
# File 'lib/rabbit/canvas.rb', line 551 def 0 < current_index end |
#iconified ⇒ Object
437 438 439 |
# File 'lib/rabbit/canvas.rb', line 437 def iconified @renderer.post_iconify end |
#index_mode? ⇒ Boolean
506 507 508 |
# File 'lib/rabbit/canvas.rb', line 506 def index_mode? @index_mode end |
#last_slide? ⇒ Boolean
547 548 549 |
# File 'lib/rabbit/canvas.rb', line 547 def .zero? or current_index == ( - 1) end |
#merge_theme(name) ⇒ Object
336 337 338 339 340 341 342 |
# File 'lib/rabbit/canvas.rb', line 336 def merge_theme(name) unless @slides.empty? manager = Theme::Manager.new(self) manager.apply(name) @renderer.post_apply_theme end end |
#move_to_first ⇒ Object
498 499 500 |
# File 'lib/rabbit/canvas.rb', line 498 def move_to_first move_to_if_can(0) end |
#move_to_if_can(index) ⇒ Object
459 460 461 462 463 464 |
# File 'lib/rabbit/canvas.rb', line 459 def move_to_if_can(index) if index and 0 <= index and index < move_to(index) end current_index end |
#move_to_last ⇒ Object
502 503 504 |
# File 'lib/rabbit/canvas.rb', line 502 def move_to_last move_to( - 1) end |
#move_to_next_if_can ⇒ Object
466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/rabbit/canvas.rb', line 466 def move_to_next_if_can = if and !.last? old_index = .drawing_index .move_to_next Action.update_status(self) @renderer.(old_index, .drawing_index) else end end |
#move_to_next_slide_if_can ⇒ Object
478 479 480 |
# File 'lib/rabbit/canvas.rb', line 478 def move_to_if_can(current_index + 1) end |
#move_to_previous_if_can ⇒ Object
482 483 484 485 486 487 488 489 490 491 492 |
# File 'lib/rabbit/canvas.rb', line 482 def move_to_previous_if_can = if and !.first? old_index = .drawing_index .move_to_previous Action.update_status(self) @renderer.(old_index, .drawing_index) else end end |
#move_to_previous_slide_if_can ⇒ Object
494 495 496 |
# File 'lib/rabbit/canvas.rb', line 494 def move_to_if_can(current_index - 1) end |
#need_reload_source? ⇒ Boolean
391 392 393 |
# File 'lib/rabbit/canvas.rb', line 391 def need_reload_source? !@processing and @source and @source.modified? end |
#next_slide ⇒ Object
315 316 317 |
# File 'lib/rabbit/canvas.rb', line 315 def [current_index + 1] end |
#on_comment(name, &callback) ⇒ Object
602 603 604 |
# File 'lib/rabbit/canvas.rb', line 602 def on_comment(name, &callback) @on_comment_callbacks << [name, callback] end |
#parse(source = nil, callback = nil, &block) ⇒ Object
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/rabbit/canvas.rb', line 348 def parse(source=nil, callback=nil, &block) id = Object.new.__id__ @parse_request_queue.push(id) @source = source || @source begin index = current_index current_allotted_time = allotted_time keep_index do @renderer.pre_parse clear Parser.parse(self, @source) new_allotted_time = allotted_time reset_timer if new_allotted_time != current_allotted_time apply_timer set_current_index(index) reload_theme do if @parse_request_queue.last != id raise ParseFinish end callback.call if callback end @renderer.post_parse index = current_index end set_current_index(index) rescue ParseFinish rescue ParseError, UnsupportedFormatError if block_given? yield($!) else logger.warn($!.) end ensure @parse_request_queue.delete_if {|x| x == id} end end |
#parsing? ⇒ Boolean
188 189 190 |
# File 'lib/rabbit/canvas.rb', line 188 def parsing? not @parse_request_queue.empty? end |
#post_terminal ⇒ Object
445 446 447 |
# File 'lib/rabbit/canvas.rb', line 445 def post_terminal @renderer.post_terminal end |
#pre_terminal ⇒ Object
441 442 443 |
# File 'lib/rabbit/canvas.rb', line 441 def pre_terminal @renderer.pre_terminal end |
#print(&block) ⇒ Object
423 424 425 426 427 |
# File 'lib/rabbit/canvas.rb', line 423 def print(&block) process do @renderer.print(&block) end end |
#processing? ⇒ Boolean
577 578 579 |
# File 'lib/rabbit/canvas.rb', line 577 def processing? @processing end |
#quit ⇒ Object
200 201 202 203 |
# File 'lib/rabbit/canvas.rb', line 200 def quit @quitted = true @frame.quit end |
#quitted? ⇒ Boolean
184 185 186 |
# File 'lib/rabbit/canvas.rb', line 184 def quitted? @quitted end |
#reload_source(callback = nil, &block) ⇒ Object
385 386 387 388 389 |
# File 'lib/rabbit/canvas.rb', line 385 def reload_source(callback=nil, &block) if need_reload_source? parse(nil, callback, &block) end end |
#reload_theme(&block) ⇒ Object
344 345 346 |
# File 'lib/rabbit/canvas.rb', line 344 def reload_theme(&block) apply_theme(@theme_name, &block) end |
#reset_timer ⇒ Object
683 684 685 |
# File 'lib/rabbit/canvas.rb', line 683 def reset_timer @limit_time = nil end |
#rest_time ⇒ Object
679 680 681 |
# File 'lib/rabbit/canvas.rb', line 679 def rest_time @limit_time ? @limit_time - Time.now : nil end |
#save_as_image ⇒ Object
409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/rabbit/canvas.rb', line 409 def save_as_image process do generator = HTML::Generator.new(self, saved_image_base_name, @saved_image_type, @output_html, @output_index_html, @rss_base_uri) generator.pdf_filename = filename if /\.pdf\z/i =~ filename.to_s generator.source_filename = @source_filename generator.save end end |
#slide_index(pattern) ⇒ Object
258 259 260 261 262 263 |
# File 'lib/rabbit/canvas.rb', line 258 def (pattern) .each_with_index do |, i| return i if .match?(pattern) end nil end |
#slide_indexes(pattern) ⇒ Object
265 266 267 268 269 270 271 |
# File 'lib/rabbit/canvas.rb', line 265 def (pattern) indexes = [] .each_with_index do |, i| indexes << i if .match?(pattern) end indexes end |
#slide_size ⇒ Object
273 274 275 |
# File 'lib/rabbit/canvas.rb', line 273 def .size end |
#slide_text(index = current_index) ⇒ Object
239 240 241 242 243 244 |
# File 'lib/rabbit/canvas.rb', line 239 def (index=current_index) return "" if .empty? = [index] return "" if .nil? .text.strip end |
#slide_title(index = current_index) ⇒ Object
228 229 230 231 232 233 234 235 236 237 |
# File 'lib/rabbit/canvas.rb', line 228 def (index=current_index) return "" if .empty? = [index] return title if .nil? if .is_a?(Element::TitleSlide) .title else "#{title}: #{.title}" end end |
#slides ⇒ Object
246 247 248 249 250 251 252 |
# File 'lib/rabbit/canvas.rb', line 246 def if @index_mode @index_slides else @slides end end |
#source ⇒ Object
539 540 541 |
# File 'lib/rabbit/canvas.rb', line 539 def source @source.read end |
#source_force_modified(force_modified) {|@source| ... } ⇒ Object
532 533 534 535 536 537 |
# File 'lib/rabbit/canvas.rb', line 532 def source_force_modified(force_modified) prev = @source.force_modified @source.force_modified = force_modified yield @source @source.force_modified = prev end |
#start_auto_redraw_timer(interval) ⇒ Object
581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/rabbit/canvas.rb', line 581 def start_auto_redraw_timer(interval) stop_auto_redraw_timer timer = GLib::Timeout.add(interval * 1000) do if quitted? @auto_redraw_timer = nil GLib::Source::REMOVE else activate("Redraw") GLib::Source::CONTINUE end end @auto_redraw_timer = timer end |
#start_timer(limit) ⇒ Object
675 676 677 |
# File 'lib/rabbit/canvas.rb', line 675 def start_timer(limit) @limit_time = Time.now + limit end |
#stop_auto_redraw_timer ⇒ Object
595 596 597 598 599 600 |
# File 'lib/rabbit/canvas.rb', line 595 def stop_auto_redraw_timer if @auto_redraw_timer GLib::Source.remove(@auto_redraw_timer) @auto_redraw_timer = nil end end |
#theme_name ⇒ Object
332 333 334 |
# File 'lib/rabbit/canvas.rb', line 332 def theme_name @theme_name || default_theme || "default" end |
#title ⇒ Object
219 220 221 222 223 224 225 226 |
# File 'lib/rabbit/canvas.rb', line 219 def title ts = if ts ts.title else "Rabbit" end end |
#title_slide ⇒ Object
625 626 627 |
# File 'lib/rabbit/canvas.rb', line 625 def @slides.find{|x| x.is_a?(Element::TitleSlide)} end |
#tmp_dir_name ⇒ Object
399 400 401 |
# File 'lib/rabbit/canvas.rb', line 399 def tmp_dir_name @source and @source.tmp_dir_name end |
#to_pixbuf(i) ⇒ Object
403 404 405 406 407 |
# File 'lib/rabbit/canvas.rb', line 403 def to_pixbuf(i) move_to_if_can(i) .flush @renderer.to_pixbuf() end |
#toggle_index_mode ⇒ Object
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/rabbit/canvas.rb', line 510 def toggle_index_mode @renderer.pre_toggle_index_mode process do if @index_mode @index_mode = false @renderer.index_mode_off else @index_mode = true @renderer.index_mode_on end modified end @renderer.post_toggle_index_mode end |
#unfullscreened ⇒ Object
433 434 435 |
# File 'lib/rabbit/canvas.rb', line 433 def unfullscreened @renderer.post_unfullscreen end |
#update_index_slides ⇒ Object
526 527 528 529 530 |
# File 'lib/rabbit/canvas.rb', line 526 def if @index_slides.empty? @index_slides = Element::IndexSlide.(self) end end |
#use_gl? ⇒ Boolean
196 197 198 |
# File 'lib/rabbit/canvas.rb', line 196 def use_gl? @use_gl end |
#with_index_mode(new_value) ⇒ Object
649 650 651 652 653 654 655 656 |
# File 'lib/rabbit/canvas.rb', line 649 def with_index_mode(new_value) current_index_mode = @index_mode @index_mode = new_value if @index_mode yield ensure @index_mode = current_index_mode end |