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

« back to all changes in this revision

Viewing changes to src/gtk-rc.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:
2
2
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
3
3
--                                                                   --
4
4
--   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --
 
5
--                 Copyright (C) 2000-2008, AdaCore                  --
5
6
--                                                                   --
6
7
-- This library is free software; you can redistribute it and/or     --
7
8
-- modify it under the terms of the GNU General Public               --
21
21
--                                                                   --
22
22
-----------------------------------------------------------------------
23
23
 
 
24
with Gtkada.Bindings; use Gtkada.Bindings;
24
25
with System;
25
26
with Interfaces.C; use Interfaces.C;
26
27
with Interfaces.C.Strings;
27
28
with Gtk.Settings; use Gtk.Settings;
28
29
with Gtk.Widget; use Gtk.Widget;
29
30
 
 
31
with Glib.Type_Conversion_Hooks;
 
32
 
30
33
package body Gtk.Rc is
31
34
 
 
35
   package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
 
36
     (Get_Type'Access, Gtk_Rc_Style_Record);
 
37
   pragma Warnings (Off, Type_Conversion);
 
38
 
32
39
   -------------
33
40
   -- Gtk_New --
34
41
   -------------
93
100
   -----------------------
94
101
 
95
102
   function Get_Default_Files return Chars_Ptr_Array is
96
 
      type Flat_Chars_Ptr_Array is array (Positive) of Chars_Ptr;
97
 
      type Flat_Access is access all Flat_Chars_Ptr_Array;
98
 
 
99
 
      function Internal return Flat_Access;
 
103
      function Internal return chars_ptr_array_access;
100
104
      pragma Import (C, Internal, "gtk_rc_get_default_files");
101
105
 
102
 
      Addr : constant Flat_Access := Internal;
103
 
      Len  : Positive;
104
 
 
105
 
      use type Strings.chars_ptr;
106
 
 
 
106
      Addr : constant chars_ptr_array_access := Internal;
107
107
   begin
108
 
      Len := 1;
109
 
 
110
 
      loop
111
 
         exit when Addr (Len) = Null_Ptr;
112
 
         Len := Len + 1;
113
 
      end loop;
114
 
 
115
 
      declare
116
 
         Result : Chars_Ptr_Array (1 .. size_t (Len) - 1);
117
 
      begin
118
 
         for J in Result'Range loop
119
 
            Result (J) := Addr (Positive (J));
120
 
         end loop;
121
 
 
122
 
         return Result;
123
 
      end;
 
108
      --  Do not free Addr, since strings are shared with result
 
109
      return To_Chars_Ptr (Addr);
124
110
   end Get_Default_Files;
125
111
 
126
112
   ---------------
347
333
               Class_Path & ASCII.NUL, Typ), Stub));
348
334
   end Get_Style_By_Paths;
349
335
 
350
 
 
351
336
end Gtk.Rc;