Module: GObject::Object::Overrides

Included in:
GObject::Object
Defined in:
lib/ffi-gobject/object.rb

Overview

Overrides for GObject, GObject’s generic base class.

Instance Method Summary collapse

Instance Method Details

#get_property(property_name) ⇒ Object



126
127
128
129
130
131
132
133
134
135
# File 'lib/ffi-gobject/object.rb', line 126

def get_property(property_name)
  gvalue = gvalue_for_property property_name
  super property_name, gvalue
  value = gvalue.get_value

  type_info = get_property_type property_name
  value = property_value_post_conversion(value, type_info) if type_info

  value
end

#set_property(property_name, value) ⇒ Object



137
138
139
140
141
142
143
144
145
# File 'lib/ffi-gobject/object.rb', line 137

def set_property(property_name, value)
  type_info = get_property_type property_name
  value = property_value_pre_conversion(value, type_info) if type_info

  gvalue = gvalue_for_property(property_name)
  gvalue.set_value value

  super property_name, gvalue
end