Glib.Properties.Creation

Entities

Simple Types

Access Types

Subprograms

Description

subtype Param_Spec is Glib.Param_Spec;

Cset_First

function Cset_First (Param : Param_Spec_String) return String
Parameters
Param
Return Value

Cset_Nth

function Cset_Nth (Param : Param_Spec_String) return String
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Boolean) return Boolean
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Char) return Glib.Gint8
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Double) return Gdouble
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Enum) return Glib.Gint

See Glib.Properties.Creation.Register_Static_Enum on how to create Enum_Type

Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Flags) return Glong
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Float) return Gfloat
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Int) return Glib.Gint
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Long) return Glib.Glong
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_String) return String
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Uchar) return Glib.Guint8
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Uint) return Glib.Guint
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Ulong) return Glib.Gulong
Parameters
Param
Return Value

Default

function Default (Param : Param_Spec_Unichar) return Gunichar
Parameters
Param
Return Value

Description

function Description (Param : Param_Spec) return String

Return the description (ie the help string) for Param

Parameters
Param
Return Value

Ensure_Non_Null

function Ensure_Non_Null (Param : Param_Spec_String) return Boolean
Parameters
Param
Return Value

Enum_Class

type Enum_Class is new Glib.C_Proxy;

Enum_Class_From_Type

function Enum_Class_From_Type (Typ : Glib.GType) return Enum_Class

Return the enumeration class corresponding to a type

Parameters
Typ
Return Value

Enum_Value

type Enum_Value is new Glib.C_Proxy;

Enumeration

function Enumeration (Param : Param_Spec_Enum) return Enum_Class

See Glib.Properties.Creation.Register_Static_Enum on how to create Enum_Type

Parameters
Param
Return Value

Epsilon

function Epsilon (Param : Param_Spec_Double) return Gdouble
Parameters
Param
Return Value

Epsilon

function Epsilon (Param : Param_Spec_Float) return Gfloat
Parameters
Param
Return Value

Flags

function Flags (Param : Param_Spec) return Param_Flags

Return the flags for the property

Parameters
Param
Return Value

Flags_Class

type Flags_Class is new Glib.C_Proxy;

Flags_Enumeration

function Flags_Enumeration (Param : Param_Spec_Flags) return Flags_Class
Parameters
Param
Return Value

Flags_Int_Value

type Flags_Int_Value is mod Glib.Gint'Last;

Flags_Value

type Flags_Value is new Glib.C_Proxy;

Get_Property_Handler

type Get_Property_Handler is access procedure
  (Object        : access Glib.Object.GObject_Record'Class;
   Prop_Id       : Property_Id;
   Value         : out Glib.Values.GValue;
   Property_Spec : Param_Spec);

This handler is called when the application needs to retrive the value of a property. You should set the value in Value

Parameters
Object
Prop_Id
Value
Property_Spec

Get_Qdata

function Get_Qdata (Param : Param_Spec; Quark : GQuark) return Glib.C_Proxy

Return the user data set for Param

Parameters
Param
Quark
Return Value

Get_Value

function Get_Value (Klass : Enum_Class; Value : Glib.Gint)
   return Enum_Value

