module Rabbit::Renderer::Display::DrawingAreaBase
Public Class Methods
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 50 def initialize(canvas) @caching = nil @need_reload_theme = false super end
Calls superclass method
Rabbit::Renderer::Display::Magnifier::new
Public Instance Methods
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 226 def attach_to(window, container=nil, &block) super init_menu init_gesture_actions add_widgets_to_container(@container, &block) widget.show attach_menu(@window) end
Calls superclass method
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 164 def cache_all_slides pre_cache_all_slides(@canvas.n_slides) canceled = false @canvas.slides.each_with_index do |slide, i| @canvas.change_current_index(i) do compile_slide(slide) end unless caching_all_slides(i) canceled = true break end end post_cache_all_slides(canceled) end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 185 def caching_all_slides(i) update_progress(i) continue = @caching_size == [width, height] && !@canvas.quitted? && !@canvas.applying? continue end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 203 def confirm(message) confirm_dialog(message) == Gtk::ResponseType::OK end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 236 def detach detach_menu(@window) widget.hide unless @window.destroyed? remove_widgets_from_container(@container) end super end
Calls superclass method
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 264 def draw_slide(slide, simulation, &block) super do |*args| block.call(*args) magnify {block.call(*args)} unless simulation end end
Calls superclass method
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 116 def index_mode_off super end
Calls superclass method
Rabbit::Renderer::Display::Info#index_mode_off
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 112 def index_mode_on super end
Calls superclass method
Rabbit::Renderer::Display::Info#index_mode_on
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 63 def post_apply_theme if @need_reload_theme @need_reload_theme = false reload_theme else super update_menu end end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#post_apply_theme
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 192 def post_cache_all_slides(canceled) end_progress @caching = false return if @canvas.quitted? if canceled reload_theme else @area.queue_draw end end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 81 def post_fullscreen super update_menu end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#post_fullscreen
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 91 def post_iconify super update_menu end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#post_iconify
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 261 def post_init_gui end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 73 def post_move(old_index, index) update_title reset_adjustment clear_graffiti # toggle_graffiti_mode if @graffiti_mode super end
Calls superclass method
Rabbit::Renderer::Display::Info#post_move
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 101 def post_parse super clear_button_handler update_title update_menu if @need_reload_theme @need_reload_theme = false reload_theme end end
Calls superclass method
Rabbit::Renderer::Display::Info#post_parse
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 142 def post_print(canceled) end_progress end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 159 def post_to_pixbuf(canceled) super end_progress end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#post_to_pixbuf
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 125 def post_toggle_index_mode @canvas.activate("ClearGraffiti") update_menu update_title super end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#post_toggle_index_mode
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 86 def post_unfullscreen super update_menu end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#post_unfullscreen
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 179 def pre_cache_all_slides(n_slides) @caching = true @caching_size = [width, height] start_progress(n_slides) end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 96 def pre_parse super update_menu end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#pre_parse
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 132 def pre_print(n_slides) start_progress(n_slides) end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 146 def pre_to_pixbuf(n_slides) super start_progress(n_slides) @pixbufing_size = [width, height] end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#pre_to_pixbuf
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 120 def pre_toggle_index_mode super Utils.process_pending_events end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#pre_toggle_index_mode
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 136 def printing(i) update_progress(i) continue = !@canvas.quitted? continue end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 215 def reload_source(&callback) if @canvas.need_reload_source? callback ||= Utils.process_pending_events_proc begin @canvas.reload_source(callback) rescue Rabbit.logger.error($!) end end end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 207 def reload_theme(&callback) if @canvas.applying? @need_reload_theme = true else super end end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#reload_theme
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 256 def reset_adjustment super @area.queue_draw end
Calls superclass method
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 152 def to_pixbufing(i) update_progress(i) continue = @pixbufing_size == [width, height] && !@canvas.quitted? && !@canvas.applying? super or continue end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#to_pixbufing
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 251 def toggle_blackout super @area.queue_draw end
Calls superclass method
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 246 def toggle_whiteout super @area.queue_draw end
Calls superclass method
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 56 def update_size(width, height) super @mask = nil set_hole reload_theme if @surface end
Calls superclass method
Private Instance Methods
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 272 def add_widgets_to_container(container) @hbox = Gtk::Box.new(:horizontal) @vbox = Gtk::Box.new(:vertical) @vbox.pack_start(@area, :expand => true, :fill => true, :padding => 0) @hbox.pack_end(@vbox, :expand => true, :fill => true, :padding => 0) if block_given? yield(container, @hbox) else container.add(@hbox) end @hbox.show @vbox.show end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 368 def confirm_dialog(message) flags = Gtk::Dialog::MODAL | Gtk::Dialog::DESTROY_WITH_PARENT dialog_type = Gtk::MessageDialog::INFO buttons = Gtk::MessageDialog::BUTTONS_OK_CANCEL dialog = Gtk::MessageDialog.new(nil, flags, dialog_type, buttons, message) result = dialog.run dialog.destroy result end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 304 def draw(widget) reload_source unless @caching if whiteouting? paint("white") elsif blackouting? paint("black") else super draw_graffiti draw_gesture draw_spotlight end end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#draw
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 319 def draw_current_slide_pixbuf(pixbuf) width, height = pixbuf.width, pixbuf.height x = @adjustment_x * width y = @adjustment_y * height @surface.draw_pixbuf(@foreground, pixbuf, x, y, 0, 0, width, height, Gdk::RGB::DITHER_NORMAL, 0, 0) if @adjustment_x != 0 or @adjustment_y != 0 draw_next_slide end end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 331 def draw_next_slide @canvas.change_current_index(@canvas.current_index + 1) do draw_current_slide do |pixbuf| draw_next_slide_pixbuf(pixbuf) end end end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 339 def draw_next_slide_pixbuf(pixbuf) width, height = pixbuf.size adjustment_width = @adjustment_x * width adjustment_height = @adjustment_y * height src_x = src_y = dest_x = dest_y = 0 src_width = width src_height = height if adjustment_width > 0 dest_x = width - adjustment_width src_width = adjustment_width elsif adjustment_width < 0 src_x = width + adjustment_width src_width = -adjustment_width end if adjustment_height > 0 dest_y = height - adjustment_height src_height = adjustment_height elsif adjustment_height < 0 src_y = height + adjustment_height src_height = -adjustment_height end @surface.draw_pixbuf(@foreground, pixbuf, src_x, src_y, dest_x, dest_y, src_width, src_height, Gdk::RGB::DITHER_NORMAL, 0, 0) end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 291 def init_drawing_area super set_button_event(@area) set_motion_event(@area) set_scroll_event(@area) end
Calls superclass method
Rabbit::Renderer::Display::DrawingAreaPrimitive#init_drawing_area
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 298 def paint(color_name) context = @surface.create_cairo_context context.set_source_rgba(*Color.parse(color_name).to_a) context.paint end
Source
# File lib/rabbit/renderer/display/drawing-area-base.rb, line 286 def remove_widgets_from_container(container) container.remove(@hbox) @hbox = @vbox = nil end