Sha256: a1e605995b21539c68f411dee7d31ec027b6228d32748079739a5d010979933f

Contents?: true

Size: 1.38 KB

Versions: 12

Compression:

Stored size: 1.38 KB

Contents

module GirFFI
  # Base class for all generated classes of type :object.
  class ObjectBase < ClassBase
    #
    # Wraps a pointer retrieved from a constructor method. Here, it is simply
    # defined as a wrapper around direct_wrap, but, e.g., InitiallyUnowned
    # overrides it to sink the floating object.
    #
    # Unlike wrap, this method assumes the pointer will always be of the type
    # corresponding to the current class, and never of a subtype.
    #
    # @param ptr Pointer to the object's C structure
    #
    # @return An object of the current class wrapping the pointer
    #
    def self.constructor_wrap ptr
      direct_wrap ptr
    end

    # Wrap the passed pointer in an instance of its type's corresponding class,
    # generally assumed to be a descendant of the current type.
    def self.wrap ptr
      GirFFI::ArgHelper.object_pointer_to_object ptr
    end

    #
    # Find property info for the named property.
    #
    # @param name The property's name
    #
    # @return [GObjectIntrospection::IPropertyInfo] The property's info
    #
    def self.find_property name
      gir_ffi_builder.find_property name
    end

    #
    # Find signal info for the named signal.
    #
    # @param name The signal's name
    #
    # @return [GObjectIntrospection::ISignalInfo] The signal's info
    #
    def self.find_signal name
      gir_ffi_builder.find_signal name
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gir_ffi-0.6.6 lib/gir_ffi/object_base.rb
gir_ffi-0.6.5 lib/gir_ffi/object_base.rb
gir_ffi-0.6.4 lib/gir_ffi/object_base.rb
gir_ffi-0.6.3 lib/gir_ffi/object_base.rb
gir_ffi-0.6.2 lib/gir_ffi/object_base.rb
gir_ffi-0.6.1 lib/gir_ffi/object_base.rb
gir_ffi-0.6.0 lib/gir_ffi/object_base.rb
gir_ffi-0.5.2 lib/gir_ffi/object_base.rb
gir_ffi-0.5.1 lib/gir_ffi/object_base.rb
gir_ffi-0.5.0 lib/gir_ffi/object_base.rb
gir_ffi-0.4.3 lib/gir_ffi/object_base.rb
gir_ffi-0.4.2 lib/gir_ffi/object_base.rb