Return the value in Klass that is Value (equivalent of 'Val in Ada)

Parameters
Klass
Value
Return Value

Gnew_Boolean

function Gnew_Boolean
  (Name, Nick, Blurb : String;
   Default           : Boolean;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Default
Flags
Return Value

Gnew_Boxed

function Gnew_Boxed
  (Name, Nick, Blurb : String;
   Boxed_Type        : Glib.GType;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Boxed_Type
Flags
Return Value

Gnew_Char

function Gnew_Char
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Gint8;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Double

function Gnew_Double
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Gdouble;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Enum

function Gnew_Enum
  (Name, Nick, Blurb : String;
   Enum_Type         : GType;
   Default           : Gint := 0;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec

See Glib.Properties.Creation.Register_Static_Enum on how to create Enum_Type

Parameters
Name
Nick
Blurb
Enum_Type
Default
Flags
Return Value

Gnew_Flags

function Gnew_Flags
  (Name, Nick, Blurb : String;
   Flags_Type        : Glib.GType;
   Default           : Guint;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Flags_Type
Default
Flags
Return Value

Gnew_Float

function Gnew_Float
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Gfloat;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Int

function Gnew_Int
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Gint;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Long

function Gnew_Long
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Glong;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Object

function Gnew_Object
  (Name, Nick, Blurb : String;
   Object_Type       : Glib.GType;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Object_Type
Flags
Return Value

Gnew_Param

function Gnew_Param
  (Name, Nick, Blurb : String;
   Param_Type        : Glib.GType;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Param_Type
Flags
Return Value

Gnew_Pointer

function Gnew_Pointer
  (Name, Nick, Blurb : String;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Flags
Return Value

Gnew_String

function Gnew_String
  (Name, Nick, Blurb : String;
   Default           : String;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Default
Flags
Return Value

Gnew_Uchar

function Gnew_Uchar
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Guint8;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Uint

function Gnew_Uint
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Guint;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Ulong

function Gnew_Ulong
  (Name, Nick, Blurb         : String;
   Minimum, Maximum, Default : Glib.Gulong;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Minimum
Maximum
Default
Flags
Return Value

Gnew_Unichar

function Gnew_Unichar
  (Name, Nick, Blurb : String;
   Default           : Gunichar;
   Flags : Param_Flags := Param_Readable or Param_Writable)
   return Param_Spec
Parameters
Name
Nick
Blurb
Default
Flags
Return Value

Install_Property

procedure Install_Property
  (Class_Record  : Glib.Object.GObject_Class;
   Prop_Id       : Property_Id;
   Property_Spec : Param_Spec)

Adds a new property to Class_Record. You should use this function only on class records you have created yourself, not on one of the standard widgets. Prop_Id is the internal representation for properties, that will be passed to the Set_Property and Get_Property_Handlers (see above) to set and retrieve the value of a property. Property_Spec should be the result of one of the GNew_* subprograms for Param_Spec, and this defines the type of the property.

You must have called Set_Properties_Handler first.

Parameters
Class_Record
Prop_Id
Property_Spec

Maximum

function Maximum (Param : Param_Spec_Char) return Glib.Gint8
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Double) return Gdouble
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Float) return Gfloat
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Int) return Glib.Gint
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Long) return Glib.Glong
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Uchar) return Glib.Guint8
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Uint) return Glib.Guint
Parameters
Param
Return Value

Maximum

function Maximum (Param : Param_Spec_Ulong) return Glib.Gulong
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Char) return Glib.Gint8
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Double) return Gdouble
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Float) return Gfloat
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Int) return Glib.Gint
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Long) return Glib.Glong
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Uchar) return Glib.Guint8
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Uint) return Glib.Guint
Parameters
Param
Return Value

Minimum

function Minimum (Param : Param_Spec_Ulong) return Glib.Gulong
Parameters
Param
Return Value

Name

function Name (Val : Enum_Value) return String

Return the name of Val. This is the equivalent of 'Image in Ada.

Parameters
Val
Return Value

Name

function Name (Val : Flags_Value) return String

Return the name of Val. This is the equivalent of 'Image in Ada.

Parameters
Val
Return Value

Nick

function Nick (Val : Enum_Value) return String

Return a displayable string for Val.

Parameters
Val
Return Value

Nick

function Nick (Val : Flags_Value) return String

Return a displayable string for Val.

Parameters
Val
Return Value

Nick_Name

function Nick_Name (Param : Param_Spec) return String

Return the nickname of the property. This is a string that can be displayed to represent the property, and is more user-friendly than the result of Name.

Parameters
Param
Return Value

Nth_Value

function Nth_Value (Klass : Enum_Class; Nth : Glib.Guint) return Enum_Value

Return the Nth-th value in Klass, or null if there is no such value.

Parameters
Klass
Nth
Return Value

Nth_Value

function Nth_Value (Klass : Flags_Class; Nth : Glib.Guint)
   return Flags_Value

Return the Nth-th value in Klass, or null if there is no such value.

Parameters
Klass
Nth
Return Value

Override_Property

procedure Override_Property
  (Class_Record  : Glib.Object.GObject_Class;
   Prop_Id       : Property_Id;
   Name          : String)

Overrides an existing property (inherited from the parent type or from one of the interfaces that are implemented). You must have called Set_Properties_Handler first.

Parameters
Class_Record
Prop_Id
Name

Owner_Type

function Owner_Type (Param : Param_Spec) return Glib.GType

The type that defined Param. If you look for instance at all properties provides by a type, they will also include properties provided by the parents of the type. This function can be used to find those declared with that type only

Parameters
Param
Return Value

Param_Spec_Boolean

type Param_Spec_Boolean is new Param_Spec;

Param_Spec_Boxed

type Param_Spec_Boxed is new Param_Spec;

Param_Spec_Char

type Param_Spec_Char is new Param_Spec;

Param_Spec_Double

