/usr/share/ada/adainclude/gtkada/gtk-adjustment.ads 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 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet --
-- Copyright (C) 2000-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/>. --
-- --
------------------------------------------------------------------------------
-- <description>
-- The Gtk.Adjustment.Gtk_Adjustment object represents a value which has an
-- associated lower and upper bound, together with step and page increments,
-- and a page size. It is used within several GTK+ widgets, including
-- Gtk.Spin_Button.Gtk_Spin_Button, Gtk.Viewport.Gtk_Viewport, and
-- Gtk.GRange.Gtk_Range (which is a base class for
-- Gtk.Scrollbar.Gtk_Hscrollbar, Gtk.Scrollbar.Gtk_Vscrollbar,
-- Gtk.Scale.Gtk_Hscale, and Gtk.Scale.Gtk_Vscale).
--
-- The Gtk.Adjustment.Gtk_Adjustment object does not update the value itself.
-- Instead it is left up to the owner of the Gtk.Adjustment.Gtk_Adjustment to
-- control the value.
--
-- The owner of the Gtk.Adjustment.Gtk_Adjustment typically calls the
-- Gtk.Adjustment.Value_Changed and Gtk.Adjustment.Changed functions after
-- changing the value and its bounds. This results in the emission of the
-- Gtk.Adjustment.Gtk_Adjustment::value_changed or
-- Gtk.Adjustment.Gtk_Adjustment::changed signal respectively.
--
-- </description>
-- <description>
-- The meaning of the most important fields can be explained on the following
-- figure (imagine this is a scrollbar):
--
-- [-------|=================|-------------------]
--
-- lower value value + page_size upper
--
-- </description>
-- <group>Scrolling</group>
pragma Ada_2005;
pragma Warnings (Off, "*is already use-visible*");
with Glib; use Glib;
with Glib.Object; use Glib.Object;
with Glib.Properties; use Glib.Properties;
package Gtk.Adjustment is
type Gtk_Adjustment_Record is new GObject_Record with null record;
type Gtk_Adjustment is access all Gtk_Adjustment_Record'Class;
------------------
-- Constructors --
------------------
procedure Gtk_New
(Adjustment : out Gtk_Adjustment;
Value : Gdouble;
Lower : Gdouble;
Upper : Gdouble;
Step_Increment : Gdouble;
Page_Increment : Gdouble;
Page_Size : Gdouble := 0.0);
procedure Initialize
(Adjustment : not null access Gtk_Adjustment_Record'Class;
Value : Gdouble;
Lower : Gdouble;
Upper : Gdouble;
Step_Increment : Gdouble;
Page_Increment : Gdouble;
Page_Size : Gdouble := 0.0);
-- Create a new adjustment. Value is the initial value of the adjustment.
-- It must be in the range (Lower .. Upper) and the adjustment's value will
-- never be outside this range. Step_Increment is the value used to make
-- minor adjustments, such as when the user clicks on the arrows of a
-- scrollbar. Page_Increment is used to make major adjustments, such as
-- when the user clicks in the through on a scrollbar. Page_Size is
-- deprecated, use the default value.
-- Initialize does nothing if the object was already created with another
-- call to Initialize* or G_New.
-- "value": the initial value.
-- "lower": the minimum value.
-- "upper": the maximum value.
-- "step_increment": the step increment.
-- "page_increment": the page increment.
-- "page_size": the page size.
function Gtk_Adjustment_New
(Value : Gdouble;
Lower : Gdouble;
Upper : Gdouble;
Step_Increment : Gdouble;
Page_Increment : Gdouble;
Page_Size : Gdouble := 0.0) return Gtk_Adjustment;
-- Create a new adjustment. Value is the initial value of the adjustment.
-- It must be in the range (Lower .. Upper) and the adjustment's value will
-- never be outside this range. Step_Increment is the value used to make
-- minor adjustments, such as when the user clicks on the arrows of a
-- scrollbar. Page_Increment is used to make major adjustments, such as
-- when the user clicks in the through on a scrollbar. Page_Size is
-- deprecated, use the default value.
-- "value": the initial value.
-- "lower": the minimum value.
-- "upper": the maximum value.
-- "step_increment": the step increment.
-- "page_increment": the page increment.
-- "page_size": the page size.
function Get_Type return Glib.GType;
pragma Import (C, Get_Type, "gtk_adjustment_get_type");
-------------
-- Methods --
-------------
procedure Changed (Adjustment : not null access Gtk_Adjustment_Record);
-- Emits a Gtk.Adjustment.Gtk_Adjustment::changed signal from the
-- Gtk.Adjustment.Gtk_Adjustment. This is typically called by the owner of
-- the Gtk.Adjustment.Gtk_Adjustment after it has changed any of the
-- Gtk.Adjustment.Gtk_Adjustment properties other than the value.
procedure Clamp_Page
(Adjustment : not null access Gtk_Adjustment_Record;
Lower : Gdouble;
Upper : Gdouble);
-- Update the Adjustment value to ensure that the range between Lower and
-- Upper is in the current page (i.e. between value and value + page_size).
-- If the range is larger than the page size, then only the start of it
-- will be in the current page. A "value_changed" signal will be emitted if
-- the value is changed.
-- "lower": the lower value.
-- "upper": the upper value.
procedure Configure
(Adjustment : not null access Gtk_Adjustment_Record;
Value : Gdouble;
Lower : Gdouble;
Upper : Gdouble;
Step_Increment : Gdouble;
Page_Increment : Gdouble;
Page_Size : Gdouble);
-- Sets all properties of the adjustment at once.
-- Use this function to avoid multiple emissions of the
-- Gtk.Adjustment.Gtk_Adjustment::changed signal. See
-- Gtk.Adjustment.Set_Lower for an alternative way of compressing multiple
-- emissions of Gtk.Adjustment.Gtk_Adjustment::changed into one.
-- Since: gtk+ 2.14
-- "value": the new value
-- "lower": the new minimum value
-- "upper": the new maximum value
-- "step_increment": the new step increment
-- "page_increment": the new page increment
-- "page_size": the new page size
function Get_Lower
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Retrieves the minimum value of the adjustment.
-- Since: gtk+ 2.14
procedure Set_Lower
(Adjustment : not null access Gtk_Adjustment_Record;
Lower : Gdouble);
-- Sets the minimum value of the adjustment.
-- When setting multiple adjustment properties via their individual
-- setters, multiple Gtk.Adjustment.Gtk_Adjustment::changed signals will be
-- emitted. However, since the emission of the
-- Gtk.Adjustment.Gtk_Adjustment::changed signal is tied to the emission of
-- the Glib.Object.GObject::notify signals of the changed properties, it's
-- possible to compress the Gtk.Adjustment.Gtk_Adjustment::changed signals
-- into one by calling g_object_freeze_notify and g_object_thaw_notify
-- around the calls to the individual setters.
-- Alternatively, using a single g_object_set for all the properties to
-- change, or using Gtk.Adjustment.Configure has the same effect of
-- compressing Gtk.Adjustment.Gtk_Adjustment::changed emissions.
-- Since: gtk+ 2.14
-- "lower": the new minimum value
function Get_Minimum_Increment
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Gets the smaller of step increment and page increment.
-- Since: gtk+ 3.2
function Get_Page_Increment
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Retrieves the page increment of the adjustment.
-- Since: gtk+ 2.14
procedure Set_Page_Increment
(Adjustment : not null access Gtk_Adjustment_Record;
Page_Increment : Gdouble);
-- Sets the page increment of the adjustment.
-- See Gtk.Adjustment.Set_Lower about how to compress multiple emissions
-- of the Gtk.Adjustment.Gtk_Adjustment::changed signal when setting
-- multiple adjustment properties.
-- Since: gtk+ 2.14
-- "page_increment": the new page increment
function Get_Page_Size
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Retrieves the page size of the adjustment.
-- Since: gtk+ 2.14
procedure Set_Page_Size
(Adjustment : not null access Gtk_Adjustment_Record;
Page_Size : Gdouble);
-- Sets the page size of the adjustment.
-- See Gtk.Adjustment.Set_Lower about how to compress multiple emissions
-- of the GtkAdjustment::changed signal when setting multiple adjustment
-- properties.
-- Since: gtk+ 2.14
-- "page_size": the new page size
function Get_Step_Increment
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Retrieves the step increment of the adjustment.
-- Since: gtk+ 2.14
procedure Set_Step_Increment
(Adjustment : not null access Gtk_Adjustment_Record;
Step_Increment : Gdouble);
-- Sets the step increment of the adjustment.
-- See Gtk.Adjustment.Set_Lower about how to compress multiple emissions
-- of the Gtk.Adjustment.Gtk_Adjustment::changed signal when setting
-- multiple adjustment properties.
-- Since: gtk+ 2.14
-- "step_increment": the new step increment
function Get_Upper
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Retrieves the maximum value of the adjustment.
-- Since: gtk+ 2.14
procedure Set_Upper
(Adjustment : not null access Gtk_Adjustment_Record;
Upper : Gdouble);
-- Sets the maximum value of the adjustment.
-- Note that values will be restricted by `upper - page-size` if the
-- page-size property is nonzero.
-- See Gtk.Adjustment.Set_Lower about how to compress multiple emissions
-- of the Gtk.Adjustment.Gtk_Adjustment::changed signal when setting
-- multiple adjustment properties.
-- Since: gtk+ 2.14
-- "upper": the new maximum value
function Get_Value
(Adjustment : not null access Gtk_Adjustment_Record) return Gdouble;
-- Gets the current value of the adjustment. See gtk_adjustment_set_value
-- ().
procedure Set_Value
(Adjustment : not null access Gtk_Adjustment_Record;
Value : Gdouble);
-- Sets the Gtk.Adjustment.Gtk_Adjustment value. The value is clamped to
-- lie between Gtk.Adjustment.Gtk_Adjustment:lower and
-- Gtk.Adjustment.Gtk_Adjustment:upper.
-- Note that for adjustments which are used in a
-- Gtk.Scrollbar.Gtk_Scrollbar, the effective range of allowed values goes
-- from Gtk.Adjustment.Gtk_Adjustment:lower to
-- Gtk.Adjustment.Gtk_Adjustment:upper -
-- Gtk.Adjustment.Gtk_Adjustment:page_size.
-- "value": the new value.
procedure Value_Changed
(Adjustment : not null access Gtk_Adjustment_Record);
-- Emits a Gtk.Adjustment.Gtk_Adjustment::value_changed signal from the
-- Gtk.Adjustment.Gtk_Adjustment. This is typically called by the owner of
-- the Gtk.Adjustment.Gtk_Adjustment after it has changed the
-- Gtk.Adjustment.Gtk_Adjustment:value property.
----------------
-- Properties --
----------------
-- The following properties are defined for this widget. See
-- Glib.Properties for more information on properties)
Lower_Property : constant Glib.Properties.Property_Double;
-- Type: Gdouble
-- The minimum value of the adjustment.
Page_Increment_Property : constant Glib.Properties.Property_Double;
-- Type: Gdouble
-- The page increment of the adjustment.
Page_Size_Property : constant Glib.Properties.Property_Double;
-- Type: Gdouble
-- The page size of the adjustment. Note that the page-size is irrelevant
-- and should be set to zero if the adjustment is used for a simple scalar
-- value, e.g. in a Gtk.Spin_Button.Gtk_Spin_Button.
Step_Increment_Property : constant Glib.Properties.Property_Double;
-- Type: Gdouble
-- The step increment of the adjustment.
Upper_Property : constant Glib.Properties.Property_Double;
-- Type: Gdouble
-- The maximum value of the adjustment. Note that values will be
-- restricted by `upper - page-size` if the page-size property is nonzero.
Value_Property : constant Glib.Properties.Property_Double;
-- Type: Gdouble
-- The value of the adjustment.
-------------
-- Signals --
-------------
type Cb_Gtk_Adjustment_Void is not null access procedure (Self : access Gtk_Adjustment_Record'Class);
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
Signal_Changed : constant Glib.Signal_Name := "changed";
procedure On_Changed
(Self : not null access Gtk_Adjustment_Record;
Call : Cb_Gtk_Adjustment_Void;
After : Boolean := False);
procedure On_Changed
(Self : not null access Gtk_Adjustment_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False);
-- Emitted when one or more of the Gtk.Adjustment.Gtk_Adjustment
-- properties have been changed, other than the
-- Gtk.Adjustment.Gtk_Adjustment:value property.
Signal_Value_Changed : constant Glib.Signal_Name := "value-changed";
procedure On_Value_Changed
(Self : not null access Gtk_Adjustment_Record;
Call : Cb_Gtk_Adjustment_Void;
After : Boolean := False);
procedure On_Value_Changed
(Self : not null access Gtk_Adjustment_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False);
-- Emitted when the Gtk.Adjustment.Gtk_Adjustment:value property has been
-- changed.
private
Value_Property : constant Glib.Properties.Property_Double :=
Glib.Properties.Build ("value");
Upper_Property : constant Glib.Properties.Property_Double :=
Glib.Properties.Build ("upper");
Step_Increment_Property : constant Glib.Properties.Property_Double :=
Glib.Properties.Build ("step-increment");
Page_Size_Property : constant Glib.Properties.Property_Double :=
Glib.Properties.Build ("page-size");
Page_Increment_Property : constant Glib.Properties.Property_Double :=
Glib.Properties.Build ("page-increment");
Lower_Property : constant Glib.Properties.Property_Double :=
Glib.Properties.Build ("lower");
end Gtk.Adjustment;
|