class Rabbit::Renderer::Print::Multiple

Public Class Methods

new(canvas) click to toggle source
Calls superclass method Rabbit::Renderer::Print::Base.new
# File lib/rabbit/renderer/print/multiple.rb, line 40
def initialize(canvas)
  @print = Print.new(canvas)
  super
end

Public Instance Methods

draw_arc(filled, x, y, w, h, a1, a2, color=nil, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 134
def draw_arc(filled, x, y, w, h, a1, a2, color=nil, params={})
  x, y = normalize(x, y)
  @print.draw_arc(filled, x, y, w, h, a1, a2, color, params)
end
draw_arc_by_radius(filled, x, y, r, a1, a2, color=nil, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 139
def draw_arc_by_radius(filled, x, y, r, a1, a2, color=nil, params={})
  x, y = normalize(x, y)
  @print.draw_arc_by_radius(filled, x, y, r, a1, a2, color, params)
end
draw_layout(layout, x, y, color=nil, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 144
def draw_layout(layout, x, y, color=nil, params={})
  x, y = normalize(x, y)
  @print.draw_layout(layout, x, y, color, params)
end
draw_line(x1, y1, x2, y2, color=nil, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 116
def draw_line(x1, y1, x2, y2, color=nil, params={})
  x1, y1 = normalize(x1, y1)
  x2, y2 = normalize(x2, y2)
  @print.draw_line(x1, y1, x2, y2, color, params)
end
draw_pixbuf(pixbuf, x, y, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 149
def draw_pixbuf(pixbuf, x, y, params={})
  x, y = normalize(x, y)
  @print.draw_pixbuf(pixbuf, x, y, params)
end
draw_poppler_page(handle, x, y, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 159
def draw_poppler_page(handle, x, y, params={})
  x, y = normalize(x, y)
  @print.draw_poppler_page(handle, x, y, params)
end
draw_rectangle(filled, x, y, w, h, color=nil, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 122
def draw_rectangle(filled, x, y, w, h, color=nil, params={})
  x, y = normalize(x, y)
  @print.draw_rectangle(filled, x, y, w, h, color, params)
end
draw_rounded_rectangle(filled, x, y, w, h, radius, color=nil, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 127
def draw_rounded_rectangle(filled, x, y, w, h, radius, color=nil,
                           params={})
  x, y = normalize(x, y)
  @print.draw_rounded_rectangle(filled, x, y, w, h, radius,
                                color, params)
end
draw_rsvg_handle(handle, x, y, params={}) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 154
def draw_rsvg_handle(handle, x, y, params={})
  x, y = normalize(x, y)
  @print.draw_rsvg_handle(handle, x, y, params)
end
draw_slide(slide, simulation) { || ... } click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 94
def draw_slide(slide, simulation)
  @print.show_page = need_show_page?
  @print.internal_draw_slide(slide, simulation) do
    if simulation
      yield
    else
      @print.save_context do
        x, y = normalize(0, 0)
        @print.internal_clip_slide(x, y, width, height)
        @print.internal_draw_background(x, y, width, height)
        yield
        draw_rectangle(false, 0, 0, width, height, @black)
      end
    end
  end
end
height() click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 49
def height
  @slide_height ||= @layout.slide_height
end
margin_bottom=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 88
def margin_bottom=(margin)
  super
  @print.margin_bottom = margin
end
margin_left=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 73
def margin_left=(margin)
  super
  @print.margin_left = margin
end
margin_right=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 78
def margin_right=(margin)
  super
  @print.margin_right = margin
end
margin_top=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 83
def margin_top=(margin)
  super
  @print.margin_top = margin
end
page_margin_bottom=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 68
def page_margin_bottom=(margin)
  super
  @print.page_margin_bottom = margin
end
page_margin_left=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 53
def page_margin_left=(margin)
  super
  @print.page_margin_left = margin
end
page_margin_right=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 58
def page_margin_right=(margin)
  super
  @print.page_margin_right = margin
end
page_margin_top=(margin) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 63
def page_margin_top=(margin)
  super
  @print.page_margin_top = margin
end
slides_per_page=(slides) click to toggle source
Calls superclass method
# File lib/rabbit/renderer/print/multiple.rb, line 111
def slides_per_page=(slides)
  super
  update_layout
end
width() click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 45
def width
  @slide_width ||= @layout.slide_width
end

Private Instance Methods

init_color() click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 170
def init_color
  @white = make_color("white")
  @black = make_color("black")
end
init_paper() click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 165
def init_paper
  @print.paper_width = A4_WIDTH
  @print.paper_height = A4_HEIGHT
end
need_show_page?() click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 199
def need_show_page?
  @canvas.last_slide? or ((current_index + 1) % @slides_per_page).zero?
end
normalize(x, y) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 195
def normalize(x, y)
  [nx(x), ny(y)]
end
normalize_x(x) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 185
def normalize_x(x)
  @layout.normalize_x(x)
end
Also aliased as: nx
normalize_y(y) click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 190
def normalize_y(y)
  @layout.normalize_y(y)
end
Also aliased as: ny
nx(x)
Alias for: normalize_x
ny(y)
Alias for: normalize_y
update_layout() click to toggle source
# File lib/rabbit/renderer/print/multiple.rb, line 175
def update_layout
  if @slides_per_page
    @layout = LayoutBase.make_layout(self)
  else
    @layout = nil
  end
  @slide_width = nil
  @slide_height = nil
end