type Gaction is new Glib.Types.GType_Interface;
Enabled_Property : constant Glib.Properties.Property_Boolean;
Name_Property : constant Glib.Properties.Property_String;
Parameter_Type_Property : constant Glib.Properties.Property_Boxed;
State_Property : constant Glib.Properties.Property_Object;
State_Type_Property : constant Glib.Properties.Property_Boxed;
function Get_Type return Glib.GType;
procedure Activate
( | Self | : Gaction; |
Parameter | : Glib.Variant.Gvariant); |
procedure Change_State
( | Self | : Gaction; |
Value | : Glib.Variant.Gvariant); |
function Get_Enabled
( | Self | : Gaction) return Boolean; |
function Get_Name
( | Self | : Gaction) return UTF8_String; |
function Get_Parameter_Type
( | Self | : Gaction) return Glib.Variant.Gvariant_Type; |
function Get_State
( | Self | : Gaction) return Glib.Variant.Gvariant; |
function Get_State_Hint
( | Self | : Gaction) return Glib.Variant.Gvariant; |
function Get_State_Type
( | Self | : Gaction) return Glib.Variant.Gvariant_Type; |
Glib.Action.Gaction represents a single named action.
The main interface to an action is that it can be activated with Glib.Action.Activate. This results in the 'activate' signal being emitted.
An activation has a Glib.Variant.Gvariant parameter (which may be null).
The correct type for the parameter is determined by a static parameter type (which is given at construction time).
An action may optionally have a state, in which case the state may be set with Glib.Action.Change_State. This call takes a Glib.Variant.Gvariant. The correct type for the state is determined by a static state type (which is given at construction time).
The state may have a hint associated with it, specifying its valid range.
Glib.Action.Gaction is merely the interface to the concept of an action, as described above. Various implementations of actions exist, including Glib.Simple_Action.Gsimple_Action and Gtk.Action.Gtk_Action.
In all cases, the implementing class is responsible for storing the name of the action, the parameter type, the enabled state, the optional state type and the state and emitting the appropriate signals when these change.
The implementor responsible for filtering calls to Glib.Action.Activate and Glib.Action.Change_State for type safety and for the state being enabled.
Probably the only useful thing to do with a Glib.Action.Gaction is to put it inside of a Glib.Simple_Action_Group.Gsimple_Action_Group.