Parent

Class/Module Index [+]

Quicksearch

Rabbit::Theme::Applier

Constants

NORMALIZED_HEIGHT
NORMALIZED_WIDTH

Those constants are meaningless. :p

Public Class Methods

new(theme, &callback) click to toggle source
# File lib/rabbit/theme/applier.rb, line 235
def initialize(theme, &callback)
  super()
  @theme = theme
  @callback = callback
  dirty_count_clean
  @match_cache = {}
  @current_target = nil
  class << slides
    def elements
      self
    end
  end
end

Public Instance Methods

[](name) click to toggle source
# File lib/rabbit/theme/applier.rb, line 303
def [](name)
  instance_variable_get("@#{name}")
end
apply_theme(name) click to toggle source
# File lib/rabbit/theme/applier.rb, line 249
def apply_theme(name)
  entry = find_theme(name)
  src = File.open(entry.theme_file) do |f|
    f.read
  end
  in_theme(entry) do
    instance_eval(normalize_source(src), entry.theme_file)
  end
end
make_container(ary) click to toggle source
# File lib/rabbit/theme/applier.rb, line 259
def make_container(ary)
  ElementContainer.new(self, ary)
end
normalized_height() click to toggle source
# File lib/rabbit/theme/applier.rb, line 275
def normalized_height
  NORMALIZED_HEIGHT / Canvas::INTERNAL_DPI
end
normalized_size(s) click to toggle source
# File lib/rabbit/theme/applier.rb, line 279
def normalized_size(s)
  ((s / canvas.width.to_f) * normalized_width).ceil
end
normalized_width() click to toggle source
# File lib/rabbit/theme/applier.rb, line 271
def normalized_width
  NORMALIZED_WIDTH / Canvas::INTERNAL_DPI
end
normalized_x(sx) click to toggle source
# File lib/rabbit/theme/applier.rb, line 283
def normalized_x(sx)
  ((sx / canvas.width.to_f) * normalized_width).ceil
end
normalized_y(sy) click to toggle source
# File lib/rabbit/theme/applier.rb, line 287
def normalized_y(sy)
  ((sy / canvas.height.to_f) * normalized_height).ceil
end
screen_size(n) click to toggle source
# File lib/rabbit/theme/applier.rb, line 291
def screen_size(n)
  ((canvas.width * n) / normalized_width).ceil
end
screen_x(nx) click to toggle source
# File lib/rabbit/theme/applier.rb, line 295
def screen_x(nx)
  ((canvas.width * nx) / normalized_width).ceil
end
screen_y(ny) click to toggle source
# File lib/rabbit/theme/applier.rb, line 299
def screen_y(ny)
  ((canvas.height * ny) / normalized_height).ceil
end
to_container(obj) click to toggle source
# File lib/rabbit/theme/applier.rb, line 263
def to_container(obj)
  if obj.is_a?(ElementContainer)
    obj
  else
    make_container([obj])
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.