type Param_Spec_Double is new Param_Spec;

Param_Spec_Enum

type Param_Spec_Enum is new Param_Spec;

See Glib.Properties.Creation.Register_Static_Enum on how to create Enum_Type

Param_Spec_Flags

type Param_Spec_Flags is new Param_Spec;

Param_Spec_Float

type Param_Spec_Float is new Param_Spec;

Param_Spec_Int

type Param_Spec_Int is new Param_Spec;

Param_Spec_Long

type Param_Spec_Long is new Param_Spec;

Param_Spec_Object

type Param_Spec_Object is new Param_Spec;

Param_Spec_Param

type Param_Spec_Param is new Param_Spec;

Param_Spec_Pointer

type Param_Spec_Pointer is new Param_Spec;

Param_Spec_String

type Param_Spec_String is new Param_Spec;

Param_Spec_Uchar

type Param_Spec_Uchar is new Param_Spec;

Param_Spec_Uint

type Param_Spec_Uint is new Param_Spec;

Param_Spec_Ulong

type Param_Spec_Ulong is new Param_Spec;

Param_Spec_Unichar

type Param_Spec_Unichar is new Param_Spec;

Property_Id

type Property_Id is new Guint;

Pspec_Name

function Pspec_Name (Param : Param_Spec) return String

Return the name of the property. This is the internal string representing the property. It Should probably not be displayed on

Parameters
Param
Return Value

Register_Static_Enum

function Register_Static_Enum
  (Name   : String;
   Values : Gtkada.Types.Chars_Ptr_Array) return Glib.GType

Create a new enumeration class from a list of valid values. Values must be freed by the caller.

Parameters
Name
Values
Return Value

Set_Properties_Handlers

procedure Set_Properties_Handlers
  (Class_Record : Glib.Object.GObject_Class;
   Set_Property : not null Set_Property_Handler;
   Get_Property : not null Get_Property_Handler)

Set the two functions used to set and retrieve properties. You should never call this function on the class record of the standard gtk+ widgets, since this will break their behavior. You should first create a new class record through Initialize_Class_Record, and then use the returned Class_Record as a parameter to this subprogram.

You cannot pass null to either of the two parameters, or you won't be able to install new properties afterwards

Parameters
Class_Record
Set_Property
Get_Property

Set_Property_Handler

type Set_Property_Handler is access procedure
  (Object        : access Glib.Object.GObject_Record'Class;
   Prop_Id       : Property_Id;
   Value         : Glib.Values.GValue;
   Property_Spec : Param_Spec);

This handler is called every time the user has asked for a new property to be changed. Prop_Id is the id you used when creating the property. Value is the new value that should be set. It is your responsability to extract the actual value from it. However, consistency has already been checked by gtk+, so we know the type is correct. Property_Spec is the definition of the property.

Note: It is your responsability to emit the "notify" signal after a property has been modified. The recommended way is to emit this signal from the internal function that actually modified the property, not directly from the Set_Propert_Handler itself. This will ensure that even if the user doesn't modify the attribute through a property but directly by calling the lower-level subprogram, the signal will still be emitted.

Parameters
Object
Prop_Id
Value
Property_Spec

Set_Qdata

procedure Set_Qdata
  (Param   : Param_Spec;
   Quark   : GQuark;
   Data    : Glib.C_Proxy;
   Destroy : G_Destroy_Notify := null)

Associate some named data with Param. Destroy is called when Param is destroyed.

Parameters
Param
Quark
Data
Destroy

Set_Value_Type

procedure Set_Value_Type (Param : Param_Spec; Typ : Glib.GType)

Override the type of param. You should only use this function when creating new Param_Spec types based on existing types. You should not change the type if you haven't created param yourself.

Parameters
Param
Typ

Substitutor

function Substitutor (Param : Param_Spec_String) return Character
Parameters
Param
Return Value

Unref

procedure Unref (Param : Param_Spec)

Decrement the reference counter. If it reaches 0, the memory is freed.

Parameters
Param

Value

function Value (Val : Enum_Value) return Glib.Gint

Return the numeric value for a specific enumeration. Use the matching Ada type and 'Val to convert it to a valid Ada enumeration

Parameters
Val
Return Value

Value

function Value (Val : Flags_Value) return Flags_Int_Value

Return the numeric value for a specific enumeration. Use the matching Ada type and 'Val to convert it to a valid Ada enumeration

Parameters
Val
Return Value

Value_Type

function Value_Type (Param : Param_Spec) return Glib.GType

Return the type of param

Parameters
Param
Return Value