/usr/share/ada/adainclude/gtkada/gtk-action.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 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 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 | ------------------------------------------------------------------------------
-- --
-- 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/>. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (Off);
pragma Warnings (Off, "*is already use-visible*");
with Ada.Unchecked_Conversion;
with Glib.Type_Conversion_Hooks; use Glib.Type_Conversion_Hooks;
with Glib.Values; use Glib.Values;
with Gtk.Arguments; use Gtk.Arguments;
with Gtkada.Bindings; use Gtkada.Bindings;
pragma Warnings(Off); -- might be unused
with Interfaces.C.Strings; use Interfaces.C.Strings;
pragma Warnings(On);
package body Gtk.Action is
package Type_Conversion_Gtk_Action is new Glib.Type_Conversion_Hooks.Hook_Registrator
(Get_Type'Access, Gtk_Action_Record);
pragma Unreferenced (Type_Conversion_Gtk_Action);
--------------------
-- Gtk_Action_New --
--------------------
function Gtk_Action_New
(Name : UTF8_String;
Label : UTF8_String := "";
Tooltip : UTF8_String := "";
Stock_Id : UTF8_String := "") return Gtk_Action
is
Action : constant Gtk_Action := new Gtk_Action_Record;
begin
Gtk.Action.Initialize (Action, Name, Label, Tooltip, Stock_Id);
return Action;
end Gtk_Action_New;
-------------
-- Gtk_New --
-------------
procedure Gtk_New
(Action : out Gtk_Action;
Name : UTF8_String;
Label : UTF8_String := "";
Tooltip : UTF8_String := "";
Stock_Id : UTF8_String := "")
is
begin
Action := new Gtk_Action_Record;
Gtk.Action.Initialize (Action, Name, Label, Tooltip, Stock_Id);
end Gtk_New;
----------------
-- Initialize --
----------------
procedure Initialize
(Action : not null access Gtk_Action_Record'Class;
Name : UTF8_String;
Label : UTF8_String := "";
Tooltip : UTF8_String := "";
Stock_Id : UTF8_String := "")
is
function Internal
(Name : Interfaces.C.Strings.chars_ptr;
Label : Interfaces.C.Strings.chars_ptr;
Tooltip : Interfaces.C.Strings.chars_ptr;
Stock_Id : Interfaces.C.Strings.chars_ptr) return System.Address;
pragma Import (C, Internal, "gtk_action_new");
Tmp_Name : Interfaces.C.Strings.chars_ptr := New_String (Name);
Tmp_Label : Interfaces.C.Strings.chars_ptr;
Tmp_Tooltip : Interfaces.C.Strings.chars_ptr;
Tmp_Stock_Id : Interfaces.C.Strings.chars_ptr;
Tmp_Return : System.Address;
begin
if not Action.Is_Created then
if Label = "" then
Tmp_Label := Interfaces.C.Strings.Null_Ptr;
else
Tmp_Label := New_String (Label);
end if;
if Tooltip = "" then
Tmp_Tooltip := Interfaces.C.Strings.Null_Ptr;
else
Tmp_Tooltip := New_String (Tooltip);
end if;
if Stock_Id = "" then
Tmp_Stock_Id := Interfaces.C.Strings.Null_Ptr;
else
Tmp_Stock_Id := New_String (Stock_Id);
end if;
Tmp_Return := Internal (Tmp_Name, Tmp_Label, Tmp_Tooltip, Tmp_Stock_Id);
Free (Tmp_Stock_Id);
Free (Tmp_Tooltip);
Free (Tmp_Label);
Free (Tmp_Name);
Set_Object (Action, Tmp_Return);
end if;
end Initialize;
--------------
-- Activate --
--------------
procedure Activate (Action : not null 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 : not null 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;
-------------------------
-- Connect_Accelerator --
-------------------------
procedure Connect_Accelerator
(Action : not null 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;
-----------------
-- Create_Icon --
-----------------
function Create_Icon
(Action : not null access Gtk_Action_Record;
Icon_Size : Gtk.Enums.Gtk_Icon_Size) return Gtk.Widget.Gtk_Widget
is
function Internal
(Action : System.Address;
Icon_Size : Gtk.Enums.Gtk_Icon_Size) return System.Address;
pragma Import (C, Internal, "gtk_action_create_icon");
Stub_Gtk_Widget : Gtk.Widget.Gtk_Widget_Record;
begin
return Gtk.Widget.Gtk_Widget (Get_User_Data (Internal (Get_Object (Action), Icon_Size), Stub_Gtk_Widget));
end Create_Icon;
-----------------
-- Create_Menu --
-----------------
function Create_Menu
(Action : not null access Gtk_Action_Record)
return Gtk.Widget.Gtk_Widget
is
function Internal (Action : System.Address) return System.Address;
pragma Import (C, Internal, "gtk_action_create_menu");
Stub_Gtk_Widget : Gtk.Widget.Gtk_Widget_Record;
begin
return Gtk.Widget.Gtk_Widget (Get_User_Data (Internal (Get_Object (Action)), Stub_Gtk_Widget));
end Create_Menu;
----------------------
-- Create_Menu_Item --
----------------------
function Create_Menu_Item
(Action : not null access Gtk_Action_Record)
return Gtk.Widget.Gtk_Widget
is
function Internal (Action : System.Address) return System.Address;
pragma Import (C, Internal, "gtk_action_create_menu_item");
Stub_Gtk_Widget : Gtk.Widget.Gtk_Widget_Record;
begin
return Gtk.Widget.Gtk_Widget (Get_User_Data (Internal (Get_Object (Action)), Stub_Gtk_Widget));
end Create_Menu_Item;
----------------------
-- Create_Tool_Item --
----------------------
function Create_Tool_Item
(Action : not null access Gtk_Action_Record)
return Gtk.Widget.Gtk_Widget
is
function Internal (Action : System.Address) return System.Address;
pragma Import (C, Internal, "gtk_action_create_tool_item");
Stub_Gtk_Widget : Gtk.Widget.Gtk_Widget_Record;
begin
return Gtk.Widget.Gtk_Widget (Get_User_Data (Internal (Get_Object (Action)), Stub_Gtk_Widget));
end Create_Tool_Item;
----------------------------
-- Disconnect_Accelerator --
----------------------------
procedure Disconnect_Accelerator
(Action : not null 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;
--------------------
-- Get_Accel_Path --
--------------------
function Get_Accel_Path
(Action : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_accel_path");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Accel_Path;
---------------------------
-- Get_Always_Show_Image --
---------------------------
function Get_Always_Show_Image
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_get_always_show_image");
begin
return Internal (Get_Object (Action)) /= 0;
end Get_Always_Show_Image;
---------------
-- Get_Gicon --
---------------
function Get_Gicon
(Action : not null 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 : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_icon_name");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Icon_Name;
----------------------
-- Get_Is_Important --
----------------------
function Get_Is_Important
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_get_is_important");
begin
return Internal (Get_Object (Action)) /= 0;
end Get_Is_Important;
---------------
-- Get_Label --
---------------
function Get_Label
(Action : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_label");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Label;
--------------
-- Get_Name --
--------------
function Get_Name
(Action : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_name");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Name;
-----------------
-- Get_Proxies --
-----------------
function Get_Proxies
(Action : not null 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");
Tmp_Return : Gtk.Widget.Widget_SList.GSlist;
begin
Gtk.Widget.Widget_SList.Set_Object (Tmp_Return, Internal (Get_Object (Action)));
return Tmp_Return;
end Get_Proxies;
-------------------
-- Get_Sensitive --
-------------------
function Get_Sensitive
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_get_sensitive");
begin
return Internal (Get_Object (Action)) /= 0;
end Get_Sensitive;
---------------------
-- Get_Short_Label --
---------------------
function Get_Short_Label
(Action : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_short_label");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Short_Label;
------------------
-- Get_Stock_Id --
------------------
function Get_Stock_Id
(Action : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_stock_id");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Stock_Id;
-----------------
-- Get_Tooltip --
-----------------
function Get_Tooltip
(Action : not null access Gtk_Action_Record) return UTF8_String
is
function Internal
(Action : System.Address) return Interfaces.C.Strings.chars_ptr;
pragma Import (C, Internal, "gtk_action_get_tooltip");
begin
return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Action)));
end Get_Tooltip;
-----------------
-- Get_Visible --
-----------------
function Get_Visible
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_get_visible");
begin
return Internal (Get_Object (Action)) /= 0;
end Get_Visible;
----------------------------
-- Get_Visible_Horizontal --
----------------------------
function Get_Visible_Horizontal
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_get_visible_horizontal");
begin
return Internal (Get_Object (Action)) /= 0;
end Get_Visible_Horizontal;
--------------------------
-- Get_Visible_Vertical --
--------------------------
function Get_Visible_Vertical
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_get_visible_vertical");
begin
return Internal (Get_Object (Action)) /= 0;
end Get_Visible_Vertical;
------------------
-- Is_Sensitive --
------------------
function Is_Sensitive
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_is_sensitive");
begin
return Internal (Get_Object (Action)) /= 0;
end Is_Sensitive;
----------------
-- Is_Visible --
----------------
function Is_Visible
(Action : not null access Gtk_Action_Record) return Boolean
is
function Internal (Action : System.Address) return Glib.Gboolean;
pragma Import (C, Internal, "gtk_action_is_visible");
begin
return Internal (Get_Object (Action)) /= 0;
end Is_Visible;
---------------------
-- Set_Accel_Group --
---------------------
procedure Set_Accel_Group
(Action : not null access Gtk_Action_Record;
Accel_Group : access Gtk.Accel_Group.Gtk_Accel_Group_Record'Class)
is
procedure Internal
(Action : System.Address;
Accel_Group : System.Address);
pragma Import (C, Internal, "gtk_action_set_accel_group");
begin
Internal (Get_Object (Action), Get_Object_Or_Null (GObject (Accel_Group)));
end Set_Accel_Group;
--------------------
-- Set_Accel_Path --
--------------------
procedure Set_Accel_Path
(Action : not null access Gtk_Action_Record;
Accel_Path : UTF8_String)
is
procedure Internal
(Action : System.Address;
Accel_Path : Interfaces.C.Strings.chars_ptr);
pragma Import (C, Internal, "gtk_action_set_accel_path");
Tmp_Accel_Path : Interfaces.C.Strings.chars_ptr := New_String (Accel_Path);
begin
Internal (Get_Object (Action), Tmp_Accel_Path);
Free (Tmp_Accel_Path);
end Set_Accel_Path;
---------------------------
-- Set_Always_Show_Image --
---------------------------
procedure Set_Always_Show_Image
(Action : not null access Gtk_Action_Record;
Always_Show : Boolean)
is
procedure Internal
(Action : System.Address;
Always_Show : Glib.Gboolean);
pragma Import (C, Internal, "gtk_action_set_always_show_image");
begin
Internal (Get_Object (Action), Boolean'Pos (Always_Show));
end Set_Always_Show_Image;
---------------
-- Set_Gicon --
---------------
procedure Set_Gicon
(Action : not null 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 : not null access Gtk_Action_Record;
Icon_Name : UTF8_String)
is
procedure Internal
(Action : System.Address;
Icon_Name : Interfaces.C.Strings.chars_ptr);
pragma Import (C, Internal, "gtk_action_set_icon_name");
Tmp_Icon_Name : Interfaces.C.Strings.chars_ptr := New_String (Icon_Name);
begin
Internal (Get_Object (Action), Tmp_Icon_Name);
Free (Tmp_Icon_Name);
end Set_Icon_Name;
----------------------
-- Set_Is_Important --
----------------------
procedure Set_Is_Important
(Action : not null access Gtk_Action_Record;
Is_Important : Boolean)
is
procedure Internal
(Action : System.Address;
Is_Important : Glib.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 : not null access Gtk_Action_Record;
Label : UTF8_String)
is
procedure Internal
(Action : System.Address;
Label : Interfaces.C.Strings.chars_ptr);
pragma Import (C, Internal, "gtk_action_set_label");
Tmp_Label : Interfaces.C.Strings.chars_ptr := New_String (Label);
begin
Internal (Get_Object (Action), Tmp_Label);
Free (Tmp_Label);
end Set_Label;
-------------------
-- Set_Sensitive --
-------------------
procedure Set_Sensitive
(Action : not null access Gtk_Action_Record;
Sensitive : Boolean)
is
procedure Internal
(Action : System.Address;
Sensitive : Glib.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 : not null access Gtk_Action_Record;
Short_Label : UTF8_String)
is
procedure Internal
(Action : System.Address;
Short_Label : Interfaces.C.Strings.chars_ptr);
pragma Import (C, Internal, "gtk_action_set_short_label");
Tmp_Short_Label : Interfaces.C.Strings.chars_ptr := New_String (Short_Label);
begin
Internal (Get_Object (Action), Tmp_Short_Label);
Free (Tmp_Short_Label);
end Set_Short_Label;
------------------
-- Set_Stock_Id --
------------------
procedure Set_Stock_Id
(Action : not null access Gtk_Action_Record;
Stock_Id : UTF8_String)
is
procedure Internal
(Action : System.Address;
Stock_Id : Interfaces.C.Strings.chars_ptr);
pragma Import (C, Internal, "gtk_action_set_stock_id");
Tmp_Stock_Id : Interfaces.C.Strings.chars_ptr := New_String (Stock_Id);
begin
Internal (Get_Object (Action), Tmp_Stock_Id);
Free (Tmp_Stock_Id);
end Set_Stock_Id;
-----------------
-- Set_Tooltip --
-----------------
procedure Set_Tooltip
(Action : not null access Gtk_Action_Record;
Tooltip : UTF8_String)
is
procedure Internal
(Action : System.Address;
Tooltip : Interfaces.C.Strings.chars_ptr);
pragma Import (C, Internal, "gtk_action_set_tooltip");
Tmp_Tooltip : Interfaces.C.Strings.chars_ptr := New_String (Tooltip);
begin
Internal (Get_Object (Action), Tmp_Tooltip);
Free (Tmp_Tooltip);
end Set_Tooltip;
-----------------
-- Set_Visible --
-----------------
procedure Set_Visible
(Action : not null access Gtk_Action_Record;
Visible : Boolean)
is
procedure Internal (Action : System.Address; Visible : Glib.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 : not null access Gtk_Action_Record;
Visible_Horizontal : Boolean)
is
procedure Internal
(Action : System.Address;
Visible_Horizontal : Glib.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 : not null access Gtk_Action_Record;
Visible_Vertical : Boolean)
is
procedure Internal
(Action : System.Address;
Visible_Vertical : Glib.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 : not null 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;
use type System.Address;
function Cb_To_Address is new Ada.Unchecked_Conversion
(Cb_Gtk_Action_Void, System.Address);
function Address_To_Cb is new Ada.Unchecked_Conversion
(System.Address, Cb_Gtk_Action_Void);
function Cb_To_Address is new Ada.Unchecked_Conversion
(Cb_GObject_Void, System.Address);
function Address_To_Cb is new Ada.Unchecked_Conversion
(System.Address, Cb_GObject_Void);
procedure Connect
(Object : access Gtk_Action_Record'Class;
C_Name : Glib.Signal_Name;
Handler : Cb_Gtk_Action_Void;
After : Boolean);
procedure Connect_Slot
(Object : access Gtk_Action_Record'Class;
C_Name : Glib.Signal_Name;
Handler : Cb_GObject_Void;
After : Boolean;
Slot : access Glib.Object.GObject_Record'Class := null);
procedure Marsh_GObject_Void
(Closure : GClosure;
Return_Value : Glib.Values.GValue;
N_Params : Glib.Guint;
Params : Glib.Values.C_GValues;
Invocation_Hint : System.Address;
User_Data : System.Address);
pragma Convention (C, Marsh_GObject_Void);
procedure Marsh_Gtk_Action_Void
(Closure : GClosure;
Return_Value : Glib.Values.GValue;
N_Params : Glib.Guint;
Params : Glib.Values.C_GValues;
Invocation_Hint : System.Address;
User_Data : System.Address);
pragma Convention (C, Marsh_Gtk_Action_Void);
-------------
-- Connect --
-------------
procedure Connect
(Object : access Gtk_Action_Record'Class;
C_Name : Glib.Signal_Name;
Handler : Cb_Gtk_Action_Void;
After : Boolean)
is
begin
Unchecked_Do_Signal_Connect
(Object => Object,
C_Name => C_Name,
Marshaller => Marsh_Gtk_Action_Void'Access,
Handler => Cb_To_Address (Handler),-- Set in the closure
After => After);
end Connect;
------------------
-- Connect_Slot --
------------------
procedure Connect_Slot
(Object : access Gtk_Action_Record'Class;
C_Name : Glib.Signal_Name;
Handler : Cb_GObject_Void;
After : Boolean;
Slot : access Glib.Object.GObject_Record'Class := null)
is
begin
Unchecked_Do_Signal_Connect
(Object => Object,
C_Name => C_Name,
Marshaller => Marsh_GObject_Void'Access,
Handler => Cb_To_Address (Handler),-- Set in the closure
Slot_Object => Slot,
After => After);
end Connect_Slot;
------------------------
-- Marsh_GObject_Void --
------------------------
procedure Marsh_GObject_Void
(Closure : GClosure;
Return_Value : Glib.Values.GValue;
N_Params : Glib.Guint;
Params : Glib.Values.C_GValues;
Invocation_Hint : System.Address;
User_Data : System.Address)
is
pragma Unreferenced (Return_Value, N_Params, Params, Invocation_Hint, User_Data);
H : constant Cb_GObject_Void := Address_To_Cb (Get_Callback (Closure));
Obj : constant Glib.Object.GObject := Glib.Object.Convert (Get_Data (Closure));
begin
H (Obj);
exception when E : others => Process_Exception (E);
end Marsh_GObject_Void;
---------------------------
-- Marsh_Gtk_Action_Void --
---------------------------
procedure Marsh_Gtk_Action_Void
(Closure : GClosure;
Return_Value : Glib.Values.GValue;
N_Params : Glib.Guint;
Params : Glib.Values.C_GValues;
Invocation_Hint : System.Address;
User_Data : System.Address)
is
pragma Unreferenced (Return_Value, N_Params, Invocation_Hint, User_Data);
H : constant Cb_Gtk_Action_Void := Address_To_Cb (Get_Callback (Closure));
Obj : constant Gtk_Action := Gtk_Action (Unchecked_To_Object (Params, 0));
begin
H (Obj);
exception when E : others => Process_Exception (E);
end Marsh_Gtk_Action_Void;
-----------------
-- On_Activate --
-----------------
procedure On_Activate
(Self : not null access Gtk_Action_Record;
Call : Cb_Gtk_Action_Void;
After : Boolean := False)
is
begin
Connect (Self, "activate" & ASCII.NUL, Call, After);
end On_Activate;
-----------------
-- On_Activate --
-----------------
procedure On_Activate
(Self : not null access Gtk_Action_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
is
begin
Connect_Slot (Self, "activate" & ASCII.NUL, Call, After, Slot);
end On_Activate;
end Gtk.Action;
|