class RCGTK::GlobalValue
This class represents global constants, variables, and functions.
Public Class Methods
Global values can only be instantiated using a pointer, and as such should not be created directly by library users.
@param [FFI::Pointer] ptr
# File lib/rcgtk/value.rb, line 1077 def initialize(ptr) @ptr = check_type(ptr, FFI::Pointer, 'ptr') end
Public Instance Methods
Get the byte alignment of this value.
@return [Integer]
# File lib/rcgtk/value.rb, line 1084 def alignment Bindings.get_alignment(@ptr) end
Set the byte alignment of this value.
@param [Integer] bytes
@return [void]
# File lib/rcgtk/value.rb, line 1093 def alignment=(bytes) Bindings.set_alignment(@ptr, bytes) end
Check if this value is a declaration.
@return [Boolean]
# File lib/rcgtk/value.rb, line 1100 def declaration? Bindings.is_declaration(@ptr).to_bool end
Sets the externally initialized property of a global value.
@param [Boolean] bool If the value is externally initialized
@return [void]
# File lib/rcgtk/value.rb, line 1109 def externally_initialized=(bool) Bindings.set_externally_initialized(@ptr, bool.to_i) end
Check if this global is initialized externally.
@return [Boolean]
# File lib/rcgtk/value.rb, line 1116 def externally_initialized? Bindings.externally_initialized(@ptr).to_bool end
Set this value as a global constant or not.
@param [Boolean] flag
@return [void]
# File lib/rcgtk/value.rb, line 1132 def global_constant=(flag) Bindings.set_global_constant(@ptr, flag.to_i) end
Check if this value is a global constant.
@return [Boolean]
# File lib/rcgtk/value.rb, line 1123 def global_constant? Bindings.is_global_constant(@ptr).to_bool end
Get this value’s initializer.
@return [Value]
# File lib/rcgtk/value.rb, line 1139 def initializer Value.new(Bindings.get_initializer(@ptr)) end
Set this value’s initializer.
@param [Value] val
@return [void]
# File lib/rcgtk/value.rb, line 1148 def initializer=(val) Bindings.set_initializer(@ptr, check_type(val, Value, 'val')) end
Get this value’s linkage type.
@see Bindings
.enum_linkage
@return [Symbol]
# File lib/rcgtk/value.rb, line 1157 def linkage Bindings.get_linkage(@ptr) end
Set this value’s linkage type.
@see Bindings
.enum_linkage
@param [Symbol] linkage
@return [void]
# File lib/rcgtk/value.rb, line 1168 def linkage=(linkage) Bindings.set_linkage(@ptr, linkage) end
Get this value’s section string.
@return [String]
# File lib/rcgtk/value.rb, line 1175 def section Bindings.get_section(@ptr) end
Set this value’s section string.
@param [String] section
@return [void]
# File lib/rcgtk/value.rb, line 1184 def section=(section) Bindings.set_section(@ptr, section) end
Returns the thread local model used by a global value.
@return [Symbol from enum_thread_local_mode]
# File lib/rcgtk/value.rb, line 1191 def thread_local_mode Bindings.get_thread_local_mode(@ptr) end
Set the global value’s thread local mode.
@param [Symbol from enum_thread_local_mode] mode
@return [void]
# File lib/rcgtk/value.rb, line 1201 def thread_local_mode=(mode) Bindings.set_thread_local_mode(@ptr, mode) end
Get this value’s visibility.
@see Bindings
.enum_visibility
@return [String]
# File lib/rcgtk/value.rb, line 1210 def visibility Bindings.get_visibility(@ptr) end
Set this value’s visibility.
@see Bindings
.enum_visibility
@param [Symbol] vis
@return [void]
# File lib/rcgtk/value.rb, line 1221 def visibility=(vis) Bindings.set_visibility(@ptr, vis) end