## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Glib

- Goto spec source

# Description

    package Glib is

This package provides definitions for the basic types used in Glib, Cairo, Gdk and Gtk.

# Packages

### C (renames C)

    package C renames Interfaces.C;

# Types

### Gshort

- Goto declaration in source

    type Gshort is new C.short;

### Glong

- Goto declaration in source

    type Glong  is new C.long;

### Gint

- Goto declaration in source

    type Gint   is new C.int;

### Gchar

- Goto declaration in source

    type Gchar  is new C.char;

### Gboolean

- Goto declaration in source

    type Gboolean is new Gint;

### Gushort

- Goto declaration in source

    type Gushort is new C.unsigned_short;

### Gulong

- Goto declaration in source

    type Gulong  is new C.unsigned_long;

### Guint

- Goto declaration in source

    type Guint   is new C.unsigned;

### Guchar

- Goto declaration in source

    type Guchar  is new C.unsigned_char;

### Gfloat

- Goto declaration in source

    type Gfloat  is new C.C_float;

### Gdouble

- Goto declaration in source

    type Gdouble is new C.double;

### Gint8

- Goto declaration in source

    type Gint8  is range -(2 ** 7) .. (2 ** 7 - 1);

### Gint16

- Goto declaration in source

    type Gint16 is range -(2 ** 15) .. (2 ** 15 - 1);

### Gint32

- Goto declaration in source

    type Gint32 is range -(2 ** 31) .. (2 ** 31 - 1);

### Gint64

- Goto declaration in source

    type Gint64 is range -(2 ** 63) .. (2 ** 63 - 1);

### Guint8

- Goto declaration in source

    type Guint8  is mod 2 ** 8;

### Guint16

- Goto declaration in source

    type Guint16 is mod 2 ** 16;

### Guint32

- Goto declaration in source

    type Guint32 is mod 2 ** 32;

### Guint64

- Goto declaration in source

    type Guint64 is mod 2 ** 64;

### Gsize

- Goto declaration in source

    type Gsize is new C.size_t;

### Gunichar

- Goto declaration in source

    type Gunichar is new Guint32;

### UTF8_String

- Goto declaration in source

    subtype UTF8_String is String;

A string that accepts only valid UTF8 sequences. Most Gtk+ function expect valid UTF8 strings instead of regular strings.

### GTime_Val

- Goto declaration in source

    type GTime_Val is record
          TV_Sec  : Glong;
          TV_Usec : Glong;
       end record;

### GTime_Val_Access

- Goto declaration in source

    type GTime_Val_Access is access all GTime_Val;

### Grange_Float

- Goto declaration in source

    subtype Grange_Float is Gdouble;

Needed for better compatibility between GtkAda 1.2 and 2.0

### Gcolor_Int

- Goto declaration in source

    subtype Gcolor_Int is Guint16;

Provided for better compatibility between GtkAda 1.2 and 2.0

### Allocation_Int

- Goto declaration in source

    subtype Allocation_Int is Gint;

Provided for better compatibility between GtkAda 1.2 and 2.0

### Gboolean_Array

- Goto declaration in source

    type Gboolean_Array is array (Natural range <>) of Gboolean;

### Gshort_Array

- Goto declaration in source

    type Gshort_Array   is array (Natural range <>) of Gshort;

### Glong_Array

- Goto declaration in source

    type Glong_Array    is array (Natural range <>) of Glong;

### Gint_Array

- Goto declaration in source

    type Gint_Array     is array (Natural range <>) of Gint;

### Guint_Array

- Goto declaration in source

    type Guint_Array    is array (Natural range <>) of Guint;

### Guint32_Array

- Goto declaration in source

    type Guint32_Array  is array (Natural range <>) of Guint32;

### Gushort_Array

- Goto declaration in source

    type Gushort_Array  is array (Natural range <>) of Gushort;

### Gulong_Array

- Goto declaration in source

    type Gulong_Array   is array (Natural range <>) of Gulong;

### Gfloat_Array

- Goto declaration in source

    type Gfloat_Array   is array (Natural range <>) of Gfloat;

### Guchar_Array

