1
-----------------------------------------------------------------------
2
-- GtkAda - Ada95 binding for Gtk+/Gnome --
4
-- Copyright (C) 2006-2008, AdaCore --
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. --
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. --
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. --
21
-----------------------------------------------------------------------
25
-- <c_version>2.8.17</c_version>
26
-- <group>Selectors</group>
27
-- <screenshot>file-button.png</screenshot>
29
with Gtk.File_Chooser; use Gtk.File_Chooser;
30
with Interfaces.C.Strings; use Interfaces.C.Strings;
33
with Glib.Type_Conversion_Hooks;
35
package body Gtk.File_Chooser_Button is
37
package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
38
(Get_Type'Access, Gtk_File_Chooser_Button_Record);
39
pragma Warnings (Off, Type_Conversion);
46
(Button : access Gtk_File_Chooser_Button_Record)
49
function Internal (Button : System.Address) return chars_ptr;
50
pragma Import (C, Internal, "gtk_file_chooser_button_get_title");
52
-- Returned value still owned by gtk+
53
return Value (Internal (Get_Object (Button)));
60
function Get_Width_Chars
61
(Button : access Gtk_File_Chooser_Button_Record)
64
function Internal (Button : System.Address) return Gint;
65
pragma Import (C, Internal, "gtk_file_chooser_button_get_width_chars");
67
return Internal (Get_Object (Button));
75
(Button : out Gtk_File_Chooser_Button;
77
Action : Gtk.File_Chooser.File_Chooser_Action) is
79
Button := new Gtk_File_Chooser_Button_Record;
80
Initialize (Button, Title, Action);
83
--------------------------
84
-- Gtk_New_With_Backend --
85
--------------------------
87
procedure Gtk_New_With_Backend
88
(Button : out Gtk_File_Chooser_Button;
90
Action : Gtk.File_Chooser.File_Chooser_Action;
93
Button := new Gtk_File_Chooser_Button_Record;
94
Initialize_With_Backend (Button, Title, Action, Backend);
95
end Gtk_New_With_Backend;
97
-------------------------
98
-- Gtk_New_With_Dialog --
99
-------------------------
101
procedure Gtk_New_With_Dialog
102
(Button : out Gtk_File_Chooser_Button;
103
Dialog : access Gtk_File_Chooser_Dialog_Record'Class) is
105
Button := new Gtk_File_Chooser_Button_Record;
106
Initialize_With_Dialog (Button, Dialog);
107
end Gtk_New_With_Dialog;
114
(Button : access Gtk_File_Chooser_Button_Record'Class;
116
Action : Gtk.File_Chooser.File_Chooser_Action)
119
(Title : String; Action : File_Chooser_Action) return System.Address;
120
pragma Import (C, Internal, "gtk_file_chooser_button_new");
122
Set_Object (Button, Internal (Title & ASCII.NUL, Action));
125
-----------------------------
126
-- Initialize_With_Backend --
127
-----------------------------
129
procedure Initialize_With_Backend
130
(Button : access Gtk_File_Chooser_Button_Record'Class;
132
Action : Gtk.File_Chooser.File_Chooser_Action;
137
Action : File_Chooser_Action;
138
Backend : String) return System.Address;
139
pragma Import (C, Internal, "gtk_file_chooser_button_new_with_backend");
142
(Button, Internal (Title & ASCII.NUL, Action, Backend & ASCII.NUL));
143
end Initialize_With_Backend;
145
----------------------------
146
-- Initialize_With_Dialog --
147
----------------------------
149
procedure Initialize_With_Dialog
150
(Button : access Gtk_File_Chooser_Button_Record'Class;
151
Dialog : access Gtk_File_Chooser_Dialog_Record'Class)
153
function Internal (Dialog : System.Address) return System.Address;
154
pragma Import (C, Internal, "gtk_file_chooser_button_new_with_dialog");
156
Set_Object (Button, Internal (Get_Object (Dialog)));
157
end Initialize_With_Dialog;
164
(Button : access Gtk_File_Chooser_Button_Record;
167
procedure Internal (Button : System.Address; Title : String);
168
pragma Import (C, Internal, "gtk_file_chooser_button_set_title");
170
Internal (Get_Object (Button), Title & ASCII.NUL);
173
---------------------
174
-- Set_Width_Chars --
175
---------------------
177
procedure Set_Width_Chars
178
(Button : access Gtk_File_Chooser_Button_Record;
181
procedure Internal (Button : System.Address; N_Chars : Gint);
182
pragma Import (C, Internal, "gtk_file_chooser_button_set_width_chars");
184
Internal (Get_Object (Button), N_Chars);
187
end Gtk.File_Chooser_Button;