Module: GirFFI

Defined in:
lib/gir_ffi.rb,
lib/gir_ffi/lib_c.rb,
lib/gir_ffi/builder.rb,
lib/gir_ffi/version.rb,
lib/gir_ffi/callback.rb,
lib/gir_ffi/type_map.rb,
lib/gir_ffi/enum_base.rb,
lib/gir_ffi/arg_helper.rb,
lib/gir_ffi/class_base.rb,
lib/gir_ffi/in_pointer.rb,
lib/gir_ffi/module_base.rb,
lib/gir_ffi/object_base.rb,
lib/gir_ffi/builder/type.rb,
lib/gir_ffi/builder/field.rb,
lib/gir_ffi/builder/module.rb,
lib/gir_ffi/builder_helper.rb,
lib/gir_ffi/in_out_pointer.rb,
lib/gir_ffi/interface_base.rb,
lib/gir_ffi/method_stubber.rb,
lib/gir_ffi/callback_helper.rb,
lib/gir_ffi/ffi_ext/pointer.rb,
lib/gir_ffi/zero_terminated.rb,
lib/gir_ffi/argument_builder.rb,
lib/gir_ffi/builder/property.rb,
lib/gir_ffi/function_builder.rb,
lib/gir_ffi/allocation_helper.rb,
lib/gir_ffi/builder/type/base.rb,
lib/gir_ffi/builder/type/enum.rb,
lib/gir_ffi/builder/type/union.rb,
lib/gir_ffi/builder/type/object.rb,
lib/gir_ffi/builder/type/struct.rb,
lib/gir_ffi/info_ext/i_arg_info.rb,
lib/gir_ffi-base/gir_ffi/library.rb,
lib/gir_ffi/info_ext/i_enum_info.rb,
lib/gir_ffi/info_ext/i_type_info.rb,
lib/gir_ffi/return_value_builder.rb,
lib/gir_ffi/setter_argument_info.rb,
lib/gir_ffi/base_argument_builder.rb,
lib/gir_ffi/builder/type/callback.rb,
lib/gir_ffi/builder/type/constant.rb,
lib/gir_ffi/info_ext/i_field_info.rb,
lib/gir_ffi/info_ext/i_union_info.rb,
lib/gir_ffi/null_argument_builder.rb,
lib/gir_ffi/builder/type/interface.rb,
lib/gir_ffi/error_argument_builder.rb,
lib/gir_ffi/info_ext/i_object_info.rb,
lib/gir_ffi/info_ext/i_signal_info.rb,
lib/gir_ffi/info_ext/i_struct_info.rb,
lib/gir_ffi/user_defined_type_info.rb,
lib/gir_ffi/variable_name_generator.rb,
lib/gir_ffi/builder/type/with_layout.rb,
lib/gir_ffi/info_ext/i_callable_info.rb,
lib/gir_ffi/info_ext/i_function_info.rb,
lib/gir_ffi/info_ext/i_property_info.rb,
lib/gir_ffi/builder/type/user_defined.rb,
lib/gir_ffi/builder/type/with_methods.rb,
lib/gir_ffi/unintrospectable_type_info.rb,
lib/gir_ffi/user_defined_property_info.rb,
lib/gir_ffi/info_ext/safe_constant_name.rb,
lib/gir_ffi/info_ext/safe_function_name.rb,
lib/gir_ffi/builder/type/registered_type.rb,
lib/gir_ffi/builder/type/unintrospectable.rb,
lib/gir_ffi/info_ext/i_registered_type_info.rb

Defined Under Namespace

Modules: AllocationHelper, ArgHelper, Builder, BuilderHelper, CallbackHelper, EnumBase, FFIExt, InfoExt, InterfaceBase, LibC, Library, ModuleBase, TypeMap Classes: ArgumentBuilder, BaseArgumentBuilder, Callback, ClassBase, ErrorArgumentBuilder, FunctionBuilder, InOutPointer, InPointer, MethodStubber, NullArgumentBuilder, ObjectBase, ReturnValueBuilder, SetterArgumentInfo, UnintrospectableTypeInfo, UserDefinedPropertyInfo, UserDefinedTypeInfo, VariableNameGenerator, ZeroTerminated

Constant Summary collapse

VERSION =
"0.6.4"

Class Method Summary collapse

Class Method Details

.define_type(klass, &block) ⇒ Object



24
25
26
27
28
29
# File 'lib/gir_ffi.rb', line 24

def self.define_type klass, &block
  info = UserDefinedTypeInfo.new(klass, &block)
  Builder::Type::UserDefined.new(info).build_class

  klass.get_gtype
end

.setup(module_name, version = nil) ⇒ Object



19
20
21
22
# File 'lib/gir_ffi.rb', line 19

def self.setup module_name, version=nil
  module_name = module_name.to_s
  GirFFI::Builder.build_module module_name, version
end