Class: Rabbit::Renderer::Print::Cairo
- Inherits:
-
Object
- Object
- Rabbit::Renderer::Print::Cairo
show all
- Includes:
- Engine::Cairo, Base
- Defined in:
- lib/rabbit/renderer/print/cairo.rb
Constant Summary
Constants included
from DirtyCount
DirtyCount::TOO_DIRTY
Constants included
from GetText
GetText::DOMAIN
Instance Attribute Summary
Attributes included from Base
#filename, #show_page
Attributes included from Base
#adjustment_x, #adjustment_y, #draw_scaled_image, #gl_quaternion, #gl_scale, #graffiti_color, #graffiti_line_width, #margin_bottom, #margin_left, #margin_right, #margin_top, #page_margin_bottom, #page_margin_left, #page_margin_right, #page_margin_top, #paper_height, #paper_width, #progress_background, #progress_foreground, #slides_per_page, #x_dpi, #y_dpi
#background, #foreground
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Base
#draw_slide, #height, #page_height, #page_width, #paper_height=, #paper_width=, #printable?, #width
Methods included from Base
#add_gesture_action, #blackouting?, #can_undo_graffiti?, #change_graffiti_color, #clean, #clean_if_dirty, #clear_slide, #clear_theme, #confirm, #connect_key, #disconnect_key, #display?, #each_slide_pixbuf, #expand_hole, #font_families, #gl_available?, #graffiti_mode?, #have_graffiti?, #hiding?, #narrow_hole, #off_screen_canvas, #post_init_gui, #print, #printable?, #redraw, #reset_adjustment, #search_slide, #searching?, #setup_event, #stop_slide_search, #to_attrs, #toggle_blackout, #toggle_info_window, #toggle_spotlight, #toggle_whiteout, #whiteouting?
Methods included from DirtyCount
#bit_dirty, #dirty, #dirty?, #dirty_count_clean, #very_dirty
Methods included from GetText
included
#alpha_available?, #background_image=, #draw_arc, #draw_arc_by_radius, #draw_background, #draw_layout, #draw_line, #draw_lines, #draw_pixbuf, #draw_polygon, #draw_poppler_page, #draw_rectangle, #draw_rounded_rectangle, #draw_rsvg_handle, #finish_context, #finish_renderer, #init_context, #init_renderer, #make_layout, #prepare_renderer, #reflect_context, #restore_context, #rotate_context, #save_context, #scale_context, #set_font_resolution, #set_source_pixbuf, #shear_context, #to_gdk_rgb, #translate_context
Methods included from Kernel
#draw_background, #draw_circle, #draw_circle_by_radius, #draw_cone, #draw_cube, #draw_dodecahedron, #draw_flag, #draw_flag_layout, #draw_icosahedron, #draw_octahedron, #draw_rectangle_flag, #draw_slide, #draw_sphere, #draw_teapot, #draw_tetrahedron, #draw_torus, #draw_triangle_flag, #flag_size, #gl_call_list, #gl_compile, #gl_supported?, #make_color, #new_list_id, #reflect_context, #restore_context, #rotate_context, #save_context, #scale_context, #shear_context, #translate_context, #z_far, #z_view
Constructor Details
#initialize(canvas) ⇒ Cairo
Returns a new instance of Cairo.
21
22
23
24
25
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 21
def initialize(canvas)
super
init_paper
init_color
end
|
Class Method Details
.priority ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 12
def priority
if (::Cairo::VERSION <=> [1, 2, 0]) >= 0
100
else
-100
end
end
|
Instance Method Details
#internal_clip_slide(x = 0, y = 0, w = width, h = height) ⇒ Object
57
58
59
60
61
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 57
def internal_clip_slide(x=0, y=0, w=width, h=height)
x, y = from_screen(x, y)
@context.rectangle(x, y, w, h)
@context.clip
end
|
#internal_draw_background(x = 0, y = 0, w = width, h = height) ⇒ Object
63
64
65
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 63
def internal_draw_background(x=0, y=0, w=width, h=height)
draw_rectangle(true, x, y, w, h, @background)
end
|
#internal_draw_slide(slide, simulation) ⇒ Object
52
53
54
55
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 52
def internal_draw_slide(slide, simulation)
yield
@context.show_page if !simulation and @show_page
end
|
#post_apply_theme ⇒ Object
43
44
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 43
def post_apply_theme
end
|
#post_move(old_index, index) ⇒ Object
46
47
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 46
def post_move(old_index, index)
end
|
#post_move_in_slide(old_index, index) ⇒ Object
49
50
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 49
def post_move_in_slide(old_index, index)
end
|
#post_parse ⇒ Object
40
41
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 40
def post_parse
end
|
#post_print(canceled) ⇒ Object
32
33
34
35
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 32
def post_print(canceled)
return if canceled
@context.target.finish
end
|
#pre_parse ⇒ Object
37
38
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 37
def pre_parse
end
|
#pre_print(slide_size) ⇒ Object
27
28
29
30
|
# File 'lib/rabbit/renderer/print/cairo.rb', line 27
def pre_print(slide_size)
super
init_context(create_context)
end
|