/usr/share/ada/adainclude/gtkada/cairo.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 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 | ------------------------------------------------------------------------------
-- GtkAda - Ada95 binding for Gtk+/Gnome --
-- --
-- Copyright (C) 2010-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/>. --
-- --
------------------------------------------------------------------------------
package body Cairo is
-----------------
-- Get_Context --
-----------------
function Get_Context
(Value : Glib.Values.GValue) return Cairo_Context is
begin
return Cairo_Context (Glib.Values.Get_Address (Value));
end Get_Context;
--------------
-- Set_Dash --
--------------
procedure Set_Dash
(Cr : Cairo_Context;
Dashes : Dash_Array;
Offset : Gdouble)
is
procedure C_Set_Dash
(Cr : Cairo_Context;
Dashes : System.Address;
Num_Dashes : Gint;
Offset : Gdouble);
pragma Import (C, C_Set_Dash, "cairo_set_dash");
Len : constant Natural := Dashes'Length;
begin
if Len = 0 then
C_Set_Dash (Cr, System.Null_Address, 0, Offset);
else
C_Set_Dash (Cr, Dashes (Dashes'First)'Address, Dashes'Length, Offset);
end if;
end Set_Dash;
--------------
-- Get_Dash --
--------------
procedure Get_Dash
(Cr : Cairo_Context;
Dashes : out Dash_Array_Access;
Offset : out Gdouble)
is
procedure C_Get_Dash
(Cr : Cairo_Context;
Dashes : System.Address;
Offset : access Gdouble);
pragma Import (C, C_Get_Dash, "cairo_get_dash");
Count : constant Integer := Integer (Get_Dash_Count (Cr));
G : aliased Gdouble;
begin
if Count = 0 then
Offset := 0.0;
Dashes := null;
return;
end if;
Dashes := new Dash_Array (1 .. Count);
C_Get_Dash (Cr, Dashes (Dashes'First)'Address, G'Access);
Offset := G;
end Get_Dash;
----------------------
-- Select_Font_Face --
----------------------
procedure Select_Font_Face
(Cr : Cairo_Context;
Family : String;
Slant : Cairo_Font_Slant;
Weight : Cairo_Font_Weight)
is
procedure C_Select_Font_Face
(Cr : Cairo_Context;
Family : System.Address;
Slant : Cairo_Font_Slant;
Weight : Cairo_Font_Weight);
pragma Import (C, C_Select_Font_Face, "cairo_select_font_face");
Tmp : constant String := Family & ASCII.NUL;
begin
C_Select_Font_Face (Cr, Tmp'Address, Slant, Weight);
end Select_Font_Face;
---------------
-- Show_Text --
---------------
procedure Show_Text
(Cr : Cairo_Context;
Utf8 : String)
is
procedure C_Show_Text (Cr : Cairo_Context; Utf8 : System.Address);
pragma Import (C, C_Show_Text, "cairo_show_text");
Tmp : constant String := Utf8 & ASCII.NUL;
begin
C_Show_Text (Cr, Tmp'Address);
end Show_Text;
---------------
-- Text_Path --
---------------
procedure Text_Path
(Cr : Cairo_Context;
Utf8 : String)
is
procedure C_Text_Path (Cr : Cairo_Context; Utf8 : System.Address);
pragma Import (C, C_Text_Path, "cairo_text_path");
Tmp : constant String := Utf8 & ASCII.NUL;
begin
C_Text_Path (Cr, Tmp'Address);
end Text_Path;
---------------
-- In_Stroke --
---------------
function In_Stroke
(Cr : Cairo_Context;
X : Gdouble;
Y : Gdouble)
return Boolean
is
function Internal (C : Cairo_Context; X, Y : Gdouble) return Gboolean;
pragma Import (C, Internal, "cairo_in_stroke");
begin
return Internal (Cr, X, Y) /= 0;
end In_Stroke;
-------------
-- In_Fill --
-------------
function In_Fill
(Cr : Cairo_Context;
X : Gdouble;
Y : Gdouble)
return Boolean
is
function Internal (C : Cairo_Context; X, Y : Gdouble) return Gboolean;
pragma Import (C, Internal, "cairo_in_fill");
begin
return Internal (Cr, X, Y) /= 0;
end In_Fill;
-----------------------
-- Has_Current_Point --
-----------------------
function Has_Current_Point (Cr : Cairo_Context) return Boolean is
function Internal (Cr : Cairo_Context) return Gboolean;
pragma Import (C, Internal, "cairo_has_current_point");
begin
return Internal (Cr) /= 0;
end Has_Current_Point;
end Cairo;
|