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
-----------------------------------------------------------------------
23
with Gdk.Pixbuf; use Gdk.Pixbuf;
24
with Gtkada.Bindings; use Gtkada.Bindings;
26
with GNAT.Strings; use GNAT.Strings;
27
with Interfaces.C.Strings; use Interfaces.C, Interfaces.C.Strings;
29
with Glib.Type_Conversion_Hooks;
31
package body Gtk.About_Dialog is
33
package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
34
(Get_Type'Access, Gtk_About_Dialog_Record);
35
pragma Warnings (Off, Type_Conversion);
42
(About : access Gtk_About_Dialog_Record) return String_List
45
(About : System.Address) return chars_ptr_array_access;
46
pragma Import (C, Internal, "gtk_about_dialog_get_artists");
48
-- Returned value owned by gtk+, and must not be freed
49
return To_String_List (Internal (Get_Object (About)).all);
57
(About : access Gtk_About_Dialog_Record) return String_List
60
(About : System.Address) return chars_ptr_array_access;
61
pragma Import (C, Internal, "gtk_about_dialog_get_authors");
63
-- Returned value owned by gtk+
64
return To_String_List (Internal (Get_Object (About)).all);
72
(About : access Gtk_About_Dialog_Record) return String
74
function Internal (About : System.Address) return chars_ptr;
75
pragma Import (C, Internal, "gtk_about_dialog_get_comments");
77
-- returned value owned by gtk+
78
return Value (Internal (Get_Object (About)));
85
function Get_Copyright
86
(About : access Gtk_About_Dialog_Record) return String
88
function Internal (About : System.Address) return chars_ptr;
89
pragma Import (C, Internal, "gtk_about_dialog_get_copyright");
91
-- returned value owned by gtk+
92
return Value (Internal (Get_Object (About)));
99
function Get_Documenters
100
(About : access Gtk_About_Dialog_Record) return String_List
103
(About : System.Address) return chars_ptr_array_access;
104
pragma Import (C, Internal, "gtk_about_dialog_get_documenters");
106
-- Returned value owned by gtk+
107
return To_String_List (Internal (Get_Object (About)).all);
115
(About : access Gtk_About_Dialog_Record) return String
117
function Internal (About : System.Address) return chars_ptr;
118
pragma Import (C, Internal, "gtk_about_dialog_get_license");
120
-- Returned value owned by gtk+
121
return Value (Internal (Get_Object (About)));
129
(About : access Gtk_About_Dialog_Record)
132
function Internal (About : System.Address) return Gdk_Pixbuf;
133
pragma Import (C, Internal, "gtk_about_dialog_get_logo");
135
return Internal (Get_Object (About));
138
------------------------
139
-- Get_Logo_Icon_Name --
140
------------------------
142
function Get_Logo_Icon_Name
143
(About : access Gtk_About_Dialog_Record) return String
145
function Internal (About : System.Address) return chars_ptr;
146
pragma Import (C, Internal, "gtk_about_dialog_get_logo_icon_name");
148
-- Returned value owned by gtk+
149
return Value (Internal (Get_Object (About)));
150
end Get_Logo_Icon_Name;
157
(About : access Gtk_About_Dialog_Record) return String
159
function Internal (About : System.Address) return chars_ptr;
160
pragma Import (C, Internal, "gtk_about_dialog_get_name");
162
-- Returned value owned by gtk+
163
return Value (Internal (Get_Object (About)));
166
----------------------------
167
-- Get_Translator_Credits --
168
----------------------------
170
function Get_Translator_Credits
171
(About : access Gtk_About_Dialog_Record) return String
173
function Internal (About : System.Address) return chars_ptr;
174
pragma Import (C, Internal, "gtk_about_dialog_get_translator_credits");
176
-- Returned value owned by gtk+
177
return Value (Internal (Get_Object (About)));
178
end Get_Translator_Credits;
185
(About : access Gtk_About_Dialog_Record) return String
187
function Internal (About : System.Address) return chars_ptr;
188
pragma Import (C, Internal, "gtk_about_dialog_get_version");
190
-- Returned value owned by gtk+
191
return Value (Internal (Get_Object (About)));
199
(About : access Gtk_About_Dialog_Record) return String
201
function Internal (About : System.Address) return chars_ptr;
202
pragma Import (C, Internal, "gtk_about_dialog_get_website");
204
-- Returned value owned by gtk+
205
return Value (Internal (Get_Object (About)));
208
-----------------------
209
-- Get_Website_Label --
210
-----------------------
212
function Get_Website_Label
213
(About : access Gtk_About_Dialog_Record) return String
215
function Internal (About : System.Address) return chars_ptr;
216
pragma Import (C, Internal, "gtk_about_dialog_get_website_label");
218
-- Returned value owned by gtk+
219
return Value (Internal (Get_Object (About)));
220
end Get_Website_Label;
222
----------------------
223
-- Get_Wrap_License --
224
----------------------
226
function Get_Wrap_License
227
(About : access Gtk_About_Dialog_Record)
231
(About : System.Address)
233
pragma Import (C, Internal, "gtk_about_dialog_get_wrap_license");
235
return Boolean'Val (Internal (Get_Object (About)));
236
end Get_Wrap_License;
242
procedure Gtk_New (About : out Gtk_About_Dialog) is
244
About := new Gtk_About_Dialog_Record;
245
Gtk.About_Dialog.Initialize (About);
253
(About : access Gtk_About_Dialog_Record'Class)
255
function Internal return System.Address;
256
pragma Import (C, Internal, "gtk_about_dialog_new");
258
Set_Object (About, Internal);
265
procedure Set_Artists
266
(About : access Gtk_About_Dialog_Record;
267
Artists : String_List)
269
procedure Internal (About : System.Address; Artists : System.Address);
270
pragma Import (C, Internal, "gtk_about_dialog_set_artists");
271
Val : aliased chars_ptr_array := From_String_List (Artists);
273
Internal (Get_Object (About), Val (Val'First)'Address);
274
Gtkada.Types.Free (Val);
281
procedure Set_Authors
282
(About : access Gtk_About_Dialog_Record;
283
Authors : String_List)
285
procedure Internal (About : System.Address; Authors : System.Address);
286
pragma Import (C, Internal, "gtk_about_dialog_set_authors");
287
Val : aliased chars_ptr_array := From_String_List (Authors);
289
Internal (Get_Object (About), Val (Val'First)'Address);
290
Gtkada.Types.Free (Val);
297
procedure Set_Comments
298
(About : access Gtk_About_Dialog_Record;
302
(About : System.Address;
304
pragma Import (C, Internal, "gtk_about_dialog_set_comments");
306
Internal (Get_Object (About), Comments & ASCII.NUL);
313
procedure Set_Copyright
314
(About : access Gtk_About_Dialog_Record;
318
(About : System.Address;
320
pragma Import (C, Internal, "gtk_about_dialog_set_copyright");
322
Internal (Get_Object (About), Copyright & ASCII.NUL);
325
---------------------
326
-- Set_Documenters --
327
---------------------
329
procedure Set_Documenters
330
(About : access Gtk_About_Dialog_Record;
331
Documenters : String_List)
333
procedure Internal (About, Documenters : System.Address);
334
pragma Import (C, Internal, "gtk_about_dialog_set_documenters");
335
Val : aliased chars_ptr_array := From_String_List (Documenters);
337
Internal (Get_Object (About), Val (Val'First)'Address);
338
Gtkada.Types.Free (Val);
345
procedure Set_License
346
(About : access Gtk_About_Dialog_Record;
350
(About : System.Address;
352
pragma Import (C, Internal, "gtk_about_dialog_set_license");
354
Internal (Get_Object (About), License & ASCII.NUL);
362
(About : access Gtk_About_Dialog_Record;
366
(About : System.Address;
368
pragma Import (C, Internal, "gtk_about_dialog_set_logo");
370
Internal (Get_Object (About), Logo);
373
------------------------
374
-- Set_Logo_Icon_Name --
375
------------------------
377
procedure Set_Logo_Icon_Name
378
(About : access Gtk_About_Dialog_Record;
379
Icon_Name : String := "")
381
procedure Internal (About : System.Address; Icon_Name : chars_ptr);
382
pragma Import (C, Internal, "gtk_about_dialog_set_logo_icon_name");
383
Str : chars_ptr := String_Or_Null (Icon_Name);
385
Internal (Get_Object (About), Str);
387
end Set_Logo_Icon_Name;
394
(About : access Gtk_About_Dialog_Record;
398
(About : System.Address;
400
pragma Import (C, Internal, "gtk_about_dialog_set_name");
402
Internal (Get_Object (About), Name & ASCII.NUL);
405
----------------------------
406
-- Set_Translator_Credits --
407
----------------------------
409
procedure Set_Translator_Credits
410
(About : access Gtk_About_Dialog_Record;
411
Translator_Credits : String)
414
(About : System.Address;
415
Translator_Credits : String);
416
pragma Import (C, Internal, "gtk_about_dialog_set_translator_credits");
418
Internal (Get_Object (About), Translator_Credits & ASCII.NUL);
419
end Set_Translator_Credits;
425
procedure Set_Version
426
(About : access Gtk_About_Dialog_Record;
430
(About : System.Address;
432
pragma Import (C, Internal, "gtk_about_dialog_set_version");
434
Internal (Get_Object (About), Version & ASCII.NUL);
441
procedure Set_Website
442
(About : access Gtk_About_Dialog_Record;
446
(About : System.Address;
448
pragma Import (C, Internal, "gtk_about_dialog_set_website");
450
Internal (Get_Object (About), Website & ASCII.NUL);
453
-----------------------
454
-- Set_Website_Label --
455
-----------------------
457
procedure Set_Website_Label
458
(About : access Gtk_About_Dialog_Record;
459
Website_Label : String)
462
(About : System.Address;
463
Website_Label : String);
464
pragma Import (C, Internal, "gtk_about_dialog_set_website_label");
466
Internal (Get_Object (About), Website_Label & ASCII.NUL);
467
end Set_Website_Label;
469
----------------------
470
-- Set_Wrap_License --
471
----------------------
473
procedure Set_Wrap_License
474
(About : access Gtk_About_Dialog_Record;
475
Wrap_License : Boolean)
478
(About : System.Address;
479
Wrap_License : Gboolean);
480
pragma Import (C, Internal, "gtk_about_dialog_set_wrap_license");
482
Internal (Get_Object (About), Boolean'Pos (Wrap_License));
483
end Set_Wrap_License;
485
end Gtk.About_Dialog;