This file is indexed.

/usr/share/ada/adainclude/gtkada/glib-properties.adb is in libgtkada2.24.1-dev 2.24.1-14.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
-----------------------------------------------------------------------
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
--                                                                   --
--                Copyright (C) 2001-2006 AdaCore                    --
--                                                                   --
-- This library is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This library is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this library; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------

with Glib.Object; use Glib.Object;
with Glib.Values; use Glib.Values;

package body Glib.Properties is

   procedure Get
     (Object : System.Address; Name : Glib.Property; Value : in out GValue);
   procedure Get
     (Object : System.Address; Name : String; Value : in out GValue);
   pragma Import (C, Get, "g_object_get_property");
   --  Internal function to get the properties

   procedure Set
     (Object : System.Address; Name : String; Value : in out GValue);
   pragma Import (C, Set, "g_object_set_property");
   --  Internal function to set the properties

   ------------------
   -- Get_Property --
   ------------------

   procedure Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : String;
      Value  : in out Glib.Values.GValue)
   is
   begin
      Get (Get_Object (Object), Name & ASCII.NUL, Value);
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : String;
      Value  : in out Glib.Values.GValue)
   is
   begin
      Set (Get_Object (Object), Name & ASCII.NUL, Value);
   end Set_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access GObject_Record'Class;
      Name   : Property_String_WO;
      Value  : String)
   is
      procedure Internal
        (Object : System.Address;
         Name   : Property;
         Value  : String);
      pragma Import (C, Internal, "ada_g_object_set_string");
   begin
      Internal (Get_Object (Object), Property (Name), Value & ASCII.NUL);
   end Set_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access GObject_Record'Class;
      Name   : Property_String;
      Value  : String) is
   begin
      Set_Property (Object, Property_String_WO (Name), Value);
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_String_RO) return String
   is
      Value : GValue;
   begin
      Init (Value, GType_String);
      Get (Get_Object (Object), Property (Name), Value);
      declare
         S : constant String := Get_String (Value);
      begin
         Unset (Value);
         return S;
      end;
   end Get_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_String) return String is
   begin
      return Get_Property (Object, Property_String_RO (Name));
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Boolean;
      Value  : Boolean)
   is
      procedure Internal
        (Object : System.Address;
         Name   : Property;
         Value  : Gint);
      pragma Import (C, Internal, "ada_g_object_set_int");

   begin
      Internal (Get_Object (Object), Property (Name), Boolean'Pos (Value));
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name : Property_Boolean) return Boolean
   is
      Value : GValue;
      B : Boolean;
   begin
      Init (Value, GType_Boolean);
      Get (Get_Object (Object), Property (Name), Value);
      B := Get_Boolean (Value);
      Unset (Value);
      return B;
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Object;
      Value  : access Glib.Object.GObject_Record'Class) is
   begin
      Set_Property (Object, Property_Address (Name), Get_Object (Value));
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name : Property_Object) return Glib.Object.GObject
   is
      Value : GValue;
      Addr  : System.Address;
      Stub  : GObject_Record;
   begin
      Init (Value, GType_Object);
      Get (Get_Object (Object), Property (Name), Value);
      Addr := Get_Address (Value);
      Unset (Value);
      return Get_User_Data (Addr, Stub);
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Object_WO;
      Value  : access Glib.Object.GObject_Record'Class) is
   begin
      Set_Property (Object, Property_Address (Name), Get_Object (Value));
   end Set_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Address;
      Value  : System.Address)
   is
      procedure Internal
        (Object : System.Address;
         Name   : Property;
         Value  : System.Address);
      pragma Import (C, Internal, "ada_g_object_set_ptr");

   begin
      Internal (Get_Object (Object), Property (Name), Value);
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name : Property_Address) return System.Address
   is
      Value : GValue;
      A     : System.Address;
   begin
      Init (Value, GType_Pointer);
      Get (Get_Object (Object), Property (Name), Value);
      A := Get_Address (Value);
      Unset (Value);
      return A;
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Float;
      Value  : Gfloat)
   is
      procedure Internal
        (Object : System.Address;
         Name   : Property;
         Value  : Gfloat);
      pragma Import (C, Internal, "ada_g_object_set_float");

   begin
      Internal (Get_Object (Object), Property (Name), Value);
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Float) return Gfloat
   is
      Value : GValue;
      A     : Gfloat;
   begin
      Init (Value, GType_Float);
      Get (Get_Object (Object), Property (Name), Value);
      A := Get_Float (Value);
      Unset (Value);
      return A;
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_Double;
      Value  : Gdouble)
   is
      procedure Internal
        (Object : System.Address;
         Name   : Property;
         Value  : Gdouble);
      pragma Import (C, Internal, "ada_g_object_set_double");
   begin
      Internal (Get_Object (Object), Property (Name), Value);
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name : Property_Double) return Gdouble
   is
      Value : GValue;
      A     : Gdouble;
   begin
      Init (Value, GType_Double);
      Get (Get_Object (Object), Property (Name), Value);
      A := Get_Double (Value);
      Unset (Value);
      return A;
   end Get_Property;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name   : Property_C_Proxy;
      Value  : C_Proxy)
   is
      procedure Internal
        (Object : System.Address;
         Name   : Property;
         Value  : C_Proxy);
      pragma Import (C, Internal, "ada_g_object_set_ptr");
   begin
      Internal (Get_Object (Object), Property (Name), Value);
   end Set_Property;

   ------------------
   -- Get_Property --
   ------------------

   function Get_Property
     (Object : access Glib.Object.GObject_Record'Class;
      Name : Property_C_Proxy) return C_Proxy
   is
      Value : GValue;
      A     : C_Proxy;
   begin
      Init (Value, GType_Object);
      Get (Get_Object (Object), Property (Name), Value);
      A := Get_Proxy (Value);
      Unset (Value);
      return A;
   end Get_Property;

end Glib.Properties;