/usr/share/ada/adainclude/gtkada/gtk-action.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 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 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 | -----------------------------------------------------------------------
-- GtkAda - Ada95 binding for Gtk+/Gnome --
-- --
-- Copyright (C) 2006-2010, 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 Gtkada.Bindings; use Gtkada.Bindings;
with Gtk.Accel_Group; use Gtk.Accel_Group;
with Gtk.Enums; use Gtk.Enums;
with Gtk.Widget; use Gtk.Widget;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Glib.Type_Conversion_Hooks;
package body Gtk.Action is
package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
(Get_Type'Access, Gtk_Action_Record);
pragma Warnings (Off, Type_Conversion);
--------------
-- Activate --
--------------
procedure Activate
(Action : access Gtk_Action_Record)
is
procedure Internal
(Action : System.Address);
pragma Import (C, Internal, "gtk_action_activate");
begin
Internal (Get_Object (Action));
end Activate;
--------------------
-- Block_Activate --
--------------------
procedure Block_Activate
(Action : access Gtk_Action_Record)
is
procedure Internal (Action : System.Address);
pragma Import (C, Internal, "gtk_action_block_activate");
begin
Internal (Get_Object (Action));
end Block_Activate;
-------------------------
-- Block_Activate_From --
-------------------------
procedure Block_Activate_From
(Action : access Gtk_Action_Record;
Proxy : access Gtk_Widget_Record'Class)
is
procedure Internal
(Action : System.Address;
Proxy : System.Address);
pragma Import (C, Internal, "gtk_action_block_activate_from");
begin
Internal (Get_Object (Action), Get_Object (Proxy));
end Block_Activate_From;
-------------------------
-- Connect_Accelerator --
-------------------------
procedure Connect_Accelerator
(Action : access Gtk_Action_Record)
is
procedure Internal
(Action : System.Address);
pragma Import (C, Internal, "gtk_action_connect_accelerator");
begin
Internal (Get_Object (Action));
end Connect_Accelerator;
-------------------
-- Connect_Proxy --
-------------------
procedure Connect_Proxy
(Action : access Gtk_Action_Record;
Proxy : access Gtk_Widget_Record'Class)
is
procedure Internal
(Action : System.Address;
Proxy : System.Address);
pragma Import (C, Internal, "gtk_action_connect_proxy");
begin
Internal (Get_Object (Action), Get_Object (Proxy));
end Connect_Proxy;
-------------
-- Convert --
-------------
function Convert (C_Object : System.Address) return Gtk_Action is
Stub : Gtk_Action_Record;
begin
return Gtk_Action (Get_User_Data (C_Object, Stub));
end Convert;
-----------------
-- Create_Icon --
-----------------
function Create_Icon
(Action : access Gtk_Action_Record;
Icon_Size : Gtk_Icon_Size)
return Gtk_Widget
is
function Internal
(Action : System.Address;
Icon_Size : Gtk_Icon_Size)
return System.Address;
pragma Import (C, Internal, "gtk_action_create_icon");
Stub : Gtk_Widget_Record;
begin
return Gtk_Widget
(Get_User_Data
(Internal (Get_Object (Action), Icon_Size), Stub));
end Create_Icon;
----------------------
-- Create_Menu_Item --
----------------------
function Create_Menu_Item
(Action : access Gtk_Action_Record)
return Gtk_Widget
is
function Internal
(Action : System.Address)
return System.Address;
pragma Import (C, Internal, "gtk_action_create_menu_item");
Stub : Gtk_Widget_Record;
begin
return Gtk_Widget
(Get_User_Data
(Internal (Get_Object (Action)), Stub));
end Create_Menu_Item;
----------------------
-- Create_Tool_Item --
----------------------
function Create_Tool_Item
(Action : access Gtk_Action_Record)
return Gtk_Widget
is
function Internal
(Action : System.Address)
return System.Address;
pragma Import (C, Internal, "gtk_action_create_tool_item");
Stub : Gtk_Widget_Record;
begin
return Gtk_Widget
(Get_User_Data
(Internal (Get_Object (Action)), Stub));
end Create_Tool_Item;
----------------------------
-- Disconnect_Accelerator --
----------------------------
procedure Disconnect_Accelerator
(Action : access Gtk_Action_Record)
is
procedure Internal
(Action : System.Address);
pragma Import (C, Internal, "gtk_action_disconnect_accelerator");
begin
Internal (Get_Object (Action));
end Disconnect_Accelerator;
----------------------
-- Disconnect_Proxy --
----------------------
procedure Disconnect_Proxy
(Action : access Gtk_Action_Record;
Proxy : access Gtk_Widget_Record'Class)
is
procedure Internal
(Action : System.Address;
Proxy : System.Address);
pragma Import (C, Internal, "gtk_action_disconnect_proxy");
begin
Internal (Get_Object (Action), Get_Object (Proxy));
end Disconnect_Proxy;
--------------------
-- Get_Accel_Path --
--------------------
function Get_Accel_Path
(Action : access Gtk_Action_Record)
return String
is
function Internal (Action : System.Address) return chars_ptr;
pragma Import (C, Internal, "gtk_action_get_accel_path");
begin
-- Do not free returned value, owned by gtk+
return Value (Internal (Get_Object (Action)));
end Get_Accel_Path;
---------------
-- Get_GIcon --
---------------
function Get_GIcon
(Action : access Gtk_Action_Record)
return Glib.G_Icon.G_Icon
is
function Internal (Action : System.Address) return Glib.G_Icon.G_Icon;
pragma Import (C, Internal, "gtk_action_get_gicon");
begin
return Internal (Get_Object (Action));
end Get_GIcon;
-------------------
-- Get_Icon_Name --
-------------------
function Get_Icon_Name
(Action : access Gtk_Action_Record)
return String
is
function Internal
(Action : System.Address)
return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_icon_name");
begin
return Value (Internal (Get_Object (Action)));
end Get_Icon_Name;
----------------------
-- Get_Is_Important --
----------------------
function Get_Is_Important
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal
(Action : System.Address)
return Gboolean;
pragma Import (C, Internal, "gtk_action_get_is_important");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Get_Is_Important;
---------------
-- Get_Label --
---------------
function Get_Label
(Action : access Gtk_Action_Record)
return String
is
function Internal
(Action : System.Address)
return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_label");
begin
return Value (Internal (Get_Object (Action)));
end Get_Label;
--------------
-- Get_Name --
--------------
function Get_Name
(Action : access Gtk_Action_Record)
return String
is
function Internal (Action : System.Address) return chars_ptr;
pragma Import (C, Internal, "gtk_action_get_name");
begin
-- Do not free returned value, owned by gtk+
return Value (Internal (Get_Object (Action)));
end Get_Name;
-----------------
-- Get_Proxies --
-----------------
function Get_Proxies
(Action : access Gtk_Action_Record)
return Gtk.Widget.Widget_SList.GSlist
is
function Internal (Action : System.Address) return System.Address;
pragma Import (C, Internal, "gtk_action_get_proxies");
L : Widget_SList.GSlist;
begin
Widget_SList.Set_Object (L, Internal (Get_Object (Action)));
return L;
end Get_Proxies;
-------------------
-- Get_Sensitive --
-------------------
function Get_Sensitive
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal
(Action : System.Address)
return Gboolean;
pragma Import (C, Internal, "gtk_action_get_sensitive");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Get_Sensitive;
---------------------
-- Get_Short_Label --
---------------------
function Get_Short_Label
(Action : access Gtk_Action_Record)
return String
is
function Internal (Action : System.Address)
return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_short_label");
begin
return Value (Internal (Get_Object (Action)));
end Get_Short_Label;
------------------
-- Get_Stock_Id --
------------------
function Get_Stock_Id
(Action : access Gtk_Action_Record)
return String
is
function Internal
(Action : System.Address)
return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_stock_id");
begin
return Value (Internal (Get_Object (Action)));
end Get_Stock_Id;
-----------------
-- Get_Tooltip --
-----------------
function Get_Tooltip
(Action : access Gtk_Action_Record)
return String
is
function Internal (Action : System.Address)
return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_tooltip");
begin
return Value (Internal (Get_Object (Action)));
end Get_Tooltip;
-----------------
-- Get_Visible --
-----------------
function Get_Visible
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal
(Action : System.Address)
return Gboolean;
pragma Import (C, Internal, "gtk_action_get_visible");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Get_Visible;
----------------------------
-- Get_Visible_Horizontal --
----------------------------
function Get_Visible_Horizontal
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal (Action : System.Address) return Gboolean;
pragma Import (C, Internal, "gtk_action_get_visible_horizontal");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Get_Visible_Horizontal;
--------------------------
-- Get_Visible_Vertical --
--------------------------
function Get_Visible_Vertical
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal (Action : System.Address) return Gboolean;
pragma Import (C, Internal, "gtk_action_get_visible_vertical");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Get_Visible_Vertical;
------------------
-- Is_Sensitive --
------------------
function Is_Sensitive
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal
(Action : System.Address)
return Gboolean;
pragma Import (C, Internal, "gtk_action_is_sensitive");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Is_Sensitive;
----------------
-- Is_Visible --
----------------
function Is_Visible
(Action : access Gtk_Action_Record)
return Boolean
is
function Internal
(Action : System.Address)
return Gboolean;
pragma Import (C, Internal, "gtk_action_is_visible");
begin
return Boolean'Val (Internal (Get_Object (Action)));
end Is_Visible;
-------------
-- Gtk_New --
-------------
procedure Gtk_New
(Action : out Gtk_Action;
Name : String;
Label : String;
Tooltip : String := "";
Stock_Id : String := "")
is
begin
Action := new Gtk_Action_Record;
Initialize
(Action,
Name,
Label,
Tooltip,
Stock_Id);
end Gtk_New;
----------------
-- Initialize --
----------------
procedure Initialize
(Action : access Gtk_Action_Record'Class;
Name : String;
Label : String;
Tooltip : String := "";
Stock_Id : String := "")
is
function Internal
(Name : String;
Label : String;
Tooltip : chars_ptr;
Stock_Id : chars_ptr)
return System.Address;
pragma Import (C, Internal, "gtk_action_new");
T : chars_ptr := String_Or_Null (Tooltip);
S : chars_ptr := String_Or_Null (Stock_Id);
begin
Set_Object
(Action, Internal (Name & ASCII.NUL, Label & ASCII.NUL, T, S));
Free (T);
Free (S);
end Initialize;
---------------------
-- Set_Accel_Group --
---------------------
procedure Set_Accel_Group
(Action : access Gtk_Action_Record;
Accel_Group : Gtk_Accel_Group := null)
is
procedure Internal
(Action : System.Address;
Accel_Group : System.Address);
pragma Import (C, Internal, "gtk_action_set_accel_group");
begin
if Accel_Group = null then
Internal (Get_Object (Action), System.Null_Address);
else
Internal (Get_Object (Action), Get_Object (Accel_Group));
end if;
end Set_Accel_Group;
--------------------
-- Set_Accel_Path --
--------------------
procedure Set_Accel_Path
(Action : access Gtk_Action_Record;
Accel_Path : String)
is
procedure Internal
(Action : System.Address;
Accel_Path : String);
pragma Import (C, Internal, "gtk_action_set_accel_path");
begin
Internal (Get_Object (Action), Accel_Path & ASCII.NUL);
end Set_Accel_Path;
---------------
-- Set_GIcon --
---------------
procedure Set_GIcon
(Action : access Gtk_Action_Record;
Icon : Glib.G_Icon.G_Icon)
is
procedure Internal (Action : System.Address; Icon : Glib.G_Icon.G_Icon);
pragma Import (C, Internal, "gtk_action_set_gicon");
begin
Internal (Get_Object (Action), Icon);
end Set_GIcon;
-------------------
-- Set_Icon_Name --
-------------------
procedure Set_Icon_Name
(Action : access Gtk_Action_Record;
Icon_Name : String)
is
procedure Internal
(Action : System.Address;
Icon_Name : String);
pragma Import (C, Internal, "gtk_action_set_icon_name");
begin
Internal (Get_Object (Action), Icon_Name & ASCII.NUL);
end Set_Icon_Name;
----------------------
-- Set_Is_Important --
----------------------
procedure Set_Is_Important
(Action : access Gtk_Action_Record;
Is_Important : Boolean)
is
procedure Internal
(Action : System.Address;
Is_Important : Gboolean);
pragma Import (C, Internal, "gtk_action_set_is_important");
begin
Internal (Get_Object (Action), Boolean'Pos (Is_Important));
end Set_Is_Important;
---------------
-- Set_Label --
---------------
procedure Set_Label
(Action : access Gtk_Action_Record;
Label : String)
is
procedure Internal
(Action : System.Address;
Label : String);
pragma Import (C, Internal, "gtk_action_set_label");
begin
Internal (Get_Object (Action), Label & ASCII.NUL);
end Set_Label;
-------------------
-- Set_Sensitive --
-------------------
procedure Set_Sensitive
(Action : access Gtk_Action_Record;
Sensitive : Boolean)
is
procedure Internal
(Action : System.Address;
Sensitive : Gboolean);
pragma Import (C, Internal, "gtk_action_set_sensitive");
begin
Internal (Get_Object (Action), Boolean'Pos (Sensitive));
end Set_Sensitive;
---------------------
-- Set_Short_Label --
---------------------
procedure Set_Short_Label
(Action : access Gtk_Action_Record;
Short_Label : String)
is
procedure Internal
(Action : System.Address;
Short_Label : String);
pragma Import (C, Internal, "gtk_action_set_short_label");
begin
Internal (Get_Object (Action), Short_Label & ASCII.NUL);
end Set_Short_Label;
------------------
-- Set_Stock_Id --
------------------
procedure Set_Stock_Id
(Action : access Gtk_Action_Record;
Stock_Id : String)
is
procedure Internal
(Action : System.Address;
Stock_Id : String);
pragma Import (C, Internal, "gtk_action_set_stock_id");
begin
Internal (Get_Object (Action), Stock_Id & ASCII.NUL);
end Set_Stock_Id;
-----------------
-- Set_Tooltip --
-----------------
procedure Set_Tooltip
(Action : access Gtk_Action_Record;
Tooltip : String)
is
procedure Internal
(Action : System.Address;
Tooltip : String);
pragma Import (C, Internal, "gtk_action_set_tooltip");
begin
Internal (Get_Object (Action), Tooltip & ASCII.NUL);
end Set_Tooltip;
-----------------
-- Set_Visible --
-----------------
procedure Set_Visible
(Action : access Gtk_Action_Record;
Visible : Boolean)
is
procedure Internal
(Action : System.Address;
Visible : Gboolean);
pragma Import (C, Internal, "gtk_action_set_visible");
begin
Internal (Get_Object (Action), Boolean'Pos (Visible));
end Set_Visible;
----------------------------
-- Set_Visible_Horizontal --
----------------------------
procedure Set_Visible_Horizontal
(Action : access Gtk_Action_Record;
Visible_Horizontal : Boolean)
is
procedure Internal
(Action : System.Address;
Visible_Horizontal : Gboolean);
pragma Import (C, Internal, "gtk_action_set_visible_horizontal");
begin
Internal (Get_Object (Action), Boolean'Pos (Visible_Horizontal));
end Set_Visible_Horizontal;
--------------------------
-- Set_Visible_Vertical --
--------------------------
procedure Set_Visible_Vertical
(Action : access Gtk_Action_Record;
Visible_Vertical : Boolean)
is
procedure Internal
(Action : System.Address;
Visible_Vertical : Gboolean);
pragma Import (C, Internal, "gtk_action_set_visible_vertical");
begin
Internal (Get_Object (Action), Boolean'Pos (Visible_Vertical));
end Set_Visible_Vertical;
----------------------
-- Unblock_Activate --
----------------------
procedure Unblock_Activate (Action : access Gtk_Action_Record) is
procedure Internal (Action : System.Address);
pragma Import (C, Internal, "gtk_action_unblock_activate");
begin
Internal (Get_Object (Action));
end Unblock_Activate;
---------------------------
-- Unblock_Activate_From --
---------------------------
procedure Unblock_Activate_From
(Action : access Gtk_Action_Record;
Proxy : access Gtk_Widget_Record'Class)
is
procedure Internal
(Action : System.Address;
Proxy : System.Address);
pragma Import (C, Internal, "gtk_action_unblock_activate_from");
begin
Internal (Get_Object (Action), Get_Object (Proxy));
end Unblock_Activate_From;
-----------------
-- Create_Menu --
-----------------
function Create_Menu
(Action : access Gtk_Action_Record)
return Gtk_Widget
is
function Internal
(Action : System.Address)
return System.Address;
pragma Import (C, Internal, "gtk_action_create_menu");
Stub : Gtk_Widget_Record;
begin
return Gtk_Widget
(Get_User_Data
(Internal (Get_Object (Action)), Stub));
end Create_Menu;
---------------------------
-- Gtk_Widget_Get_Action --
---------------------------
function Gtk_Widget_Get_Action
(Widget : access Gtk_Widget_Record)
return Gtk_Action
is
function Internal
(Widget : System.Address)
return System.Address;
pragma Import (C, Internal, "gtk_widget_get_action");
Stub : Gtk_Action_Record;
begin
return Gtk_Action
(Get_User_Data
(Internal (Get_Object (Widget)), Stub));
end Gtk_Widget_Get_Action;
end Gtk.Action;
|