## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Values

- Goto spec source

# Description

    package Glib.Values is

This package provides an interface to generic values as used in the Glib object model.

The main type in this package is GValues, which is the equivalent of the C's (GValue*) array, i.e an array of unions. This package provides functions to extract the values from this type.

Binding from C File version 1.3.15

# Types

### GValue

- Goto declaration in source
- Goto full declaration in source

    type GValue is private;

A generic value that can hold any of the types as provided in the Set and Get functions below.

### GValues

- Goto declaration in source
- Goto full declaration in source

    type GValues is private;

This type represents a table of values. Each argument of the table can be of any type. The index of the first element is always 1.

### GValue_Array

- Goto declaration in source

    type GValue_Array is array (Gint range <>) of GValue;

# Subprograms & Entries

### Make_Values

- Goto spec in source

    function Make_Values (Nb: Guint) return GValues;

Create a new GValues structure from scratch. This procedure causes the allocation of an underlying C array, and this memory should be deallocated after use using procedure Free (see below).

### Make_Values

- Goto spec in source

    function Make_Values (Nb: Guint;Val: System.Address) return GValues;

Build a GValues structure from the given C array. Nb should be the number of elements in the Values array.

### Free

- Goto spec in source

    procedure Free (Val: in out GValues);

Deallocate the memory associated with the given Values array.

### Nth

- Goto spec in source

    function Nth (Val: GValues;Num: Guint) return GValue;

Return the Num-th element from Values.

### Init

- Goto spec in source

    procedure Init (Value: in out GValue;G_Type: Glib.GType);

Set the type of Value to G_Type. This limits the operations you can then apply to Value. For instance, Value must have been initialized with a GType_Int before you can use Set_Int (see below). Note that for enumeration types, you shouldn't use GType_Enum, but rather the exact GType corresponding to the enumeration. If you need to store a reference-counted type in a GValue, it is recommanded that you use a type derived from Boxed (see Set_Boxed below)

### Unset

- Goto spec in source
- Goto body in source

    procedure Unset (Value: in out GValue);

Frees the memory allocate for Value (like strings contents) in the call to Init. You only need to call this function in cases where you have called Init yourself.

### Set_Char

- Goto spec in source
- Goto body in source

    procedure Set_Char (Value: in out GValue;V_Char: Gchar);

### Get_Char

- Goto spec in source
- Goto body in source

    function  Get_Char (Value: GValue) return Gchar;

### Set_Uchar

- Goto spec in source
- Goto body in source

    procedure Set_Uchar (Value: in out GValue;V_Uchar: Guchar);

### Get_Uchar

- Goto spec in source
- Goto body in source

    function  Get_Uchar (Value: GValue) return Guchar;

### Set_Boolean

- Goto spec in source

    procedure Set_Boolean (Value: in out GValue;V_Boolean: Boolean);

### Get_Boolean

- Goto spec in source

    function  Get_Boolean (Value: GValue) return Boolean;

### Set_Int

- Goto spec in source
- Goto body in source

    procedure Set_Int (Value: in out GValue;V_Int: Gint);

### Get_Int

- Goto spec in source
- Goto body in source

    function  Get_Int (Value: GValue) return Gint;

### Set_Uint

- Goto spec in source
- Goto body in source

    procedure Set_Uint (Value: in out GValue;V_Uint: Guint);

### Get_Uint

- Goto spec in source
- Goto body in source

    function  Get_Uint (Value: GValue) return Guint;

### Set_Long

- Goto spec in source
- Goto body in source

    procedure Set_Long (Value: in out GValue;V_Long: Glong);

### Get_Long

- Goto spec in source
- Goto body in source

    function  Get_Long (Value: GValue) return Glong;

### Set_Ulong

- Goto spec in source
- Goto body in source

    procedure Set_Ulong (Value: in out GValue;V_Ulong: Gulong);

### Get_Ulong

- Goto spec in source
- Goto body in source

    function  Get_Ulong (Value: GValue) return Gulong;

### Set_Float

- Goto spec in source
- Goto body in source

    procedure Set_Float (Value: in out GValue;V_Float: Gfloat);

### Get_Float

- Goto spec in source
- Goto body in source

    function  Get_Float (Value: GValue) return Gfloat;

### Set_Double

- Goto spec in source
- Goto body in source

    procedure Set_Double (Value: in out GValue;V_Double: Gdouble);

### Get_Double

- Goto spec in source
- Goto body in source

    function  Get_Double (Value: GValue) return Gdouble;

### Set_String

- Goto spec in source

    procedure Set_String (Value: in out GValue;V_String: String);

### Get_String

- Goto spec in source

    function  Get_String (Value: GValue) return String;

### Get_String

- Goto spec in source

    function  Get_String (Value: GValue;Length: Gint) return String;

### Get_Chars

- Goto spec in source
- Goto body in source

    function  Get_Chars (Value: GValue) return Interfaces.C.Strings.chars_ptr;

### Set_Proxy

- Goto spec in source
- Goto body in source

    procedure Set_Proxy (Value: in out GValue;V_Proxy: C_Proxy);

### Get_Proxy

- Goto spec in source
- Goto body in source

    function  Get_Proxy (Value: GValue) return C_Proxy;

### Set_Address

- Goto spec in source
- Goto body in source

    procedure Set_Address (Value: in out GValue;V_Address: System.Address);

### Get_Address

- Goto spec in source
- Goto body in source

    function  Get_Address (Value: GValue) return System.Address;

### Set_Boxed

- Goto spec in source
- Goto body in source

    procedure Set_Boxed (Value: in out GValue;V_Address: System.Address);

### Get_Boxed

- Goto spec in source
- Goto body in source

    function  Get_Boxed (Value: GValue) return System.Address;

This is similar to Set_Address and Get_Address, except that the boxed type might have been associated with some specific initialization and finalization functions through Glib.Boxed_Type_Register_Static For instance: declare Typ : Glib.GType; Value : GValue; function To_Ref_Counted_Value is new Ada.Unchecked_Conversion (System.Address, My_Ref_Counted_Type); begin Typ := Boxed_Typed_Register_Static ("FOO", Copy'Access, Free'Access); Init (Value, Typ); Set_Boxed (Value, my_ref_counted_value.all'address); Val := To_Ref_Counted_Value (Get_Boxed (Value)); Unset (Value); end; See also Glib.Generic_Properties.Generic_Internal_Boxed_Property.

### Set_Enum

- Goto spec in source
- Goto body in source

    procedure Set_Enum (Value: in out GValue;V_Enum: Gint);

### Get_Enum

- Goto spec in source
- Goto body in source

    function Get_Enum (Value: GValue) return Glib.Gint;

These are used to manipulate the standard GtkAda enumeration types. For types that you have redefined yourself, you have access to more suitable functions directly in the package Generic_Enumeration_Property.

### Set_Flags

- Goto spec in source
- Goto body in source

    procedure Set_Flags (Value: in out GValue;V_Enum: Guint);

### Get_Flags

- Goto spec in source
- Goto body in source

    function Get_Flags (Value: GValue) return Glib.Guint;

??? Should really manipulate Glib.Properties.Creation.Flags_Int_Value

### Set_Object

- Goto spec in source

    procedure Set_Object (Value: in out GValue;To: Glib.Object.GObject);

### Get_Object

- Goto spec in source

    function Get_Object (Value: GValue) return Glib.Object.GObject;

These are used to manipulate GObject instances.