Module: Rabbit::Renderer::Display::DrawingAreaBase

Includes:
ButtonHandler, DrawingAreaPrimitive, Gesture, Graffiti, Info, KeyHandler, Magnifier, Mask, Menu, Progress, ScrollHandler, Search, Spotlight
Included in:
DrawingArea
Defined in:
lib/rabbit/renderer/display/drawing-area-base.rb

Constant Summary

Constants included from ButtonHandler

ButtonHandler::BUTTON_PRESS_ACCEPTING_TIME

Constants included from Mask

Mask::MASK_SIZE_STEP

Constants included from DirtyCount

DirtyCount::TOO_DIRTY

Constants included from GetText

GetText::DOMAIN

Instance Attribute Summary

Attributes included from DrawingAreaPrimitive

#filename

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

Instance Method Summary collapse

Methods included from Magnifier

#toggle_magnifier

Methods included from Spotlight

#toggle_spotlight

Methods included from Info

#hide_info_window, #show_info_window, #toggle_info_window

Methods included from KeyHandler

#connect_key, #disconnect_key

Methods included from Search

#search_slide, #searching?, #stop_slide_search

Methods included from Mask

#expand_hole, #narrow_hole, #set_hole

Methods included from Graffiti

#can_undo_graffiti?, #change_graffiti_color, #clear_graffiti, #graffiti_mode?, #have_graffiti?, #toggle_graffiti_mode, #undo_graffiti

Methods included from DrawingAreaPrimitive

#clear_slide, #display?, #post_move_in_slide, #widget

Methods included from GL

#draw_cone, #draw_cube, #draw_dodecahedron, #draw_icosahedron, #draw_octahedron, #draw_sphere, #draw_teapot, #draw_tetrahedron, #draw_torus, #gl_call_list, #gl_compile, #gl_supported?

Methods included from Base

#create_pango_context, #create_pango_layout, #height, #make_layout, #redraw, #size, #update_title, #width

Methods included from HookHandler

#add_button_press_hook, #add_button_release_hook, #add_motion_notify_hook, #add_scroll_hook, #call_hook_procs, #clear_button_press_hook, #clear_button_release_hook, #clear_hooks, #clear_motion_notify_hook, #clear_scroll_hook

Methods included from Base

#add_gesture_action, #blackouting?, #can_undo_graffiti?, #change_graffiti_color, #clean, #clean_if_dirty, #clear_slide, #clear_theme, #connect_key, #create_pango_context, #disconnect_key, #display?, #each_slide_pixbuf, #expand_hole, #font_families, #gl_available?, #graffiti_mode?, #have_graffiti?, #hiding?, #narrow_hole, #offscreen_canvas, #print, #printable?, #redraw, #search_slide, #searching?, #setup_event, #stop_slide_search, #to_attrs, #toggle_info_window, #toggle_spotlight, #whiteouting?

Methods included from DirtyCount

#bit_dirty, #dirty, #dirty?, #dirty_count_clean, #very_dirty

Methods included from GetText

included

Instance Method Details

#attach_to(window, container = nil, &block) ⇒ Object



204
205
206
207
208
209
210
211
212
213
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 204

def attach_to(window, container=nil, &block)
  super

  init_menu
  init_gesture_actions
  add_widgets_to_container(@container, &block)
  widget.show
  attach_menu(@window)
  attach_key(@window)
end

#cache_all_slidesObject



142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 142

def cache_all_slides
  pre_cache_all_slides(@canvas.slide_size)
  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

#caching_all_slides(i) ⇒ Object



163
164
165
166
167
168
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 163

def caching_all_slides(i)
  update_progress(i)
  continue = @caching_size == [width, height] &&
    !@canvas.quitted? && !@canvas.applying?
  continue
end

#confirm(message) ⇒ Object



181
182
183
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 181

def confirm(message)
  confirm_dialog(message) == Gtk::MessageDialog::RESPONSE_OK
end

#detachObject



215
216
217
218
219
220
221
222
223
224
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 215

def detach
  detach_key(@window)
  detach_menu(@window)
  widget.hide
  unless @window.destroyed?
    remove_widgets_from_container(@container)
  end

  super
end

#draw_slide(slide, simulation, &block) ⇒ Object



244
245
246
247
248
249
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 244

def draw_slide(slide, simulation, &block)
  super do |*args|
    block.call(*args)
    magnify {block.call(*args)} unless simulation
  end