- Goto declaration in source

    type Guchar_Array   is array (Natural range <>) of Guchar;

### Gdouble_Array

- Goto declaration in source

    type Gdouble_Array  is array (Natural range <>) of Gdouble;

### Boolean_Array

- Goto declaration in source

    type Boolean_Array  is array (Natural range <>) of Boolean;

### Short_Array

- Goto declaration in source

    type Short_Array    is array (Natural range <>) of C.short;

### Long_Array

- Goto declaration in source

    type Long_Array     is array (Natural range <>) of C.long;

### Guchar_Array_Access

- Goto declaration in source

    type Guchar_Array_Access is access Guchar_Array;

### String_Ptr

- Goto declaration in source

    type String_Ptr is access all String;

### C_Dummy

- Goto declaration in source
- Goto full declaration in source

    type C_Dummy is limited private;

<doc_ignore>

### C_Proxy

- Goto declaration in source

    type C_Proxy is access all C_Dummy;

General proxy for C structures. This type is used instead of System.Address so that the variables are automatically initialized to 'null'. The value pointed to is irrelevant, and in fact should not be accessed. It has thus been made limited private with no subprogram to access it. C_Proxy is a public type so that one can compare directly the value of the variables with 'null'.

### G_Destroy_Notify_Address

- Goto declaration in source

    type G_Destroy_Notify_Address is
         access procedure (Data : System.Address);

### G_Destroy_Notify

- Goto declaration in source

    type G_Destroy_Notify is access procedure (Data : Glib.C_Proxy);

### GQuark

- Goto declaration in source

    type GQuark is new Guint32;

Represents a string internally in GtkAda. Once you know the equivalent for a string, you can always use it instead of the string, which provides a faster access for all the functions that use htables in GtkAda. There is a global htable that contains all the quarks defined in your application and GtkAda itself.

### Signal_Id

- Goto declaration in source

    type Signal_Id is private;

This uniquely identifies a connection widget<->signal.

### Signal_Name

- Goto declaration in source

    type Signal_Name is new String;

A signal name as used in connect, shared type between the Gtk and Glib layer.

### G_Connect_Flags

- Goto declaration in source

    type G_Connect_Flags is mod 2 ** C.int'Size;

### Property

- Goto declaration in source

    type Property (<>) is private;

### Param_Spec

- Goto declaration in source

    type Param_Spec is new Glib.C_Proxy;

### Param_Spec_Array

- Goto declaration in source

    type Param_Spec_Array is array (Natural range <>) of Param_Spec;

See Glib.Properties.Creation for more information on this type

### Param_Flags

- Goto declaration in source

    type Param_Flags is mod 2 ** 6;

### GType

- Goto declaration in source

    type GType is new Gsize;

This type describes an internal type in Glib. You shouldn't have to use it in your own applications, however it might be useful sometimes. Every object type is associated with a specific value, created dynamically at run time the first time you instantiate an object of that type (thus if you have never used e.g a Gtk_File_Selection, it won't have any GType associated with it). You can get the exact type value for each type by using the functions Get_Type provided in all the packages in GtkAda. You can get the specific value for an existing widget by using the function Glib.Object.Get_Type.

### GType_Class

- Goto declaration in source

    type GType_Class is private;

An opaque structure used as the base for all classes in glib and gtk+. See also Glib.Object.GObject_Class for a more useful child of this type.

### GType_Array

- Goto declaration in source

    type GType_Array is array (Guint range <>) of Glib.GType;

### Boxed_Copy

- Goto declaration in source

    type Boxed_Copy is access
          function (Boxed : System.Address) return System.Address;

### Boxed_Free

- Goto declaration in source

    type Boxed_Free is access procedure (Boxed : System.Address);

# Constants & Global variables

### Unknown_Quark

- Goto declaration in source

(GQuark)

    Unknown_Quark : constant GQuark := 0;

### Invalid_Signal_Id

- Goto declaration in source

(Signal_Id)

    Invalid_Signal_Id : constant Signal_Id;

### Null_Signal_Id

- Goto declaration in source

(Signal_Id)

    Null_Signal_Id : constant Signal_Id;

### G_Connect_After

- Goto declaration in source

