1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. pragma Ada_2005; 
  25.  
  26. pragma Warnings (Off, "*is already use-visible*"); 
  27. with Gdk.Types;            use Gdk.Types; 
  28. with Interfaces.C.Strings; use Interfaces.C.Strings; 
  29.  
  30. package Gtk.Stock is 
  31.  
  32.    Stock_About : constant UTF8_String := "gtk-about"; 
  33.    Stock_Add : constant UTF8_String := "gtk-add"; 
  34.    Stock_Apply : constant UTF8_String := "gtk-apply"; 
  35.    Stock_Bold : constant UTF8_String := "gtk-bold"; 
  36.    Stock_Cancel : constant UTF8_String := "gtk-cancel"; 
  37.    Stock_Caps_Lock_Warning : constant UTF8_String := "gtk-caps-lock-warning"; 
  38.    Stock_Cdrom : constant UTF8_String := "gtk-cdrom"; 
  39.    Stock_Clear : constant UTF8_String := "gtk-clear"; 
  40.    Stock_Close : constant UTF8_String := "gtk-close"; 
  41.    Stock_Color_Picker : constant UTF8_String := "gtk-color-picker"; 
  42.    Stock_Connect : constant UTF8_String := "gtk-connect"; 
  43.    Stock_Convert : constant UTF8_String := "gtk-convert"; 
  44.    Stock_Copy : constant UTF8_String := "gtk-copy"; 
  45.    Stock_Cut : constant UTF8_String := "gtk-cut"; 
  46.    Stock_Delete : constant UTF8_String := "gtk-delete"; 
  47.    Stock_Dialog_Authentication : constant UTF8_String := "gtk-dialog-authentication"; 
  48.    Stock_Dialog_Error : constant UTF8_String := "gtk-dialog-error"; 
  49.    Stock_Dialog_Info : constant UTF8_String := "gtk-dialog-info"; 
  50.    Stock_Dialog_Question : constant UTF8_String := "gtk-dialog-question"; 
  51.    Stock_Dialog_Warning : constant UTF8_String := "gtk-dialog-warning"; 
  52.    Stock_Directory : constant UTF8_String := "gtk-directory"; 
  53.    Stock_Discard : constant UTF8_String := "gtk-discard"; 
  54.    Stock_Disconnect : constant UTF8_String := "gtk-disconnect"; 
  55.    Stock_Dnd : constant UTF8_String := "gtk-dnd"; 
  56.    Stock_Dnd_Multiple : constant UTF8_String := "gtk-dnd-multiple"; 
  57.    Stock_Edit : constant UTF8_String := "gtk-edit"; 
  58.    Stock_Execute : constant UTF8_String := "gtk-execute"; 
  59.    Stock_File : constant UTF8_String := "gtk-file"; 
  60.    Stock_Find : constant UTF8_String := "gtk-find"; 
  61.    Stock_Find_And_Replace : constant UTF8_String := "gtk-find-and-replace"; 
  62.    Stock_Floppy : constant UTF8_String := "gtk-floppy"; 
  63.    Stock_Fullscreen : constant UTF8_String := "gtk-fullscreen"; 
  64.    Stock_Go_Back : constant UTF8_String := "gtk-go-back"; 
  65.    Stock_Go_Down : constant UTF8_String := "gtk-go-down"; 
  66.    Stock_Go_Forward : constant UTF8_String := "gtk-go-forward"; 
  67.    Stock_Go_Up : constant UTF8_String := "gtk-go-up"; 
  68.    Stock_Goto_Bottom : constant UTF8_String := "gtk-goto-bottom"; 
  69.    Stock_Goto_First : constant UTF8_String := "gtk-goto-first"; 
  70.    Stock_Goto_Last : constant UTF8_String := "gtk-goto-last"; 
  71.    Stock_Goto_Top : constant UTF8_String := "gtk-goto-top"; 
  72.    Stock_Harddisk : constant UTF8_String := "gtk-harddisk"; 
  73.    Stock_Help : constant UTF8_String := "gtk-help"; 
  74.    Stock_Home : constant UTF8_String := "gtk-home"; 
  75.    Stock_Indent : constant UTF8_String := "gtk-indent"; 
  76.    Stock_Index : constant UTF8_String := "gtk-index"; 
  77.    Stock_Info : constant UTF8_String := "gtk-info"; 
  78.    Stock_Italic : constant UTF8_String := "gtk-italic"; 
  79.    Stock_Jump_To : constant UTF8_String := "gtk-jump-to"; 
  80.    Stock_Justify_Center : constant UTF8_String := "gtk-justify-center"; 
  81.    Stock_Justify_Fill : constant UTF8_String := "gtk-justify-fill"; 
  82.    Stock_Justify_Left : constant UTF8_String := "gtk-justify-left"; 
  83.    Stock_Justify_Right : constant UTF8_String := "gtk-justify-right"; 
  84.    Stock_Leave_Fullscreen : constant UTF8_String := "gtk-leave-fullscreen"; 
  85.    Stock_Media_Forward : constant UTF8_String := "gtk-media-forward"; 
  86.    Stock_Media_Next : constant UTF8_String := "gtk-media-next"; 
  87.    Stock_Media_Pause : constant UTF8_String := "gtk-media-pause"; 
  88.    Stock_Media_Play : constant UTF8_String := "gtk-media-play"; 
  89.    Stock_Media_Previous : constant UTF8_String := "gtk-media-previous"; 
  90.    Stock_Media_Record : constant UTF8_String := "gtk-media-record"; 
  91.    Stock_Media_Rewind : constant UTF8_String := "gtk-media-rewind"; 
  92.    Stock_Media_Stop : constant UTF8_String := "gtk-media-stop"; 
  93.    Stock_Missing_Image : constant UTF8_String := "gtk-missing-image"; 
  94.    Stock_Network : constant UTF8_String := "gtk-network"; 
  95.    Stock_New : constant UTF8_String := "gtk-new"; 
  96.    Stock_No : constant UTF8_String := "gtk-no"; 
  97.    Stock_Ok : constant UTF8_String := "gtk-ok"; 
  98.    Stock_Open : constant UTF8_String := "gtk-open"; 
  99.    Stock_Orientation_Landscape : constant UTF8_String := "gtk-orientation-landscape"; 
  100.    Stock_Orientation_Portrait : constant UTF8_String := "gtk-orientation-portrait"; 
  101.    Stock_Orientation_Reverse_Landscape : constant UTF8_String := "gtk-orientation-reverse-landscape"; 
  102.    Stock_Orientation_Reverse_Portrait : constant UTF8_String := "gtk-orientation-reverse-portrait"; 
  103.    Stock_Page_Setup : constant UTF8_String := "gtk-page-setup"; 
  104.    Stock_Paste : constant UTF8_String := "gtk-paste"; 
  105.    Stock_Preferences : constant UTF8_String := "gtk-preferences"; 
  106.    Stock_Print : constant UTF8_String := "gtk-print"; 
  107.    Stock_Print_Error : constant UTF8_String := "gtk-print-error"; 
  108.    Stock_Print_Paused : constant UTF8_String := "gtk-print-paused"; 
  109.    Stock_Print_Preview : constant UTF8_String := "gtk-print-preview"; 
  110.    Stock_Print_Report : constant UTF8_String := "gtk-print-report"; 
  111.    Stock_Print_Warning : constant UTF8_String := "gtk-print-warning"; 
  112.    Stock_Properties : constant UTF8_String := "gtk-properties"; 
  113.    Stock_Quit : constant UTF8_String := "gtk-quit"; 
  114.    Stock_Redo : constant UTF8_String := "gtk-redo"; 
  115.    Stock_Refresh : constant UTF8_String := "gtk-refresh"; 
  116.    Stock_Remove : constant UTF8_String := "gtk-remove"; 
  117.    Stock_Revert_To_Saved : constant UTF8_String := "gtk-revert-to-saved"; 
  118.    Stock_Save : constant UTF8_String := "gtk-save"; 
  119.    Stock_Save_As : constant UTF8_String := "gtk-save-as"; 
  120.    Stock_Select_All : constant UTF8_String := "gtk-select-all"; 
  121.    Stock_Select_Color : constant UTF8_String := "gtk-select-color"; 
  122.    Stock_Select_Font : constant UTF8_String := "gtk-select-font"; 
  123.    Stock_Sort_Ascending : constant UTF8_String := "gtk-sort-ascending"; 
  124.    Stock_Sort_Descending : constant UTF8_String := "gtk-sort-descending"; 
  125.    Stock_Spell_Check : constant UTF8_String := "gtk-spell-check"; 
  126.    Stock_Stop : constant UTF8_String := "gtk-stop"; 
  127.    Stock_Strikethrough : constant UTF8_String := "gtk-strikethrough"; 
  128.    Stock_Undelete : constant UTF8_String := "gtk-undelete"; 
  129.    Stock_Underline : constant UTF8_String := "gtk-underline"; 
  130.    Stock_Undo : constant UTF8_String := "gtk-undo"; 
  131.    Stock_Unindent : constant UTF8_String := "gtk-unindent"; 
  132.    Stock_Yes : constant UTF8_String := "gtk-yes"; 
  133.    Stock_Zoom_100 : constant UTF8_String := "gtk-zoom-100"; 
  134.    Stock_Zoom_Fit : constant UTF8_String := "gtk-zoom-fit"; 
  135.    Stock_Zoom_In : constant UTF8_String := "gtk-zoom-in"; 
  136.    Stock_Zoom_Out : constant UTF8_String := "gtk-zoom-out"; 
  137.  
  138.    type Gtk_Stock_Item is private; 
  139.    function From_Object_Free (B : access Gtk_Stock_Item) return Gtk_Stock_Item; 
  140.    pragma Inline (From_Object_Free); 
  141.  
  142.  
  143.    type Gtk_Stock_Item_Array is array (Natural range <>) of Gtk_Stock_Item; 
  144.  
  145.    ------------- 
  146.    -- Methods -- 
  147.    ------------- 
  148.  
  149.    function Copy (Self : Gtk_Stock_Item) return Gtk_Stock_Item; 
  150.    pragma Import (C, Copy, "gtk_stock_item_copy"); 
  151.    --  Copies a stock item, mostly useful for language bindings and not in 
  152.    --  applications. 
  153.  
  154.    ---------------------- 
  155.    -- GtkAda additions -- 
  156.    ---------------------- 
  157.  
  158.    procedure Gtk_New 
  159.      (Item               : out Gtk_Stock_Item; 
  160.       Stock_Id           : String; 
  161.       Label              : UTF8_String; 
  162.       Modifier           : Gdk.Types.Gdk_Modifier_Type; 
  163.       Keyval             : Gdk.Types.Gdk_Key_Type; 
  164.       Translation_Domain : String); 
  165.    --  Create a new stock item. 
  166.  
  167.    procedure Free (Item : in out Gtk_Stock_Item); 
  168.    --  Free memory allocated in Item. 
  169.  
  170.    procedure Add (Item : Gtk_Stock_Item); 
  171.    --  Register Item. 
  172.    --  If an item already exists with the same stock ID as one of the items, 
  173.    --  the old item gets replaced. The stock item is copied, so GtkAda does 
  174.    --  not hold any pointer into item and item can be freed. Use 
  175.    --  Add_Static if item is persistent and GtkAda need not copy the array. 
  176.  
  177.    --------------- 
  178.    -- Functions -- 
  179.    --------------- 
  180.  
  181.    procedure Add (Items : Gtk_Stock_Item_Array); 
  182.    --  Registers each of the stock items in Items. If an item already exists 
  183.    --  with the same stock ID as one of the Items, the old item gets replaced. 
  184.    --  The stock items are copied, so GTK+ does not hold any pointer into Items 
  185.    --  and Items can be freed. Use Gtk.Stock.Add_Static if Items is persistent 
  186.    --  and GTK+ need not copy the array. 
  187.    --  "items": a Gtk.Stock.Gtk_Stock_Item or array of items 
  188.  
  189.    procedure Add_Static (Items : Gtk_Stock_Item_Array); 
  190.    --  Same as Gtk.Stock.Add, but doesn't copy Items, so Items must persist 
  191.    --  until application exit. 
  192.    --  "items": a Gtk.Stock.Gtk_Stock_Item or array of 
  193.    --  Gtk.Stock.Gtk_Stock_Item 
  194.  
  195.    procedure Lookup 
  196.       (Stock_Id : UTF8_String; 
  197.        Item     : out Gtk_Stock_Item; 
  198.        Success  : out Boolean); 
  199.    --  Fills Item with the registered values for Stock_Id, returning True if 
  200.    --  Stock_Id was known. 
  201.    --  "stock_id": a stock item name 
  202.    --  "item": stock item to initialize with values 
  203.  
  204. private 
  205. type Gtk_Stock_Item is record 
  206.    Stock_Id : Interfaces.C.Strings.chars_ptr; 
  207.    Label : Interfaces.C.Strings.chars_ptr; 
  208.    Modifier : Gdk.Types.Gdk_Modifier_Type; 
  209.    Keyval : Guint; 
  210.    Translation_Domain : Interfaces.C.Strings.chars_ptr; 
  211. end record; 
  212. pragma Convention (C, Gtk_Stock_Item); 
  213.  
  214. end Gtk.Stock;