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

« back to all changes in this revision

Viewing changes to src/gtk-file_chooser_dialog.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:
 
1
-----------------------------------------------------------------------
 
2
--              GtkAda - Ada95 binding for Gtk+/Gnome                --
 
3
--                                                                   --
 
4
--                 Copyright (C) 2006-2008, AdaCore                  --
 
5
--                                                                   --
 
6
-- This library is free software; you can redistribute it and/or     --
 
7
-- modify it under the terms of the GNU General Public               --
 
8
-- License as published by the Free Software Foundation; either      --
 
9
-- version 2 of the License, or (at your option) any later version.  --
 
10
--                                                                   --
 
11
-- This library is distributed in the hope that it will be useful,   --
 
12
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
 
13
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
 
14
-- General Public License for more details.                          --
 
15
--                                                                   --
 
16
-- You should have received a copy of the GNU General Public         --
 
17
-- License along with this library; if not, write to the             --
 
18
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
 
19
-- Boston, MA 02111-1307, USA.                                       --
 
20
--                                                                   --
 
21
-----------------------------------------------------------------------
 
22
 
 
23
with Gtk.File_Chooser;   use Gtk.File_Chooser;
 
24
with Gtk.Window;         use Gtk.Window;
 
25
 
 
26
with Glib.Type_Conversion_Hooks;
 
27
 
 
28
package body Gtk.File_Chooser_Dialog is
 
29
 
 
30
   package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
 
31
     (Get_Type'Access, Gtk_File_Chooser_Dialog_Record);
 
32
   pragma Warnings (Off, Type_Conversion);
 
33
 
 
34
   -------------
 
35
   -- Gtk_New --
 
36
   -------------
 
37
 
 
38
   procedure Gtk_New
 
39
     (Dialog            : out Gtk_File_Chooser_Dialog;
 
40
      Title             : String;
 
41
      Parent            : access Gtk.Window.Gtk_Window_Record'Class;
 
42
      Action            : Gtk.File_Chooser.File_Chooser_Action)
 
43
   is
 
44
   begin
 
45
      Dialog := new Gtk_File_Chooser_Dialog_Record;
 
46
      Initialize (Dialog, Title, Parent, Action);
 
47
   end Gtk_New;
 
48
 
 
49
   ----------------
 
50
   -- Initialize --
 
51
   ----------------
 
52
 
 
53
   procedure Initialize
 
54
     (Dialog            : access Gtk_File_Chooser_Dialog_Record'Class;
 
55
      Title             : String;
 
56
      Parent            : access Gtk.Window.Gtk_Window_Record'Class;
 
57
      Action            : Gtk.File_Chooser.File_Chooser_Action)
 
58
   is
 
59
      function Internal
 
60
        (Title             : String;
 
61
         Parent            : System.Address;
 
62
         Action            : File_Chooser_Action)
 
63
         return System.Address;
 
64
      pragma Import (C, Internal, "ada_gtk_file_chooser_dialog_new");
 
65
   begin
 
66
      Set_Object
 
67
        (Dialog,
 
68
         Internal (Title & ASCII.NUL, Get_Object (Parent), Action));
 
69
   end Initialize;
 
70
 
 
71
   --------------------------
 
72
   -- Gtk_New_With_Backend --
 
73
   --------------------------
 
74
 
 
75
   procedure Gtk_New_With_Backend
 
76
     (Dialog            : out Gtk_File_Chooser_Dialog;
 
77
      Title             : String;
 
78
      Parent            : access Gtk.Window.Gtk_Window_Record'Class;
 
79
      Action            : Gtk.File_Chooser.File_Chooser_Action;
 
80
      Backend           : String)
 
81
   is
 
82
   begin
 
83
      Dialog := new Gtk_File_Chooser_Dialog_Record;
 
84
      Initialize_With_Backend (Dialog, Title, Parent, Action, Backend);
 
85
   end Gtk_New_With_Backend;
 
86
 
 
87
   -----------------------------
 
88
   -- Initialize_With_Backend --
 
89
   -----------------------------
 
90
 
 
91
   procedure Initialize_With_Backend
 
92
     (Dialog            : access Gtk_File_Chooser_Dialog_Record'Class;
 
93
      Title             : String;
 
94
      Parent            : access Gtk.Window.Gtk_Window_Record'Class;
 
95
      Action            : Gtk.File_Chooser.File_Chooser_Action;
 
96
      Backend           : String)
 
97
   is
 
98
      function Internal
 
99
        (Title             : String;
 
100
         Parent            : System.Address;
 
101
         Action            : File_Chooser_Action;
 
102
         Backend           : String)
 
103
         return System.Address;
 
104
      pragma Import
 
105
        (C, Internal, "ada_gtk_file_chooser_dialog_new_with_backend");
 
106
   begin
 
107
      Set_Object
 
108
        (Dialog,
 
109
         Internal (Title & ASCII.NUL, Get_Object (Parent), Action,
 
110
                   Backend & ASCII.NUL));
 
111
   end Initialize_With_Backend;
 
112
 
 
113
end Gtk.File_Chooser_Dialog;