(G_Connect_Flags)

    G_Connect_After   : constant G_Connect_Flags := 2 ** 0;

### G_Connect_Swapped

- Goto declaration in source

(G_Connect_Flags)

    G_Connect_Swapped : constant G_Connect_Flags := 2 ** 1;

Used to specify the behavior of a signal's connection.

### Param_Readable

- Goto declaration in source

(Param_Flags)

    Param_Readable       : constant Param_Flags := 2 ** 0;

### Param_Writable

- Goto declaration in source

(Param_Flags)

    Param_Writable       : constant Param_Flags := 2 ** 1;

### Param_Construct

- Goto declaration in source

(Param_Flags)

    Param_Construct      : constant Param_Flags := 2 ** 2;

### Param_Construct_Only

- Goto declaration in source

(Param_Flags)

    Param_Construct_Only : constant Param_Flags := 2 ** 3;

### Param_Lax_Validation

- Goto declaration in source

(Param_Flags)

    Param_Lax_Validation : constant Param_Flags := 2 ** 4;

### Param_Private

- Goto declaration in source

(Param_Flags)

    Param_Private        : constant Param_Flags := 2 ** 5;

These are the various flags that help define if, and when, a property can be read and modified.

### GType_Fundamental_Shift

- Goto declaration in source

(Integer)

    GType_Fundamental_Shift : constant Integer := 2;

### GType_Invalid

- Goto declaration in source

(GType)

    GType_Invalid   : constant GType := 0 * (2 ** GType_Fundamental_Shift);

### GType_None

- Goto declaration in source

(GType)

    GType_None      : constant GType := 1 * (2 ** GType_Fundamental_Shift);

### GType_Interface

- Goto declaration in source

(GType)

    GType_Interface : constant GType := 2 * (2 ** GType_Fundamental_Shift);

### GType_Char

- Goto declaration in source

(GType)

    GType_Char      : constant GType := 3 * (2 ** GType_Fundamental_Shift);

### GType_Uchar

- Goto declaration in source

(GType)

    GType_Uchar     : constant GType := 4 * (2 ** GType_Fundamental_Shift);

### GType_Boolean

- Goto declaration in source

(GType)

    GType_Boolean   : constant GType := 5 * (2 ** GType_Fundamental_Shift);

### GType_Int

- Goto declaration in source

(GType)

    GType_Int       : constant GType := 6 * (2 ** GType_Fundamental_Shift);

### GType_Uint

- Goto declaration in source

(GType)

    GType_Uint      : constant GType := 7 * (2 ** GType_Fundamental_Shift);

### GType_Long

- Goto declaration in source

(GType)

    GType_Long      : constant GType := 8 * (2 ** GType_Fundamental_Shift);

### GType_Ulong

- Goto declaration in source

(GType)

    GType_Ulong     : constant GType := 9 * (2 ** GType_Fundamental_Shift);

### GType_Int64

- Goto declaration in source

(GType)

    GType_Int64     : constant GType := 10 * (2 ** GType_Fundamental_Shift);

### GType_UInt64

- Goto declaration in source

(GType)

    GType_UInt64    : constant GType := 11 * (2 ** GType_Fundamental_Shift);

### GType_Enum

- Goto declaration in source

(GType)

    GType_Enum      : constant GType := 12 * (2 ** GType_Fundamental_Shift);

### GType_Flags

- Goto declaration in source

(GType)

    GType_Flags     : constant GType := 13 * (2 ** GType_Fundamental_Shift);

### GType_Float

- Goto declaration in source

(GType)

    GType_Float     : constant GType := 14 * (2 ** GType_Fundamental_Shift);

### GType_Double

- Goto declaration in source

(GType)

    GType_Double    : constant GType := 15 * (2 ** GType_Fundamental_Shift);

### GType_String

- Goto declaration in source

(GType)

    GType_String    : constant GType := 16 * (2 ** GType_Fundamental_Shift);

Null terminated string.

### GType_Pointer

- Goto declaration in source

(GType)

    GType_Pointer   : constant GType := 17 * (2 ** GType_Fundamental_Shift);

A general pointer type.

### GType_Param

