~ubuntu-branches/ubuntu/intrepid/libgtkada2/intrepid

« back to all changes in this revision

Viewing changes to src/glib-types.adb

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-08-11 09:46:51 UTC
  • mfrom: (6.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20080811094651-9mjd6acwa98ffw5c
Tags: 2.12.0-2ubuntu1
Add lpia to supported architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
--                                                                   --
21
21
-----------------------------------------------------------------------
22
22
 
23
 
with Glib.Object;  use Glib.Object;
24
 
with System;       use System;
 
23
with Gtkada.Bindings; use Gtkada.Bindings;
 
24
with Glib.Object;     use Glib.Object;
 
25
with System;          use System;
25
26
 
26
27
package body Glib.Types is
27
28
 
65
66
      return GObject (Get_User_Data (System.Address (Interf), Stub));
66
67
   end To_Object;
67
68
 
 
69
   ----------------
 
70
   -- Interfaces --
 
71
   ----------------
 
72
 
 
73
   function Interfaces (T : GType) return GType_Array is
 
74
      use GType_Arrays;
 
75
      function Internal
 
76
        (T        : GType;
 
77
         N_Ifaces : access Guint) return Unbounded_Array_Access;
 
78
      pragma Import (C, Internal, "g_type_interfaces");
 
79
 
 
80
      N      : aliased Guint;
 
81
      Output : constant Unbounded_Array_Access := Internal (T, N'Access);
 
82
      Result : constant GType_Array := To_Array (Output, N);
 
83
 
 
84
   begin
 
85
      --  Do says we should free, but doing so results in double deallocation
 
86
--      G_Free (Output);
 
87
      return Result;
 
88
   end Interfaces;
 
89
 
 
90
   ------------------
 
91
   -- Is_Interface --
 
92
   ------------------
 
93
 
 
94
   function Is_Interface (T : GType) return Boolean is
 
95
      function Internal (T : GType) return Gboolean;
 
96
      pragma Import (C, Internal, "ada_g_type_is_interface");
 
97
   begin
 
98
      return Boolean'Val (Internal (T));
 
99
   end Is_Interface;
 
100
 
 
101
   ----------
 
102
   -- Is_A --
 
103
   ----------
 
104
 
 
105
   function Is_A (T : GType; Is_A_Type : GType) return Boolean is
 
106
      function Internal (T1, T2 : GType) return Gboolean;
 
107
      pragma Import (C, Internal, "g_type_is_a");
 
108
   begin
 
109
      return Boolean'Val (Internal (T, Is_A_Type));
 
110
   end Is_A;
 
111
 
 
112
 
68
113
end Glib.Types;