Description
This package provides a minimal binding to the
GObject type in
Glib.
See
Glib.Properties for information on how to manipulate properties
Types
-
type GObject is access all GObject_Record'Class;
-
type GObject_Class is new GType_Class;
-
type GObject_Record is tagged private;
-
type Interface_Vtable is private;
-
type Signal_Id_Array is array (Guint range <>) of Glib.Signal_Id;
-
type Signal_Parameter_Types is
array (Natural range <>, Natural range <>) of GType;
-
type Signal_Query is private;
-
type Weak_Notify is access procedure
(Data : System.Address;
Where_The_Object_Was : System.Address);
-
type verification is made to check if you are using the correct
-- matching Get function. This is your own responsability.
--
-- We recommend using this package only if you want your data to be
-- available from your own C code. If you just want to access it from Ada,
-- you should consider creating a new tagged type instead, that extends
-- either GObject_Record or the specific widget type you need.
--
end User_Data;
Subprograms
-
function Is_Created (Object : in GObject_Record'Class) return Boolean;
-
function Get_Type (Object : access GObject_Record) return GType;
Life cycle
-
procedure G_New (Object : out GObject);
-
procedure Initialize (Object : access GObject_Record'Class);
-
procedure Ref (Object : access GObject_Record);
-
procedure Unref (Object : access GObject_Record);
-
procedure Weak_Ref
(Object : access GObject_Record'Class;
Notify : Weak_Notify;
Data : System.Address := System.Null_Address);
-
procedure Weak_Unref
(Object : access GObject_Record'Class;
Notify : Weak_Notify;
Data : System.Address := System.Null_Address);
-
procedure Deallocate (Object : access GObject_Record);
Interfacing with C
The following functions are made public so that one can easily create
new objects outside the
Glib or
Gtk package hierarchy.
Only experienced users should make use of these functions.
-
function Get_Object
(Object : access GObject_Record'Class) return System.Address;
-
procedure Set_Object
(Object : access GObject_Record'Class;
Value : System.Address);
-
function Get_User_Data
(Obj : System.Address;
Stub : GObject_Record'Class) return GObject;
-
function Get_User_Data_Fast
(Obj : System.Address;
Stub : GObject_Record'Class) return GObject;
-
function Unchecked_Cast
(Obj : access GObject_Record'Class;
Stub : GObject_Record'Class) return GObject;
Signals
Any child of
GObject can be associated with any number of signals. The
mechanism for signals is fully generic, and any number of arguments can
be associated with signals.
See the function
Initialize_Class_Record for more information on how
to create new signals for your own new widgets.
The subprograms below are provided for introspection: they make it
possible to query the list of signals defined for a specific widget,
as well as their parameters and return types.
??? This section is incomplete.
-
-
function List_Ids (Typ :
Glib.GType)
return Signal_Id_Array;
-
-
-
function Signal_Name (Q : Signal_Query) return String;
-
function Return_Type (Q : Signal_Query)
return Glib.GType;
-
function Params (Q : Signal_Query) return GType_Array;
Creating new widgets
These types and functions are used only when creating new widget types
directly in Ada. These functions initialize the classes so that they are
correctly recognized by gtk+ itself
See the GtkAda user's guide for more information on how to create your
own widget types in Ada.
-
procedure Initialize_Class_Record
(Object :
access GObject_Record'Class;
Signals :
Gtkada.Types.Chars_Ptr_Array;
Class_Record :
in out GObject_Class;
Type_Name : String;
Parameters : Signal_Parameter_Types := Null_Parameter_Types);
-
function Type_From_Class (Class_Record : GObject_Class) return GType;
Properties introspection
See
glib.ads for more information on properties
-
-
Signals
Any child of
GObject can be associated with any number of signals. The
mechanism for signals is fully generic, and any number of arguments can
be associated with signals.
See the function
Initialize_Class_Record for more information on how
to create new signals for your own new widgets.
The subprograms below are provided for introspection: they make it
possible to query the list of signals defined for a specific widget,
as well as their parameters and return types.
??? This section is incomplete.
-
procedure Notify
(Object : access GObject_Record;
Property_Name : String);
Lists
-
function Convert (W : GObject) return System.Address;
function Convert (W : System.Address) return GObject;