Sha256: b3b45ea475d648ee165d9c9c771deb721b12efb27dd4fa27de47bceea5feef06

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

module Glimmer
  module SWT
    # emulating org.eclipse.swt.graphics.Image
    class ImageProxy
      class << self
        def create(*args, &content)
          if args.size == 1 && args.first.is_a?(ImageProxy)
            args.first
          else
            new(*args, &content)
          end
        end
      end
    
      attr_reader :file_path, :width, :height
      
      def initialize(*args)
        options = args.last.is_a?(Hash) ? args.last : {}
        # TODO support a parent as a first argument before the file path
        @file_path = args.first
        @width = options[:width]
        @height = options[:height]
      end
      
      # TODO implement scale_to
    end
    # TODO alias as org.eclipse.swt.graphics.Image
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.29.0 lib/glimmer/swt/image_proxy.rb
glimmer-dsl-opal-0.28.3 lib/glimmer/swt/image_proxy.rb
glimmer-dsl-opal-0.28.2 lib/glimmer/swt/image_proxy.rb