end

#index_mode_offObject



94
95
96
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 94

def index_mode_off
  super
end

#index_mode_onObject



90
91
92
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 90

def index_mode_on
  super
end

#initialize(canvas) ⇒ Object



35
36
37
38
39
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 35

def initialize(canvas)
  @caching = nil
  @need_reload_theme = false
  super
end

#post_apply_themeObject



41
42
43
44
45
46
47
48
49
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 41

def post_apply_theme
  if @need_reload_theme
    @need_reload_theme = false
    reload_theme
  else
    super
    update_menu
  end
end

#post_cache_all_slides(canceled) ⇒ Object



170
171
172
173
174
175
176
177
178
179
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 170

def post_cache_all_slides(canceled)
  end_progress
  @caching = false
  return if @canvas.quitted?
  if canceled
    reload_theme
  else
    @area.queue_draw
  end
end

#post_fullscreenObject



59
60
61
62
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 59

def post_fullscreen
  super
  update_menu
end

#post_iconifyObject



69
70
71
72
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 69

def post_iconify
  super
  update_menu
end

#post_init_guiObject



241
242
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 241

def post_init_gui
end

#post_move(old_index, index) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 51

def post_move(old_index, index)
  update_title
  reset_adjustment
  clear_graffiti
  # toggle_graffiti_mode if @graffiti_mode
  super
end

#post_parseObject



79
80
81
82
83
84
85
86
87
88
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 79

def post_parse
  super
  clear_button_handler
  update_title
  update_menu
  if @need_reload_theme
    @need_reload_theme = false
    reload_theme
  end
end

#post_print(canceled) ⇒ Object



120
121
122
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 120

def post_print(canceled)
  end_progress
end

#post_to_pixbuf(canceled) ⇒ Object



137
138
139
140
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 137

def post_to_pixbuf(canceled)
  super
  end_progress
end

#post_toggle_index_modeObject



103
104
105
106
107
108
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 103

def post_toggle_index_mode
  @canvas.activate("ClearGraffiti")
  update_menu
  update_title
  super
end

#post_unfullscreenObject



64
65
66
67
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 64

def post_unfullscreen
  super
  update_menu
end

#pre_cache_all_slides(slide_size) ⇒ Object



157
158
159
160
161
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 157

def pre_cache_all_slides(slide_size)
  @caching = true
  @caching_size = [width, height]
  start_progress(slide_size)
end

#pre_parseObject



74
75
76
77
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 74

def pre_parse
  super
  update_menu
end

#pre_print(slide_size) ⇒ Object



110
111
112
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 110

def pre_print(slide_size)
  start_progress(slide_size)
end

#pre_to_pixbuf(slide_size) ⇒ Object



124
125
126
127
128
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 124

def pre_to_pixbuf(slide_size)
  super
  start_progress(slide_size)
  @pixbufing_size = [width, height]
end

#pre_toggle_index_modeObject



98
99
100
101
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 98

def pre_toggle_index_mode
  super
  Utils.process_pending_events
end

#printing(i) ⇒ Object



114
115
116
117
118
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 114

def printing(i)
  update_progress(i)
  continue = !@canvas.quitted?
  continue
end

#reload_source(&callback) ⇒ Object



193
194
195
196
197
198
199
200
201
202
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 193

def reload_source(&callback)
  if @canvas.need_reload_source?
    callback ||= Utils.process_pending_events_proc
    begin
      super(callback)
    rescue
      @canvas.logger.error($!)
    end
  end
end

#reload_theme(&callback) ⇒ Object



185
186
187
188
189
190
191
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 185

def reload_theme(&callback)
  if @canvas.applying?
    @need_reload_theme = true
  else
    super
  end
end

#reset_adjustmentObject



236
237
238
239
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 236

def reset_adjustment
  super
  @area.queue_draw
end

#to_pixbufing(i) ⇒ Object



130
131
132
133
134
135
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 130

def to_pixbufing(i)
  update_progress(i)
  continue = @pixbufing_size == [width, height] &&
    !@canvas.quitted? && !@canvas.applying?
  super or continue
end

#toggle_blackoutObject



231
232
233
234
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 231

def toggle_blackout
  super
  @area.queue_draw
end

#toggle_whiteoutObject



226
227
228
229
# File 'lib/rabbit/renderer/display/drawing-area-base.rb', line 226

def toggle_whiteout
  super
  @area.queue_draw
end