Class: Shoes::Swt::RedrawingAspect

Inherits:
Object
  • Object
show all
Defined in:
shoes-swt/lib/shoes/swt/redrawing_aspect.rb

Constant Summary collapse

NEED_TO_UPDATE =
{
  Animation                        => [:eval_block],
  Button                           => [:eval_block],
  ClickListener                    => [:eval_block],
  Download                         => [:actually_run_block],
  ::Shoes::InternalApp             => [:execute_block],
  Keypress                         => [:eval_block],
  Keyrelease                       => [:eval_block],
  MouseMoveListener                => [:eval_move_block],
  TextBlock::CursorPainter         => [:move_textcursor],
  Timer                            => [:eval_block],
  Slot                             => [:update_scroll],
  ::Shoes::Common::Changeable      => [:call_change_listeners],
}.freeze
SAME_POSITION =

These need to trigger a redraw

{
  Common::Visibility      => [:update_visibility],
  Image                   => [:create_image],
  ::Shoes::Common::Hover  => [:eval_hover_block],
  ::Shoes::Common::Style  => [:update_style],
  ::Shoes::Common::Remove => [:remove],
  ::Shoes::Slot           => [:mouse_hovered, :mouse_left],
  ::Shoes::TextBlock      => [:replace],
}.freeze
CHANGED_POSITION =
{ ::Shoes::DimensionsDelegations => [:adjust_current_position],
::Shoes::Common::Positioning   => [:_position, :displace],
::Shoes::Common::Hover         => [:eval_hover_block] }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(swt_app, display) ⇒ RedrawingAspect

Returns a new instance of RedrawingAspect.



48
49
50
51
52
53
# File 'shoes-swt/lib/shoes/swt/redrawing_aspect.rb', line 48

def initialize(swt_app, display)
  @app = swt_app
  @display = display
  extend_needed_classes
  add_redraws
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



46
47
48
# File 'shoes-swt/lib/shoes/swt/redrawing_aspect.rb', line 46

def app
  @app
end

Instance Method Details

#remove_redrawsObject



55
56
57
# File 'shoes-swt/lib/shoes/swt/redrawing_aspect.rb', line 55

def remove_redraws
  affected_classes.each(&:remove_all_callbacks)
end