File: gtk-tool_item.adb

package info (click to toggle)
libgtkada2 2.8.1-6lenny3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,496 kB
  • ctags: 3,886
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,169; xml: 19
file content (402 lines) | stat: -rw-r--r-- 12,271 bytes parent folder | download | duplicates (2)
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
-----------------------------------------------------------------------
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
--                                                                   --
--                Copyright (C) 2006 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.                                       --
--                                                                   --
-----------------------------------------------------------------------

--  <c_version>2.8.17</c_version>

with Gtk.Enums;        use Gtk.Enums;
with Gtk.Menu_Item;    use Gtk.Menu_Item;
with Gtk.Tooltips;     use Gtk.Tooltips;

package body Gtk.Tool_Item is

   -------------
   -- Gtk_New --
   -------------

   procedure Gtk_New (Item : out Gtk_Tool_Item) is
   begin
      Item := new Gtk_Tool_Item_Record;
      Gtk.Tool_Item.Initialize (Item);
   end Gtk_New;

   ----------------
   -- Initialize --
   ----------------

   procedure Initialize (Item : access Gtk_Tool_Item_Record'Class) is
      function Internal return System.Address;
      pragma Import (C, Internal, "gtk_tool_item_new");
   begin
      Set_Object (Item, Internal);
   end Initialize;

   ----------------
   -- Get_Expand --
   ----------------

   function Get_Expand
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Boolean
   is
      function Internal
        (Tool_Item : System.Address)
         return Gboolean;
      pragma Import (C, Internal, "gtk_tool_item_get_expand");
   begin
      return Boolean'Val (Internal (Get_Object (Tool_Item)));
   end Get_Expand;

   ---------------------
   -- Get_Homogeneous --
   ---------------------

   function Get_Homogeneous
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Boolean
   is
      function Internal
        (Tool_Item : System.Address)
         return Gboolean;
      pragma Import (C, Internal, "gtk_tool_item_get_homogeneous");
   begin
      return Boolean'Val (Internal (Get_Object (Tool_Item)));
   end Get_Homogeneous;

   -------------------
   -- Get_Icon_Size --
   -------------------

   function Get_Icon_Size
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Gtk_Icon_Size
   is
      function Internal
        (Tool_Item : System.Address)
         return Gtk_Icon_Size;
      pragma Import (C, Internal, "gtk_tool_item_get_icon_size");
   begin
      return Internal (Get_Object (Tool_Item));
   end Get_Icon_Size;

   ----------------------
   -- Get_Is_Important --
   ----------------------

   function Get_Is_Important
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Boolean
   is
      function Internal
        (Tool_Item : System.Address)
         return Gboolean;
      pragma Import (C, Internal, "gtk_tool_item_get_is_important");
   begin
      return Boolean'Val (Internal (Get_Object (Tool_Item)));
   end Get_Is_Important;

   ---------------------
   -- Get_Orientation --
   ---------------------

   function Get_Orientation
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Gtk_Orientation
   is
      function Internal
        (Tool_Item : System.Address)
         return Gtk_Orientation;
      pragma Import (C, Internal, "gtk_tool_item_get_orientation");
   begin
      return Internal (Get_Object (Tool_Item));
   end Get_Orientation;

   -------------------------
   -- Get_Proxy_Menu_Item --
   -------------------------

   function Get_Proxy_Menu_Item
     (Tool_Item    : access Gtk_Tool_Item_Record;
      Menu_Item_Id : String)
      return Gtk_Menu_Item
   is
      function Internal
        (Tool_Item    : System.Address;
         Menu_Item_Id : String)
         return System.Address;
      pragma Import (C, Internal, "gtk_tool_item_get_proxy_menu_item");
      Stub : Gtk_Menu_Item_Record;
   begin
      return Gtk_Menu_Item
        (Get_User_Data
          (Internal (Get_Object (Tool_Item), Menu_Item_Id & ASCII.NUL), Stub));
   end Get_Proxy_Menu_Item;

   ----------------------
   -- Get_Relief_Style --
   ----------------------

   function Get_Relief_Style
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Gtk_Relief_Style
   is
      function Internal
        (Tool_Item : System.Address)
         return Gtk_Relief_Style;
      pragma Import (C, Internal, "gtk_tool_item_get_relief_style");
   begin
      return Internal (Get_Object (Tool_Item));
   end Get_Relief_Style;

   -----------------------
   -- Get_Toolbar_Style --
   -----------------------

   function Get_Toolbar_Style
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Gtk_Toolbar_Style
   is
      function Internal
        (Tool_Item : System.Address)
         return Gtk_Toolbar_Style;
      pragma Import (C, Internal, "gtk_tool_item_get_toolbar_style");
   begin
      return Internal (Get_Object (Tool_Item));
   end Get_Toolbar_Style;

   -------------------------
   -- Get_Use_Drag_Window --
   -------------------------

   function Get_Use_Drag_Window
     (Toolitem : access Gtk_Tool_Item_Record)
      return Boolean
   is
      function Internal
        (Toolitem : System.Address)
         return Gboolean;
      pragma Import (C, Internal, "gtk_tool_item_get_use_drag_window");
   begin
      return Boolean'Val (Internal (Get_Object (Toolitem)));
   end Get_Use_Drag_Window;

   ----------------------------
   -- Get_Visible_Horizontal --
   ----------------------------

   function Get_Visible_Horizontal
     (Toolitem : access Gtk_Tool_Item_Record)
      return Boolean
   is
      function Internal
        (Toolitem : System.Address)
         return Gboolean;
      pragma Import (C, Internal, "gtk_tool_item_get_visible_horizontal");
   begin
      return Boolean'Val (Internal (Get_Object (Toolitem)));
   end Get_Visible_Horizontal;

   --------------------------
   -- Get_Visible_Vertical --
   --------------------------

   function Get_Visible_Vertical
     (Toolitem : access Gtk_Tool_Item_Record)
      return Boolean
   is
      function Internal
        (Toolitem : System.Address)
         return Gboolean;
      pragma Import (C, Internal, "gtk_tool_item_get_visible_vertical");
   begin
      return Boolean'Val (Internal (Get_Object (Toolitem)));
   end Get_Visible_Vertical;

   ------------------
   -- Rebuild_Menu --
   ------------------

   procedure Rebuild_Menu
     (Tool_Item : access Gtk_Tool_Item_Record)
   is
      procedure Internal
        (Tool_Item : System.Address);
      pragma Import (C, Internal, "gtk_tool_item_rebuild_menu");
   begin
      Internal (Get_Object (Tool_Item));
   end Rebuild_Menu;

   ------------------------------
   -- Retrieve_Proxy_Menu_Item --
   ------------------------------

   function Retrieve_Proxy_Menu_Item
     (Tool_Item : access Gtk_Tool_Item_Record)
      return Gtk_Menu_Item
   is
      function Internal
        (Tool_Item : System.Address)
         return System.Address;
      pragma Import (C, Internal, "gtk_tool_item_retrieve_proxy_menu_item");
      Stub : Gtk_Menu_Item_Record;
   begin
      return Gtk_Menu_Item
        (Get_User_Data
          (Internal (Get_Object (Tool_Item)), Stub));
   end Retrieve_Proxy_Menu_Item;

   ----------------
   -- Set_Expand --
   ----------------

   procedure Set_Expand
     (Tool_Item : access Gtk_Tool_Item_Record;
      Expand    : Boolean)
   is
      procedure Internal
        (Tool_Item : System.Address;
         Expand    : Gboolean);
      pragma Import (C, Internal, "gtk_tool_item_set_expand");
   begin
      Internal (Get_Object (Tool_Item), Boolean'Pos (Expand));
   end Set_Expand;

   ---------------------
   -- Set_Homogeneous --
   ---------------------

   procedure Set_Homogeneous
     (Tool_Item   : access Gtk_Tool_Item_Record;
      Homogeneous : Boolean)
   is
      procedure Internal
        (Tool_Item   : System.Address;
         Homogeneous : Gboolean);
      pragma Import (C, Internal, "gtk_tool_item_set_homogeneous");
   begin
      Internal (Get_Object (Tool_Item), Boolean'Pos (Homogeneous));
   end Set_Homogeneous;

   ----------------------
   -- Set_Is_Important --
   ----------------------

   procedure Set_Is_Important
     (Tool_Item    : access Gtk_Tool_Item_Record;
      Is_Important : Boolean)
   is
      procedure Internal
        (Tool_Item    : System.Address;
         Is_Important : Gboolean);
      pragma Import (C, Internal, "gtk_tool_item_set_is_important");
   begin
      Internal (Get_Object (Tool_Item), Boolean'Pos (Is_Important));
   end Set_Is_Important;

   -------------------------
   -- Set_Proxy_Menu_Item --
   -------------------------

   procedure Set_Proxy_Menu_Item
     (Tool_Item    : access Gtk_Tool_Item_Record;
      Menu_Item_Id : String;
      Menu_Item    : Gtk_Menu_Item)
   is
      procedure Internal
        (Tool_Item    : System.Address;
         Menu_Item_Id : String;
         Menu_Item    : System.Address);
      pragma Import (C, Internal, "gtk_tool_item_set_proxy_menu_item");
   begin
      Internal (Get_Object (Tool_Item), Menu_Item_Id & ASCII.NUL,
                Get_Object (Menu_Item));
   end Set_Proxy_Menu_Item;

   -----------------
   -- Set_Tooltip --
   -----------------

   procedure Set_Tooltip
     (Tool_Item   : access Gtk_Tool_Item_Record;
      Tooltips    : access Gtk_Tooltips_Record'Class;
      Tip_Text    : String;
      Tip_Private : String := "")
   is
      procedure Internal
        (Tool_Item   : System.Address;
         Tooltips    : System.Address;
         Tip_Text    : String;
         Tip_Private : String);
      pragma Import (C, Internal, "gtk_tool_item_set_tooltip");
   begin
      Internal (Get_Object (Tool_Item), Get_Object (Tooltips),
                Tip_Text & ASCII.NUL, Tip_Private & ASCII.NUL);
   end Set_Tooltip;

   -------------------------
   -- Set_Use_Drag_Window --
   -------------------------

   procedure Set_Use_Drag_Window
     (Toolitem        : access Gtk_Tool_Item_Record;
      Use_Drag_Window : Boolean)
   is
      procedure Internal
        (Toolitem        : System.Address;
         Use_Drag_Window : Gboolean);
      pragma Import (C, Internal, "gtk_tool_item_set_use_drag_window");
   begin
      Internal (Get_Object (Toolitem), Boolean'Pos (Use_Drag_Window));
   end Set_Use_Drag_Window;

   ----------------------------
   -- Set_Visible_Horizontal --
   ----------------------------

   procedure Set_Visible_Horizontal
     (Toolitem           : access Gtk_Tool_Item_Record;
      Visible_Horizontal : Boolean)
   is
      procedure Internal
        (Toolitem           : System.Address;
         Visible_Horizontal : Gboolean);
      pragma Import (C, Internal, "gtk_tool_item_set_visible_horizontal");
   begin
      Internal (Get_Object (Toolitem), Boolean'Pos (Visible_Horizontal));
   end Set_Visible_Horizontal;

   --------------------------
   -- Set_Visible_Vertical --
   --------------------------

   procedure Set_Visible_Vertical
     (Toolitem         : access Gtk_Tool_Item_Record;
      Visible_Vertical : Boolean)
   is
      procedure Internal
        (Toolitem         : System.Address;
         Visible_Vertical : Gboolean);
      pragma Import (C, Internal, "gtk_tool_item_set_visible_vertical");
   begin
      Internal (Get_Object (Toolitem), Boolean'Pos (Visible_Vertical));
   end Set_Visible_Vertical;

end Gtk.Tool_Item;