Class: GObjectIntrospection::IStructInfo

Inherits:
IRegisteredTypeInfo show all
Defined in:
lib/ffi-gobject_introspection/i_struct_info.rb

Overview

Wraps a GIStructInfo struct. Represents a struct.

Instance Method Summary collapse

Methods inherited from IRegisteredTypeInfo

#g_type, #type_init, #type_name

Methods inherited from IBaseInfo

#==, build_array_method, #container, #deprecated?, #info_type, #initialize, #name, #namespace, #safe_name, #safe_namespace, #to_ptr, wrap

Constructor Details

This class inherits a constructor from GObjectIntrospection::IBaseInfo

Instance Method Details

#alignmentObject



37
38
39
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 37

def alignment
  Lib.g_struct_info_get_alignment @gobj
end

#field(index) ⇒ Object



8
9
10
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 8

def field(index)
  IFieldInfo.wrap(Lib.g_struct_info_get_field @gobj, index)
end

#find_method(name) ⇒ Object



25
26
27
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 25

def find_method(name)
  method_map[name]
end

#get_method(index) ⇒ Object



18
19
20
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 18

def get_method(index)
  IFunctionInfo.wrap(Lib.g_struct_info_get_method @gobj, index)
end

#get_n_methodsObject



15
16
17
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 15

def get_n_methods
  Lib.g_struct_info_get_n_methods @gobj
end

#gtype_struct?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 41

def gtype_struct?
  Lib.g_struct_info_is_gtype_struct @gobj
end

#method_mapObject



29
30
31
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 29

def method_map
  @method_map ||= Hash[get_methods.map {|mthd| [mthd.name, mthd] }]
end

#n_fieldsObject



5
6
7
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 5

def n_fields
  Lib.g_struct_info_get_n_fields @gobj
end

#sizeObject



33
34
35
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 33

def size
  Lib.g_struct_info_get_size @gobj
end