/usr/share/ada/adainclude/gtkada/gdk-main.adb is in libgtkada16.1.0-dev 17.0.2017-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 | ------------------------------------------------------------------------------
-- GtkAda - Ada95 binding for the Gimp Toolkit --
-- --
-- Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet --
-- Copyright (C) 1998-2017, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 3, 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 MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
with Gdk.Types; use Gdk.Types;
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;
-------------------
-- Keyboard_Grab --
-------------------
function Keyboard_Grab
(Window : Gdk.Gdk_Window;
Owner_Events : Boolean := True;
Time : Guint32 := 0) return Gdk_Grab_Status
is
function Internal
(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.Gdk_Window;
Owner_Events : Boolean := True;
Event_Mask : Gdk.Event.Gdk_Event_Mask;
Confine_To : Gdk.Gdk_Window := null;
Cursor : Gdk.Gdk_Cursor := null;
Time : Guint32 := 0) return Gdk_Grab_Status
is
function Internal
(Window : Gdk_Window;
Owner_Events : Gint;
Event_Mask : Gint;
Confine_To : Gdk_Window;
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;
end Gdk.Main;
|