class RCGTK::GlobalValue

This class represents global constants, variables, and functions.

Public Class Methods

new(ptr) click to toggle source

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

alignment() click to toggle source

Get the byte alignment of this value.

@return [Integer]

# File lib/rcgtk/value.rb, line 1084
def alignment
        Bindings.get_alignment(@ptr)
end
alignment=(bytes) click to toggle source

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
declaration?() click to toggle source

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
externally_initialized=(bool) click to toggle source

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
externally_initialized?() click to toggle source

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
global_constant=(flag) click to toggle source

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
global_constant?() click to toggle source

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
initializer() click to toggle source

Get this value’s initializer.

@return [Value]

# File lib/rcgtk/value.rb, line 1139
def initializer
        Value.new(Bindings.get_initializer(@ptr))
end
initializer=(val) click to toggle source

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
linkage() click to toggle source

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
linkage=(linkage) click to toggle source

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
section() click to toggle source

Get this value’s section string.

@return [String]

# File lib/rcgtk/value.rb, line 1175
def section
        Bindings.get_section(@ptr)
end
section=(section) click to toggle source

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
thread_local_mode() click to toggle source

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
thread_local_mode=(mode) click to toggle source

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
visibility() click to toggle source

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
visibility=(vis) click to toggle source

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