/usr/share/ada/adainclude/gtkada/gdk-main.adb is in libgtkada2.24.1-dev 2.24.1-2.
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 | -----------------------------------------------------------------------
-- GtkAda - Ada95 binding for the Gimp Toolkit --
-- --
-- Copyright (C) 1998-1999 E. Briot, J. Brobecker and A. Charlet --
-- Copyright (C) 2000-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 System;
with Interfaces.C.Strings;
package body Gdk.Main is
----------
-- Init --
----------
procedure Init is
gnat_argc : Interfaces.C.int;
pragma Import (C, gnat_argc);
gnat_argv : System.Address;
pragma Import (C, gnat_argv);
procedure Internal (argc : System.Address; argv : System.Address);
pragma Import (C, Internal, "gdk_init");
begin
Internal (gnat_argc'Address, gnat_argv'Address);
end Init;
-----------------
-- Get_Display --
-----------------
function Get_Display return String is
use Interfaces.C.Strings;
function Internal return chars_ptr;
pragma Import (C, Internal, "gdk_get_display");
Result : constant chars_ptr := Internal;
begin
if Result = Null_Ptr then
return "";
else
return Interfaces.C.Strings.Value (Internal);
end if;
end Get_Display;
------------------
-- Get_Use_Xshm --
------------------
function Get_Use_Xshm return Boolean is
function Internal return Gint;
pragma Import (C, Internal, "gdk_get_use_xshm");
begin
return Internal /= 0;
end Get_Use_Xshm;
-------------------
-- Keyboard_Grab --
-------------------
function Keyboard_Grab
(Window : Gdk.Window.Gdk_Window;
Owner_Events : Boolean := True;
Time : Guint32 := 0) return Gdk_Grab_Status
is
function Internal
(Window : Gdk.Window.Gdk_Window;
Owner_Events : Gint;
Time : Guint32) return Gint;
pragma Import (C, Internal, "gdk_keyboard_grab");
begin
return Gdk_Grab_Status'Val
(Internal (Window, To_Gint (Owner_Events), Time));
end Keyboard_Grab;
---------------------
-- Keyboard_Ungrab --
---------------------
procedure Keyboard_Ungrab (Time : Guint32 := 0) is
procedure Internal (Time : Guint32);
pragma Import (C, Internal, "gdk_keyboard_ungrab");
begin
Internal (Time);
end Keyboard_Ungrab;
------------------
-- Pointer_Grab --
------------------
function Pointer_Grab
(Window : Gdk.Window.Gdk_Window;
Owner_Events : Boolean := True;
Event_Mask : Gdk.Event.Gdk_Event_Mask;
Confine_To : Gdk.Window.Gdk_Window := Gdk.Window.Null_Window;
Cursor : Gdk.Cursor.Gdk_Cursor := Gdk.Cursor.Null_Cursor;
Time : Guint32 := 0) return Gdk_Grab_Status
is
function Internal
(Window : Gdk.Window.Gdk_Window;
Owner_Events : Gint;
Event_Mask : Gint;
Confine_To : Gdk.Window.Gdk_Window;
Cursor : Gdk.Cursor.Gdk_Cursor;
Time : Guint32) return Gint;
pragma Import (C, Internal, "gdk_pointer_grab");
begin
return Gdk_Grab_Status'Val
(Internal
(Window,
To_Gint (Owner_Events),
Gint (Event_Mask),
Confine_To,
Cursor,
Time));
end Pointer_Grab;
------------------------
-- Pointer_Is_Grabbed --
------------------------
function Pointer_Is_Grabbed return Boolean is
function Internal return Gint;
pragma Import (C, Internal, "gdk_pointer_is_grabbed");
begin
return Internal /= 0;
end Pointer_Is_Grabbed;
--------------------
-- Pointer_Ungrab --
--------------------
procedure Pointer_Ungrab (Time : Guint32 := 0) is
procedure Internal (Time : Guint32);
pragma Import (C, Internal, "gdk_pointer_ungrab");
begin
Internal (Time);
end Pointer_Ungrab;
----------------
-- Set_Locale --
----------------
function Set_Locale return String is
function Internal return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gdk_set_locale");
begin
return C.Strings.Value (Internal);
end Set_Locale;
procedure Set_Locale is
procedure Internal;
pragma Import (C, Internal, "gdk_set_locale");
begin
Internal;
end Set_Locale;
------------------
-- Set_Use_Xshm --
------------------
procedure Set_Use_Xshm (Use_Xshm : Boolean := True) is
procedure Internal (Use_Xshm : Gint);
pragma Import (C, Internal, "gdk_set_use_xshm");
begin
Internal (To_Gint (Use_Xshm));
end Set_Use_Xshm;
end Gdk.Main;
|