class Pango::Loader - pango-3.2.9 Documentation

# class Pango::Loader

### Private Instance Methods

convert_attribute_classes() click to toggle source

    # File lib/pango/loader.rb, line 36
    def convert_attribute_classes
      self.class.register_boxed_class_converter(Attribute.gtype) do |attribute|
        attribute.klass.type.to_class
      end
    end

load_field_reader(info, i, field_info, klass, name, method_name) click to toggle source
Calls superclass method

    # File lib/pango/loader.rb, line 58
    def load_field_reader(info, i, field_info, klass, name, method_name)
      case klass.name
      when "Pango::AttrShape"
        return if klass.method_defined?(method_name)
      end
      super
    end

load_method_info(info, klass, method_name) click to toggle source
Calls superclass method

    # File lib/pango/loader.rb, line 66
    def load_method_info(info, klass, method_name)
      case klass.name
      when "Pango::Matrix"
        case method_name
        when "translate", "scale", "rotate", "concat"
          method_name += "!"
        end
      when "Pango::AttrList", "Pango::AttrIterator"
        return if klass.method_defined?(method_name)
      end
      super(info, klass, method_name)
    end

load_struct_info(info) click to toggle source
Calls superclass method

    # File lib/pango/loader.rb, line 42
    def load_struct_info(info)
      case info.name
      when "AttrClass"
        klass = self.class.define_struct(info.size,
                                         info.name,
                                         @base_module)
        load_fields(info, klass)
      when /Class\z/
        super
      when "Attribute", /\AAttr[A-Z]/
        @pending_attribute_infos << info
      else
        super
      end
    end

post_load(repository, namespace) click to toggle source

    # File lib/pango/loader.rb, line 24
    def post_load(repository, namespace)
      require_extension
      @pending_attribute_infos.each do |info|
        name = rubyish_class_name(info)
        klass = @base_module.const_get(name)
        load_fields(info, klass)
        load_methods(info, klass)
      end
      require_libraries
      convert_attribute_classes
    end

pre_load(repository, namespace) click to toggle source

    # File lib/pango/loader.rb, line 20
    def pre_load(repository, namespace)
      @pending_attribute_infos = []
    end

require_extension() click to toggle source

    # File lib/pango/loader.rb, line 79
    def require_extension
      begin
        major, minor, _ = RUBY_VERSION.split(/\./)
        require "#{major}.#{minor}/pango.so"
      rescue LoadError
        require "pango.so"
      end
    end

require_libraries() click to toggle source

    # File lib/pango/loader.rb, line 88
    def require_libraries
      require "pango/attr-type"
      require "pango/color"
      require "pango/font-description"
      require "pango/language"
      require "pango/layout"
      require "pango/rectangle"
      require "pango/markup"
      require "pango/matrix"
      require "pango/version"

      require "pango/deprecated"
    end