Sha256: ff9b89fd9d35d68e96acf134e0bd479e24e9a2edb17d1f33793f51504c9d924a

Contents?: true

Size: 1.64 KB

Versions: 14

Compression:

Stored size: 1.64 KB

Contents

# Copyright (c) 2007-2021 Andy Maleh
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# 
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'glimmer/dsl/expression'
require 'glimmer/swt/image_proxy'

module Glimmer
  module DSL
    module SWT
      # image expression
      # Note: Cannot be a static expression because it clashes with image property expression
      class ImageExpression < Expression
        def can_interpret?(parent, keyword, *args, &block)
          keyword.to_s == 'image' and
            (parent.nil? or !parent.respond_to?('image'))
        end
  
        def interpret(parent, keyword, *args, &block)
          Glimmer::SWT::ImageProxy.new(*args)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
glimmer-dsl-swt-4.18.3.3 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.3.2 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.3.1 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.3.0 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.2.5 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.2.4 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.2.3 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.2.2 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.2.1 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.2.0 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.1.1 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.1.0 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.0.2 lib/glimmer/dsl/swt/image_expression.rb
glimmer-dsl-swt-4.18.0.1 lib/glimmer/dsl/swt/image_expression.rb