- Goto declaration in source

(GType)

    GType_Param     : constant GType := 19 * (2 ** GType_Fundamental_Shift);

### GType_Object

- Goto declaration in source

(GType)

    GType_Object    : constant GType := 20 * (2 ** GType_Fundamental_Shift);

One of the widgets/objects

### GType_Boxed

- Goto declaration in source

(GType)

    GType_Boxed     : constant GType := 18 * (2 ** GType_Fundamental_Shift);

The base type for all boxed types. In tree models, you should use the actual type returned by Boxed_Type_Register_Static.

# Subprograms & Entries

### To_Boolean_Array

- Goto spec in source

    function To_Boolean_Array (A: Gboolean_Array) return Boolean_Array;

Convert a C-style boolean array into an Ada-style array.

### To_Gint

- Goto spec in source

    function To_Gint (Bool: Boolean) return Gint;

Convert an Ada boolean into a C int.

### Free

- Goto spec in source

    procedure Free is new Ada.Unchecked_Deallocation (Object => Guchar_Array, Name => Guchar_Array_Access);

<doc_ignore>

### Free

- Goto spec in source

    procedure Free is new Ada.Unchecked_Deallocation (Object => String, Name => String_Ptr);

</doc_ignore>

### To_Proxy

- Goto spec in source

    function To_Proxy is new Ada.Unchecked_Conversion (System.Address, C_Proxy);

### To_Address

- Goto spec in source

    function To_Address is new Ada.Unchecked_Conversion (C_Proxy, System.Address);

Converts from a System.Address returned by a C function to an internal C_Proxy.

### Quark_From_String

- Goto spec in source

    function Quark_From_String (Id: String) return GQuark;

Return, or create the quark associated with the string. Note that if the quark does not already exist, an entry is created for it in the global htable for quarks.

### Quark_Try_String

- Goto spec in source

    function Quark_Try_String (Id: String) return GQuark;

Return the quark associated with the string, if it exists. If it does not exist, return Unknown_Quark.

### Build

- Goto spec in source

    function Build (Name: String) return Property;

You should use this function only if you are creating new widgets, and their properties. Normal usage of properties doesn't require the use of this function. An ASCII.NUL character is automatically appended if necessary

### Property_Name

- Goto spec in source

    function Property_Name (Prop: Property) return String;

Return the name of the property. This name includes the trailing ASCII.Nul, and thus can be passed as is to C.

### Parent

- Goto spec in source
- Goto body in source

    function Parent (Typ: GType) return GType;

Return the parent type of Typ (eg if Typ is associated with a Gtk widget, it returns the typ of its parent).

### Fundamental

- Goto spec in source
- Goto body in source

    function Fundamental (Typ: GType) return GType;

Return the fundamental type for Type. In gtk+, the types are organized into several hierarchies, similar to what is done for widgets. All of these hierarchies are based on one of the fundamental types defined below. This function returns that fundamental type. For instance, each enumeration type in gtk+ has its own GType. However, Fundamental will return GType_Enum in all of these cases.

### Type_Name

- Goto spec in source

    function Type_Name (Type_Num: GType) return String;

Return the name of the type (enumeration,...) associated with Typ. If Fundamental (Typ) return GType_Enum, this returns the name of the enumeration type that Typ represents. This might be useful in debug messages.

### Type_From_Name

- Goto spec in source

    function Type_From_Name (Name: String) return GType;

Convert a string to the matching type. Name should be the C GObject name rather than the Ada name: thus, use names such as GtkScrollbar or GtkButton for widgets.

### Get_Qdata

- Goto spec in source
- Goto body in source

    function Get_Qdata (Typ: GType;Quark: GQuark) return Glib.C_Proxy;

Return the user data set for Typ

### Set_Qdata

- Goto spec in source
- Goto body in source

    procedure Set_Qdata (Typ: GType;Quark: GQuark;Data: Glib.C_Proxy);

Associate some named data with Typ.

### Boxed_Type_Register_Static

- Goto spec in source

    function Boxed_Type_Register_Static (Name: String;Copy: Boxed_Copy;Free: Boxed_Free) return GType;

Create a new boxed type