1<?xml version="1.0"?> 2 3<!-- This file overrides parts of the .gir files. --> 4 5<GIR xmlns:gir="http://www.gtk.org/introspection/core/1.0" 6 xmlns:c="http://www.gtk.org/introspection/c/1.0"> 7 8 <!-- ################################################ 9 Gdk.Device 10 ################################################--> 11 12 <package id="GdkDevice"> 13 <enum ctype="GdkDeviceType" /> 14 <list ada="Device_List" ctype="GdkDevice"/> 15 <method id="::changed" bind="False" /> <!-- elaboration circularity --> 16 <method id="gdk_device_get_axis" bind="False" /><!-- need support for array of gdoubles --> 17 <method id="gdk_device_get_axis_value" bind="False" /><!-- need support for array of gdoubles --> 18 <method id="gdk_device_get_history" bind="False" /><!-- need support for array of Gdk_Time_Coord --> 19 <method id="gdk_device_free_history" bind="False" /><!-- no need while we don't bind get_history --> 20 <method id="gdk_device_grab_info_libgtk_only" bind="False" /><!-- not part of library --> 21 <method id="gdk_device_get_key" return="" bind="False"/><!-- pending L118-010 --> 22 <method id="gdk_device_get_window_at_position" bind="False"/><!-- below --> 23 <method id="gdk_device_get_position" bind="False"/><!-- pending resolution of a problem with generating the stub object --> 24 <method id="gdk_device_list_axes" bind="False"/><!-- no support for atom lists --> 25 <method id="gdk_device_list_slave_devices" bind="False"/><!-- no support 26 for Gdk_Device_Type_Master lists --> 27 28 <extra> 29 <spec> 30 procedure Get_Window_At_Position 31 (Self : not null access Gdk_Device_Record; 32 Win_X : out Gint; 33 Win_Y : out Gint; 34 Window : out Gdk.Gdk_Window); 35 -- Obtains the window underneath Device, returning the location of the 36 -- device in Win_X and Win_Y. Returns null if the window tree under Device 37 -- is not known to GDK (for example, belongs to another application). 38 -- As a slave device coordinates are those of its master pointer, This 39 -- function may not be called on devices of type 40 -- Gdk.Device.Gdk_Device_Type_Slave, unless there is an ongoing grab on 41 -- them, see Gdk.Device.Grab. 42 -- Since: gtk+ 3.0 43 -- "win_x": return location for the X coordinate of the device location, 44 -- relative to the window origin, or null. 45 -- "win_y": return location for the Y coordinate of the device location, 46 -- relative to the window origin, or null. 47 48 procedure Set_Device 49 (Event : Gdk.Event.Gdk_Event; 50 Device : not null access Gdk_Device_Record); 51 -- Sets the device for Event to Device. The event must 52 -- have been allocated by GTK+, for instance, by gdk_event_copy(). 53 54 procedure Set_Source_Device 55 (Event : Gdk.Event.Gdk_Event; 56 Device : not null access Gdk_Device_Record); 57 -- Sets the slave device for Event to Device. 58 -- The event must have been allocated by GTK+, 59 -- for instance by gdk_event_copy(). 60 </spec> 61 <body> 62 procedure Set_Source_Device 63 (Event : Gdk.Event.Gdk_Event; 64 Device : not null access Gdk_Device_Record) 65 is 66 procedure Internal (Event : Gdk.Event.Gdk_Event; D : System.Address); 67 pragma Import (C, Internal, "gdk_event_set_source_device"); 68 begin 69 Internal (Event, Get_Object (Device)); 70 end Set_Source_Device; 71 72 procedure Set_Device 73 (Event : Gdk.Event.Gdk_Event; 74 Device : not null access Gdk_Device_Record) 75 is 76 procedure Internal (Event : Gdk.Event.Gdk_Event; D : System.Address); 77 pragma Import (C, Internal, "gdk_event_set_device"); 78 begin 79 Internal (Event, Get_Object (Device)); 80 end Set_Device; 81 82 procedure Get_Window_At_Position 83 (Self : not null access Gdk_Device_Record; 84 Win_X : out Gint; 85 Win_Y : out Gint; 86 Window : out Gdk.Gdk_Window) 87 is 88 function Internal 89 (Self : System.Address; 90 Acc_Win_X : access Gint; 91 Acc_Win_Y : access Gint) return Gdk.Gdk_Window; 92 pragma Import (C, Internal, "gdk_device_get_window_at_position"); 93 Acc_Win_X : aliased Gint; 94 Acc_Win_Y : aliased Gint; 95 begin 96 Window := Internal (Get_Object (Self), Acc_Win_X'Access, Acc_Win_Y'Access); 97 Win_X := Acc_Win_X; 98 Win_Y := Acc_Win_Y; 99 end Get_Window_At_Position; 100 </body> 101 </extra> 102 </package> 103 104 <!-- ################################################ 105 Gdk.Drag_Contexts 106 ################################################--> 107 108 <package id="GdkDragContext"> 109 <enum ctype="GdkDragAction" prefix="GDK_"/> 110 <enum ctype="GdkDragProtocol" prefix="GDK_"/> 111 <method id="gdk_drag_context_list_targets" bind="False"/><!-- not supposed to be used by applications --> 112 </package> 113 114 <!-- ################################################ 115 Gdk.Screen 116 ################################################--> 117 118 <package id="GdkScreen"> 119 <doc group="Gdk, the low-level API"/> 120 <parameter name="self" ada="Screen"/> 121 <method id="gdk_screen_get_setting" bind="False" /> 122 <method id="::composited-changed" bind="False" /> <!-- elaboration circularity --> 123 <method id="::monitors-changed" bind="False" /> <!-- elaboration circularity --> 124 <method id="::size-changed" bind="False" /> <!-- elaboration circularity --> 125 126 <method id="gdk_screen_get_toplevel_windows" return="WindowList" bind="False"/> <!-- circular dep --> 127 <method id="gdk_screen_get_window_stack" return="WindowList" bind="False"/> <!-- circular dep with GdkWindow--> 128 <method id="gdk_screen_list_visuals" return="WindowList" bind="False"/> <!-- circular dep with GdkWindow--> 129 <extra> 130 <with_spec pkg="Gdk.Types" /> 131 <spec> 132 ------------- 133 -- Display -- 134 ------------- 135 -- These subprograms should really be in gdk-display.ads to match what is 136 -- done for gtk+ itself, but that would create dependency circularities. 137 -- Ada 2005 has support for these, but we want GtkAda to build with Ada95 138 -- compilers. 139 140 function Get_Screen 141 (Display : access Gdk.Display.Gdk_Display_Record'Class; 142 Screen_Num : Glib.Gint) 143 return Gdk_Screen; 144 -- Returns a screen object for one of the screens of the display. 145 146 function Get_Default_Screen 147 (Display : access Gdk.Display.Gdk_Display_Record'Class) return Gdk_Screen; 148 -- Get the default Gdk_Screen for display. 149 150 procedure Get_Pointer 151 (Display : access Gdk.Display.Gdk_Display_Record'Class; 152 Screen : out Gdk_Screen; 153 X : out Glib.Gint; 154 Y : out Glib.Gint; 155 Mask : out Gdk.Types.Gdk_Modifier_Type); 156 -- Gets the current location of the pointer and the current modifier 157 -- mask for a given display. 158 -- (X, Y) are coordinates relative to the root window on the display 159 160 procedure Warp_Pointer 161 (Display : access Gdk.Display.Gdk_Display_Record'Class; 162 Screen : access Gdk_Screen_Record; 163 X : Glib.Gint; 164 Y : Glib.Gint); 165 -- Warps the pointer of display to the point x,y on the screen screen, 166 -- unless the pointer is confined to a window by a grab, in which case it 167 -- will be moved as far as allowed by the grab. Warping the pointer creates 168 -- events as if the user had moved the mouse instantaneously to the 169 -- destination. 170 -- 171 -- Note that the pointer should normally be under the control of the user. 172 -- This function was added to cover some rare use cases like keyboard 173 -- navigation support for the color picker in the GtkColorSelectionDialog. 174 </spec> 175 <body> 176 function Get_Screen 177 (Display : access Gdk_Display_Record'Class; 178 Screen_Num : Gint) 179 return Gdk_Screen 180 is 181 function Internal 182 (Display : System.Address; 183 Screen_Num : Gint) 184 return System.Address; 185 pragma Import (C, Internal, "gdk_display_get_screen"); 186 -- External binding: gdk_display_get_screen 187 Stub : Gdk_Screen_Record; 188 begin 189 return Gdk_Screen 190 (Get_User_Data 191 (Internal (Get_Object (Display), Screen_Num), Stub)); 192 end Get_Screen; 193 194 function Get_Default_Screen 195 (Display : access Gdk_Display_Record'Class) 196 return Gdk_Screen 197 is 198 function Internal 199 (Display : System.Address) 200 return System.Address; 201 pragma Import (C, Internal, "gdk_display_get_default_screen"); 202 -- External binding: gdk_display_get_default_screen 203 Stub : Gdk_Screen_Record; 204 begin 205 return Gdk_Screen 206 (Get_User_Data 207 (Internal (Get_Object (Display)), Stub)); 208 end Get_Default_Screen; 209 210 procedure Get_Pointer 211 (Display : access Gdk_Display_Record'Class; 212 Screen : out Gdk_Screen; 213 X : out Gint; 214 Y : out Gint; 215 Mask : out Gdk_Modifier_Type) 216 is 217 procedure Internal 218 (Display : System.Address; 219 Screen : out System.Address; 220 X : out Gint; 221 Y : out Gint; 222 Mask : out Gdk_Modifier_Type); 223 pragma Import (C, Internal, "gdk_display_get_pointer"); 224 -- External binding: gdk_display_get_pointer 225 226 S : System.Address; 227 Stub : Gdk_Screen_Record; 228 229 begin 230 Internal (Get_Object (Display), S, X, Y, Mask); 231 Screen := Gdk_Screen (Get_User_Data (S, Stub)); 232 end Get_Pointer; 233 234 procedure Warp_Pointer 235 (Display : access Gdk.Display.Gdk_Display_Record'Class; 236 Screen : access Gdk_Screen_Record; 237 X : Glib.Gint; 238 Y : Glib.Gint) 239 is 240 procedure Internal (D, S : System.Address; X, Y : Gint); 241 pragma Import (C, Internal, "gdk_display_warp_pointer"); 242 -- External binding: gdk_display_warp_pointer 243 begin 244 Internal (Get_Object (Display), Get_Object (Screen), X, Y); 245 end Warp_Pointer; 246 </body> 247 </extra> 248 </package> 249 250 <!-- ################################################ 251 Gtk.Aspect_Frame 252 ################################################--> 253 254 <package id="GtkAspectFrame"> 255 <doc testgtk="create_frame.adb" group="Layout Containers"/> 256 <parameter name="self" ada="Aspect_Frame"/> 257 <method id="gtk_aspect_frame_new"> 258 <parameter name="label" default='""' allow-none="1"/> 259 </method> 260 </package> 261 262 <!-- ################################################### 263 Gtk.Button 264 ###################################################--> 265 266 <package id="GtkButton"> 267 <doc screenshot="gtk-button" group="Buttons and Toggles" 268 testgtk="create_buttons.adb"/> 269 <parameter name="self" ada="Button"/> 270 <method id="gtk_button_new" bind="False"/> 271 <method id="gtk_button_new_with_label" ada="Gtk_New" > 272 <parameter name="label" default='""' allow-none="1"/> 273 </method> 274 </package> 275 276 <!-- ################################################### 277 Gtk.Cell_Area 278 ###################################################--> 279 280 <package id="GtkCellArea"> 281 <doc group="Layout Containers"/> 282 <method id="gtk_cell_area_cell_get_valist" bind="False"/><!-- va_list --> 283 <method id="gtk_cell_area_cell_set_valist" bind="False"/><!-- va_list --> 284 <method id="gtk_cell_area_add_with_properties" bind="False"/><!-- varargs--> 285 <method id="gtk_cell_area_cell_get" bind="False"/><!-- varargs--> 286 <method id="gtk_cell_area_cell_set" bind="False"/><!-- varargs--> 287 <method id="gtk_cell_area_get_cell_allocation"> 288 <parameter name="cell_area" direction="access" /> 289 <parameter name="allocation" direction="access" /> 290 </method> 291 <method id="gtk_cell_area_get_focus_siblings" return="ObjectList"/> 292 <method id="gtk_cell_area_get_cell_at_position" bind="False"/> 293 <!-- bound manually below --> 294 <extra> 295 <spec> 296 function Get_Area 297 (Context : access Gtk_Cell_Area_Context_Record) 298 return Gtk.Cell_Area.Gtk_Cell_Area; 299 -- Fetches the Gtk.Cell_Area.Gtk_Cell_Area this Context was created by. 300 -- This is generally unneeded by layouting widgets; however it is important 301 -- for the context implementation itself to fetch information about the 302 -- area it is being used for. 303 -- For instance at GtkCellAreaContextClass.allocate time its important to 304 -- know details about any cell spacing that the Gtk.Cell_Area.Gtk_Cell_Area 305 -- is configured with in order to compute a proper allocation. 306 -- Since: gtk+ 3.0 307 308 function Get_Area 309 (Cell_Layout : Gtk_Cell_Layout) return Gtk.Cell_Area.Gtk_Cell_Area; 310 -- Returns the underlying Gtk.Cell_Area.Gtk_Cell_Area which might be 311 -- Cell_Layout if called on a Gtk.Cell_Area.Gtk_Cell_Area or might be null 312 -- if no Gtk.Cell_Area.Gtk_Cell_Area is used by Cell_Layout. 313 -- Since: gtk+ 3.0 314 315 procedure Get_Cell_At_Position 316 (Self : access Gtk_Cell_Area_Record; 317 Context : access Gtk.Cell_Area_Context.Gtk_Cell_Area_Context_Record'Class; 318 Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 319 Cell_Area : Gdk.Rectangle.Gdk_Rectangle; 320 X : Gint; 321 Y : Gint; 322 Alloc_Area : out Gdk.Rectangle.Gdk_Rectangle; 323 Renderer : out Gtk.Cell_Renderer.Gtk_Cell_Renderer); 324 -- Gets the Gtk.Cell_Renderer.Gtk_Cell_Renderer at X and Y coordinates 325 -- inside Area and optionally returns the full cell allocation for it 326 -- inside Cell_Area. 327 -- Since: gtk+ 3.0 328 -- "context": the Gtk.Cell_Area_Context.Gtk_Cell_Area_Context used to hold 329 -- sizes for Area. 330 -- "widget": the Gtk.Widget.Gtk_Widget that Area is rendering on 331 -- "cell_area": the whole allocated area for Area in Widget for this row 332 -- "x": the x position 333 -- "y": the y position 334 -- "alloc_area": where to store the inner allocated area of the returned 335 -- cell renderer, or null. 336 -- "renderer": the rendered that was found. 337 </spec> 338 <body> 339 -------------- 340 -- Get_Area -- 341 -------------- 342 343 function Get_Area 344 (Context : access Gtk_Cell_Area_Context_Record) 345 return Gtk.Cell_Area.Gtk_Cell_Area 346 is 347 function Internal (Context : System.Address) return System.Address; 348 pragma Import (C, Internal, "gtk_cell_area_context_get_area"); 349 Stub_Gtk_Cell_Area : Gtk.Cell_Area.Gtk_Cell_Area_Record; 350 begin 351 return Gtk.Cell_Area.Gtk_Cell_Area 352 (Get_User_Data (Internal (Get_Object (Context)), Stub_Gtk_Cell_Area)); 353 end Get_Area; 354 355 -------------- 356 -- Get_Area -- 357 -------------- 358 359 function Get_Area 360 (Cell_Layout : Gtk_Cell_Layout) return Gtk.Cell_Area.Gtk_Cell_Area 361 is 362 function Internal 363 (Cell_Layout : Gtk_Cell_Layout) return System.Address; 364 pragma Import (C, Internal, "gtk_cell_layout_get_area"); 365 Stub_Gtk_Cell_Area : Gtk.Cell_Area.Gtk_Cell_Area_Record; 366 begin 367 return Gtk.Cell_Area.Gtk_Cell_Area (Get_User_Data (Internal (Cell_Layout), Stub_Gtk_Cell_Area)); 368 end Get_Area; 369 370 -------------------------- 371 -- Get_Cell_At_Position -- 372 -------------------------- 373 374 procedure Get_Cell_At_Position 375 (Self : access Gtk_Cell_Area_Record; 376 Context : access Gtk.Cell_Area_Context.Gtk_Cell_Area_Context_Record'Class; 377 Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 378 Cell_Area : Gdk.Rectangle.Gdk_Rectangle; 379 X : Gint; 380 Y : Gint; 381 Alloc_Area : out Gdk.Rectangle.Gdk_Rectangle; 382 Renderer : out Gtk.Cell_Renderer.Gtk_Cell_Renderer) 383 is 384 function Internal 385 (Self : System.Address; 386 Context : System.Address; 387 Widget : System.Address; 388 Cell_Area : Gdk.Rectangle.Gdk_Rectangle; 389 X : Gint; 390 Y : Gint; 391 Acc_Alloc_Area : access Gdk.Rectangle.Gdk_Rectangle) 392 return System.Address; 393 pragma Import (C, Internal, "gtk_cell_area_get_cell_at_position"); 394 Acc_Alloc_Area : aliased Gdk.Rectangle.Gdk_Rectangle; 395 Stub_Gtk_Cell_Renderer : Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record; 396 Tmp_Return : System.Address; 397 begin 398 Tmp_Return := Internal 399 (Get_Object (Self), Get_Object (Context), Get_Object (Widget), 400 Cell_Area, X, Y, Acc_Alloc_Area'Access); 401 Alloc_Area := Acc_Alloc_Area; 402 Renderer := Gtk.Cell_Renderer.Gtk_Cell_Renderer 403 (Get_User_Data (Tmp_Return, Stub_Gtk_Cell_Renderer)); 404 end Get_Cell_At_Position; 405 </body> 406 </extra> 407 </package> 408 409 <!-- ################################################### 410 Gtk.Cell_Area_Context 411 ###################################################--> 412 413 <package id="GtkCellAreaContext"> 414 <doc group="Layout Containers"/> 415 <method id="gtk_cell_area_context_get_area" bind="False"/> 416 <!-- in Gtk.Cell_Area --> 417 </package> 418 419 <!-- ################################################ 420 Gtk.Color_Selection 421 ################################################--> 422 423 <package id="GtkColorSelection"> 424 <doc testgtk="create_color_selection.adb" 425 screenshot="gtk-colorsel" 426 group="Drawing"> 427A Gtk_Color_Selection widget is a complex dialog that allows the user 428to select a color based either on its (Red, Green, Blue) or its 429(Hue, Saturation, Value). 430An additional field is provided to select the opacity of the color (this 431is usually called the alpha channel). 432 433See Gtk.Color_Selection_Dialog for a version of this widget that comes with 434its own dialog. 435 436See Gtk.Extra.Color_Combo for a different way to select colors. 437 </doc> 438 <parameter name="self" ada="Colorsel"/> 439 440 <!-- Bound manually below --> 441 <method id="gtk_color_selection_palette_from_string" bind="False"/> 442 <method id="gtk_color_selection_palette_to_string" bind="False"/> 443 444 <extra> 445 <spec> 446 type Gtk_Color_Selection_Change_Palette_With_Screen_Func is access procedure 447 (Screen : System.Address; -- Convert to Gdk_Screen with Get_User_Data 448 Colors : Gdk.Color.Gdk_Color_Unconstrained_Array; 449 N_Colors : Gint); 450 pragma Convention (C, Gtk_Color_Selection_Change_Palette_With_Screen_Func); 451 -- This function should save the new palette contents, and update the 452 -- Gtk_Settings property "gtk-color-palette" so all Gtk_Color_Selection 453 -- widgets will be modified, including the current one. For instance, you 454 -- would do: 455 -- Set_String_Property 456 -- (Get_Default, Gtk_Color_Palette, Palette_To_String (Colors), "Foo"); 457 458 function Palette_From_String 459 (Str : String) return Gdk.Color.Gdk_Color_Array; 460 -- Parses a color palette string. This string is a colon-separated list of 461 -- color names readable by Gdk.Color.Parse. 462 -- An empty array is returned if Str couldn't be parsed 463 464 function Palette_To_String 465 (Colors : Gdk.Color.Gdk_Color_Array) return String; 466 -- Encodes a palette as a string, useful for persistent storage. 467 </spec> 468 469 <with_body pkg="Gtkada.C"/> 470 <with_body pkg="Interfaces.C.Strings"/> 471 472 <body> 473 package Color_Arrays is new Gtkada.C.Unbounded_Arrays 474 (Gdk.Color.Gdk_Color, Gdk.Color.Null_Color, Natural, 475 Gdk.Color.Gdk_Color_Array); 476 477 function Palette_From_String (Str : String) return Gdk_Color_Array is 478 use Color_Arrays; 479 function Internal 480 (Str : String; 481 Colors : access Unbounded_Array_Access; N : access Gint) 482 return Gboolean; 483 pragma Import (C, Internal, "gtk_color_selection_palette_from_string"); 484 485 N : aliased Gint; 486 Output : aliased Unbounded_Array_Access; 487 begin 488 if Internal (Str & ASCII.NUL, Output'Access, N'Access) = 0 then 489 Output := null; 490 end if; 491 492 declare 493 Result : constant Gdk_Color_Array := To_Array (Output, Integer (N)); 494 begin 495 G_Free (Output); 496 return Result; 497 end; 498 end Palette_From_String; 499 500 function Palette_To_String (Colors : Gdk_Color_Array) return String is 501 function Internal 502 (Colors : System.Address; 503 N_Colors : Gint) 504 return Interfaces.C.Strings.chars_ptr; 505 pragma Import (C, Internal, "gtk_color_selection_palette_to_string"); 506 Str : chars_ptr; 507 begin 508 if Colors'Length = 0 then 509 return ""; 510 else 511 Str := Internal (Colors (Colors'First)'Address, Colors'Length); 512 declare 513 Result : constant String := Value (Str); 514 begin 515 Free (Str); 516 return Result; 517 end; 518 end if; 519 end Palette_To_String; 520 </body> 521 </extra> 522 </package> 523 524 <!-- ################################################ 525 Gtk.Color_Selection_Dialog 526 ################################################--> 527 528 <package id="GtkColorSelectionDialog"> 529 <doc group="Drawing"> 530The Gtk_Color_Selection_Dialog provides a standard dialog which allows the 531user to select a color much like the Gtk_File_Selection provides a standard 532dialog for file selection. 533 </doc> 534 <parameter name="self" ada="Color_Selection_Dialog"/> 535 <method id="gtk_color_selection_dialog_get_color_selection" 536 return="GtkColorSelection"> 537 </method> 538 </package> 539 540 <!-- ################################################ 541 Gtk.Combo_Box 542 ################################################--> 543 544 <package id="GtkComboBox"> 545 <doc group="Numeric/Text Data Entry"/> 546 <parameter name="self" ada="Combo_Box"/> 547 <method id="gtk_combo_box_popup_for_device" bind="False" /> 548 <method id="gtk_combo_box_get_popup_accessible" bind="False" /> 549 <method id="gtk_combo_box_get_active_iter" bind="False"/> <!-- below--> 550 <extra> 551 552 <with_body pkg="Gtk.GEntry" /> 553 <spec> 554 function Get_Active_Iter 555 (Combo_Box : not null access Gtk_Combo_Box_Record) 556 return Gtk.Tree_Model.Gtk_Tree_Iter; 557 -- Return the currently active iter 558 559 function Get_Active_Text 560 (Combo_Box : not null access Gtk_Combo_Box_Record) 561 return UTF8_String; 562 -- Return the text present in the entry if it has one, or the empty string 563 564 </spec> 565 <body> 566 function Get_Active_Iter 567 (Combo_Box : not null access Gtk_Combo_Box_Record) return Gtk_Tree_Iter 568 is 569 function Internal 570 (Combo_Box : System.Address; 571 Iter : System.Address) 572 return Gboolean; 573 pragma Import (C, Internal, "gtk_combo_box_get_active_iter"); 574 Iter : aliased Gtk_Tree_Iter; 575 Tmp : constant Gboolean := Internal 576 (Get_Object (Combo_Box), Iter'Address); 577 begin 578 if Tmp /= 0 then 579 return Iter; 580 else 581 return Null_Iter; 582 end if; 583 end Get_Active_Iter; 584 585 function Get_Active_Text 586 (Combo_Box : not null access Gtk_Combo_Box_Record) 587 return UTF8_String is 588 begin 589 if not Combo_Box.Get_Has_Entry then 590 return ""; 591 end if; 592 593 return Gtk_Entry (Combo_Box.Get_Child).Get_Text; 594 end Get_Active_Text; 595 596 </body> 597 </extra> 598 </package> 599 600 <!-- ################################################ 601 Gtk.Combo_Box_Text 602 ################################################--> 603 604 <package id="GtkComboBoxText"> 605 <doc group="Numeric/Text Data Entry"/> 606 </package> 607 608 <!-- ################################################ 609 Gtk.EventBox 610 ################################################--> 611 612 <package id="GtkEventBox"> 613 <doc group="Layout Containers"/> 614 <parameter name="self" ada="Event_Box"/> 615 <method id="gtk_event_box_new"> 616 <doc> 617Create a new box. 618 619The box's child can then be set using the Gtk.Container.Add function. 620 </doc> 621 </method> 622 </package> 623 624 625 <!-- ################################################ 626 Gtk.Font_Selection 627 ################################################--> 628 629 <package id="GtkFontSelection"> 630 <doc testgtk="create_font_selection.adb" 631 screenshot="gtk-fontsel" 632 group="Selectors"> 633This widget provides a nice way for the user of your application to 634select fonts. 635It first searches on your system for the list of fonts available, and 636displays a set of boxes to select them based on their name, their 637weight, their size, etc. 638This widget is provided in two forms, one widget that can be embedded 639in any container, a Gtk_Font_Selection, whereas the other one comes 640directly in its own separate window (to be popped up as a dialog). 641 642Some filters can be applied to the widget, when you want the user to 643select only a font only among a specific subset (like bitmap or 644true-type fonts for instance). 645There are two kinds of filters: a base filter, set in your application 646and that the user can not change; a user filter that can be modified 647interactively by the user. 648 </doc> 649 <parameter name="self" ada="Fontsel"/> 650 <method id="gtk_font_selection_get_family" bind="False"/> 651 <method id="gtk_font_selection_get_face" bind="False"/> 652 </package> 653 654 <!-- ################################################ 655 Gtk.Font_Selection_Dialog 656 ################################################--> 657 658 <package id="GtkFontSelectionDialog"> 659 <doc testgtk="create_font_selection.adb" 660 screenshot="gtk-fontsel" 661 group="Selectors"> 662This widget provides a dialog for selecting a font. 663See also Gtk.Font_Selection. 664 </doc> 665 <parameter name="self" ada="Dialog"/> 666 </package> 667 668 <!-- ################################################### 669 Gtk.Frame 670 ###################################################--> 671 <package id="GtkFrame"> 672 <doc screenshot="gtk-frame" testgtk="create_frame.adb" 673 group="Ornaments"> 674This is a very convenient widget to visually group related widgets (like 675groups of buttons for instance), possibly with a title to explain the 676purpose of this group. 677 678A Gtk_Frame has only one child, so you have to put a container like for 679instance a Gtk_Box inside if you want the frame to surround multiple 680widgets. 681 </doc> 682 <parameter name="self" ada="Frame"/> 683 684 <method id="gtk_frame_new"> 685 <parameter name="label" default='""' allow-none="1"/> 686 </method> 687 </package> 688 689 <!-- ################################################ 690 Gtk.Label 691 ################################################--> 692 693 <package id="GtkLabel"> 694 <doc screenshot="gtk-label" testgtk="create_label.adb" 695 group="Display widgets"/> 696 <parameter name="self" ada="Label"/> 697 <method id="gtk_label_new"> 698 <parameter name="str" default='""'/> 699 </method> 700 <method id="gtk_label_get" bind="false"/> 701 <method id="gtk_label_select_region"> 702 <parameter name="start_offset" default="-1"/> 703 <parameter name="end_offset" default="-1"/> 704 </method> 705 <method id="gtk_label_get_selection_bounds" 706 return_as_param="Has_Selection"/> 707 <method id="gtk_label_set_pattern"> 708 <doc> 709Change the underlines pattern. 710 711Pattern is a simple string made of underscore and space characters, 712matching the ones in the string. GtkAda will underline every letter 713that matches an underscore. 714 715An empty string disables the underlines. 716 717example: If the text is FooBarBaz and the Pattern is "___ ___" 718then both "Foo" and "Baz" will be underlined, but not "Bar". 719 </doc> 720 </method> 721 </package> 722 723 <!-- ################################################### 724 Gtk.Notebook 725 ###################################################--> 726 727 <package id="GtkNotebook"> 728 <enum ctype="GtkNotebookTab"/> 729 <doc screenshot="gtk-notebook" group="Layout containers" 730 testgtk="create_notebook.adb"/> 731 <parameter name="self" ada="Notebook"/> 732 <method id="gtk_notebook_set_scrollable"> 733 <parameter name="scrollable" default="True" /> 734 </method> 735 <method id="gtk_notebook_set_tab_reorderable"> 736 <parameter name="reorderable" default="True" /> 737 </method> 738 <method id="gtk_notebook_set_current_page"> 739 <parameter name="page_num" default="-1" /> 740 </method> 741 <method id="gtk_notebook_set_show_border"> 742 <parameter name="show_border" default="True" /> 743 </method> 744 <method id="gtk_notebook_append_page_menu" return="void" /> 745 <method id="gtk_notebook_set_show_tabs"> 746 <parameter name="show_tabs" default="True" /> 747 </method> 748 <method id="gtk_notebook_set_tab_detachable"> 749 <parameter name="detachable" default="True" /> 750 </method> 751 <extra> 752 <spec> 753 procedure Append_Page 754 (Notebook : access Gtk_Notebook_Record; 755 Child : access Gtk.Widget.Gtk_Widget_Record'Class); 756 procedure Append_Page 757 (Notebook : access Gtk_Notebook_Record; 758 Child : access Gtk.Widget.Gtk_Widget_Record'Class; 759 Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 760 procedure Prepend_Page 761 (Notebook : access Gtk_Notebook_Record; 762 Child : access Gtk.Widget.Gtk_Widget_Record'Class; 763 Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); 764 -- Convenience functions, same as above but discarding the return value. 765 </spec> 766 <body> 767 procedure Append_Page 768 (Notebook : access Gtk_Notebook_Record; 769 Child : access Gtk.Widget.Gtk_Widget_Record'Class) 770 is 771 Ignored : Gint; 772 pragma Unreferenced (Ignored); 773 begin 774 Ignored := Append_Page (Notebook, Child, null); 775 end Append_Page; 776 777 procedure Append_Page 778 (Notebook : access Gtk_Notebook_Record; 779 Child : access Gtk.Widget.Gtk_Widget_Record'Class; 780 Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class) 781 is 782 Ignored : Gint; 783 pragma Unreferenced (Ignored); 784 begin 785 Ignored := Append_Page (Notebook, Child, Tab_Label); 786 end Append_Page; 787 788 procedure Prepend_Page 789 (Notebook : access Gtk_Notebook_Record; 790 Child : access Gtk.Widget.Gtk_Widget_Record'Class; 791 Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class) 792 is 793 Ignored : Gint; 794 pragma Unreferenced (Ignored); 795 begin 796 Ignored := Append_Page (Notebook, Child, Tab_Label); 797 end Prepend_Page; 798 </body> 799 </extra> 800 </package> 801 802 <!-- ################################################ 803 Gtk.Paned 804 ################################################--> 805 806 <package id="GtkPaned"> 807 <doc screenshot="gtk-paned" testgtk="create_paned.adb" 808 group="Layout container"/> 809 <parameter name="self" ada="Paned"/> 810 <method id="gtk_paned_pack1"> 811 <parameter name="self" ada="Paned"/> 812 <parameter name="resize" default="False" /> 813 <parameter name="shrink" default="True" /> 814 <doc> 815Add a child to the top or left pane. 816You can not change dynamically the attributes Resize and Shrink. 817Instead, you have to remove the child from the container, and put it 818back with the new value of the attributes. You should also first 819call Glib.Object.Ref on the child so as to be sure it is not destroyed 820when you remove it, and Glib.Object.Unref it at the end. See the 821example in testgtk/ in the GtkAda distribution. 822 </doc> 823 </method> 824 <method id="gtk_paned_pack2"> 825 <parameter name="self" ada="Paned"/> 826 <parameter name="resize" default="False" /> 827 <parameter name="shrink" default="False" /> 828 </method> 829 <method id="gtk_paned_add1"> 830 <parameter name="self" ada="Paned"/> 831 <doc> 832Add the first child of the container. 833The child will be displayed either in the top or in the left pane, 834depending on the orientation of the container. 835This is equivalent to using the Pack1 procedure with its default parameters. 836 </doc> 837 </method> 838 <method id="gtk_paned_add2"> 839 <parameter name="self" ada="Paned"/> 840 <doc> 841Add the second child of the container. 842It will be displayed in the bottom or right pane, depending on the 843container's orientation. 844This is equivalent to using Pack2 with its default parameters. 845 </doc> 846 </method> 847 </package> 848 849 <package id="GtkVPaned" into="GtkPaned"> 850 <type name="Gtk_Vpaned" subtype="true"/> 851 <parameter name="self" ada="Paned"/> 852 <method id="gtk_vpaned_new" ada="Gtk_New_Vpaned"> 853 <doc>The children will be displayed one on top of the other</doc> 854 </method> 855 <method id="gtk_vpaned_get_type" ada="Get_Type_Vpaned" /> 856 </package> 857 858 <package id="GtkHPaned" into="GtkPaned"> 859 <type name="Gtk_Hpaned" subtype="true"/> 860 <parameter name="self" ada="Paned"/> 861 <method id="gtk_hpaned_new" ada="Gtk_New_Hpaned"> 862 <doc>The children will be displayed next to each other</doc> 863 </method> 864 <method id="gtk_hpaned_get_type" ada="Get_Type_Hpaned" /> 865 </package> 866 867 868 <!-- ################################################ 869 Gtk.Box, Gtk.Vbox, Gtk.Hbox 870 ################################################--> 871 <package id="GtkBox"> 872 <doc screenshot="gtk-box" testgtk="create_box.adb" 873 group="Layout containers"> 874See the testgtk example in the GtkAda distribution to see concrete examples 875on how all the parameters for the boxes work. 876 </doc> 877 <method id="gtk_box_pack_start"> 878 <parameter name="self" ada="In_Box"/> 879 <parameter name="expand" default="True"/> 880 <parameter name="fill" default="True"/> 881 <parameter name="padding" default="0"/> 882 </method> 883 <method id="gtk_box_pack_end"> 884 <parameter name="self" ada="In_Box"/> 885 <parameter name="expand" default="True"/> 886 <parameter name="fill" default="True"/> 887 <parameter name="padding" default="0"/> 888 </method> 889 <parameter name="self" ada="Box"/> 890 891 <extra> 892 <gir:method c:identifier="ada_box_get_child" name="Get_Child" 893 version="GtkAda 1.0"> 894 <gir:doc>Return the Num-th child of the box, or null if there is no such child</gir:doc> 895 <gir:return-value> 896 <gir:type name="GtkWidget" c:type="GtkWidget*"/> 897 </gir:return-value> 898 <gir:parameters> 899 <gir:parameter name="num"> 900 <gir:type name="Gint" c:type="gint"/> 901 </gir:parameter> 902 </gir:parameters> 903 </gir:method> 904 </extra> 905 </package> 906 907 <package id="GtkVBox" into="GtkBox"> 908 <type name="Gtk_Vbox" subtype="true"/> 909 <method id="gtk_vbox_new" ada="Gtk_New_Vbox"> 910 <parameter name="homogeneous" default="False"/> 911 <parameter name="spacing" default="0"/> 912 </method> 913 <parameter name="self" ada="Box"/> 914 <method id="gtk_vbox_get_type" ada="Get_Vbox_Type" /> 915 </package> 916 917 <package id="GtkHBox" into="GtkBox"> 918 <type name="Gtk_Hbox" subtype="true"/> 919 <method id="gtk_hbox_new" ada="Gtk_New_Hbox" > 920 <parameter name="homogeneous" default="False"/> 921 <parameter name="spacing" default="0"/> 922 </method> 923 <parameter name="self" ada="Box"/> 924 <method id="gtk_hbox_get_type" ada="Get_Hbox_Type" /> 925 </package> 926 927 <package id="GtkScale"> 928 <doc group="Numeric/Text Data Entry" screenshot="gtk-scale.png"/> 929 <parameter name="self" ada="Scale"/> 930 </package> 931 <package id="GtkVScale" into="GtkScale"> 932 <parameter name="self" ada="Scale"/> 933 <type name="Gtk_Vscale" subtype="true"/> 934 <method id="gtk_vscale_new" ada="Gtk_New_Vscale"> 935 <parameter name="adjustment" default="null"/> 936 </method> 937 <method id="gtk_vscale_new_with_range" ada="Gtk_New_Vscale"/> 938 <method id="gtk_vscale_get_type" ada="Vscale_Get_Type" /> 939 </package> 940 <package id="GtkHScale" into="GtkScale"> 941 <parameter name="self" ada="Scale"/> 942 <type name="Gtk_Hscale" subtype="true"/> 943 <method id="gtk_hscale_new" ada="Gtk_New_Hscale"> 944 <parameter name="adjustment" default="null"/> 945 </method> 946 <method id="gtk_hscale_new_with_range" ada="Gtk_New_Hscale"/> 947 <method id="gtk_hscale_get_type" ada="Hscale_Get_Type" /> 948 </package> 949 950 <package id="GtkArrow"> 951 <doc screenshot="gtk-arrow" testgtk="create_arrow.adb"/> 952 <parameter name="self" ada="Arrow"/> 953 </package> 954 955 <package id="GtkClipboard"> 956 <parameter name="self" ada="Clipboard"/> 957 <method id="gtk_clipboard_get"> 958 <parameter name="selection" default="Gdk.Types.Gdk_None"/> 959 </method> 960 <method id="gtk_clipboard_get_for_display"> 961 <parameter name="selection" default="Gdk.Types.Gdk_None"/> 962 </method> 963 <method id="gtk_clipboard_request_rich_text"> 964 <parameter name="buffer" ctype="GObject*"/> 965 </method> 966 <method id="gtk_clipboard_wait_is_rich_text_available"> 967 <parameter name="buffer" ctype="GObject*"/> 968 </method> 969 <method id="gtk_clipboard_set_can_store"> 970 <parameter name="targets" type="Gtk.Target_List.Target_Entry_Array"/> 971 </method> 972 <method id="gtk_clipboard_set_text"> 973 <parameter name="text" ctype="char*"/> 974 <parameter name="len" default="-1" ada=""/> 975 </method> 976 977 <method id="gtk_clipboard_set_with_data" bind="false" /> <!-- low-level --> 978 <method id="gtk_clipboard_set_with_owner" bind="false" /> <!-- low-level --> 979 <method id="gtk_clipboard_wait_for_rich_text" bind="false" /> <!-- Returns an array, not practical --> 980 <method id="gtk_clipboard_wait_for_targets" bind="false" /> <!-- bound manually below --> 981 <extra> 982 <spec> 983 function Wait_For_Targets 984 (Clipboard : not null access Gtk_Clipboard_Record) 985 return Gdk.Types.Gdk_Atom_Array; 986 -- Returns a list of targets that are present on the clipboard, or an empty 987 -- array if there aren't any targets available. 988 -- This function waits for the data to be received using the main 989 -- loop, so events, timeouts, etc, may be dispatched during the wait. 990 </spec> 991 <with_body pkg="Gtkada.C" /> 992 <body> 993 package Atom_Arrays is new Gtkada.C.Unbounded_Arrays 994 (Gdk.Types.Gdk_Atom, Gdk.Types.Gdk_None, 995 Natural, Gdk.Types.Gdk_Atom_Array); 996 997 ---------------------- 998 -- Wait_For_Targets -- 999 ---------------------- 1000 1001 function Wait_For_Targets 1002 (Clipboard : not null access Gtk_Clipboard_Record) 1003 return Gdk.Types.Gdk_Atom_Array 1004 is 1005 use Atom_Arrays; 1006 function Internal 1007 (Clipboard : System.Address; 1008 Targets : access Unbounded_Array_Access; 1009 N_Targets : access Gint) return Gboolean; 1010 pragma Import (C, Internal, "gtk_clipboard_wait_for_targets"); 1011 1012 Output : aliased Unbounded_Array_Access; 1013 N_Targets : aliased Gint; 1014 begin 1015 if Internal 1016 (Get_Object (Clipboard), 1017 Output'Unchecked_Access, 1018 N_Targets'Unchecked_Access) = 0 1019 then 1020 G_Free (Output); 1021 Output := null; 1022 end if; 1023 1024 declare 1025 Result : constant Gdk_Atom_Array := 1026 To_Array (Output, Integer (N_Targets)); 1027 begin 1028 if Output /= null then 1029 G_Free (Output); 1030 end if; 1031 1032 return Result; 1033 end; 1034 end Wait_For_Targets; 1035 </body> 1036 </extra> 1037 </package> 1038 1039 <!-- ####################################################### 1040 ## Gtk.Viewport 1041 #######################################################--> 1042 1043 <package id="GtkViewport"> 1044 <doc group="Scrolling"/> 1045 <parameter name="self" ada="Viewport"/> 1046 <method id="gtk_viewport_new"> 1047 <parameter name="hadjustment" default="null"/> 1048 <parameter name="vadjustment" default="null"/> 1049 </method> 1050 1051 <!-- These are now inherited from the Scrollable interface --> 1052 <method id="gtk_viewport_get_hadjustment" bind="false"/> 1053 <method id="gtk_viewport_get_vadjustment" bind="false"/> 1054 <method id="gtk_viewport_set_hadjustment" bind="false"/> 1055 <method id="gtk_viewport_set_vadjustment" bind="false"/> 1056 </package> 1057 1058 <!-- ####################################################### 1059 ## Gtk.Pixmap 1060 #######################################################--> 1061 1062 <package id="GtkPixmap"> 1063 <doc group="Obsolescent widgets"/> 1064 <parameter name="self" ada="Pixmap"/> 1065 <parameter name="pixmap" ada="Val"/> 1066 <method id="gtk_pixmap_set_build_insensitive"> 1067 <doc>Whether the pixmap should be grayed out, as is done for insensitive widgets that do not accept user interaction</doc> 1068 </method> 1069 1070 <extra> 1071 <with_spec pkg="Gtk.Widget" /> 1072 <with_spec pkg="Gtk.Window" /> 1073 <with_spec pkg="Gtkada.Types" /> 1074 <with_body pkg="Interfaces.C.Strings" /> 1075 <with_body pkg="Gdk.Color" /> 1076 <spec> 1077 function Create_Pixmap 1078 (Filename : String; 1079 Window : access Gtk.Window.Gtk_Window_Record'Class) return Gtk_Pixmap; 1080 -- Create a pixmap given a window and a filename 1081 1082 function Create_Pixmap 1083 (Data : Gtkada.Types.Chars_Ptr_Array; 1084 Window : access Gtk.Window.Gtk_Window_Record'Class) return Gtk_Pixmap; 1085 -- Create a pixmap given a window and a buffer. 1086 </spec> 1087 <body> 1088 Dummy_Pixmap : constant Gtkada.Types.chars_ptr_array := 1089 (New_String ("1 1 1 1"), 1090 New_String ("c None"), 1091 New_String (" ")); 1092 -- This is a dummy pixmap we use when a pixmap can't be found. 1093 1094 function Create_Pixmap 1095 (Filename : String; 1096 Window : access Gtk.Window.Gtk_Window_Record'Class) return Gtk_Pixmap 1097 is 1098 Gdkpixmap : Gdk.Pixmap.Gdk_Pixmap; 1099 Mask : Gdk.Bitmap.Gdk_Bitmap; 1100 Pixmap : Gtk_Pixmap; 1101 1102 use Gtk.Widget; 1103 use Gtk.Window; 1104 1105 begin 1106 if not Realized_Is_Set (Window) then 1107 Gtk.Window.Realize (Window); 1108 end if; 1109 1110 if Filename = "" then 1111 Gdk.Pixmap.Create_From_Xpm_D 1112 (Gdkpixmap, Get_Window (Window), Mask, 1113 Gdk.Color.Null_Color, Dummy_Pixmap); 1114 else 1115 Gdk.Pixmap.Create_From_Xpm 1116 (Gdkpixmap, Get_Window (Window), Mask, 1117 Gdk.Color.Null_Color, Filename); 1118 end if; 1119 1120 Gtk_New (Pixmap, Gdkpixmap, Mask); 1121 return Pixmap; 1122 end Create_Pixmap; 1123 1124 function Create_Pixmap 1125 (Data : Gtkada.Types.Chars_Ptr_Array; 1126 Window : access Gtk.Window.Gtk_Window_Record'Class) return Gtk_Pixmap 1127 is 1128 Gdkpixmap : Gdk.Pixmap.Gdk_Pixmap; 1129 Mask : Gdk.Bitmap.Gdk_Bitmap; 1130 Pixmap : Gtk_Pixmap; 1131 1132 use Gtk.Widget; 1133 use Gtk.Window; 1134 1135 begin 1136 if not Realized_Is_Set (Window) then 1137 Gtk.Window.Realize (Window); 1138 end if; 1139 1140 Gdk.Pixmap.Create_From_Xpm_D 1141 (Gdkpixmap, Get_Window (Window), Mask, Gdk.Color.Null_Color, Data); 1142 Gtk_New (Pixmap, Gdkpixmap, Mask); 1143 1144 return Pixmap; 1145 end Create_Pixmap; 1146 </body> 1147 </extra> 1148 </package> 1149 1150 <package id="GtkMisc"> 1151 <doc group="Abstract base classes"/> 1152 <parameter name="self" ada="Misc"/> 1153 <method id="gtk_misc_set_alignment"> 1154 <doc> 1155Modify the alignment for the widget. 1156Xalign and Yalign are both values between 0.0 and 1.0 that specify the 1157alignment: if Xalign is 0.0, the widget will be left aligned; if it is 11580.5, the widget will be centered; if it is 1.0 the widget will be 1159right aligned. Yalign is from top (0.0) to bottom (1.0). 1160Both Xalign and Yalign will be constrained to the range 0.0 .. 1.0 1161Note that if the widget fills its allocated area, these two parameters 1162won't have any effect. 1163 </doc> 1164 </method> 1165 </package> 1166 1167 <package id="GtkBin"> 1168 <doc group="Abstract base classes"/> 1169 <parameter name="self" ada="Bin"/> 1170 </package> 1171 1172 <!-- ################################################################# 1173 Gtk.Layout 1174 ################################################################ --> 1175 1176 <package id="GtkLayout"> 1177 <doc group="Layout containers" testgtk="create_layout.adb" 1178 screenshot="gtk-layout"> 1179A Gtk_Layout is a widget that can have an almost infinite size, without 1180occupying a lot of memory. Its children can be located anywhere within 1181it, but will only appear on the screen if the visible area of the layout 1182contains them. 1183Just like a Gtk_Viewport, its visible area is indicated by two 1184Gtk_Adjustment widgets, and thus a Gtk_Layout can be put as is in a 1185Gtk_Scrolled_Window. 1186As for Gtk_Fixed containers, the children can be located anywhere in the 1187layout (no automatic organization is done). But, as opposed to Gtk_Fixed 1188widgets, a Gtk_Layout does not try to resize itself to show all its 1189children. 1190 1191Starting from GtkAda 2.0, you have to call Set_Size and specify the maximum 1192size of the layout, otherwise children added with Put outside the size 1193defined for the layout will never be visible. 1194One way to do this is to systematically call Set_Size before calling Put, 1195and make sure you specify a size big enough for the layout. 1196 </doc> 1197 <parameter name="self" ada="Layout"/> <!-- for all methods --> 1198 <method id="gtk_layout_new"> 1199 <parameter name="hadjustment" default="null"/> 1200 <parameter name="vadjustment" default="null"/> 1201 </method> 1202 <method id="gtk_layout_put"> 1203 <doc>The child will be displayed on the screen only if at least part of it intersects the visible area of the layout. The layout does not resize itself to automatically show the widget. You also need to call Set_Size, if the size you initially defined is smaller than (X, Y), or the child will never be visible even if the layout is scrolled.</doc> 1204 </method> 1205 1206 <!-- These are now inherited from the Scrollable interface --> 1207 <method id="gtk_layout_get_hadjustment" bind="false"/> 1208 <method id="gtk_layout_get_vadjustment" bind="false"/> 1209 <method id="gtk_layout_set_hadjustment" bind="false"/> 1210 <method id="gtk_layout_set_vadjustment" bind="false"/> 1211 </package> 1212 1213 <package id="GtkRange"> 1214 <doc testgtk="create_range.adb" screenshot="gtk-range"/> 1215 <parameter name="self" ada="The_Range"/> 1216 </package> 1217 1218 <package id="GtkButtonBox"> 1219 <doc testgtk="create_button_box.adb" screenshot="gtk-button_box" 1220 group="Layout containers"> 1221A Gtk_Button_Box is a special type of Gtk_Box specially tailored to contain 1222buttons. 1223 1224This is only a base class for Gtk_Hbutton_Box and Gtk_Vbutton_Box which 1225provide a way to arrange their children horizontally (resp. vertically). 1226You can not instantiate a Gtk_Button_Box directly, and have to use one the 1227above two instead. 1228 </doc> 1229 <parameter name="self" ada="Widget"/> 1230 </package> 1231 1232 <package id="GtkHButtonBox"> 1233 <doc group="Layout containers"> 1234A Gtk_Hbutton_Box is a specific Gtk_Button_Box that organizes its 1235children horizontally. 1236The beginning of the box (when you add children with Gtk.Box.Pack_Start) 1237is on the left of the box. Its end (for Gtk.Box.Pack_End) is on the right. 1238 </doc> 1239 <parameter name="self" ada="Widget"/> 1240 </package> 1241 1242 <package id="GtkVButtonBox"> 1243 <doc group="Layout containers"> 1244A Gtk_Vbutton_Box is a specific Gtk_Button_Box that organizes its 1245children vertically. 1246The beginning of the box (when you add children with Gtk.Box.Pack_Start) 1247is on the top of the box. Its end (for Gtk.Box.Pack_End) is on the bottom. 1248 </doc> 1249 <parameter name="self" ada="Widget"/> 1250 </package> 1251 1252 <package id="GtkVolumeButton"> 1253 <parameter name="self" ada="Widget"/> 1254 </package> 1255 1256 <package id="GtkAboutDialog"> 1257 <doc group="Windows" testgtk="create_about.adb"/> 1258 <parameter name="self" ada="About"/> 1259 <enum ctype="GtkLicense"/> 1260 </package> 1261 1262 <package id="GtkEntry"> 1263 <doc testgtk="create_entry.adb" group="Numeric/Text Data Entry" 1264 screenshot="gtk-gentry"> 1265A Gtk_Entry is a single line text editing widget. 1266The text is automatically scrolled if it is longer than can be displayed 1267on the screen, so that the cursor position is visible at all times. 1268 1269See Gtk_Text_View for a multiple-line text editing widget. 1270 </doc> 1271 <parameter name="self" ada="The_Entry"/> 1272 <enum ctype="GtkEntryIconPosition" prefix=""/> 1273 1274 <method id="gtk_entry_set_invisible_char"> 1275 <parameter name="ch" ada="Char"/> 1276 </method> 1277 <method id="gtk_entry_set_has_frame"> 1278 <parameter name="setting" default="True"/> 1279 </method> 1280 <method id="gtk_entry_set_width_chars"> 1281 <parameter name="n_chars" ada="Width"/> 1282 </method> 1283 1284 <extra> 1285 <spec>subtype Gtk_GEntry is Gtk_Entry;</spec> 1286 <spec> 1287 procedure Insert_Text 1288 (Editable : access Gtk_Entry_Record; 1289 New_Text : UTF8_String; 1290 Position : in out Gint); 1291 -- Convenience subprogram, identical to Insert_Text above without 1292 -- the requirement to supply the New_Text_Length argument. 1293 </spec> 1294 <body> 1295 procedure Insert_Text 1296 (Editable : access Gtk_Entry_Record; 1297 New_Text : UTF8_String; 1298 Position : in out Gint) is 1299 begin 1300 Insert_Text 1301 (Editable, New_Text & ASCII.NUL, New_Text'Length, Position); 1302 end Insert_Text; 1303 </body> 1304 </extra> 1305 </package> 1306 1307 <package id="GtkDialog"> 1308 <doc group="Windows" testgtk="create_dialog.adb" 1309 screenshot="gtk-dialog"> 1310 See Gtkada.Dialogs for a higher level dialog interface. 1311 </doc> 1312 <parameter name="self" ada="Dialog" /> 1313 <parameter name="response_id" type="Gtk_Response_Type"/> 1314 <method id="gtk_dialog_get_action_area" return="GtkBox*"/> 1315 <method id="gtk_dialog_get_content_area" return="GtkBox*"/> 1316 <method id="gtk_dialog_get_response_for_widget" return="GtkResponseType"/> 1317 <method id="gtk_dialog_run" return="GtkResponseType"/> 1318 <method id="gtkada_GtkDialog_get_vbox" bind="true" return="GtkBox*"/> 1319 <method id="gtk_dialog_add_button"> 1320 <parameter name="button_text" ada="text"/> 1321 </method> 1322 1323 <!-- Bound manually below --> 1324 <method id="gtk_dialog_set_alternative_button_order_from_array" bind="False"/> 1325 1326 <!-- Following methods have varargs --> 1327 <method id="gtk_dialog_new_with_buttons" bind="False"/> 1328 <method id="gtk_dialog_add_buttons" bind="False"/> 1329 <method id="gtk_dialog_set_alternative_button_order" bind="False"/> 1330 1331 <method id="ada_gtk_dialog_new_with_buttons"> 1332 <parameter name="parent" default="null"/> 1333 </method> 1334 1335 <extra> 1336 <gir:constructor c:identifier="ada_gtk_dialog_new_with_buttons" 1337 name="new" version="GtkAda 1.0"> 1338 <gir:doc>Create a new dialog with a specific title, and specific attributes. Parent is the transient parent for the dialog (ie the one that is used for reference for the flag Destroy_With_Parent, or to compute the initial position of the dialog).</gir:doc> 1339 <gir:return-value> 1340 <gir:type name="GtkDialog" c:type="GtkDialog*"/> 1341 </gir:return-value> 1342 <gir:parameters> 1343 <gir:parameter name="title"> 1344 <gir:type name="utf8" c:type="gchar*"/> 1345 </gir:parameter> 1346 <gir:parameter name="parent"> 1347 <gir:type name="Window" c:type="GtkWindow*"/> 1348 </gir:parameter> 1349 <gir:parameter name="flags"> 1350 <gir:type name="DialogFlags" c:type="GtkDialogFlags"/> 1351 </gir:parameter> 1352 </gir:parameters> 1353 </gir:constructor> 1354 1355 <with_spec pkg="Gdk.Screen" /> 1356 <spec> 1357 procedure Set_Alternative_Button_Order_From_Array 1358 (Dialog : access Gtk_Dialog_Record; 1359 New_Order : Response_Type_Array); 1360 -- Sets an alternative button order. If the gtk-alternative-button-order 1361 -- setting is set to %TRUE, the dialog buttons are reordered according to 1362 -- the order of the response ids passed to this function. 1363 -- 1364 -- By default, GTK+ dialogs use the button order advocated by the Gnome 1365 -- Human Interface Guidelines with the affirmative button at the far right, 1366 -- and the cancel button left of it. But the builtin GTK+ dialogs and 1367 -- message dialogs' do provide an alternative button order, which is more 1368 -- suitable on some platforms, e.g. Windows. 1369 -- 1370 -- Use this function after adding all the buttons to your dialog. 1371 1372 function Gtk_Alternative_Dialog_Button_Order 1373 (Screen : Gdk.Screen.Gdk_Screen := null) return Boolean; 1374 -- Returns True if dialogs are expected to use an alternative button order 1375 -- on the given screen (or current screen if null) . See 1376 -- Set_Alternative_Button_Order_From_Array for more details about 1377 -- alternative button order. 1378 -- 1379 -- If you need to use this function, you should probably connect to the 1380 -- ::notify:gtk-alternative-button-order signal on the Gtk_Settings object 1381 -- associated to Screen, in order to be notified if the button order 1382 -- setting changes. 1383 -- 1384 -- Returns: Whether the alternative button order should be used 1385 1386 function Use_Header_Bar_From_Settings 1387 (Widget : access Gtk.Widget.Gtk_Widget_Record'Class := null) 1388 return Gtk_Dialog_Flags; 1389 -- Check in the gtk settings whether dialogs should display their action 1390 -- buttons in the header bar rather than in the action area at the bottom. 1391 -- Widget is used to retrieve the settings. If unspecified, the default 1392 -- settings are used. 1393 -- The value of the setting can be set in the file 1394 -- $HOME/.config/gtk-3.0/settings.ini 1395 -- with the following line: 1396 -- gtk-dialogs-use-header=0 1397 1398 procedure G_New_Dialog 1399 (Self : not null access Gtk_Dialog_Record'Class; 1400 Flags : Gtk_Dialog_Flags; 1401 Typ : Glib.GType := Gtk.Dialog.Get_Type); 1402 -- Equivalent of Glib.Object.G_New for a dialog. This function should be 1403 -- used when you are subclassing the dialog class (for instance to add new 1404 -- signals). The Use_Header_Bar flag can only have an impact before the 1405 -- dialog is created, so this function will take that into account as 1406 -- appropriate. Other flags (Modal and Destroy_With_Parent) are ignored. 1407 </spec> 1408 1409 <with_body pkg="Gtk.Settings" /> 1410 <with_body pkg="Glib.Properties" /> 1411 <body> 1412 procedure G_New_Dialog 1413 (Self : not null access Gtk_Dialog_Record'Class; 1414 Flags : Gtk_Dialog_Flags; 1415 Typ : Glib.GType := Gtk.Dialog.Get_Type) 1416 is 1417 function Internal 1418 (Typ : GType; Flags : Gtk_Dialog_Flags) return System.Address; 1419 pragma Import (C, Internal, "ada_g_dialog_new"); 1420 begin 1421 if not Self.Is_Created then 1422 Set_Object (Self, Internal (Typ, Flags)); 1423 end if; 1424 end G_New_Dialog; 1425 1426 procedure Set_Alternative_Button_Order_From_Array 1427 (Dialog : access Gtk_Dialog_Record; 1428 New_Order : Response_Type_Array) 1429 is 1430 procedure Internal 1431 (Dialog : System.Address; 1432 N_Params : Gint; 1433 New_Order : System.Address); 1434 pragma Import 1435 (C, Internal, "gtk_dialog_set_alternative_button_order_from_array"); 1436 begin 1437 Internal (Get_Object (Dialog), New_Order'Length, 1438 New_Order (New_Order'First)'Address); 1439 end Set_Alternative_Button_Order_From_Array; 1440 1441 function Gtk_Alternative_Dialog_Button_Order 1442 (Screen : Gdk.Screen.Gdk_Screen := null) return Boolean 1443 is 1444 function Internal (Screen : System.Address) return Gboolean; 1445 pragma Import (C, Internal, "gtk_alternative_dialog_button_order"); 1446 begin 1447 return Boolean'Val (Internal (Get_Object (Screen))); 1448 end Gtk_Alternative_Dialog_Button_Order; 1449 1450 function Use_Header_Bar_From_Settings 1451 (Widget : access Gtk.Widget.Gtk_Widget_Record'Class := null) 1452 return Gtk_Dialog_Flags 1453 is 1454 S : Gtk_Settings; 1455 begin 1456 if Widget = null then 1457 S := Gtk.Settings.Get_Default; 1458 else 1459 S := Get_Settings (Widget); 1460 end if; 1461 1462 if Get_Property (S, Gtk_Dialogs_Use_Header_Property) then 1463 return Use_Header_Bar; 1464 else 1465 return 0; 1466 end if; 1467 end Use_Header_Bar_From_Settings; 1468 </body> 1469 1470 <type ctype="GtkDialogFlags" ada="Gtk_Dialog_Flags"> 1471 type Gtk_Dialog_Flags is mod 8; 1472 for Gtk_Dialog_Flags'Size use Gint'Size; 1473 pragma Convention (C, Gtk_Dialog_Flags); 1474 Modal : constant Gtk_Dialog_Flags := 2 ** 0; 1475 Destroy_With_Parent : constant Gtk_Dialog_Flags := 2 ** 1; 1476 Use_Header_Bar : constant Gtk_Dialog_Flags := 2 ** 2; 1477 -- Various flags that can be set for the dialog, with the following 1478 -- implications: 1479 -- - Modal : the dialog is modal, see Gtk.Window.Set_Modal 1480 -- - Destroy_With_Parent: The dialog is destroyed if its parent is 1481 -- destroyed. See Gtk.Window.Set_Destroy_With_Parent 1482 -- - Use_Header_Bar: create dialogs with actions in the header bar 1483 -- instead of action area (since 3.12) 1484 </type> 1485 1486 <type ctype="GtkResponseType" ada="Gtk_Response_Type"> 1487 type Gtk_Response_Type is new Gint; 1488 -- Type used for Response_Id's. 1489 -- Positive values are totally user-interpreted. 1490 -- GtkAda will sometimes return Gtk_Response_None if no Response_Id is 1491 -- available. 1492 -- 1493 -- Typical usage is: 1494 -- if Gtk.Dialog.Run (Dialog) = Gtk_Response_Accept then 1495 -- blah; 1496 -- end if; 1497 1498 Gtk_Response_None : constant Gtk_Response_Type := -1; 1499 -- GtkAda returns this if a response widget has no Response_Id, 1500 -- or if the dialog gets programmatically hidden or destroyed. 1501 1502 Gtk_Response_Reject : constant Gtk_Response_Type := -2; 1503 Gtk_Response_Accept : constant Gtk_Response_Type := -3; 1504 -- GtkAda won't return these unless you pass them in 1505 -- as the response for an action widget. They are 1506 -- for your convenience. 1507 1508 Gtk_Response_Delete_Event : constant Gtk_Response_Type := -4; 1509 -- If the dialog is deleted through the button in the titlebar 1510 1511 Gtk_Response_OK : constant Gtk_Response_Type := -5; 1512 Gtk_Response_Cancel : constant Gtk_Response_Type := -6; 1513 Gtk_Response_Close : constant Gtk_Response_Type := -7; 1514 Gtk_Response_Yes : constant Gtk_Response_Type := -8; 1515 Gtk_Response_No : constant Gtk_Response_Type := -9; 1516 Gtk_Response_Apply : constant Gtk_Response_Type := -10; 1517 Gtk_Response_Help : constant Gtk_Response_Type := -11; 1518 -- These are returned from dialogs, and you can also use them 1519 -- yourself if you like. 1520 </type> 1521 1522 <type ctype="GtkResponseType*" ada="Response_Type_Array"> 1523 type Response_Type_Array is array (Natural range <>) of Gtk_Response_Type; 1524 </type> 1525 </extra> 1526 </package> 1527 1528 <package id="GtkExpander"> 1529 <doc group="Layout containers" screenshot="gtk-expanded"/> 1530 <parameter name="self" ada="Expander"/> 1531 </package> 1532 1533 <package id="GtkDrawingArea"> 1534 <doc group="Drawing" testgtk="libart_demo.adb"> 1535See also the Double_Buffer widget provided in the GtkAda examples for an advanced example that demonstrates how to use double buffering, to avoid flickering in your drawings.</doc> 1536 <parameter name="self" ada="Drawing_Area"/> 1537 </package> 1538 1539 <package id="GtkAdjustment"> 1540 <doc group="Scrolling"> 1541The meaning of the most important fields can be explained on the following figure (imagine this is a scrollbar): 1542 1543[-------|=================|-------------------] 1544 1545lower value value + page_size upper 1546 </doc> 1547 <parameter name="self" ada="Adjustment"/> 1548 <method id="gtk_adjustment_new"> 1549 <parameter name="page_size" default="0.0"/> 1550 <doc>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.</doc> 1551 </method> 1552 <method id="gtk_adjustment_clamp_page"> 1553 <doc>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.</doc> 1554 </method> 1555 </package> 1556 1557 <package id="GtkImage"> 1558 <doc group="Display widgets" screenshot="gtk-image"/> 1559 <parameter name="self" ada="Image"/> 1560 <parameter name="image" ada="Val"/> 1561 <parameter name="size" type="Gtk.Enums.Gtk_Icon_Size"/> 1562 <method id="gtk_image_new_from_animation" ada="Gtk_New"/> 1563 <method id="gtk_image_new_from_file" ada="Gtk_New"/> 1564 <method id="gtk_image_new_from_image" ada="Gtk_New"/> 1565 <method id="gtk_image_new_from_pixbuf" ada="Gtk_New"/> 1566 <method id="gtk_image_new_from_icon_set" ada="Gtk_New"/> 1567 <method id="gtk_image_new_from_pixmap" ada="Gtk_New"/> 1568 <method id="gtk_image_new_from_stock" ada="Gtk_New"/> 1569 <method id="gtk_image_get_animation" ada="Get"/> 1570 <method id="gtk_image_set_from_animation" ada="Set"/> 1571 <method id="gtk_image_get_image" ada="Get"/> 1572 <method id="gtk_image_get" bind="False"/> <!-- same as get_image --> 1573 <method id="gtk_image_set_from_image" ada="Set"/> 1574 <method id="gtk_image_set" bind="False"/> <!-- same as set_from_image --> 1575 <method id="gtk_image_get_pixbuf" ada="Get"/> 1576 <method id="gtk_image_set_from_pixbuf" ada="Set"/> 1577 <method id="gtk_image_get_icon_set" ada="Get"/> 1578 <method id="gtk_image_set_from_icon_set" ada="Set"/> 1579 <method id="gtk_image_get_pixmap" ada="Get"/> 1580 <method id="gtk_image_set_from_pixmap" ada="Set"/> 1581 <method id="gtk_image_get_stock" ada="Get" bind="False"/> 1582 <method id="gtk_image_set_from_stock" ada="Set"/> 1583 <method id="gtk_image_get_gicon" ada="Get"/> 1584 <method id="gtk_image_set_from_gicon" ada="Set"/> 1585 <method id="gtk_image_set_from_file" ada="Set"/> 1586 <method id="gtk_image_get_icon_name" ada="Get" bind="False"/> 1587 <enum ctype="GtkImageType"/> 1588 <extra> 1589 <with_spec pkg="GNAT.Strings"/> 1590 <spec> 1591 function Get 1592 (Image : access Gtk_Image_Record; 1593 Size : access Gtk.Enums.Gtk_Icon_Size) return String; 1594 -- Get the stock_id for the image displayed 1595 1596 procedure Get_Icon_Name 1597 (Image : access Gtk_Image_Record; 1598 Name : out GNAT.Strings.String_Access; 1599 Size : out Gtk.Enums.Gtk_Icon_Size); 1600 </spec> 1601 <body> 1602 procedure Get_Icon_Name 1603 (Image : access Gtk_Image_Record; 1604 Name : out GNAT.Strings.String_Access; 1605 Size : out Gtk_Icon_Size) 1606 is 1607 procedure Internal 1608 (Image : System.Address; 1609 Name : out Interfaces.C.Strings.chars_ptr; 1610 Size : out Gtk_Icon_Size); 1611 pragma Import (C, Internal, "gtk_image_get_icon_name"); 1612 Str : chars_ptr; 1613 begin 1614 Internal (Get_Object (Image), Str, Size); 1615 Name := new String'(Value (Str)); 1616 end Get_Icon_Name; 1617 1618 function Get 1619 (Image : access Gtk_Image_Record; 1620 Size : access Gtk.Enums.Gtk_Icon_Size) return String 1621 is 1622 procedure Internal 1623 (Image : System.Address; 1624 Stock_Id : out Interfaces.C.Strings.chars_ptr; 1625 Size : out Gint); 1626 pragma Import (C, Internal, "gtk_image_get_stock"); 1627 1628 Stock : Interfaces.C.Strings.chars_ptr; 1629 Sze : Gint; 1630 1631 begin 1632 Internal (Get_Object (Image), Stock, Sze); 1633 Size.all := Gtk.Enums.Gtk_Icon_Size'Val (Sze); 1634 return Interfaces.C.Strings.Value (Stock); 1635 end Get; 1636 </body> 1637 </extra> 1638 </package> 1639 1640 <package id="GtkCalendar"> 1641 <doc group="Selectors" testgtk="create_calendar.adb" 1642 screenshot="gtk-calendar"/> 1643 <parameter name="self" ada="Calendar"/> 1644 <enum ctype="GtkCalendarDisplayOptions" prefix="GTK_CALENDAR_"/> 1645 </package> 1646 1647 <package id="GtkSizeGroup"> 1648 <doc testgtk="create_size_groups.adb"/> 1649 <parameter name="self" ada="Size_Group" /> 1650 <method id="gtk_size_group_new"> 1651 <parameter name="mode" default="Both"/> 1652 </method> 1653 <method id="gtk_size_group_get_widgets" return="WidgetSList"/> 1654 <enum ctype="GtkSizeGroupMode" ada="Size_Group_Mode" prefix="GTK_SIZE_GROUP_"/> 1655 </package> 1656 1657 <package id="GtkAlignment"> 1658 <doc testgtk="create_alignment.adb" screenshot="gtk-alignment"/> 1659 <parameter name="self" ada="Alignment"/> 1660 <method id="gtkada_GtkAlignment_get_xalign" bind="True"/> 1661 <method id="gtkada_GtkAlignment_get_xscale" bind="True"/> 1662 <method id="gtkada_GtkAlignment_get_yalign" bind="True"/> 1663 <method id="gtkada_GtkAlignment_get_yscale" bind="True"/> 1664 </package> 1665 1666 <package id="GtkStatusbar"> 1667 <doc group="Display widgets" testgtk="create_status.adb" 1668 screenshot="gtk-status_bar"/> 1669 <parameter name="self" ada="Statusbar"/> 1670 <parameter name="context" type="Context_Id"/> 1671 <parameter name="context_id" ada="context" type="Context_Id"/> 1672 <parameter name="message_id" ada="Message" type="Message_Id"/> 1673 <method id="gtk_statusbar_get_context_id" return="Context_Id"/> 1674 <method id="gtkada_GtkStatusbar_get_messages" return="MessagesList" 1675 bind="True"/> 1676 <method id="gtk_statusbar_push" return="Message_Id"/> 1677 <extra> 1678 <type> 1679 type Context_Id is new Guint; 1680 type Message_Id is new Guint; 1681 </type> 1682 </extra> 1683 </package> 1684 1685 <package id="GtkTable"> 1686 <doc group="Layout containers"/> 1687 <parameter name="self" ada="Table"/> 1688 <method id="gtk_table_new"> 1689 <doc>Create a new table. The width allocated to the table is divided into Columns columns, which all have the same width if Homogeneous is True. If Homogeneous is False, the width will be calculated with the children contained in the table. Same behavior for the rows.</doc> 1690 </method> 1691 <method id="gtk_table_attach"> 1692 <doc>Insert a new widget in the table. All the attachments are relative to the separations between columns and rows (for instance, to insert a widget spanning the first two columns in the table, you should put Left_Attach=0 and Right_Attach=2). Same behavior for the rows. Xoptions and Yoptions indicate the behavior of the child when the table is resized (whether the child can shrink or expand). See the description in Gtk.Box for more information on the possible values. Xpadding and Ypadding are the amount of space left around the child.</doc> 1693 <parameter name="xoptions" default="Expand or Fill"/> 1694 <parameter name="yoptions" default="Expand or Fill"/> 1695 <parameter name="xpadding" default="0"/> 1696 <parameter name="ypadding" default="0"/> 1697 </method> 1698 <method id="gtk_table_attach_defaults"> 1699 <doc>Insert a new widget in the table, with default values. No padding is put around the child, and the options are set to Expand and Fill. This call is similar to Attach with default values and is only provided for compatibility.</doc> 1700 </method> 1701 <method id="gtk_table_set_col_spacing"> 1702 <doc>Set the spacing in pixels between Column and the next one.</doc> 1703 </method> 1704 <method id="gtk_table_set_homogeneous"> 1705 <doc>Indicate the homogeneous status of the table. If Homogeneous is True, the rows and columns of the table will all be allocated the same width or height.</doc> 1706 </method> 1707 </package> 1708 1709 <package id="GtkCheckButton"> 1710 <doc screenshot="gtk-check_button" group="Buttons and Toggles" 1711 testgtk="create_check_buttons.adb"/> 1712 <parameter name="self" ada="Check_Button"/> 1713 <method id="gtk_check_button_new" bind="False"/> 1714 <method id="gtk_check_button_new_with_label" ada="Gtk_New" > 1715 <parameter name="label" default='""' allow-none="1"/> 1716 <doc>Create a check button. if Label is null, then no widget is associated with the button, and any widget can be added to the button (with Gtk.Container.Add).</doc> 1717 </method> 1718 </package> 1719 1720 <package id="GtkToggleButton"> 1721 <doc screenshot="gtk-toggle_button" group="Buttons and Toggles" 1722 testgtk="create_toggle_buttons.adb"> 1723You should consider using a Gtk_Check_Button instead, since it looks nicer and provides more visual clues that the button can be toggled. 1724 </doc> 1725 <parameter name="self" ada="Toggle_Button"/> 1726 <method id="gtk_toggle_button_new" bind="False"/> 1727 <method id="gtk_toggle_button_new_with_label" ada="Gtk_New" > 1728 <doc>Initialize a button. If Label is "", then no label is created inside the button and you will have to provide your own child through a call to Gtk.Container.Add. This is the recommended way to put a pixmap inside a toggle button.</doc> 1729 <parameter name="label" default='""' allow-none="1"/> 1730 </method> 1731 <method id="gtk_toggle_button_set_active"> 1732 <doc>Change the state of the button. When Is_Active is True, the button is drawn as a pressed button</doc> 1733 </method> 1734 <method id="gtk_toggle_button_set_inconsistent"> 1735 <parameter name="Setting" default="True"/> 1736 </method> 1737 </package> 1738 1739 <package id="GtkAccelGroup"> 1740 <parameter name="self" ada="Accel_Group"/> 1741 <method id="gtk_accel_group_new"> 1742 <doc>Creates a new Gtk.Accel_Group.Gtk_Accel_Group. 1743Remember to call Gtk.Window.Add_Accel_Group to active the group.</doc> 1744 </method> 1745 <method id="gtk_accel_group_connect"> 1746 <parameter name="closure" type="C_Gtk_Accel_Group_Activate"/> 1747 </method> 1748 <method id="gtk_accel_group_disconnect"> 1749 <parameter name="closure" type="C_Gtk_Accel_Group_Activate"/> 1750 </method> 1751 <method id="gtk_accel_group_connect_by_path"> 1752 <parameter name="closure" type="C_Gtk_Accel_Group_Activate"/> 1753 </method> 1754 <method id="gtk_accel_group_query" bind="False"/> 1755 <!-- ???Would be nice --> 1756 <method id="gtk_accel_group_from_accel_closure"> 1757 <parameter name="closure" type="C_Gtk_Accel_Group_Activate"/> 1758 </method> 1759 <function id="gtk_accel_groups_activate"> 1760 <parameter name="accel_key" type="Gdk.Types.Gdk_Key_Type"/> 1761 </function> 1762 <function id="gtk_accel_groups_from_object" ada="From_Object" 1763 return="ObjectSList"/> 1764 <function id="gtk_accelerator_valid"> 1765 <parameter name="keyval" type="Gdk.Types.Gdk_Key_Type"/> 1766 </function> 1767 <function id="gtk_accelerator_parse"> 1768 <parameter name="accelerator_key" ctype="GdkKeyType*"/> 1769 </function> 1770 <function id="gtk_accelerator_name"> 1771 <parameter name="accelerator_key" type="Gdk.Types.Gdk_Key_Type"/> 1772 </function> 1773 <function id="gtk_accelerator_get_label"> 1774 <parameter name="accelerator_key" type="Gdk.Types.Gdk_Key_Type"/> 1775 </function> 1776 <function id="gtk_accelerator_set_default_mod_mask" 1777 ada="Set_Default_Mod_Mask" /> 1778 <function id="gtk_accelerator_get_default_mod_mask" 1779 return="GdkModifierType" ada="Get_Default_Mod_Mask"/> 1780 <enum ctype="GtkAccelFlags" prefix="GTK_"/> 1781 <record ctype="GtkAccelKey"> 1782 <field name="accel_key" ctype="GdkKeyType"/> 1783 <field name="accel_flags" ctype="GtkAccelFlags"/> 1784 </record> 1785 <extra> 1786 <type ctype="GtkAccelGroupActive" ada="Gtk_Accel_Group_Activate"> 1787 type Gtk_Accel_Group_Activate is access function 1788 (Accel_Group : access Gtk_Accel_Group_Record'Class; 1789 Acceleratable : Glib.Object.GObject; 1790 Keyval : Gdk.Types.Gdk_Key_Type; 1791 Modifier : Gdk.Types.Gdk_Modifier_Type) return Boolean; 1792 1793 type C_Gtk_Accel_Group_Activate is access function 1794 (Accel_Group : System.Address; 1795 Acceleratable : System.Address; 1796 Keyval : Gdk.Types.Gdk_Key_Type; 1797 Modifier : Gdk.Types.Gdk_Modifier_Type) return Boolean; 1798 pragma Convention (C, C_Gtk_Accel_Group_Activate); 1799 -- Same as Gtk_Accel_Group_Activate, but passing directly the C values. 1800 -- You must use Get_User_Data to convert to the Ada types. 1801 </type> 1802 </extra> 1803 </package> 1804 1805 <package id="GtkRadioButton"> 1806 <doc screenshot="gtk-radio_button" group="Buttons and Toggles" 1807 testgtk="create_radio_button.adb"/> 1808 <parameter name="self" ada="Radio_Button"/> 1809 <parameter name="radio_group_member" ada="Group"/> 1810 <method id="gtk_radio_button_new" bind="False"/> 1811 <method id="gtk_radio_button_new_from_widget" bind="False"/> 1812 <method id="gtk_radio_button_new_with_label" ada="Gtk_New" > 1813 <doc>Creates or initializes a new radio button, belonging to Group. If Label is left as the empty string, then the button will not have any child and you are free to put any thing you want in it, including a pixmap. To initialize the group (when creating the first button), leave Group to the Null_List. You can later get the new group that is created with a call to the Get_Group subprogram below.</doc> 1814 <parameter name="group" default="Widget_SList.Null_List" ctype="WidgetSList"/> 1815 <parameter name="label" default='""' allow-none="1"/> 1816 </method> 1817 <method id="gtk_radio_button_new_with_label_from_widget" ada="Gtk_New" > 1818 <parameter name="radio_group_member" allow-none="1"/> 1819 <parameter name="label" default='""' allow-none="1"/> 1820 </method> 1821 <method id="gtk_radio_button_new_with_mnemonic"> 1822 <parameter name="group" default="Widget_SList.Null_List" ctype="WidgetSList"/> 1823 </method> 1824 <method id="gtk_radio_button_new_with_mnemonic_from_widget" ada="Gtk_New_With_Mnemonic"> 1825 <doc extend="true">To initialize a new group (when creating the first button), you should pass it null or a button that has not been created with Gtk_New, as in the example below.</doc> 1826 <parameter name="radio_group_member" allow-none="1"/> 1827 </method> 1828 <method id="gtk_radio_button_get_group" return="WidgetSList"/> 1829 <method id="gtk_radio_button_set_group"> 1830 <parameter name="group" ctype="WidgetSList"/> 1831 </method> 1832 </package> 1833 1834 <package id="GtkRadioAction"> 1835 <doc group="Action-based menus" see="Gtk_Action"/> 1836 <parameter name="self" ada="Action"/> 1837 <method id="gtk_radio_action_new"> 1838 <parameter name="label" default='""'/> 1839 <parameter name="tooltip" default='""'/> 1840 <parameter name="stock_id" default='""'/> 1841 </method> 1842 <method id="gtk_radio_action_set_group"> 1843 <parameter name="group" ctype="WidgetSList"/> 1844 <doc extend="true">A common way to set up a group of radio group is the following: 1845 1846__PRE__ Group : GSlist := null; 1847 Action : Gtk_Radio_Action; 1848 while ... loop 1849 Gtk_New (Action, ...); 1850 Set_Group (Action, Group); 1851 Group := Get_Group (Action); 1852 end loop;</doc> 1853 </method> 1854 <method id="gtk_radio_action_get_group" return="WidgetSList"/> 1855 </package> 1856 1857 <package id="GtkSeparator"> 1858 <doc group="Ornaments" screenshot="gtk-separator"/> 1859 <parameter name="self" ada="Separator"/> 1860 </package> 1861 <package id="GtkVSeparator" into="GtkSeparator"> 1862 <type name="Gtk_Vseparator" subtype="true"/> 1863 <method id="gtk_vseparator_new" ada="Gtk_New_Vseparator"/> 1864 <parameter name="self" ada="Separator"/> 1865 <method id="gtk_vseparator_get_type" ada="Vseparator_Get_Type" /> 1866 </package> 1867 <package id="GtkHSeparator" into="GtkSeparator"> 1868 <type name="Gtk_Hseparator" subtype="true"/> 1869 <method id="gtk_hseparator_new" ada="Gtk_New_Hseparator"/> 1870 <parameter name="self" ada="Separator"/> 1871 <method id="gtk_hseparator_get_type" ada="Hseparator_Get_Type" /> 1872 </package> 1873 1874 <package id="GtkSeparatorMenuItem"> 1875 <doc group="Menus and Toolbars"/> 1876 <parameter name="self" ada="Widget" /> 1877 </package> 1878 1879 <package id="GtkSeparatorToolItem"> 1880 <doc group="Menus and Toolbars"/> 1881 <parameter name="self" ada="Item" /> 1882 </package> 1883 1884 <package id="GtkRuler"> 1885 <doc group="Drawing" testgtk="create_rulers.adb" 1886 screenshot="gtk-rulers"> 1887 This widget is generally put on the sides of a drawing area to help the user measure distances. It indicates the current position of the mouse cursor within the drawing area, and can be graduated in multiple units.</doc> 1888 <parameter name="self" ada="Ruler" /> 1889 <method id="gtk_ruler_set_metric"> 1890 <doc>Set or get the units used for a Gtk_Ruler. See Set_Metric</doc> 1891 </method> 1892 </package> 1893 <package id="GtkVRuler" into="GtkRuler"> 1894 <type name="Gtk_Vruler" subtype="true"/> 1895 <method id="gtk_vruler_new" ada="Gtk_New_Vruler"/> 1896 <parameter name="self" ada="Ruler"/> 1897 <method id="gtk_vruler_get_type" ada="Vruler_Get_Type" /> 1898 </package> 1899 <package id="GtkHRuler" into="GtkRuler"> 1900 <type name="Gtk_Hruler" subtype="true"/> 1901 <method id="gtk_hruler_new" ada="Gtk_New_Hruler"/> 1902 <parameter name="self" ada="Ruler"/> 1903 <method id="gtk_hruler_get_type" ada="Hruler_Get_Type" /> 1904 </package> 1905 1906 <package id="GtkFixed"> 1907 <doc group="Layout containers" testgtk="create_fixed.adb" 1908 screenshot="gtk-fixed"/> 1909 <parameter name="self" ada="Fixed" /> 1910 <method id="gtk_fixed_put"> 1911 <doc>Add Widget to a Fixed container at the given position. X indicates the horizontal position to place the widget at. Y is the vertical position to place the widget at.</doc> 1912 </method> 1913 <method id="gtk_fixed_move"> 1914 <doc>Move a child of a GtkFixed container to the given position. X indicates the horizontal position to place the widget at. Y is the vertical position to place the widget at.</doc> 1915 </method> 1916 <method id="gtk_fixed_set_has_window"> 1917 <parameter name="has_window" default="False"/> 1918 </method> 1919 </package> 1920 1921 <package id="GtkCellEditable"> 1922 <doc group="Trees and Lists"/> 1923 <parameter name="self" ada="Cell_Editable"/> 1924 </package> 1925 1926 <package id="GtkBuildable"> 1927 <virtual-method id='*' bind='False'/> 1928 <method id="gtk_buildable_custom_tag_start" bind="False"/> 1929 </package> 1930 1931 <package id="GtkFileChooser"> 1932 <doc group="Selectors"> 1933This package provides an interface implemented by Gtk.File_Chooser_Widget and Gtk.File_Chooser_Button, and by your own file selection widgets if you wish to expose a standard interface. 1934 1935Gtk_File_Chooser allows for shortcuts to various places in the filesystem. In the default implementation these are displayed in the left pane. It may be a bit confusing at first that these shortcuts come from various sources and in various flavours, so lets explain the terminology here: 1936 1937__PRE__ - Bookmarks 1938 are created by the user, by dragging folders from the right pane to the 1939 left pane, or by using the "Add". Bookmarks can be renamed and deleted 1940 by the user. 1941 - Shortcuts 1942 can be provided by the application or by the underlying filesystem 1943 abstraction (e.g. both the gnome-vfs and the Windows filesystems 1944 provide "Desktop" shortcuts). Shortcuts cannot be modified by the user. 1945 - Volumes 1946 are provided by the underlying filesystem abstraction. They are the 1947 "roots" of the filesystem. 1948 1949File Names and Encodings 1950 1951When the user is finished selecting files in a Gtk_File_Chooser, your program can get the selected names either as filenames or as URIs. For URIs, the normal escaping rules are applied if the URI contains non-ASCII characters. However, filenames are always returned in the character set specified by the G_FILENAME_ENCODING environment variable. Please see the Glib documentation for more details about this variable. 1952 1953Important: This means that while you can pass the result of Get_Filename to low-level file system primitives , you will need to convert it to UTF-8 before using it in a Gtk_Label for instance. Conversion is done through Glib.Convert.Filename_To_UTF8. 1954 1955You can add a custom preview widget to a file chooser and then get notification about when the preview needs to be updated. To install a preview widget, use gtk_file_chooser_set_preview_widget(). Then, connect to the GtkFileChooser::update-preview signal to get notified when you need to update the contents of the preview. 1956 1957Preview widgets 1958 1959You can add a custom preview widget to a file chooser and then get notification about when the preview needs to be updated. To install a preview widget, use Set_Preview_Widget. Then, connect to the GtkFileChooser::update-preview signal to get notified when you need to 1960update the contents of the preview. 1961 1962Your callback should use Get_Preview_Filename to see what needs previewing. Once you have generated the preview for the corresponding file, you must call Set_Preview_Widget_Active with a boolean flag that indicates whether your callback could successfully generate a preview. 1963 1964Adding Extra Widgets 1965 1966You can add extra widgets to a file chooser to provide options that are not present in the default design. For example, you can add a toggle button to give the user the option to open a file in read-only mode. You can use Set_Extra_Widget to insert additional widgets in a file chooser. 1967 1968If you want to set more than one extra widget in the file chooser, you can a container such as a GtkVBox or a GtkTable and include your widgets in it. Then, set the container as the whole extra widget. 1969 1970Key bindings 1971 1972The following default key bindings are provided, but you can use a gtkrc file to override them if you need (see gtk-rc.ads). 1973 1974__PRE__ 1975 Signal name | Key binding 1976 location-popup | Control-L (empty path) 1977 | / (path of "/") 1978 | ~ (home directory) 1979 up-folder | Alt-Up or backspace 1980 down-folder | Alt-Down 1981 home-folder | Alt-Home 1982 desktop-folder | Alt-D 1983 quick-bookmark | Alt-1 through Alt-0 1984 </doc> 1985 </package> 1986 1987 <package id="GtkCellLayout"> 1988 <virtual-method id='*' bind='False'/> <!-- circular dep with Gtk.Cell_Area --> 1989 <doc group="Trees and Lists" testgtk="create_cell_view.adb"/> 1990 <parameter name="self" ada="Cell_Layout"/> 1991 <method id="gtk_cell_layout_get_area" bind="False"/> 1992 <!-- in Gtk.Cell_Area --> 1993 1994 <method id="gtk_cell_layout_set_attributes" bind="False"/> 1995 <method id="gtk_cell_layout_get_cells" return="GtkCellRendererList"/> 1996 </package> 1997 1998 <package id="GtkAssistant"> 1999 <doc group="Windows" testgtk="create_assistant.adb"/> 2000 <parameter name="self" ada="Assistant"/> 2001 <enum ctype="GtkAssistantPageType" prefix=""/> 2002 </package> 2003 2004 <package id="GtkSpinner"> 2005 <doc group="Ornaments"/> 2006 <parameter name="self" ada="Spinner"/> 2007 </package> 2008 2009 <package id="GtkEntryCompletion"> 2010 <doc group="Numeric/Text Data Entry"/> 2011 <parameter name="self" ada="Completion"/> 2012 </package> 2013 2014 <package id="GtkScrollable"> 2015 <doc group="Interfaces"/> 2016 </package> 2017 2018 <package id="GtkProgressBar"> 2019 <doc testgtk="create_progress.adb" 2020 screenshot="gtk-progress_bar" 2021 group="Display widgets"/> 2022 <parameter name="self" ada="Progress_Bar"/> 2023 </package> 2024 2025 <package id="GtkColorButton"> 2026 <doc group="Buttons and Toggles"/> 2027 <parameter name="self" ada="Button"/> 2028 2029 <method id="gtk_color_button_get_rgba" bind="False"/><!--from interface now--> 2030 <method id="gtk_color_button_set_rgba" bind="False"/><!--from interface now--> 2031 <method id="gtk_color_button_get_use_alpha" bind="False"/><!--from interface now--> 2032 <method id="gtk_color_button_set_use_alpha" bind="False"/><!--from interface now--> 2033 </package> 2034 2035 <package id="GtkLinkButton"> 2036 <doc group="Buttons and Toggles"/> 2037 <parameter name="self" ada="Widget" /> 2038 </package> 2039 2040 <package id="GtkFileFilter"> 2041 <enum ctype="GtkFileFilterFlags"/> 2042 <record ctype="GtkFileFilterInfo"/> 2043 </package> 2044 2045 <package id="GtkFileChooser"> 2046 <doc group=""/> 2047 <parameter name="self" ada="Chooser"/> 2048 <enum ctype="GtkFileChooserAction" prefix="GTK_FILE_CHOOSER_"/> 2049 <enum ctype="GtkFileChooserConfirmation" prefix="GTK_FILE_CHOOSER_"/> 2050 <enum ctype="GtkFileChooserError" prefix="GTK_FILE_CHOOSER_"/> 2051 2052 <!-- we won't bind any of these internal functions which pass GFile 2053 types --> 2054 <method id="gtk_file_chooser_get_file" bind="False"/> 2055 <method id="gtk_file_chooser_get_files" bind="False"/> 2056 <method id="gtk_file_chooser_get_current_folder_file" bind="False"/> 2057 <method id="gtk_file_chooser_get_preview_file" bind="False"/> 2058 <method id="gtk_file_chooser_select_file" bind="False"/> 2059 <method id="gtk_file_chooser_set_current_folder_file" bind="False"/> 2060 <method id="gtk_file_chooser_set_file" bind="False"/> 2061 <method id="gtk_file_chooser_unselect_file" bind="False"/> 2062 2063 <method id="gtk_file_chooser_get_filenames" return="StringSList"/> 2064 <method id="gtk_file_chooser_get_uris" return="StringSList"/> 2065 <method id="gtk_file_chooser_list_shortcut_folder_uris" 2066 return="StringSList"/> 2067 <method id="gtk_file_chooser_list_shortcut_folders" 2068 return="StringSList"/> 2069 <method id="gtk_file_chooser_list_filters" return="ObjectSList"/> 2070 </package> 2071 2072 <package id="GtkFileChooserButton"> 2073 <doc group="Buttons and Toggles"/> 2074 <parameter name="self" ada="Button"/> 2075 </package> 2076 2077 <package id="GtkToolbar"> 2078 <parameter name="self" ada="Toolbar"/> 2079 <method id="gtk_toolbar_set_show_arrow"> 2080 <parameter name="show_arrow" default="True"/> 2081 </method> 2082 <method id="gtk_toolbar_insert"> 2083 <parameter name="pos" default="-1"/> 2084 </method> 2085 <method id="gtk_tool_shell_get_orientation" bind="False"/> 2086 <method id="gtk_tool_shell_get_icon_size" bind="False"/> 2087 <method id="gtk_tool_shell_get_relief_style" bind="False"/> 2088 <method id="gtk_tool_shell_get_style" bind="False"/> 2089 </package> 2090 2091 <package id="GtkEditable"> 2092 <parameter name="self" ada="Editable"/> 2093 <method id="::insert-text"> 2094 <parameter name="position" direction="access"/> 2095 </method> 2096 <method id="gtk_editable_select_region"> 2097 <parameter name="end_pos" default="-1"/> 2098 </method> 2099 <method id="gtk_editable_delete_text"> 2100 <parameter name="end_pos" default="-1"/> 2101 </method> 2102 <method id="gtk_editable_get_chars"> 2103 <parameter name="end_pos" default="-1"/> 2104 </method> 2105 <extra> 2106 <spec> 2107 procedure Insert_Text 2108 (Editable : Gtk_Editable; 2109 New_Text : UTF8_String; 2110 Position : in out Gint); 2111 -- Convenience subprogram, identical to Insert_Text above without 2112 -- the requirement to supply the New_Text_Length argument. 2113 </spec> 2114 <body> 2115 procedure Insert_Text 2116 (Editable : Gtk_Editable; 2117 New_Text : UTF8_String; 2118 Position : in out Gint) is 2119 begin 2120 Insert_Text 2121 (Editable, New_Text & ASCII.NUL, New_Text'Length, Position); 2122 end Insert_Text; 2123 </body> 2124 </extra> 2125 <method id="gtk_editable_get_selection_bounds" 2126 return_as_param="Has_Selection"/> 2127 </package> 2128 2129 <package id="GtkToolItem"> 2130 <parameter name="self" ada="Tool_Item"/> 2131 <method id="gtk_tool_item_retrieve_proxy_menu_item" return="GtkMenuItem"/> 2132 <method id="gtk_tool_item_get_proxy_menu_item" return="GtkMenuItem"/> 2133 <method id="gtk_tool_item_set_proxy_menu_item"> 2134 <parameter name="menu_item" ctype="GtkMenuItem"/> 2135 </method> 2136 </package> 2137 2138 <package id="GtkScrollbar"> 2139 <parameter name="self" ada="Scrollbar"/> 2140 </package> 2141 2142 <package id="GtkHScrollbar" into="GtkScrollbar"> 2143 <parameter name="self" ada="Scrollbar"/> 2144 <type name="Gtk_Hscrollbar" subtype="true"/> 2145 <method id="gtk_hscrollbar_new" ada="Gtk_New_Hscrollbar"/> 2146 <method id="gtk_hscrollbar_get_type" ada="Hscrollbar_Get_Type"/> 2147 </package> 2148 2149 <package id="GtkVScrollbar" into="GtkScrollbar"> 2150 <parameter name="self" ada="Scrollbar"/> 2151 <type name="Gtk_Vscrollbar" subtype="true"/> 2152 <method id="gtk_vscrollbar_new" ada="Gtk_New_Vscrollbar"/> 2153 <method id="gtk_vscrollbar_get_type" ada="Vscrollbar_Get_Type"/> 2154 </package> 2155 2156 <package id="GtkCellRenderer"> 2157 <parameter name="self" ada="Cell"/> 2158 <enum ctype="GtkCellRendererState"/> 2159 <enum ctype="GtkCellRendererMode"/> 2160 <method id="gtk_cell_renderer_get_size"> 2161 <!-- hack to make cell_area an in-out parameter --> 2162 <parameter name="cell_area" ctype="GdkRectangle**"/> 2163 </method> 2164 <list ada="Cell_Renderer_List" ctype="GtkCellRenderer"/> 2165 </package> 2166 2167 <package id="GtkStatusIcon"> 2168 <parameter name="self" ada="Status_Icon"/> 2169 <!-- ??? inclusion of below method is pending on L117-038 --> 2170 <method id="gtk_status_icon_get_geometry" bind="False"/> 2171 2172 <method id="gtk_status_icon_position_menu"> 2173 <parameter name="user_data" ada="Icon" type="Glib.Object.GObject"/> 2174 <body> 2175 procedure Internal 2176 (Menu : System.Address; 2177 X : out Gint; 2178 Y : out Gint; 2179 Push_In : out Integer; 2180 Icon : System.Address); 2181 pragma Import (C, Internal, "gtk_status_icon_position_menu"); 2182 -- Custom body because we need to initialize to 0 here (on OSX). 2183 Tmp_Push_In : aliased Integer := 0; 2184 begin 2185 Internal (Get_Object (Menu), X, Y, Tmp_Push_In, Get_Object (Icon)); 2186 Push_In := Tmp_Push_In /= 0; 2187 </body> 2188 </method> 2189 </package> 2190 2191 <package id="GtkMenuItem"> 2192 <parameter name="self" ada="Menu_Item"/> 2193 <method id="gtk_menu_item_select" ada="Gtk_Select"/> 2194 <method id="gtk_menu_item_set_right_justified"> 2195 <parameter name="right_justified" default="True"/> 2196 </method> 2197 <extra> 2198 <spec> 2199 procedure Gtk_New 2200 (Menu_Item : out Gtk_Menu_Item; 2201 Label : UTF8_String) renames Gtk_New_With_Label; 2202 procedure Initialize 2203 (Menu_Item : access Gtk_Menu_Item_Record'Class; 2204 Label : UTF8_String) renames Initialize_With_Label; 2205 -- For backwards compatibility. 2206 </spec> 2207 </extra> 2208 </package> 2209 2210 <package id="GtkRecentFilter"> 2211 <parameter name="self" ada="Filter"/> 2212 <enum ctype="GtkRecentFilterFlags" /> 2213 <record ctype="GtkRecentFilterInfo" /> 2214 <slist ada="Gtk_Recent_Filter_List" ctype="GtkRecentFilter"/> 2215 </package> 2216 2217 <package id="GtkFileChooserDialog"> 2218 <parameter name="self" ada="Dialog"/> 2219 <method id="gtk_file_chooser_dialog_new" ada="Gtk_New" bind="False"/> <!-- varargs --> 2220 2221 <extra> 2222 <gir:constructor name="new" 2223 c:identifier="ada_gtk_file_chooser_dialog_new" 2224 version="2.4" 2225 introspectable="0"> 2226 <gir:doc xml:whitespace="preserve">Creates a new #GtkFileChooserDialog. This function is analogous to gtk_dialog_new_with_buttons().</gir:doc> 2227 <gir:return-value transfer-ownership="none"> 2228 <gir:doc xml:whitespace="preserve">a new #GtkFileChooserDialog</gir:doc> 2229 <gir:type name="Widget" c:type="GtkWidget*"/> 2230 </gir:return-value> 2231 <gir:parameters> 2232 <gir:parameter name="title" transfer-ownership="none" allow-none="1"> 2233 <gir:doc xml:whitespace="preserve">Title of the dialog, or %NULL</gir:doc> 2234 <gir:type name="utf8" c:type="gchar*"/> 2235 </gir:parameter> 2236 <gir:parameter name="parent" transfer-ownership="none" allow-none="1"> 2237 <gir:doc xml:whitespace="preserve">Transient parent of the dialog, or %NULL</gir:doc> 2238 <gir:type name="Window" c:type="GtkWindow*"/> 2239 </gir:parameter> 2240 <gir:parameter name="action" transfer-ownership="none"> 2241 <gir:doc xml:whitespace="preserve">Open or save mode for the dialog</gir:doc> 2242 <gir:type name="FileChooserAction" c:type="GtkFileChooserAction"/> 2243 </gir:parameter> 2244 </gir:parameters> 2245 </gir:constructor> 2246 </extra> 2247 </package> 2248 2249 <package id="GtkHandleBox" obsolescent="True"> 2250 <parameter name="self" ada="Handle_Box"/> 2251 </package> 2252 2253 <package id="GtkScaleButton"> 2254 <parameter name="self" ada="Button"/> 2255 </package> 2256 2257 <package id="GtkRecentManager"> 2258 <doc> 2259In case the default screen is being used, adding a new recently used file is as 2260simple as: 2261 2262__PRE__ 2263 declare 2264 Manager : constant Gtk_Recent_Manager := Get_Default; 2265 begin 2266 Add_Item (Manager, File_URI); 2267 end; 2268 2269While looking up a recently used file is as simple as using: 2270 2271__PRE__ 2272 declare 2273 Manager : constant Gtk_Recent_Manager := Get_Default; 2274 Info : Gtk_Recent_Info; 2275 Error : Glib.Error.GError; 2276 begin 2277 Lookup_Item (Info, Manager, File_URI, Error); 2278 if Error /= null then 2279 -- Use the info object 2280 Unref (Info); 2281 else 2282 Put_Line 2283 ("Could not find the file: " & Glib.Error.Get_Message (Error)); 2284 Glib.Error.Error_Free (Error); 2285 end if; 2286 end; 2287 </doc> 2288 <param name="self" ada="Manager" /> 2289 <record ctype="GtkRecentData" /> 2290 <method id="gtk_recent_manager_get_items" return="GtkRecentInfoList"/> 2291 <list ada="Gtk_Recent_Info_List" ctype="GtkRecentInfo"/> 2292 2293 <!-- Bound below --> 2294 <method id="gtk_recent_manager_add_full" bind="False" /> 2295 2296 <extra> 2297 <with_spec pkg="GNAT.Strings" /> 2298 <with_body pkg="Gtkada.Bindings" /> 2299 <spec> 2300 function Add_Full 2301 (Manager : access Gtk_Recent_Manager_Record; 2302 Uri : UTF8_String; 2303 Display_Name : UTF8_String := ""; 2304 Description : UTF8_String := ""; 2305 Mime_Type : UTF8_String; 2306 App_Name : UTF8_String; 2307 App_Exec : UTF8_String; 2308 Groups : GNAT.Strings.String_List; 2309 Is_Private : Boolean) 2310 return Boolean; 2311 -- Manager : the Gtk_Recent_Manager on which to operate 2312 -- Uri : pointer to resource 2313 -- Display_Name : a UTF-8 encoded string, containing the name of the 2314 -- recently used resource to be displayed, or "". 2315 -- Description : a UTF-8 encoded string, containing a short description 2316 -- of the resource, or "". 2317 -- Mime_Type : the MIME type of the resource. 2318 -- App_Name : the name of the application that is registering this 2319 -- recently used resource. 2320 -- App_Exec : command line used to launch this resource; may contain 2321 -- the "%f" and "%u" escape characters which will be 2322 -- expanded to the resource file path and URI, respectively, 2323 -- when the command line is retrieved. 2324 -- Groups : a vector of strings containing groups names. 2325 -- Is_Private : whether this resource should be displayed only by the 2326 -- applications that have registered it or not. 2327 -- 2328 -- Adds a new resource, pointed by Uri, into the recently used 2329 -- resources list, using the metadata specified. 2330 -- 2331 -- The passed URI will be used to identify this resource inside the 2332 -- list. 2333 -- 2334 -- In order to register the new recently used resource, metadata about 2335 -- the resource must be passed as well as the URI. This metadata must 2336 -- contain the MIME type of the resource pointed by the URI; the name of 2337 -- the application that is registering the item, and a command line to be 2338 -- used when launching the item. 2339 -- 2340 -- Optionally, it is possible to specify a UTF-8 string to be used when 2341 -- viewing the item instead of the last component of the URI; a short 2342 -- description of the item; whether the item should be considered private - 2343 -- that is, should be displayed only by the applications that have 2344 -- registered it. 2345 -- 2346 -- Returns True if the new item was successfully added to the recently 2347 -- used resources list, False otherwise. 2348 </spec> 2349 <body> 2350 function Add_Full 2351 (Manager : access Gtk_Recent_Manager_Record; 2352 Uri : UTF8_String; 2353 Display_Name : UTF8_String := ""; 2354 Description : UTF8_String := ""; 2355 Mime_Type : UTF8_String; 2356 App_Name : UTF8_String; 2357 App_Exec : UTF8_String; 2358 Groups : GNAT.Strings.String_List; 2359 Is_Private : Boolean) 2360 return Boolean 2361 is 2362 function Internal 2363 (Manager : System.Address; 2364 Uri : String; 2365 Recent_Data : System.Address) 2366 return Gboolean; 2367 pragma Import (C, Internal, "gtk_recent_manager_add_full"); 2368 2369 type Gtk_Recent_Data_Record is record 2370 display_name : chars_ptr; 2371 description : chars_ptr; 2372 mime_type : chars_ptr; 2373 app_name : chars_ptr; 2374 app_exec : chars_ptr; 2375 groups : System.Address; 2376 is_private : Gboolean; 2377 end record; 2378 pragma Convention (C, Gtk_Recent_Data_Record); 2379 -- Internal record that matches struct _GtkRecentData in 2380 -- gtkrecentmanager.h 2381 2382 C_Groups : aliased chars_ptr_array := From_String_List (Groups); 2383 -- Temporary variable to aid translation 2384 2385 GRD : aliased Gtk_Recent_Data_Record; 2386 -- Data to feed in to gtk_recent_manager_add_full() 2387 2388 Result : Gboolean; 2389 begin 2390 -- Set up. 2391 GRD.display_name := String_Or_Null (Display_Name); 2392 GRD.description := String_Or_Null (Description); 2393 GRD.mime_type := New_String (Mime_Type); 2394 GRD.app_name := New_String (App_Name); 2395 GRD.app_exec := New_String (App_Exec); 2396 GRD.is_private := Boolean'Pos (Is_Private); 2397 2398 if C_Groups'Length > 0 then 2399 GRD.groups := C_Groups (C_Groups'First)'Address; 2400 else 2401 GRD.groups := System.Null_Address; 2402 end if; 2403 -- Invoke function. 2404 Result := Internal (Get_Object (Manager), Uri & ASCII.NUL, GRD'Address); 2405 2406 -- Clean up, making sure to avoid double-deallocations where such 2407 -- may be possible. 2408 if GRD.display_name /= Null_Ptr then 2409 Free (GRD.display_name); 2410 end if; 2411 if GRD.description /= Null_Ptr then 2412 Free (GRD.description); 2413 end if; 2414 Free (GRD.mime_type); 2415 Free (GRD.app_name); 2416 Free (GRD.app_exec); 2417 for I in C_Groups'Range loop 2418 if C_Groups (I) /= Null_Ptr then 2419 Free (C_Groups (I)); 2420 end if; 2421 end loop; 2422 2423 -- Return result. 2424 return Boolean'Val (Result); 2425 end Add_Full; 2426 </body> 2427 </extra> 2428 </package> 2429 2430 <package id="GtkRecentInfo"> <!-- into="GtkRecentManager">--> 2431 <method id="gtk_recent_info_ref" return="void" /> 2432 2433 <!-- ??? Disabled for now, we are creating an unconstrained local var --> 2434 <method id="gtk_recent_info_get_application_info" return="void" bind="False"/> 2435 2436 <!-- These functions return the length separately, not needed in Ada--> 2437 <method id="gtk_recent_info_get_applications" bind="False" /> 2438 <method id="gtk_recent_info_get_groups" bind="False" /> 2439 2440 <extra> 2441 <type> 2442 subtype time_t is Long_Integer; 2443 -- Type to interface with C's time_t type. To convert this to/from 2444 -- an Ada type, look at Ada.Calendar.Conversion_Operations and be 2445 -- sure to pay special attention to the ranges each type is capable 2446 -- of representing. 2447 </type> 2448 </extra> 2449 </package> 2450 2451 <package id="GtkRecentChooser"> 2452 <virtual-method id='*' bind='False'/> 2453 <parameter name="self" ada="Chooser" /> 2454 <method id="gtk_recent_chooser_get_items" return="RecentInfoList"/> 2455 <enum ctype="GtkRecentSortType" /> 2456 2457 <!-- These functions return the length separately, not needed in Ada--> 2458 <method id="gtk_recent_chooser_get_uris" bind="False" /> 2459 2460 <method id="gtk_recent_chooser_list_filters" return="RecentFilterSList"/> 2461 </package> 2462 2463 <package id="GtkWidgetClass" into="GtkWidget" bindtype="false"> 2464 <method id="gtk_widget_class_find_style_property"/> 2465 <method id="gtk_widget_class_install_style_property" > 2466 <parameter name="pspec" ctype="GParamSpec"/> 2467 </method> 2468 <method id="gtk_widget_class_set_accessible_role" bind="False" /> <!-- needs atk --> 2469 <method id="gtk_widget_class_set_accessible_type" bind="False" /> <!-- needs atk --> 2470 2471 <method id="gtk_widget_class_install_style_property_parser" bind="False" /> 2472 <method id="gtk_widget_class_list_style_properties" bind="False" /> 2473 2474 <method id="gtk_widget_class_set_template" bind="False"/> <!-- needs GBytes --> 2475 <method id="gtk_widget_class_set_template_from_resource" bind="False"/> <!-- needs GBytes --> 2476 <method id="gtk_widget_class_bind_template_callback_full" bind="False"/> <!-- useless withouth gtk_widget_class_set_template --> 2477 </package> 2478 2479 <package id="GtkWidget" needs_merge="false"> 2480 <parameter name="self" ada="Widget" /> 2481 <enum ctype="GtkAlign"/> 2482 <enum ctype="GtkWidgetHelpType" /> 2483 <record ctype="GtkRequisition"/> 2484 <record ctype="GtkWidgetPath"/> 2485 <list ada="Widget_List" ctype="Widget"/> 2486 <slist ada="Widget_SList" ctype="Widget"/> 2487 2488 <method id="::query-tooltip"> 2489 <parameter name="tooltip" ctype="GObject*"/> 2490 </method> 2491 2492 <method id="gtk_widget_new" bind="False" /> <!-- varargs --> 2493 <method id="gtk_widget_style_get" bind="False" /> <!-- varargs --> 2494 <method id="gtk_widget_style_get_valist" bind="False"/><!-- varargs --> 2495 <method id="gtk_widget_list_accel_closures" bind="False"/><!-- We do not expose Closures--> 2496 <method id="gtk_widget_get_style_context" bind="False"/><!-- in Gtk.Style_Context--> 2497 <method id="gtk_widget_get_accessible" bind="False"/> <!-- Requires ATK --> 2498 <method id="gtk_widget_get_clipboard" bind="False"/><!-- in Gtk.Clipboard --> 2499 <method id="gtk_widget_get_settings" bind="False"/><!-- in Gtk.Settings --> 2500 <method id="gtk_widget_modify_style" bind="False"/><!-- in Gtk.RC --> 2501 <method id="gtk_widget_get_modifier_style" bind="False"/><!-- in Gtk.RC --> 2502 <method id="gtk_widget_class_path" bind="False"/><!-- deprecated --> 2503 <method id="gtk_widget_path" bind="False"/><!-- deprecated --> 2504 <method id="gtk_drag_source_set_icon_gicon" bind="False"/><!-- does not exist in quartz backend--> 2505 <method id="gtk_drag_source_get_target_list" bind="False"/><!-- in Gtk.Dnd --> 2506 <method id="gtk_drag_source_set_target_list" bind="False"/><!-- in Gtk.Dnd--> 2507 <method id="gtk_drag_begin" bind="False"/><!-- in Gtk.Dnd --> 2508 <method id="gtk_drag_dest_find_target" bind="False"/><!-- in Gtk.Dnd--> 2509 <method id="gtk_drag_dest_get_target_list" bind="False"/><!-- in Gtk.Dnd--> 2510 <method id="gtk_drag_dest_set_target_list" bind="False"/><!-- in Gtk.Dnd--> 2511 <method id="gtk_drag_dest_set" bind="False"/><!-- in Gtk.Dnd --> 2512 <method id="gtk_drag_source_set" bind="False"/><!-- in Gtk.Dnd --> 2513 <method id="gtk_widget_modify_base" obsolescent="True"/> 2514 <method id="gtk_widget_modify_fg" obsolescent="True"> 2515 <doc extend="true"> 2516 Only states between State_Normal and State_Insensitive are valid. 2517 </doc> 2518 </method> 2519 <method id="gtk_widget_modify_bg" obsolescent="True"/> 2520 <method id="gtk_widget_modify_text" obsolescent="True"/> 2521 <method id="gtk_widget_modify_font" obsolescent="True"/> 2522 <method id="gtk_widget_insert_action_group" bind="False"/> <!-- needs GAction --> 2523 <method id="gtk_widget_set_sensitive"> 2524 <parameter name="Sensitive" default="True"/> 2525 </method> 2526 <method id="gtk_widget_size_allocate"> 2527 <parameter name="allocation" ctype="GtkAllocation" /> 2528 </method> 2529 <method id="gtk_widget_set_size_request"> 2530 <parameter name="Width" default="-1" /> 2531 <parameter name="Height" default="-1" /> 2532 </method> 2533 <method id="gtk_widget_add_accelerator"> 2534 <parameter name="Accel_Key" ctype="GdkKeyType" /> 2535 <parameter name="Accel_Signal" ctype="SignalName" /> 2536 </method> 2537 <method id="gtk_widget_remove_accelerator"> 2538 <parameter name="Accel_Key" ctype="GdkKeyType" /> 2539 </method> 2540 <method id="gtk_widget_add_events"> 2541 <parameter name="Events" ctype="GdkEventMask"/> 2542 </method> 2543 <method id="gtk_widget_set_events"> 2544 <parameter name="Events" ctype="GdkEventMask"/> 2545 </method> 2546 <method id="gtk_widget_get_events" return="GdkEventMask"/> 2547 <method id="gtk_widget_get_tooltip_window" return="GtkWidget*" /> 2548 <method id="gtk_widget_set_tooltip_window"> 2549 <parameter name="Custom_Window" ctype="GtkWidget*"/> 2550 </method> 2551 <method id="gtk_widget_list_mnemonic_labels" return="WidgetList" /> 2552 <method id="gtk_widget_render_icon"> 2553 <parameter name="Detail" default='""'/> 2554 </method> 2555 <method id="gtk_widget_create_pango_layout"> 2556 <parameter name="Text" allow-none="1"/> 2557 </method> 2558 <method id="gtk_widget_intersect"> 2559 <parameter name="Intersection" direction="access"/> 2560 </method> 2561 <method id="gtk_widget_translate_coordinates" return_as_param="Result"/> 2562 <method id="gtk_widget_destroy"> 2563 <body> 2564 procedure Internal (Widget : System.Address); 2565 pragma Import (C, Internal, "gtk_widget_destroy"); 2566 2567 procedure Unref_Internal (Widget : System.Address); 2568 pragma Import (C, Unref_Internal, "g_object_unref"); 2569 -- External binding: g_object_unref 2570 2571 Ptr : constant System.Address := Get_Object (Widget); 2572 2573 use type System.Address; 2574 begin 2575 -- Keep a reference on the object, so that the Ada structure is 2576 -- never automatically deleted when the C object is. 2577 -- We can't reset the content of Widget to System.Null_Address before 2578 -- calling the C function, because we want the user's destroy 2579 -- callbacks to be called with the appropriate object. 2580 Ref (Widget); 2581 Internal (Ptr); 2582 2583 -- We then can make sure that the object won't be referenced any 2584 -- more, (The Ada structure won't be free before the ref count goes 2585 -- down to 0, and we don't want the user to use a deleted object...). 2586 Set_Object (Widget, System.Null_Address); 2587 2588 -- Free the reference we had. In most cases, this results in the 2589 -- object being freed. We can't use directly Unref, since the Ptr 2590 -- field for Object is Null_Address. 2591 Unref_Internal (Ptr); 2592 </body> 2593 </method> 2594 2595 <function id="gtk_cairo_transform_to_window" ada="Transform_To_Window" /> 2596 <function id="gtk_cairo_should_draw_window" ada="Should_Draw_Window" /> 2597 <extra> 2598 <with_spec pkg="Gdk.Rectangle"/> 2599 <type> 2600 subtype Gtk_Allocation is Gdk.Rectangle.Gdk_Rectangle; 2601 </type> 2602 <spec> 2603 ------------------------------------ 2604 -- Override default size handling -- 2605 ------------------------------------ 2606 2607 type Gtk_Requisition_Access is access all Gtk_Requisition; 2608 type Gtk_Allocation_Access is access all Gtk_Allocation; 2609 pragma Convention (C, Gtk_Requisition_Access); 2610 pragma Convention (C, Gtk_Allocation_Access); 2611 2612 function Get_Requisition 2613 (Value : Glib.Values.GValue) return Gtk_Requisition_Access; 2614 function Get_Allocation 2615 (Value : Glib.Values.GValue) return Gtk_Allocation_Access; 2616 -- Convert values received as callback parameters 2617 2618 type Size_Allocate_Handler is access procedure 2619 (Widget : System.Address; Allocation : Gtk_Allocation); 2620 pragma Convention (C, Size_Allocate_Handler); 2621 -- Widget is the gtk+ C widget, that needs to be converted to Ada through 2622 -- a call to: 2623 -- declare 2624 -- Stub : Gtk_Widget_Record; -- or the exact type you expect 2625 -- begin 2626 -- My_Widget := Gtk_Widget (Glib.Object.Get_User_Data (Widget, Stub); 2627 -- end; 2628 2629 procedure Set_Default_Size_Allocate_Handler 2630 (Klass : Glib.Object.GObject_Class; 2631 Handler : Size_Allocate_Handler); 2632 pragma Import (C, Set_Default_Size_Allocate_Handler, 2633 "ada_WIDGET_CLASS_override_size_allocate"); 2634 -- Override the default size_allocate handler for this class. This handler 2635 -- is automatically called in several cases (when a widget is dynamically 2636 -- resized for instance), not through a signal. Thus, if you need to 2637 -- override the default behavior provided by one of the standard 2638 -- containers, you can not simply use Gtk.Handlers.Emit_Stop_By_Name, and 2639 -- you must override the default handler. Note also that this handler 2640 -- is automatically inherited by children of this class. 2641 -- 2642 -- This function is not needed unless you are writting your own 2643 -- widgets, and should be reserved for advanced customization of the 2644 -- standard widgets. 2645 2646 type Preferred_Size_Handler is access procedure 2647 (Widget : System.Address; 2648 Minimum_Size : out Glib.Gint; 2649 Natural_Size : out Glib.Gint); 2650 pragma Convention (C, Preferred_Size_Handler); 2651 2652 type Preferred_Size_For_Handler is access procedure 2653 (Widget : System.Address; 2654 Ref : Glib.Gint; -- known width or height 2655 Minimum_Size : out Glib.Gint; 2656 Natural_Size : out Glib.Gint); 2657 pragma Convention (C, Preferred_Size_For_Handler); 2658 2659 procedure Set_Default_Get_Preferred_Width_Handler 2660 (Klass : Glib.Object.GObject_Class; 2661 Handler : Preferred_Size_Handler); 2662 procedure Set_Default_Get_Preferred_Height_Handler 2663 (Klass : Glib.Object.GObject_Class; 2664 Handler : Preferred_Size_Handler); 2665 procedure Set_Default_Get_Preferred_Height_For_Width_Handler 2666 (Klass : Glib.Object.GObject_Class; 2667 Handler : Preferred_Size_For_Handler); 2668 procedure Set_Default_Get_Preferred_Width_For_Height_Handler 2669 (Klass : Glib.Object.GObject_Class; 2670 Handler : Preferred_Size_For_Handler); 2671 pragma Import (C, Set_Default_Get_Preferred_Width_Handler, 2672 "ada_WIDGET_CLASS_override_get_preferred_width"); 2673 pragma Import (C, Set_Default_Get_Preferred_Height_Handler, 2674 "ada_WIDGET_CLASS_override_get_preferred_height"); 2675 pragma Import (C, Set_Default_Get_Preferred_Height_For_Width_Handler, 2676 "ada_WIDGET_CLASS_override_get_preferred_height_for_width"); 2677 pragma Import (C, Set_Default_Get_Preferred_Width_For_Height_Handler, 2678 "ada_WIDGET_CLASS_override_get_preferred_width_for_height"); 2679 -- Override the computation of a widget's preferred sizes. 2680 -- You will only need to override this computation if you are writting 2681 -- your own container widgets. 2682 2683 procedure Inherited_Get_Preferred_Width 2684 (Klass : Glib.Object.Ada_GObject_Class; 2685 Widget : access Gtk_Widget_Record'Class; 2686 Minimum_Size, Natural_Size : out Glib.Gint); 2687 procedure Inherited_Get_Preferred_Width_For_Height 2688 (Klass : Glib.Object.Ada_GObject_Class; 2689 Widget : access Gtk_Widget_Record'Class; 2690 Height : Glib.Gint; 2691 Minimum_Size, Natural_Size : out Glib.Gint); 2692 procedure Inherited_Get_Preferred_Height 2693 (Klass : Glib.Object.Ada_GObject_Class; 2694 Widget : access Gtk_Widget_Record'Class; 2695 Minimum_Size, Natural_Size : out Glib.Gint); 2696 procedure Inherited_Get_Preferred_Height_For_Width 2697 (Klass : Glib.Object.Ada_GObject_Class; 2698 Widget : access Gtk_Widget_Record'Class; 2699 Width : Glib.Gint; 2700 Minimum_Size, Natural_Size : out Glib.Gint); 2701 -- Call the default implementation 2702 2703 procedure Inherited_Size_Allocate 2704 (Klass : Glib.Object.Ada_GObject_Class; 2705 Widget : access Gtk_Widget_Record'Class; 2706 Allocation : Gtk_Allocation); 2707 -- Call the inherited size_allocate. This is useful if you have overloaded it in 2708 -- your own class, but still need to call the standard implementation. 2709 2710 type Realize_Handler is access procedure (Widget : System.Address); 2711 pragma Convention (C, Realize_Handler); 2712 procedure Set_Default_Realize_Handler 2713 (Klass : Glib.Object.GObject_Class; 2714 Handler : Realize_Handler); 2715 pragma Import (C, Set_Default_Realize_Handler, 2716 "ada_WIDGET_CLASS_override_realize"); 2717 -- Override the handler for the "realize" signal. This handler should 2718 -- create the window for the widget 2719 2720 procedure Inherited_Realize 2721 (Klass : Glib.Object.Ada_GObject_Class; 2722 Widget : access Gtk_Widget_Record'Class); 2723 -- Call the inherited realize. 2724 2725 --------------------------- 2726 -- Override Draw handler -- 2727 --------------------------- 2728 2729 generic 2730 with function Draw 2731 (W : access Gtk_Widget_Record'Class; 2732 Cr : Cairo.Cairo_Context) return Boolean; 2733 function Proxy_Draw 2734 (W : System.Address; Cr : Cairo.Cairo_Context) return Gboolean; 2735 pragma Convention (C, Proxy_Draw); 2736 2737 type Draw_Handler is access function 2738 (W : System.Address; 2739 Cr : Cairo.Cairo_Context) return Gboolean; 2740 pragma Convention (C, Draw_Handler); 2741 -- A function responsible for drawing a widget. 2742 2743 procedure Set_Default_Draw_Handler 2744 (Klass : Glib.Object.GObject_Class; Handler : Draw_Handler); 2745 -- Override the default drawing function. This in general gives more 2746 -- control than connection to Signal_Draw, however a widget is responsible 2747 -- for drawing its children. 2748 -- Use the generic Proxy_Draw to create a suitable callback. 2749 2750 function Inherited_Draw 2751 (Klass : Glib.Object.Ada_GObject_Class; 2752 Widget : access Gtk_Widget_Record'Class; 2753 Cr : Cairo.Cairo_Context) return Boolean; 2754 -- Call the inherited draw. This is useful if you have overloaded draw in 2755 -- your own class, but still need to draw the child widgets that do not 2756 -- have their own window (the others will already get their own "draw" 2757 -- event. 2758 -- See http://developer.gnome.org/gtk3/3.0/chap-drawing-model.html 2759 -- for an explanation of the gtk+ drawing model. 2760 </spec> 2761 <with_body pkg="Ada.Unchecked_Conversion" use="False"/> 2762 <body> 2763 function Convert is new Ada.Unchecked_Conversion 2764 (Draw_Handler, System.Address); 2765 2766 function Proxy_Draw 2767 (W : System.Address; 2768 Cr : Cairo.Cairo_Context) return Gboolean 2769 is 2770 Stub : Gtk_Widget_Record; 2771 W2 : constant Gtk_Widget := Gtk_Widget (Get_User_Data (W, Stub)); 2772 begin 2773 return Boolean'Pos (Draw (W2, Cr)); 2774 end Proxy_Draw; 2775 2776 function Inherited_Draw 2777 (Klass : Glib.Object.Ada_GObject_Class; 2778 Widget : access Gtk_Widget_Record'Class; 2779 Cr : Cairo.Cairo_Context) return Boolean 2780 is 2781 function Internal (Klass : Ada_GObject_Class; 2782 Widget : System.Address; 2783 Cr : Cairo.Cairo_Context) return Gboolean; 2784 pragma Import (C, Internal, "ada_inherited_WIDGET_CLASS_draw"); 2785 begin 2786 return Internal (Klass, Widget.Get_Object, Cr) /= 0; 2787 end Inherited_Draw; 2788 2789 procedure Inherited_Get_Preferred_Width 2790 (Klass : Glib.Object.Ada_GObject_Class; 2791 Widget : access Gtk_Widget_Record'Class; 2792 Minimum_Size, Natural_Size : out Glib.Gint) 2793 is 2794 procedure Internal (Klass : Ada_GObject_Class; 2795 Widget : System.Address; 2796 Min, Nat : out Glib.Gint); 2797 pragma Import 2798 (C, Internal, "ada_inherited_WIDGET_CLASS_get_preferred_width"); 2799 begin 2800 Internal (Klass, Widget.Get_Object, Minimum_Size, Natural_Size); 2801 end Inherited_Get_Preferred_Width; 2802 2803 procedure Inherited_Get_Preferred_Width_For_Height 2804 (Klass : Glib.Object.Ada_GObject_Class; 2805 Widget : access Gtk_Widget_Record'Class; 2806 Height : Glib.Gint; 2807 Minimum_Size, Natural_Size : out Glib.Gint) 2808 is 2809 procedure Internal (Klass : Ada_GObject_Class; 2810 Widget : System.Address; 2811 Height : Glib.Gint; 2812 Min, Nat : out Glib.Gint); 2813 pragma Import 2814 (C, Internal, "ada_inherited_WIDGET_CLASS_get_preferred_width_for_height"); 2815 begin 2816 Internal (Klass, Widget.Get_Object, Height, Minimum_Size, Natural_Size); 2817 end Inherited_Get_Preferred_Width_For_Height; 2818 2819 procedure Inherited_Get_Preferred_Height 2820 (Klass : Glib.Object.Ada_GObject_Class; 2821 Widget : access Gtk_Widget_Record'Class; 2822 Minimum_Size, Natural_Size : out Glib.Gint) 2823 is 2824 procedure Internal (Klass : Ada_GObject_Class; 2825 Widget : System.Address; 2826 Min, Nat : out Glib.Gint); 2827 pragma Import 2828 (C, Internal, "ada_inherited_WIDGET_CLASS_get_preferred_height"); 2829 begin 2830 Internal (Klass, Widget.Get_Object, Minimum_Size, Natural_Size); 2831 end Inherited_Get_Preferred_Height; 2832 2833 procedure Inherited_Get_Preferred_Height_For_Width 2834 (Klass : Glib.Object.Ada_GObject_Class; 2835 Widget : access Gtk_Widget_Record'Class; 2836 Width : Glib.Gint; 2837 Minimum_Size, Natural_Size : out Glib.Gint) 2838 is 2839 procedure Internal (Klass : Ada_GObject_Class; 2840 Widget : System.Address; 2841 Width : Glib.Gint; 2842 Min, Nat : out Glib.Gint); 2843 pragma Import 2844 (C, Internal, "ada_inherited_WIDGET_CLASS_get_preferred_height_for_width"); 2845 begin 2846 Internal (Klass, Widget.Get_Object, Width, Minimum_Size, Natural_Size); 2847 end Inherited_Get_Preferred_Height_For_Width; 2848 2849 procedure Inherited_Size_Allocate 2850 (Klass : Glib.Object.Ada_GObject_Class; 2851 Widget : access Gtk_Widget_Record'Class; 2852 Allocation : Gtk_Allocation) 2853 is 2854 procedure Internal (Klass : Ada_GObject_Class; 2855 Widget : System.Address; 2856 Allocation : Gtk_Allocation); 2857 pragma Import 2858 (C, Internal, "ada_inherited_WIDGET_CLASS_size_allocate"); 2859 begin 2860 Internal (Klass, Widget.Get_Object, Allocation); 2861 end Inherited_Size_Allocate; 2862 2863 procedure Inherited_Realize 2864 (Klass : Glib.Object.Ada_GObject_Class; 2865 Widget : access Gtk_Widget_Record'Class) 2866 is 2867 procedure Internal (Klass : Ada_GObject_Class; 2868 Widget : System.Address); 2869 pragma Import 2870 (C, Internal, "ada_inherited_WIDGET_CLASS_realize"); 2871 begin 2872 Internal (Klass, Widget.Get_Object); 2873 end Inherited_Realize; 2874 2875 procedure Set_Default_Draw_Handler 2876 (Klass : Glib.Object.GObject_Class; Handler : Draw_Handler) 2877 is 2878 procedure Internal (K : GObject_Class; H : System.Address); 2879 pragma Import (C, Internal, "ada_WIDGET_CLASS_override_draw"); 2880 begin 2881 Internal (Klass, Convert (Handler)); 2882 end Set_Default_Draw_Handler; 2883 2884 function Get_Allocation 2885 (Value : Glib.Values.GValue) return Gtk_Allocation_Access 2886 is 2887 pragma Warnings (Off); 2888 -- This UC is safe aliasing-wise, so kill warning 2889 function To_Allocation is new 2890 Ada.Unchecked_Conversion (System.Address, Gtk_Allocation_Access); 2891 pragma Warnings (On); 2892 begin 2893 return To_Allocation (Glib.Values.Get_Address (Value)); 2894 end Get_Allocation; 2895 2896 function Get_Requisition 2897 (Value : Glib.Values.GValue) return Gtk_Requisition_Access 2898 is 2899 pragma Warnings (Off); 2900 -- This UC is safe aliasing-wise, so kill warning 2901 function To_Requisition is new 2902 Ada.Unchecked_Conversion (System.Address, Gtk_Requisition_Access); 2903 pragma Warnings (On); 2904 begin 2905 return To_Requisition (Glib.Values.Get_Address (Value)); 2906 end Get_Requisition; 2907 </body> 2908 </extra> 2909 </package> 2910 2911 <package id="PangoEnums"> 2912 <enum ctype="PangoAlignment" ada="Alignment"/> 2913 <enum ctype="PangoAttrType" ada="Attr_Type"/> 2914 <enum ctype="PangoCoverageLevel" ada="Coverage_Level"/> 2915 <enum ctype="PangoDirection" ada="Direction"/> 2916 <enum ctype="PangoFontMask" ada="Font_Mask"/> 2917 <enum ctype="PangoGravity" ada="Gravity"/> 2918 <enum ctype="PangoGravityHint" ada="GravityHint"/> 2919 <enum ctype="PangoStretch" ada="Stretch"/> 2920 <enum ctype="PangoStyle" ada="Style"/> 2921 <enum ctype="PangoUnderline" ada="Underline"/> 2922 <enum ctype="PangoVariant" ada="Variant"/> 2923 <enum ctype="PangoWeight" ada="Weight"/> 2924 <enum ctype="PangoWrapMode" ada="Wrap_Mode"/> 2925 2926 <extra> 2927 <with_spec pkg="Glib"/> 2928 <spec> 2929 Pango_Scale : constant := 1024; 2930 -- All internal units in Pango are expressed in terms of this unit. A 2931 -- typical pango size must be divided by Pango_Scale to get the equivalent 2932 -- in pixels. 2933 2934 function To_Pixels (Pango_Units : Gint) return Gint; 2935 -- Convert a size in pango units to pixels. This is a rounding of 2936 -- Pango_Units divided by Pango_Scale 2937 2938 -- Enum types are bound with the following algorithm: 2939 -- + the "Pango" prefix of the type name is stripped 2940 -- + Each word of the type name is separated by '_' 2941 -- + the full enum name is kept, but capitalized. 2942 2943 -- All enums types should be sorted by alphabetical order... 2944 </spec> 2945 <body> 2946 function To_Pixels (Pango_Units : Gint) return Gint is 2947 begin 2948 if Pango_Units > 0 then 2949 return (Pango_Units + Pango_Scale / 2) / Pango_Scale; 2950 else 2951 return (Pango_Units - Pango_Scale / 2) / Pango_Scale; 2952 end if; 2953 end To_Pixels; 2954 </body> 2955 </extra> 2956 </package> 2957 2958 <package id="GtkEnums"> 2959 <enum ctype="GtkArrowType"/> 2960 <enum ctype="GtkAttachOptions"/> 2961 <enum ctype="GtkButtonBoxStyle"/> 2962 <enum ctype="GtkCornerType"/> 2963 <enum ctype="GtkDeleteType"/> 2964 <enum ctype="GtkDirectionType"/> 2965 <enum ctype="GtkDragResult"/> 2966 <enum ctype="GtkExpanderStyle"/> 2967 <enum ctype="GtkIconSize" asbitfield="True"/> 2968 <enum ctype="GtkJunctionSides"/> 2969 <enum ctype="GtkBaselinePosition"/> 2970 <enum ctype="GtkJustification"/> 2971 <enum ctype="GtkMenuDirectionType"/> 2972 <enum ctype="GtkMovementStep"/> 2973 <enum ctype="GtkInputHints"/> 2974 <enum ctype="GtkInputPurpose"/> 2975 <enum ctype="GtkNumberUpLayout" prefix="GTK_NUMBER_UP_LAYOUT_"/> 2976 <enum ctype="GtkOrientation"/> 2977 <enum ctype="GtkPackDirection"/> 2978 <enum ctype="GtkPackType"/> 2979 <enum ctype="GtkPageOrientation"/> 2980 <enum ctype="GtkPageSet"/> 2981 <enum ctype="GtkPanDirection"/> 2982 <enum ctype="GtkPropagationPhase"/> 2983 <enum ctype="GtkEventSequenceState"/> 2984 <enum ctype="GtkLevelBarMode"/> 2985 <enum ctype="GtkPathPriorityType"/> 2986 <enum ctype="GtkPathType"/> 2987 <enum ctype="GtkPolicyType"/> 2988 <enum ctype="GtkPositionType"/> 2989 <enum ctype="GtkPrintDuplex"/> 2990 <enum ctype="GtkPrintPages"/> 2991 <enum ctype="GtkPrintQuality"/> 2992 <enum ctype="GtkRegionFlags"/> 2993 <enum ctype="GtkReliefStyle"/> 2994 <enum ctype="GtkResizeMode"/> 2995 <enum ctype="GtkScrollStep"/> 2996 <enum ctype="GtkScrollType"/> 2997 <enum ctype="GtkScrollablePolicy"/> 2998 <enum ctype="GtkSelectionMode"/> 2999 <enum ctype="GtkSensitivityType"/> 3000 <enum ctype="GtkShadowType"/> 3001 <enum ctype="GtkSizeRequestMode" prefix="GTK_SIZE_REQUEST_"/> 3002 <enum ctype="GtkSortType"/> 3003 <enum ctype="GtkStateFlags" prefix=""/> 3004 <enum ctype="GtkStateType"/> 3005 <enum ctype="GtkTargetFlags" prefix=""/> 3006 <enum ctype="GtkTextDirection"/> 3007 <enum ctype="GtkTextWindowType"/> 3008 <enum ctype="GtkTreeViewGridLines" prefix="GTK_TREE_VIEW_"/> 3009 <enum ctype="GtkToolbarSpaceStyle"/> 3010 <enum ctype="GtkToolbarStyle"/> 3011 <enum ctype="GtkUnit" prefix="GTK_UNIT_"/> 3012 <enum ctype="GtkWindowPosition"/> 3013 <enum ctype="GtkWindowType"/> 3014 <enum ctype="GtkWrapMode"/> 3015 3016 <extra> 3017 <with_spec pkg="Glib.Glist"/> 3018 <with_spec pkg="Glib.GSlist"/> 3019 <spec> 3020 function Convert (S : String) return System.Address; 3021 function Convert (S : System.Address) return String; 3022 package String_List is new Glib.Glist.Generic_List (UTF8_String); 3023 package String_SList is new Glib.GSlist.Generic_SList (UTF8_String); 3024 -- Warning: when you create this list, new memory gets allocated for 3025 -- all the strings. You should use the function Free_String_List 3026 -- instead of Glib.Glist.Free to be sure to free this memory. 3027 3028 procedure Free_String_List (List : in out String_List.Glist); 3029 procedure Free_String_List (List : in out String_SList.GSlist); 3030 -- Free the memory occupied by all the strings in the list, as well 3031 -- as the memory occupied by the list itself. 3032 </spec> 3033 <with_body pkg="Ada.Unchecked_Conversion" use="False"/> 3034 <with_body pkg="Interfaces.C.Strings" use="False"/> 3035 <body> 3036 function Convert (S : String) return System.Address is 3037 function Internal is new 3038 Ada.Unchecked_Conversion (Interfaces.C.Strings.chars_ptr, System.Address); 3039 begin 3040 return Internal (Interfaces.C.Strings.New_String (S)); 3041 end Convert; 3042 3043 function Convert_Chars_Ptr is new 3044 Ada.Unchecked_Conversion (System.Address, Interfaces.C.Strings.chars_ptr); 3045 3046 function Convert (S : System.Address) return String is 3047 begin 3048 return Interfaces.C.Strings.Value (Convert_Chars_Ptr (S)); 3049 end Convert; 3050 3051 procedure Free_String_List (List : in out String_List.Glist) is 3052 use type String_List.Glist; 3053 Tmp : String_List.Glist := List; 3054 Chars : Interfaces.C.Strings.chars_ptr; 3055 begin 3056 while Tmp /= String_List.Null_List loop 3057 Chars := Convert_Chars_Ptr (String_List.Get_Data_Address (Tmp)); 3058 Interfaces.C.Strings.Free (Chars); 3059 Tmp := String_List.Next (Tmp); 3060 end loop; 3061 3062 String_List.Free (List); 3063 List := String_List.Null_List; 3064 end Free_String_List; 3065 3066 procedure Free_String_List (List : in out String_SList.GSlist) is 3067 use type String_SList.GSlist; 3068 3069 Tmp : String_SList.GSlist := List; 3070 Chars : Interfaces.C.Strings.chars_ptr; 3071 begin 3072 while Tmp /= String_SList.Null_List loop 3073 Chars := Convert_Chars_Ptr (String_SList.Get_Data_Address (Tmp)); 3074 Interfaces.C.Strings.Free (Chars); 3075 Tmp := String_SList.Next (Tmp); 3076 end loop; 3077 3078 String_SList.Free (List); 3079 List := String_SList.Null_List; 3080 end Free_String_List; 3081 </body> 3082 </extra> 3083 </package> 3084 3085 <package id="GtkContainer"> 3086 <parameter name="self" ada="Container"/> 3087 <method id="gtk_container_add_with_properties" bind="False"/><!-- varargs --> 3088 <method id="gtk_container_child_get" bind="False"/> <!-- varargs --> 3089 <method id="gtk_container_child_get_valist" bind="False"/> <!-- varargs --> 3090 <method id="gtk_container_child_set" bind="False"/> <!-- varargs --> 3091 <method id="gtk_container_child_set_valist" bind="False"/> <!-- varargs --> 3092 <method id="gtk_container_get_children" return="WidgetList"/> 3093 <method id="gtk_container_set_focus_chain"> 3094 <parameter name="focusable_widgets" ctype="WidgetList"/> 3095 </method> 3096 <method id="gtk_container_child_set_property"> 3097 <parameter name="value" direction="in" ctype="GValue"/> 3098 </method> 3099 3100 <!-- ??? Binding needs testing --> 3101 <method id="gtk_container_get_focus_chain" return_as_param="Success" bind="false"> 3102 <parameter name="focusable_widgets" ctype="WidgetList*" direction="out"/> 3103 </method> 3104 </package> 3105 3106 <package id="GtkSpinButton"> 3107 <parameter name="self" ada="Spin_Button"/> 3108 <enum ctype="GtkSpinType"/> 3109 <enum ctype="GtkSpinButtonUpdatePolicy"/> 3110 <method id="gtk_spin_button_new_with_range" ada="Gtk_New"/> 3111 <method id="gtk_spin_button_new"> 3112 <parameter name="digits" default="0"/> 3113 </method> 3114 </package> 3115 3116 <package id="GtkAction"> 3117 <parameter name="self" ada="Action"/> 3118 <method id="gtk_action_get_accel_closure" bind="False" /> <!-- Closures not handled--> 3119 <method id="gtk_action_get_proxies" return="WidgetSList*"/> 3120 </package> 3121 3122 <package id="GtkMenu"> 3123 <parameter name="self" ada="Menu"/> 3124 <callback id="Gtk_Menu_Position_Func"> 3125 <parameter name="x" direction="out"/> 3126 <parameter name="y" direction="out"/> 3127 </callback> 3128 <method id="gtk_menu_get_active" return="GtkMenuItem"/> 3129 <method id="gtk_menu_popup"> 3130 <parameter name="parent_menu_shell" ctype="GtkMenuShell" default="null"/> 3131 <parameter name="parent_menu_item" ctype="GtkMenuItem" default="null"/> 3132 <parameter name="func" default="null"/> 3133 <parameter name="button" default="1"/> 3134 <parameter name="activate_time" default="0"/> 3135 </method> 3136 <method id="gtk_menu_get_for_attach_widget" return="WidgetList*"/> 3137 </package> 3138 3139 <package id="GtkMenuBar"> 3140 <parameter name="self" ada="Menu_Bar"/> 3141 </package> 3142 3143 <package id="GtkMenuShell"> 3144 <parameter name="self" ada="Menu_Shell"/> 3145 </package> 3146 3147 <package id="GtkMenuToolButton"> 3148 <parameter name="self" ada="Button"/> 3149 <method id="gtk_menu_tool_button_new"> 3150 <parameter name="self" ada="Menu"/> 3151 <parameter name="icon_widget" default="null"/> 3152 </method> 3153 <method id="gtk_menu_tool_button_new_from_stock"> 3154 <parameter name="self" ada="Menu"/> 3155 </method> 3156 <method id="gtk_menu_tool_button_get_menu" return="GtkMenu"/> 3157 </package> 3158 3159 <package id="GtkImageMenuItem"> 3160 <method id="gtk_image_menu_item_new"/> 3161 <method id="gtk_image_menu_item_new_with_label" ada="Gtk_New"/> 3162 </package> 3163 3164 <package id="GtkCheckMenuItem"> 3165 <parameter name="self" ada="Check_Menu_Item"/> 3166 <method id="gtk_check_menu_item_new" bind="False"/> 3167 <method id="gtk_check_menu_item_new_with_label" ada="Gtk_New" > 3168 <parameter name="label" default='""' allow-none="1"/> 3169 </method> 3170 </package> 3171 3172 <package id="GdkRGBA"> 3173 <method id="gdk_rgba_equal"> 3174 <parameter name="p2" ctype="GdkRGBA*"/> 3175 </method> 3176 <method id="gdk_rgba_parse" return_as_param="Success"> 3177 <parameter name="self" direction="out"/> 3178 </method> 3179 <extra> 3180 <with_spec pkg="Glib.Values" /> 3181 <with_spec pkg="Glib.Object" /> 3182 <spec> 3183 type array_of_Gdk_RGBA is array (Natural range <>) of Gdk_RGBA; 3184 3185 Null_RGBA : constant Gdk_RGBA := (0.0, 0.0, 0.0, 0.0); 3186 Black_RGBA : constant Gdk_RGBA := (0.0, 0.0, 0.0, 1.0); 3187 White_RGBA : constant Gdk_RGBA := (1.0, 1.0, 1.0, 1.0); 3188 3189 type Property_RGBA is new Glib.Property; 3190 procedure Set_Property 3191 (Object : access Glib.Object.GObject_Record'Class; 3192 Name : Property_RGBA; 3193 Value : Gdk_RGBA); 3194 function Get_Property 3195 (Object : access Glib.Object.GObject_Record'Class; 3196 Name : Property_RGBA) return Gdk_RGBA; 3197 3198 function Gdk_RGBA_Or_Null (Val : System.Address) return System.Address; 3199 -- Used for the GtkAda binding itself. 3200 -- Return either a Null_Address or a pointer to Val, depending on 3201 -- whether Val is the null value for the type. 3202 -- In all cases, Val is supposed to be an access to the type mentioned in 3203 -- the name of the subprogram. 3204 -- In Ada2012, these could be replaced with expression functions instead. 3205 3206 procedure Set_Value (Value : in out Glib.Values.GValue; Val : Gdk_RGBA); 3207 function Get_Value (Value : Glib.Values.GValue) return Gdk_RGBA; 3208 -- Conversion functions for storing a Gdk_RGBA as a GValue. 3209 </spec> 3210 <with_body pkg="Glib.Generic_Properties" /> 3211 <body> 3212 function To_Address 3213 (Val : Gdk_RGBA; Addr : System.Address) return System.Address; 3214 package RGBA_Properties is new Generic_Internal_Boxed_Property 3215 (Gdk_RGBA, Gdk.RGBA.Get_Type, To_Address); 3216 3217 procedure Set_Property 3218 (Object : access Glib.Object.GObject_Record'Class; 3219 Name : Property_RGBA; 3220 Value : Gdk_RGBA) is 3221 begin 3222 RGBA_Properties.Set_Property 3223 (Object, RGBA_Properties.Property (Name), Value); 3224 end Set_Property; 3225 3226 function Get_Property 3227 (Object : access Glib.Object.GObject_Record'Class; 3228 Name : Property_RGBA) return Gdk_RGBA is 3229 begin 3230 return RGBA_Properties.Get_Property 3231 (Object, RGBA_Properties.Property (Name)); 3232 end Get_Property; 3233 3234 function Gdk_RGBA_Or_Null (Val : System.Address) return System.Address is 3235 function Internal is new Gtkada.Bindings.Generic_To_Address_Or_Null 3236 (Gdk_RGBA, Null_RGBA); 3237 begin 3238 return Internal (Val); 3239 end Gdk_RGBA_Or_Null; 3240 3241 function Get_Value (Value : Glib.Values.GValue) return Gdk_RGBA 3242 renames RGBA_Properties.Get_Value; 3243 procedure Set_Value (Value : in out Glib.Values.GValue; Val : Gdk_RGBA) 3244 renames RGBA_Properties.Set_Value; 3245 3246 function To_Address 3247 (Val : Gdk_RGBA; Addr : System.Address) return System.Address is 3248 begin 3249 if Val = Null_RGBA then 3250 return System.Null_Address; 3251 else 3252 return Addr; 3253 end if; 3254 end To_Address; 3255 </body> 3256 </extra> 3257 </package> 3258 3259 <package id="GtkScrolledWindow"> 3260 <parameter name="self" ada="Scrolled_Window"/> 3261 <method id="gtk_scrolled_window_new"> 3262 <parameter name="hadjustment" default="null"/> 3263 <parameter name="vadjustment" default="null"/> 3264 </method> 3265 <method id="gtk_scrolled_window_get_hscrollbar" return="GtkScrollbar"/> 3266 <method id="gtk_scrolled_window_get_vscrollbar" return="GtkScrollbar"/> 3267 </package> 3268 3269 <package id="GtkWindow"> 3270 <parameter name="self" ada="Window"/> 3271 <method id="gtk_window_new"> 3272 <parameter name="type" default="Gtk.Enums.Window_Toplevel"/> 3273 </method> 3274 <method id="gtk_window_set_opacity" bind="False"/> <!-- would hide Gtk.Widget.Set_Opacity--> 3275 <method id="gtk_window_get_opacity" bind="False"/> <!-- would hide Gtk.Widget.Get_Opacity--> 3276 <method id="gtk_window_list_toplevels" return="WidgetList"/> 3277 <method id="gtk_window_get_icon_list" return="ObjectList"/> 3278 <method id="gtk_window_set_icon_list"> 3279 <parameter name="list" ctype="ObjectList"/> 3280 </method> 3281 <method id="gtk_window_get_default_icon_list" return="ObjectList"/> 3282 <method id="gtk_window_set_default_icon_list"> 3283 <parameter name="list" ctype="ObjectList"/> 3284 </method> 3285 <method id="gtk_window_add_mnemonic"> 3286 <parameter name="keyval" ctype="GdkKeyType"/> 3287 </method> 3288 <method id="gtk_window_remove_mnemonic"> 3289 <parameter name="keyval" ctype="GdkKeyType"/> 3290 </method> 3291 <method id="gtk_window_mnemonic_activate"> 3292 <parameter name="keyval" ctype="GdkKeyType"/> 3293 </method> 3294 <method id="gtk_window_get_resize_grip_area" return_as_param="retrieved"/> 3295 <method id="gtk_window_set_modal"> 3296 <parameter name="modal" default="True"/> 3297 </method> 3298 3299 <method id="gtk_window_get_application" bind="False"/> <!-- Circular dependency --> 3300 <method id="gtk_window_set_application" bind="False"/> <!-- Circular dependency --> 3301 </package> 3302 3303 <package id="GtkWindowGroup" into="GtkWindow"> 3304 <parameter name="self" ada="Window_Group"/> 3305 <method id="gtk_window_group_get_type" ada="Group_Get_Type"/> 3306 <method id="gtk_window_group_list_windows" return="WidgetList"/> 3307 </package> 3308 3309 <package id="GtkPaperSize"> 3310 <parameter name="self" ada="Widget"/> 3311 <list ada="Gtk_Paper_Size_Glist" ctype="GtkPaperSize" section="Functions"/> 3312 <method id="gtk_paper_size_get_paper_sizes" return="GtkPaperSizeList"/> 3313 <extra> 3314 <spec> 3315 -- Common names, from PWG 5101.1-2002 PWG: Standard for Media Standardized 3316 -- Names 3317 Gtk_Paper_Name_A3 : constant String := "iso_a3"; 3318 Gtk_Paper_Name_A4 : constant String := "iso_a4"; 3319 Gtk_Paper_Name_A5 : constant String := "iso_a5"; 3320 Gtk_Paper_Name_B5 : constant String := "iso_b5"; 3321 Gtk_Paper_Name_Letter : constant String := "na_letter"; 3322 Gtk_Paper_Name_Executive : constant String := "na_executive"; 3323 Gtk_Paper_Name_Legal : constant String := "na_legal"; 3324 </spec> 3325 </extra> 3326 </package> 3327 3328 <package id="GtkRecentAction"> 3329 <parameter name="self" ada="Widget"/> 3330 <method id="gtk_recent_action_new_for_manager"> 3331 <parameter name="manager" default="Gtk.Recent_Manager.Get_Default"/> 3332 </method> 3333 </package> 3334 3335 <package id="GtkTearoffMenuItem"> 3336 <parameter name="self" ada="Menu_Item"/> 3337 </package> 3338 3339 <package id="GtkRecentChooserDialog"> 3340 <parameter name="self" ada="Widget"/> 3341 <extra> 3342 <gir:constructor c:identifier="ada_gtk_recent_chooser_dialog_new" name="new"> 3343 <gir:return-value> 3344 <gir:type name="GtkWidget" c:type="GtkWidget*"/> 3345 </gir:return-value> 3346 <gir:parameters> 3347 <gir:parameter name="title" allow-none="1"> 3348 <gir:type name="utf8" c:type="gchar*"/> 3349 </gir:parameter> 3350 <gir:parameter name="parent" allow-none="1"> 3351 <gir:type name="Window" c:type="GtkWindow*"/> 3352 </gir:parameter> 3353 </gir:parameters> 3354 </gir:constructor> 3355 <gir:constructor c:identifier="ada_gtk_recent_chooser_dialog_new_for_manager" name="new_for_manager"> 3356 <gir:return-value> 3357 <gir:type name="GtkWidget" c:type="GtkWidget*"/> 3358 </gir:return-value> 3359 <gir:parameters> 3360 <gir:parameter name="title" allow-none="1"> 3361 <gir:type name="utf8" c:type="gchar*"/> 3362 </gir:parameter> 3363 <gir:parameter name="parent" allow-none="1"> 3364 <gir:type name="Window" c:type="GtkWindow*"/> 3365 </gir:parameter> 3366 <gir:parameter name="manager" allow-none="1"> 3367 <gir:type name="RecentManager" c:type="GtkRecentManager*"/> 3368 </gir:parameter> 3369 </gir:parameters> 3370 </gir:constructor> 3371 </extra> 3372 </package> 3373 3374 <package id="GtkRecentChooserMenu"> 3375 </package> 3376 3377 <package id="GtkRecentChooserWidget"> 3378 <parameter name="self" ada="Widget"/> 3379 </package> 3380 3381 <package id="GtkToggleAction"> 3382 <parameter name="self" ada="Action"/> 3383 </package> 3384 3385 <package id="GtkToggleToolButton"> 3386 <parameter name="self" ada="Button"/> 3387 </package> 3388 3389 <package id="GtkStyle"> 3390 <parameter name="self" ada="Style"/> 3391 <method id="gtk_style_get_valist" bind="False"/><!-- va_list --> 3392 <method id="gtk_style_lookup_color" 3393 return_as_param="Found"/> 3394 3395 <method id="gtk_style_render_icon" bind="False"/> <!-- need icon_source --> 3396 <method id="gtk_style_lookup_icon_set" bind="False"/> <!-- need icon_factory --> 3397 </package> 3398 3399 <package id="GtkSymbolicColor"> 3400 <method id="gtk_symbolic_color_resolve" bind="False"/> <!-- circular dep with StyleProperties --> 3401 </package> 3402 3403 <package id="GtkStyleProvider"> 3404 <virtual-method id='*' bind='False'/> <!-- circular dep with StyleProperties --> 3405 <method id="gtk_style_provider_get_style" bind="False" /> <!-- circular dep with StyleProperties --> 3406 <method id="gtk_style_provider_get_style_property" 3407 return_as_param="Found"/> 3408 <method id="gtk_style_provider_get_icon_factory" bind="False" /> <!-- in GtkIconFactory --> 3409 <extra> 3410 <spec> 3411 subtype Priority is Glib.Guint; 3412 3413 Priority_Fallback : constant Priority := 1; 3414 -- Used when no theme is defined 3415 3416 Priority_Theme : constant Priority := 200; 3417 -- Used for style information provided by the theme 3418 3419 Priority_Settings : constant Priority := 400; 3420 -- Used for information provided via Gtk_Settings 3421 3422 Priority_Application : constant Priority := 600; 3423 -- For application-specific information 3424 3425 Priority_User : constant Priority := 800; 3426 -- Used for the style information from ~/.gtk-3.0.css 3427 </spec> 3428 </extra> 3429 </package> 3430 3431 <package id="GtkStyleProperties"> 3432 <virtual-method id='*' bind='False'/> <!-- circular dep with StyleProvider --> 3433 <method id="gtk_style_properties_get_property" 3434 return_as_param="Exists"/> 3435 <method id="gtk_style_properties_set_valist" bind="False"/> <!-- need valist --> 3436 <method id="gtk_style_properties_get_valist" bind="False"/> <!-- need valist --> 3437 <method id="gtk_style_properties_lookup_property" bind="False"/> <!-- need StylePropertyParser --> 3438 <method id="gtk_style_properties_register_property" bind="False"/> <!-- need StylePropertyParser --> 3439 </package> 3440 3441 <package id="GtkStyleContext"> 3442 <method id="gtk_style_context_has_region" 3443 return_as_param="Is_Defined"/> 3444 <method id="gtk_style_context_list_classes" return="StringList"/> 3445 <method id="gtk_style_context_list_regions" return="StringList"/> 3446 <method id="gtk_style_context_get_valist" bind="False"/> <!-- needs valist --> 3447 <method id="gtk_style_context_get_style_valist" bind="False"/> <!-- needs valist --> 3448 <method id="gtk_style_context_lookup_color" return_as_param="Found"/> 3449 <method id="gtk_style_context_state_is_running" 3450 return_as_param="Is_Running"/> 3451 <method id="gtk_style_context_lookup_icon_set" bind="False"/> <!-- in GtkIconSet--> 3452 <function id="gtk_render_handle"/> 3453 <function id="gtk_render_check" /> 3454 <function id="gtk_render_option" /> 3455 <function id="gtk_render_arrow" /> 3456 <function id="gtk_render_background" /> 3457 <function id="gtk_render_frame" /> 3458 <function id="gtk_render_expander" /> 3459 <function id="gtk_render_focus" /> 3460 <function id="gtk_render_layout" /> 3461 <function id="gtk_render_line" /> 3462 <function id="gtk_render_slider" /> 3463 <function id="gtk_render_frame_gap" /> 3464 <function id="gtk_render_extension" /> 3465 <function id="gtk_render_activity" /> 3466 <!-- <function id="gtk_render_icon_pixbuf" /> --> 3467 <function id="gtk_render_icon" /> 3468 <function id="gtk_render_icon_surface" /> 3469 <extra> 3470 <spec> 3471 function Get_Style_Context 3472 (Widget : not null access Gtk_Widget_Record'Class) 3473 return Gtk_Style_Context; 3474 -- Returns the style context associated to Widget. 3475 -- must not be freed. 3476 </spec> 3477 <body> 3478 function Get_Style_Context 3479 (Widget : not null access Gtk_Widget_Record'Class) 3480 return Gtk_Style_Context 3481 is 3482 function Internal (Widget : System.Address) return System.Address; 3483 pragma Import (C, Internal, "gtk_widget_get_style_context"); 3484 Stub_Gtk_Style_Context : Gtk_Style_Context_Record; 3485 begin 3486 return Gtk_Style_Context 3487 (Get_User_Data (Internal (Get_Object (Widget)), Stub_Gtk_Style_Context)); 3488 end Get_Style_Context; 3489 </body> 3490 </extra> 3491 </package> 3492 3493 <package id="GtkToolButton"> 3494 <parameter name="self" ada="Button"/> 3495 <method id="gtk_tool_button_new"> 3496 <parameter name="icon_widget" default="null" /> 3497 </method> 3498 </package> 3499 3500 <package id="GtkFontButton"> 3501 <parameter name="self" ada="Font_Button"/> 3502 </package> 3503 3504 <package id="GtkTextBuffer"> 3505 <parameter name="self" ada="Buffer"/> 3506 3507 <!-- the following involve a complex callback type and are not needed --> 3508 <method id="gtk_text_buffer_register_serialize_format" bind="False"/> 3509 <method id="gtk_text_buffer_register_deserialize_format" bind="False"/> 3510 <method id="gtk_text_buffer_serialize" bind="False"/> 3511 <method id="gtk_text_buffer_deserialize" bind="False"/> 3512 <method id="gtk_text_buffer_get_serialize_formats" bind="False"/> 3513 <method id="gtk_text_buffer_get_deserialize_formats" bind="False"/> 3514 3515 <method id="gtk_text_buffer_new"> 3516 <parameter name="table" default="null"/> 3517 </method> 3518 3519 <method id="gtk_text_buffer_create_mark"> 3520 <parameter name="left_gravity" default="True"/> 3521 </method> 3522 3523 <method id="gtk_text_buffer_get_text"> 3524 <parameter name="include_hidden_chars" default="False"/> 3525 </method> 3526 3527 <method id="gtk_text_buffer_get_slice"> 3528 <parameter name="include_hidden_chars" default="False"/> 3529 </method> 3530 3531 <method id="gtk_text_buffer_paste_clipboard"> 3532 <parameter name="override_location" ada="" ctype="gpointer" default="System.Null_Address"/> 3533 <parameter name="default_editable" default="True"/> 3534 </method> 3535 3536 <method id="gtk_text_buffer_get_selection_bounds" return_as_param="Result"> 3537 <parameter name="start" direction="out"/> 3538 <parameter name="end" direction="out"/> 3539 </method> 3540 3541 <method id="gtk_text_buffer_delete"> 3542 <parameter name="start" direction="inout"/> 3543 <parameter name="end" direction="inout"/> 3544 </method> 3545 3546 <method id="gtk_text_buffer_delete_interactive" return_as_param="Result"> 3547 <parameter name="start" direction="inout"/> 3548 <parameter name="end" direction="inout"/> 3549 </method> 3550 3551 <method id="gtk_text_buffer_insert"> 3552 <parameter name="iter" direction="inout"/> 3553 <parameter name="len" default="-1" ada=""/> 3554 </method> 3555 3556 <method id="gtk_text_buffer_insert_interactive"> 3557 <parameter name="iter" direction="inout"/> 3558 <parameter name="len" default="-1" ada=""/> 3559 </method> 3560 3561 <method id="gtk_text_buffer_insert_interactive_at_cursor"> 3562 <parameter name="len" default="-1" ada=""/> 3563 </method> 3564 3565 <method id="gtk_text_buffer_set_text"> 3566 <parameter name="len" default="-1" ada=""/> 3567 </method> 3568 3569 <method id="gtk_text_buffer_insert_at_cursor"> 3570 <parameter name="len" default="-1" ada=""/> 3571 </method> 3572 3573 <method id="gtk_text_buffer_create_tag" bind="False"/><!-- vararg, bound manually below --> 3574 <method id="gtk_text_buffer_insert_with_tags" bind="False"/><!-- vararg, bound manually below --> 3575 3576 <!-- body bound manually to add safety check --> 3577 <method id="gtk_text_buffer_get_iter_at_line_offset"> 3578 <body> 3579 procedure Internal 3580 (Buffer : System.Address; 3581 Iter : out Gtk.Text_Iter.Gtk_Text_Iter; 3582 Line_Number : Gint; 3583 Char_Offset : Gint); 3584 pragma Import (C, Internal, "gtk_text_buffer_get_iter_at_line_offset"); 3585 Result : Boolean; 3586 begin 3587 -- Prevent critical crashes from gtk+ if Char_Offset is invalid 3588 Internal (Get_Object (Buffer), Iter, Line_Number, 0); 3589 3590 if not Ends_Line (Iter) then 3591 Forward_To_Line_End (Iter, Result); 3592 3593 if Char_Offset <= Get_Line_Offset (Iter) then 3594 Internal (Get_Object (Buffer), Iter, Line_Number, Char_Offset); 3595 end if; 3596 end if; 3597 </body> 3598 </method> 3599 3600 <extra> 3601 <with_spec pkg="Gtkada.Types"/> 3602 <spec> 3603 procedure Insert 3604 (Buffer : access Gtk_Text_Buffer_Record; 3605 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3606 Text : Gtkada.Types.Chars_Ptr); 3607 -- More efficient version of Insert, which doesn't require a string copy. 3608 3609 procedure Insert_At_Cursor 3610 (Buffer : access Gtk_Text_Buffer_Record; 3611 Text : Gtkada.Types.Chars_Ptr; 3612 Len : Gint := -1); 3613 -- Call Buffer_Insert, using the current cursor position 3614 -- as the insertion point. 3615 -- Text: UTF-8 format C string to insert. 3616 3617 function Get_Text 3618 (Buffer : access Gtk_Text_Buffer_Record; 3619 Start : Gtk.Text_Iter.Gtk_Text_Iter; 3620 The_End : Gtk.Text_Iter.Gtk_Text_Iter; 3621 Include_Hidden_Chars : Boolean := False) return Gtkada.Types.Chars_Ptr; 3622 -- Same as Get_Text above, but return a pointer to a C string, for 3623 -- efficiency. 3624 -- The caller is responsible for freeing (using Gtkada.Types.g_free) the 3625 -- returned pointer. 3626 3627 function Selection_Exists 3628 (Buffer : access Gtk_Text_Buffer_Record) return Boolean; 3629 -- Return True if some text in the buffer is currently selected. 3630 3631 procedure Insert_With_Tags 3632 (Buffer : access Gtk_Text_Buffer_Record; 3633 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3634 Text : UTF8_String; 3635 Tag : Gtk_Text_Tag); 3636 procedure Insert_With_Tags 3637 (Buffer : access Gtk_Text_Buffer_Record; 3638 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3639 Text : Gtkada.Types.Chars_Ptr; 3640 Tag : Gtk.Text_Tag.Gtk_Text_Tag); 3641 -- Same as Insert, but specifies the tag to apply to the range. 3642 3643 function Get_Buffer 3644 (Iter : Gtk_Text_Iter) return Gtk.Text_Buffer.Gtk_Text_Buffer; 3645 -- Returns the Gtk.Text_Buffer.Gtk_Text_Buffer this iterator is associated 3646 -- with. 3647 3648 function Get_Buffer 3649 (Mark : Gtk_Text_Mark) 3650 return Gtk.Text_Buffer.Gtk_Text_Buffer; 3651 -- Gets the buffer this mark is located inside, or null if the mark is 3652 -- deleted. 3653 3654 function Create_Tag 3655 (Buffer : access Gtk_Text_Buffer_Record; 3656 Tag_Name : String := "") 3657 return Gtk.Text_Tag.Gtk_Text_Tag; 3658 -- Creates a tag and adds it to the tag table for Buffer. Equivalent to 3659 -- calling gtk.text_tag.gtk_new and then adding the tag to the buffer's tag 3660 -- table. The returned tag is owned by the buffer's tag table, so the ref 3661 -- count will be equal to one. 3662 -- 3663 -- If Tag_Name is NULL, the tag is anonymous, otherwise a tag called 3664 -- Tag_Name must not already exist in the tag table for this buffer. 3665 </spec> 3666 <body> 3667 ------------ 3668 -- Insert -- 3669 ------------ 3670 3671 procedure Insert 3672 (Buffer : access Gtk_Text_Buffer_Record; 3673 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3674 Text : Gtkada.Types.Chars_Ptr) 3675 is 3676 procedure Internal 3677 (Buffer : System.Address; 3678 Iter : Gtk.Text_Iter.Gtk_Text_Iter; 3679 Text : Gtkada.Types.Chars_Ptr; 3680 Len : Gint := -1); 3681 pragma Import (C, Internal, "gtk_text_buffer_insert"); 3682 3683 begin 3684 Internal (Get_Object (Buffer), Iter, Text); 3685 end Insert; 3686 3687 procedure Insert_At_Cursor 3688 (Buffer : access Gtk_Text_Buffer_Record; 3689 Text : Gtkada.Types.Chars_Ptr; 3690 Len : Gint := -1) 3691 is 3692 procedure Internal 3693 (Buffer : System.Address; 3694 Text : Gtkada.Types.Chars_Ptr; 3695 Len : Gint); 3696 pragma Import (C, Internal, "gtk_text_buffer_insert_at_cursor"); 3697 3698 begin 3699 Internal (Get_Object (Buffer), Text, Len); 3700 end Insert_At_Cursor; 3701 3702 procedure Insert_With_Tags 3703 (Buffer : access Gtk_Text_Buffer_Record; 3704 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3705 Text : UTF8_String; 3706 Tag : Gtk_Text_Tag) 3707 is 3708 procedure Internal 3709 (Buffer : System.Address; 3710 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3711 Text : UTF8_String; 3712 Len : Gint; 3713 Tag : System.Address); 3714 pragma Import (C, Internal, "ada_gtk_text_buffer_insert_with_tags"); 3715 3716 begin 3717 Internal 3718 (Get_Object (Buffer), Iter, Text, Text'Length, Get_Object (Tag)); 3719 end Insert_With_Tags; 3720 3721 procedure Insert_With_Tags 3722 (Buffer : access Gtk_Text_Buffer_Record; 3723 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3724 Text : Gtkada.Types.Chars_Ptr; 3725 Tag : Gtk.Text_Tag.Gtk_Text_Tag) 3726 is 3727 procedure Internal 3728 (Buffer : System.Address; 3729 Iter : in out Gtk.Text_Iter.Gtk_Text_Iter; 3730 Text : Gtkada.Types.Chars_Ptr; 3731 Len : Gint := -1; 3732 Tag : System.Address); 3733 pragma Import (C, Internal, "ada_gtk_text_buffer_insert_with_tags"); 3734 3735 begin 3736 Internal (Get_Object (Buffer), Iter, Text, Tag => Get_Object (Tag)); 3737 end Insert_With_Tags; 3738 3739 -------------- 3740 -- Get_Text -- 3741 -------------- 3742 3743 function Get_Text 3744 (Buffer : access Gtk_Text_Buffer_Record; 3745 Start : Gtk.Text_Iter.Gtk_Text_Iter; 3746 The_End : Gtk.Text_Iter.Gtk_Text_Iter; 3747 Include_Hidden_Chars : Boolean := False) return Gtkada.Types.Chars_Ptr 3748 is 3749 function Internal 3750 (Buffer : System.Address; 3751 Start : Gtk.Text_Iter.Gtk_Text_Iter; 3752 The_End : Gtk.Text_Iter.Gtk_Text_Iter; 3753 Include_Hidden_Chars : Gboolean) 3754 return Interfaces.C.Strings.chars_ptr; 3755 pragma Import (C, Internal, "gtk_text_buffer_get_text"); 3756 3757 begin 3758 return Internal 3759 (Get_Object (Buffer), 3760 Start, 3761 The_End, 3762 Boolean'Pos (Include_Hidden_Chars)); 3763 end Get_Text; 3764 3765 function Selection_Exists 3766 (Buffer : access Gtk_Text_Buffer_Record) return Boolean 3767 is 3768 Ignored_A, Ignored_B : Gtk_Text_Iter; 3769 Has_Selection : Boolean; 3770 begin 3771 Get_Selection_Bounds (Buffer, Ignored_A, Ignored_B, Has_Selection); 3772 return Has_Selection; 3773 end Selection_Exists; 3774 3775 ---------------- 3776 -- Get_Buffer -- 3777 ---------------- 3778 3779 function Get_Buffer 3780 (Iter : Gtk_Text_Iter) return Gtk.Text_Buffer.Gtk_Text_Buffer 3781 is 3782 function Internal (Iter : Gtk_Text_Iter) return System.Address; 3783 pragma Import (C, Internal, "gtk_text_iter_get_buffer"); 3784 Stub_Gtk_Text_Buffer : Gtk.Text_Buffer.Gtk_Text_Buffer_Record; 3785 begin 3786 return Gtk.Text_Buffer.Gtk_Text_Buffer (Get_User_Data (Internal (Iter), Stub_Gtk_Text_Buffer)); 3787 end Get_Buffer; 3788 3789 ---------------- 3790 -- Get_Buffer -- 3791 ---------------- 3792 3793 function Get_Buffer 3794 (Mark : Gtk_Text_Mark) 3795 return Gtk.Text_Buffer.Gtk_Text_Buffer 3796 is 3797 function Internal (Mark : System.Address) return System.Address; 3798 pragma Import (C, Internal, "gtk_text_mark_get_buffer"); 3799 Stub_Gtk_Text_Buffer : Gtk.Text_Buffer.Gtk_Text_Buffer_Record; 3800 begin 3801 return Gtk.Text_Buffer.Gtk_Text_Buffer (Get_User_Data (Internal (Get_Object (Mark)), Stub_Gtk_Text_Buffer)); 3802 end Get_Buffer; 3803 3804 ---------------- 3805 -- Create_Tag -- 3806 ---------------- 3807 3808 function Create_Tag 3809 (Buffer : access Gtk_Text_Buffer_Record; 3810 Tag_Name : String := "") 3811 return Gtk_Text_Tag 3812 is 3813 function Internal 3814 (Buffer : System.Address; 3815 Tag_Name : Interfaces.C.Strings.chars_ptr) 3816 return System.Address; 3817 pragma Import (C, Internal, "ada_gtk_text_buffer_create_tag"); 3818 Stub : Gtk_Text_Tag_Record; 3819 Str : Interfaces.C.Strings.chars_ptr := String_Or_Null (Tag_Name); 3820 Tag : Gtk_Text_Tag; 3821 begin 3822 Tag := Gtk_Text_Tag 3823 (Get_User_Data (Internal (Get_Object (Buffer), Str), Stub)); 3824 Free (Str); 3825 return Tag; 3826 end Create_Tag; 3827 </body> 3828 </extra> 3829 </package> 3830 3831 <package id="GtkTextMark"> 3832 <parameter name="self" ada="Mark"/> 3833 <method id="gtk_text_mark_get_buffer" bind="False"/><!-- circular dependency, added manually in Gtk.Text_Buffer --> 3834 3835 <extra> 3836 <with_spec pkg="Glib.Values"/> 3837 <spec> 3838 ------------------------------- 3839 -- Converting to/from GValue -- 3840 ------------------------------- 3841 3842 procedure Set_Text_Mark 3843 (Val : in out Glib.Values.GValue; 3844 Mark : access Gtk_Text_Mark_Record); 3845 function Get_Text_Mark (Val : Glib.Values.GValue) return Gtk_Text_Mark; 3846 -- Set the value of the given GValue to Mark. 3847 3848 </spec> 3849 <body> 3850 ------------------- 3851 -- Set_Text_Mark -- 3852 ------------------- 3853 3854 procedure Set_Text_Mark 3855 (Val : in out Glib.Values.GValue; 3856 Mark : access Gtk_Text_Mark_Record) is 3857 begin 3858 Glib.Values.Set_Address (Val, Get_Object (Mark)); 3859 end Set_Text_Mark; 3860 3861 ------------------- 3862 -- Get_Text_Mark -- 3863 ------------------- 3864 3865 function Get_Text_Mark (Val : Glib.Values.GValue) return Gtk_Text_Mark is 3866 Stub : Gtk_Text_Mark_Record; 3867 begin 3868 return Gtk_Text_Mark 3869 (Get_User_Data_Fast (Glib.Values.Get_Address (Val), Stub)); 3870 end Get_Text_Mark; 3871 </body> 3872 </extra> 3873 </package> 3874 3875 <package id="GtkTextChildAnchor"> 3876 <parameter name="self" ada="Anchor"/> 3877 <method id="gtk_text_child_anchor_get_widgets" return="WidgetSList"/> 3878 </package> 3879 3880 <package id="GtkTextTag"> 3881 <parameter name="self" ada="Tag"/> 3882 <method id="::event" bind="False" /> 3883 <method id="gtk_text_tag_new"> 3884 <doc extend="true"> 3885Newly created tags must be added to the tags table for the buffer you 3886intend to use them in, as in: 3887 "Gtk.Text_Tag_Table.Add (Get_Tag_Table (Buffer), Tag)". 3888See also Gtk.Text_Buffer.Create_Tag which is a more convenient way of 3889creating a tag. 3890 </doc> 3891 </method> 3892 <method id="gtk_text_tag_event" bind="false"/> <!-- circular dep with text_iter--> 3893 <slist ada="Text_Tag_List" ctype="GtkTextTag"/> 3894 </package> 3895 3896 <package id="GtkCssProvider"> 3897 <method id="::parsing-error" bind="False" /> 3898 <method id="gtk_css_provider_load_from_data"> 3899 <parameter name="data" ctype="char*"/> 3900 <parameter name="length" default="-1" ada=""/> 3901 <parameter name="error" direction="access"/> 3902 </method> 3903 <method id="gtk_css_provider_load_from_path"> 3904 <parameter name="error" direction="access"/> 3905 </method> 3906 <method id="gtk_css_provider_load_from_file" bind="False"/> <!-- needs GFile --> 3907 </package> 3908 3909 <package id="GtkMain"> 3910 <function id="gtk_get_major_version" /> 3911 <function id="gtk_get_minor_version" /> 3912 <function id="gtk_get_micro_version" /> 3913 <function id="gtk_get_binary_age" /> 3914 <function id="gtk_get_interface_age" /> 3915 <function id="gtk_check_version" /> 3916 <function id="gtk_parse_args" bind="False" /> <!-- no access to argc argv -->x 3917 <function id="gtk_init" bind="False" /> <!-- custom --> 3918 <function id="gtk_init_check" bind="False" /> <!-- custom --> 3919 <function id="gtk_init_with_args" bind="False" /> 3920 <function id="gtk_disable_setlocale"/> 3921 <function id="gtk_get_default_language"/> 3922 <function id="gtk_events_pending"/> 3923 <function id="gtk_main_do_event"/> 3924 <function id="gtk_main"/> 3925 <function id="gtk_main_level"/> 3926 <function id="gtk_main_quit"/> 3927 <function id="gtk_main_iteration" /> 3928 <function id="gtk_main_iteration_do"/> 3929 <function id="gtk_true" /> 3930 <function id="gtk_false" /> 3931 <function id="gtk_grab_add" bind="False" /> <!-- in GtkWidget --> 3932 <function id="gtk_grab_get_current" /> 3933 <function id="gtk_grab_remove" bind="False"/> <!-- in GtkWidget --> 3934 <function id="gtk_device_grab_add" /> 3935 <function id="gtk_device_grab_remove" /> 3936 <function id="gtk_key_snooper_install" /> 3937 <function id="gtk_key_snooper_remove" /> 3938 <function id="gtk_get_current_event" /> 3939 <function id="gtk_get_current_event_time" /> 3940 <function id="gtk_get_current_event_state" 3941 return_as_param="Has_Current_Event"> 3942 <parameter name="state" direction="out" /> 3943 </function> 3944 <function id="gtk_get_current_event_device" /> 3945 <function id="gtk_get_event_widget" /> 3946 <function id="gtk_propagate_event" /> 3947 3948 <extra> 3949 <spec> 3950 procedure Init; 3951 -- Initialize GtkAda's internal structures. 3952 -- This subprogram should be called before any other one in GtkAda. 3953 -- If GtkAda could not be initialized (no access to the display, etc.), the 3954 -- application exits with an error 3955 3956 function Init_Check return Boolean; 3957 -- Initialize GtkAda's internal structures. 3958 -- Return False if there was an error (no access to the display, etc.) 3959 </spec> 3960 <body> 3961 gnat_argc : Interfaces.C.int; 3962 pragma Import (C, gnat_argc); 3963 3964 gnat_argv : System.Address; 3965 pragma Import (C, gnat_argv); 3966 3967 procedure Init is 3968 procedure Internal (argc : System.Address; argv : System.Address); 3969 pragma Import (C, Internal, "gtk_init"); 3970 3971 begin 3972 Internal (gnat_argc'Address, gnat_argv'Address); 3973 end Init; 3974 3975 function Init_Check return Boolean is 3976 function Internal 3977 (argc : System.Address; argv : System.Address) return Gboolean; 3978 pragma Import (C, Internal, "gtk_init_check"); 3979 begin 3980 return Boolean'Val (Internal (gnat_argc'Address, gnat_argv'Address)); 3981 end Init_Check; 3982 </body> 3983 </extra> 3984 </package> 3985 3986 <package id="GdkCursor" bindtype="False"> 3987 <enum ctype="GdkCursorType" prefix="GDK_"/> 3988 3989 <method id="gdk_cursor_new_from_pixbuf" bind="False" /> <!-- in gdk.pixbuf --> 3990 <method id="gdk_cursor_get_image" bind="False" /> <!-- in gdk.pixbuf --> 3991 3992 <method id="gdk_cursor_unref" bind="False" /> <!-- obsolete --> 3993 <method id="gdk_cursor_ref" bind="False" /> <!-- obsolete --> 3994 3995 <method id="gdk_cursor_get_surface" return_as_param="Surface"/> 3996 3997 <extra> 3998 <spec> 3999 procedure Ref (Self : Gdk.Gdk_Cursor); 4000 pragma Import (C, Ref, "g_object_ref"); 4001 4002 procedure Unref (Self : Gdk.Gdk_Cursor); 4003 pragma Import (C, Unref, "g_object_unref"); 4004 </spec> 4005 </extra> 4006 </package> 4007 4008 <package id="GtkTextAttributes"> 4009 <parameter name="self" ada="Text_Attr"/> 4010 <record ctype="GtkTextAppearance"/> 4011 4012 </package> 4013 4014 <package id="GtkTextTagTable"> 4015 <parameter name="self" ada="Table"/> 4016 <method id='gtk_text_tag_table_add' return='void'/> <!-- backward compatibility --> 4017 </package> 4018 4019 <package id="GtkTextView"> 4020 <parameter name="self" ada="View"/> 4021 <enum ctype="GtkTextViewLayer" /> 4022 4023 <!-- These are now inherited from the Scrollable interface --> 4024 <method id="gtk_text_view_get_hadjustment" bind="false"/> 4025 <method id="gtk_text_view_get_vadjustment" bind="false"/> 4026 <method id="gtk_text_view_set_hadjustment" bind="false"/> 4027 <method id="gtk_text_view_set_vadjustment" bind="false"/> 4028 4029 <method id="gtk_text_view_new_with_buffer" ada="Gtk_New"/> 4030 4031 <virtual-method id='draw_layer' bind='True'> 4032 <doc> 4033The draw_layer virtual function is called before and after the text 4034view is drawing its own text. Applications can override this vfunc 4035in a subclass to draw customized content underneath or above the 4036text. Since: 3.14 4037 </doc> 4038 </virtual-method> 4039 </package> 4040 4041 <package id="GdkWindow" bindtype="False"> 4042 <record ctype="GdkGeometry"/> 4043 <enum ctype="GdkWindowWindowClass" prefix="GDK_" ada="Gdk_Window_Class"/> 4044 <enum ctype="GdkWindowEdge" prefix="GDK_"/> 4045 <enum ctype="GdkWindowType" prefix="GDK_"/> 4046 <enum ctype="GdkWindowAttributesType" prefix="GDK_"/> 4047 <enum ctype="GdkWindowHints" prefix="GDK_"/> 4048 <enum ctype="GdkWindowTypeHint" prefix="GDK_"/> 4049 <enum ctype="GdkWMDecoration" prefix="GDK_"/> 4050 <enum ctype="GdkWMFunction" prefix="GDK_"/> 4051 <enum ctype="GdkGravity" prefix="GDK_"/> 4052 <enum ctype="GdkFullscreenMode" prefix="GDK_FULLSCREEN_" /> 4053 <list ada="Gdk_Window_List" ctype="GdkWindow"/> 4054 <method id="::pick-embedded-child" bind="False" /> 4055 <method id="::from-embedder" bind="False" /> 4056 <method id="::to-embedder" bind="False" /> 4057 <method id="::create-surface" bind="False" /> 4058 <method id="gdk_window_add_filter" bind="False" /> <!-- dangerous --> 4059 <method id="gdk_window_remove_filter" bind="False" /> <!-- dangerous --> 4060 <method id="gdk_window_get_children" return="GdkWindowList"/> 4061 <method id="gdk_window_get_decorations" return_as_param="Has_Decorations"/> 4062 <method id="gdk_window_get_device_position" return_as_param="Window"/> 4063 <method id="gdk_window_get_origin" return="void"/> 4064 <method id="gdk_window_get_pointer" return_as_param="Window"/> 4065 <method id="gdk_window_peek_children" return="GdkWindowList" /> 4066 <method id="gdk_window_at_pointer" return_as_param="Window"/> 4067 <method id="gdk_window_new"> 4068 <parameter name="attributes_mask" ctype="GdkWindowAttributesType"/> 4069 </method> 4070 4071<!-- <method id="gdk_window_get_events" bind="False" /> <!- circular dep with GdkEvent --> 4072<!-- <method id="gdk_window_set_events" bind="False" /> <!- circular dep with GdkEvent --> 4073<!-- <method id="gdk_window_get_device_events" bind="False" /> <!- circular dep with GdkEvent --> 4074<!-- <method id="gdk_window_set_device_events" bind="False" /> <!- circular dep with GdkEvent --> 4075<!-- <method id="gdk_window_get_source_events" bind="False" /> <!- circular dep with GdkEvent --> 4076<!-- <method id="gdk_window_set_source_events" bind="False" /> <!- circular dep with GdkEvent --> 4077 4078 <method id="gdk_window_set_icon_list" bind="False"/> <!-- needs PixbufList --> 4079 <method id="gdk_window_get_drag_protocol" return_as_param="Protocol" bind="False"/> <!-- circular dep with GdkDragContent --> 4080 4081 <method id="gdk_window_get_user_data" bind="False"/> <!-- see below --> 4082 <method id="gdk_window_get_children_with_user_data" bind="False"/> <!-- low-level --> 4083 4084 <extra> 4085 <spec> 4086 function Get_User_Data (Window : Gdk_Window) return Glib.Object.GObject; 4087 -- Return the widget to which events are reported when they happen on 4088 -- Window. This is the widget that was set through the call to 4089 -- Set_User_data. 4090 4091 procedure Set_User_Data 4092 (Window : Gdk_Window; 4093 Widget : access Glib.Object.GObject_Record'Class); 4094 -- Sets a special field in the window. 4095 -- All the events reported by the Xserver (or the Windows server) for 4096 -- Window will be redirected to Widget through the standard signals 4097 -- "expose_event", "button_press_event", ... 4098 -- You almost always need to call this function after creating a new 4099 -- Gdk_Window yourself, or you won't be able to handle the events. 4100 4101 procedure Ref (Window : Gdk_Window); 4102 procedure Unref (Window : Gdk_Window); 4103 pragma Import (C, Ref, "g_object_ref"); 4104 pragma Import (C, Unref, "g_object_unref"); 4105 </spec> 4106 <body> 4107 function Get_User_Data (Window : Gdk_Window) return Glib.Object.GObject is 4108 procedure Internal (Window : Gdk_Window; Widget : System.Address); 4109 pragma Import (C, Internal, "gdk_window_get_user_data"); 4110 Data : aliased System.Address; 4111 Stub : GObject_Record; 4112 begin 4113 Internal (Window, Data'Address); 4114 return Get_User_Data (Data, Stub); 4115 end Get_User_Data; 4116 4117 procedure Set_User_Data 4118 (Window : Gdk_Window; 4119 Widget : access Glib.Object.GObject_Record'Class) 4120 is 4121 procedure Internal (Window : Gdk_Window; Widget : System.Address); 4122 pragma Import (C, Internal, "gdk_window_set_user_data"); 4123 begin 4124 Internal (Window, Get_Object (Widget)); 4125 end Set_User_Data; 4126 </body> 4127 </extra> 4128 </package> 4129 4130 <package id="GtkIconView"> 4131 <parameter name="self" ada="Icon_View"/> 4132 <enum ctype="GtkIconViewDropPosition" prefix="GTK_ICON_VIEW_"/> 4133 <method id="gtk_icon_view_get_cursor" return_as_param="Cursor_Is_Set"/> 4134 <method id="gtk_icon_view_get_dest_item_at_pos" return_as_param="Has_Item"/> 4135 <method id="gtk_icon_view_get_item_at_pos" return_as_param="Has_Item"/> 4136 <method id="gtk_icon_view_get_selected_items" return="TreePathList"/> 4137 <method id="gtk_icon_view_get_tooltip_context" return_as_param="Success"/> 4138 <method id="gtk_icon_view_get_visible_range" return="void"/> 4139 4140 <method id="gtk_icon_view_enable_model_drag_source" bind="False"/> <!-- see below --> 4141 <method id="gtk_icon_view_enable_model_drag_dest" bind="False"/> <!-- see below --> 4142 <extra> 4143 <with_spec pkg="Gtk.Target_List"/> 4144 <with_spec pkg="Gdk.Dnd"/> 4145 <with_spec pkg="Gdk.Types"/> 4146 <spec> 4147 procedure Enable_Model_Drag_Dest 4148 (Icon_View : access Gtk_Icon_View_Record; 4149 Targets : Gtk.Target_List.Target_Entry_Array; 4150 Actions : Gdk.Dnd.Drag_Action); 4151 -- Turns Icon_view into a drop destination for automatic DND. 4152 -- Targets is the list of targets that the drag will support. 4153 4154 procedure Enable_Model_Drag_Source 4155 (Icon_View : access Gtk_Icon_View_Record; 4156 Start_Button_Mask : Gdk.Types.Gdk_Modifier_Type; 4157 Targets : Gtk.Target_List.Target_Entry_Array; 4158 Actions : Gdk.Dnd.Drag_Action); 4159 -- Turns Icon_view into a drag source for automatic DND. 4160 -- Start_Button_Mask is the allowed buttons to start drag. 4161 </spec> 4162 <body> 4163 procedure Enable_Model_Drag_Dest 4164 (Icon_View : access Gtk_Icon_View_Record; 4165 Targets : Target_Entry_Array; 4166 Actions : Drag_Action) 4167 is 4168 procedure Internal 4169 (Icon_View : System.Address; 4170 Targets : System.Address; 4171 N_Targets : Gint; 4172 Actions : Drag_Action); 4173 pragma Import (C, Internal, "gtk_icon_view_enable_model_drag_dest"); 4174 begin 4175 Internal (Get_Object (Icon_View), 4176 Targets (Targets'First)'Address, Targets'Length, 4177 Actions); 4178 end Enable_Model_Drag_Dest; 4179 4180 procedure Enable_Model_Drag_Source 4181 (Icon_View : access Gtk_Icon_View_Record; 4182 Start_Button_Mask : Gdk_Modifier_Type; 4183 Targets : Target_Entry_Array; 4184 Actions : Drag_Action) 4185 is 4186 procedure Internal 4187 (Icon_View : System.Address; 4188 Start_Button_Mask : Gdk_Modifier_Type; 4189 Targets : System.Address; 4190 N_Targets : Gint; 4191 Actions : Drag_Action); 4192 pragma Import (C, Internal, "gtk_icon_view_enable_model_drag_source"); 4193 begin 4194 Internal (Get_Object (Icon_View), Start_Button_Mask, 4195 Targets (Targets'First)'Address, Targets'Length, 4196 Actions); 4197 end Enable_Model_Drag_Source; 4198 </body> 4199 </extra> 4200 </package> 4201 4202 <package id="GdkEvent"> 4203 <enum ctype="GdkEventType" prefix="GDK_" ignore="GDK_DOUBLE_BUTTON_PRESS GDK_TRIPLE_BUTTON_PRESS"/> 4204 <enum ctype="GdkEventMask" prefix="GDK_"/> 4205 <enum ctype="GdkVisibilityState" prefix="GDK_"/> 4206 <enum ctype="GdkScrollDirection" prefix="GDK_"/> 4207 <enum ctype="GdkNotifyType" prefix="GDK_"/> 4208 <enum ctype="GdkCrossingMode" prefix="GDK_"/> 4209 <enum ctype="GdkPropertyState" prefix="GDK_"/> 4210 <enum ctype="GdkWindowState" prefix="GDK_"/> 4211 <enum ctype="GdkSettingAction" prefix="GDK_"/> 4212 <enum ctype="GdkOwnerChange" prefix="GDK_"/> 4213 <record ctype="GdkEventSequence"/> 4214 <record ctype="GdkEventAny"/> 4215 <record ctype="GdkEventButton"/> 4216 <record ctype="GdkEventExpose"/> 4217 <record ctype="GdkEventVisibility"/> 4218 <record ctype="GdkEventMotion"/> 4219 <record ctype="GdkEventScroll"/> 4220 <record ctype="GdkEventKey"/> 4221 <record ctype="GdkEventCrossing"/> 4222 <record ctype="GdkEventFocus"/> 4223 <record ctype="GdkEventConfigure"/> 4224 <record ctype="GdkEventProperty"/> 4225 <record ctype="GdkEventSelection"/> 4226 <record ctype="GdkEventOwnerChange"/> 4227 <record ctype="GdkEventProximity"/> 4228 <record ctype="GdkEventDND"/> 4229 <record ctype="GdkEventWindowState"/> 4230 <record ctype="GdkEventSetting"/> 4231 <record ctype="GdkEventTouch"/> 4232 <record ctype="GdkEventGrabBroken"/> 4233 4234 <record ctype="GdkEvent" ada="Gdk_Event_Record"> 4235 <union value="GDK_NOTHING" field="any"/> 4236 <union value="GDK_DELETE" field="any"/> 4237 <union value="GDK_DESTROY" field="any" /> 4238 <union value="GDK_EXPOSE" field="expose" /> 4239 <union value="GDK_MOTION_NOTIFY" field="motion" /> 4240 <union value="GDK_BUTTON_PRESS" field="button" /> 4241 <union value="GDK_2BUTTON_PRESS" field="button" /> 4242 <union value="GDK_3BUTTON_PRESS" field="button" /> 4243 <union value="GDK_BUTTON_RELEASE" field="button" /> 4244 <union value="GDK_KEY_PRESS" field="key" /> 4245 <union value="GDK_KEY_RELEASE" field="key" /> 4246 <union value="GDK_ENTER_NOTIFY" field="crossing" /> 4247 <union value="GDK_LEAVE_NOTIFY" field="crossing" /> 4248 <union value="GDK_FOCUS_CHANGE" field="focus_change" /> 4249 <union value="GDK_CONFIGURE" field="configure" /> 4250 <union value="GDK_MAP" field="any" /> 4251 <union value="GDK_UNMAP" field="any" /> 4252 <union value="GDK_PROPERTY_NOTIFY" field="property" /> 4253 <union value="GDK_SELECTION_CLEAR" field="selection" /> 4254 <union value="GDK_SELECTION_REQUEST" field="selection" /> 4255 <union value="GDK_SELECTION_NOTIFY" field="selection" /> 4256 <union value="GDK_PROXIMITY_IN" field="proximity" /> 4257 <union value="GDK_PROXIMITY_OUT" field="proximity" /> 4258 <union value="GDK_DRAG_ENTER" field="dnd" /> 4259 <union value="GDK_DRAG_LEAVE" field="dnd" /> 4260 <union value="GDK_DRAG_MOTION" field="dnd" /> 4261 <union value="GDK_DRAG_STATUS" field="dnd" /> 4262 <union value="GDK_DROP_START" field="dnd" /> 4263 <union value="GDK_DROP_FINISHED" field="dnd" /> 4264 <union value="GDK_CLIENT_EVENT" field="any" /> 4265 <union value="GDK_VISIBILITY_NOTIFY" field="visibility" /> 4266 <union value="GDK_SCROLL" field="scroll" /> 4267 <union value="GDK_WINDOW_STATE" field="window_state" /> 4268 <union value="GDK_SETTING" field="setting" /> 4269 <union value="GDK_OWNER_CHANGE" field="owner_change" /> 4270 <union value="GDK_GRAB_BROKEN" field="grab_broken" /> 4271 <union value="GDK_DAMAGE" field="expose" /> 4272 <union value="GDK_TOUCH_BEGIN" field="touch" /> 4273 <union value="GDK_TOUCH_UPDATE" field="touch" /> 4274 <union value="GDK_TOUCH_END" field="touch" /> 4275 <union value="GDK_TOUCH_CANCEL" field="touch" /> 4276 </record> 4277 4278 <method id="gdk_event_get_coords" return="void"/> 4279 <method id="gdk_event_get_root_coords" return="void"/> 4280 <method id="gdk_event_get_axis" return="void"/> 4281 <method id="gdk_event_get_scroll_direction" return="void"/> 4282 <method id="gdk_event_get_scroll_deltas" return="void"/> 4283 4284 <!-- These are getters provided by gtk+ itself. They are reused from our 4285 own misc.c file, because we want GtkAda to raise exceptions instead. 4286 See <extra> below 4287 --> 4288 <method id="gdk_event_get_button" bind="False"/> 4289 <method id="gdk_event_get_state" bind="False"/> 4290 <method id="gdk_event_get_click_count" bind="False"/> 4291 <method id="gdk_event_get_keyval" bind="False"/> 4292 <method id="gdk_event_get_keycode" bind="False"/> 4293 4294 <!-- Avoid circular dependencies Event->Device->Display->Event --> 4295 <method id="gdk_event_get_device" bind="False"/> 4296 <method id="gdk_event_get_source_device" bind="False"/> 4297 <method id="gdk_event_set_device" bind="False"/> 4298 <method id="gdk_event_set_source_device" bind="False"/> 4299 <method id="gdk_event_get_screen" bind="False"/> 4300 <method id="gdk_event_set_screen" bind="False"/> 4301 4302 <function id="gdk_events_pending" ada="Events_Pending"/> 4303 <method id="gdk_events_get_angle" ada="Get_Angle"/> 4304 <method id="gdk_events_get_center" ada="Get_Center"/> 4305 <method id="gdk_events_get_distance" ada="Get_Distance"/> 4306 <function id="gdk_set_show_events" ada="Set_Show_Events"/> 4307 <function id="gdk_get_show_events" ada="Get_Show_Events"/> 4308 4309 <extra> 4310 <gir:method name="Get_Button" c:identifier="ada_gdk_event_get_button"> 4311 <gir:doc>Extract the button number from an event</gir:doc> 4312 <gir:return-value><gir:type name="guint" c:type="guint"/></gir:return-value> 4313 </gir:method> 4314 <gir:method name="Get_State" c:identifier="ada_gdk_event_get_state"> 4315 <gir:doc>State of the mouse buttons and keyboard keys just prior to the event</gir:doc> 4316 <gir:return-value><gir:type name="GdkModifierType" c:type="GdkModifierType"/></gir:return-value> 4317 </gir:method> 4318 <gir:method name="Get_Key_Val" c:identifier="ada_gdk_event_get_keyval"> 4319 <gir:doc>Code of the key that was pressed (and that generated the event)</gir:doc> 4320 <gir:return-value><gir:type name="GdkKeyType" c:type="GdkKeyType"/></gir:return-value> 4321 </gir:method> 4322 <gir:method name="Get_Keycode" c:identifier="ada_gdk_event_get_keycode"> 4323 <gir:doc>Hardware key code of the key that was pressed</gir:doc> 4324 <gir:return-value><gir:type name="guint" c:type="guint"/></gir:return-value> 4325 </gir:method> 4326 4327 <type ctype="GdkEvent*" ada="Gdk_Event"> 4328 type Gdk_Event is access all Gdk_Event_Record; 4329 pragma No_Strict_Aliasing (Gdk_Event); 4330 </type> 4331 <with_spec pkg="Glib.Values" /> 4332 <spec> 4333 Double_Button_Press : constant Gdk_Event_Type := Gdk_2button_Press; 4334 Triple_Button_Press : constant Gdk_Event_Type := Gdk_3button_Press; 4335 4336 Button_Primary : constant Gint := 1; 4337 Button_Secondary : constant Gint := 3; 4338 Button_Middle : constant Gint := 2; 4339 -- The primary button is typically the left mouse button, or the 4340 -- right button in a left-handed setup. The secondary button is the 4341 -- other one. 4342 4343 function From_Address (C : System.Address) return Gdk_Event; 4344 -- Convert a C handler to the matching Event structure. 4345 4346 function To_Address (C : Gdk_Event) return System.Address; 4347 -- Convert an event to the underlying C handler. 4348 4349 function Get_Event (Value : Glib.Values.GValue) return Gdk_Event; 4350 -- Convert a value into a Gdk_Event. 4351 4352 function To_Event (Event : access Gdk_Event_Button) return Gdk_Event; 4353 function To_Event (Event : access Gdk_Event_Key) return Gdk_Event; 4354 -- Cast Event into a Gdk_Event, which can be used to call some of 4355 -- subprograms in the API. The return value is a pointer to Event, 4356 -- which should therefore remain valid as long as the pointer is in 4357 -- use. 4358 4359 ------------------------------- 4360 -- Some constants used below -- 4361 ------------------------------- 4362 -- This constants have the '-1' since in some cases gtk itself uses 4363 -- the extrema to return some meaningful value (for instance, the result 4364 -- of Get_Area can have the values Guint16'Last to mean the whole area). 4365 4366 Invalid_Gdouble_Value : constant Gdouble := Gdouble'Last - 1.0; 4367 Invalid_Gint_Value : constant Gint := Gint'Last - 1; 4368 Invalid_Guint_Value : constant Guint := Guint'Last - 1; 4369 Invalid_Guint32_Value : constant Guint32 := Guint32'Last - 1; 4370 Invalid_Gulong_Value : constant Gulong := Gulong'Last - 1; 4371 4372 pragma Export (C, Invalid_Gdouble_Value, "ada_gdk_invalid_gdouble_value"); 4373 pragma Export (C, Invalid_Gint_Value, "ada_gdk_invalid_gint_value"); 4374 pragma Export (C, Invalid_Guint_Value, "ada_gdk_invalid_guint_value"); 4375 pragma Export (C, Invalid_Guint32_Value, "ada_gdk_invalid_guint32_value"); 4376 pragma Export (C, Invalid_Gulong_Value, "ada_gdk_invalid_gulong_value"); 4377 </spec> 4378 <body> 4379 function From_Address (C : System.Address) return Gdk_Event is 4380 function Convert is new Ada.Unchecked_Conversion 4381 (Glib.C_Proxy, Gdk_Event); 4382 begin 4383 return Convert (Glib.C_Proxy'(Glib.To_Proxy (C))); 4384 end From_Address; 4385 4386 function To_Address (C : Gdk_Event) return System.Address is 4387 function Convert is new Ada.Unchecked_Conversion 4388 (Gdk_Event, Glib.C_Proxy); 4389 begin 4390 return Glib.To_Address (Convert (C)); 4391 end To_Address; 4392 4393 function Get_Event (Value : Glib.Values.GValue) return Gdk_Event is 4394 function Convert is new Ada.Unchecked_Conversion 4395 (Glib.C_Proxy, Gdk_Event); 4396 begin 4397 return Convert (Glib.Values.Get_Proxy (Value)); 4398 end Get_Event; 4399 4400 function To_Event (Event : access Gdk_Event_Button) return Gdk_Event is 4401 type Gdk_Event_Button_Access is access all Gdk_Event_Button; 4402 function Convert is new Ada.Unchecked_Conversion 4403 (Gdk_Event_Button_Access, Gdk_Event); 4404 begin 4405 return Convert (Gdk_Event_Button_Access (Event)); 4406 end To_Event; 4407 4408 function To_Event (Event : access Gdk_Event_Key) return Gdk_Event is 4409 type Gdk_Event_Key_Access is access all Gdk_Event_Key; 4410 function Convert is new Ada.Unchecked_Conversion 4411 (Gdk_Event_Key_Access, Gdk_Event); 4412 begin 4413 return Convert (Gdk_Event_Key_Access (Event)); 4414 end To_Event; 4415 </body> 4416 </extra> 4417 4418 <doc group="Gdk, the low-level API"/> 4419 <parameter name="self" ada="Event"/> 4420 </package> 4421 4422 <package id="GtkRadioToolButton"> 4423 <method id="gtk_radio_tool_button_new"> 4424 <parameter name="group" ctype="WidgetSList"/> 4425 </method> 4426 <method id="gtk_radio_tool_button_new_from_stock"> 4427 <parameter name="group" ctype="WidgetSList"/> 4428 </method> 4429 <method id="gtk_radio_tool_button_set_group"> 4430 <parameter name="group" ctype="WidgetSList"/> 4431 </method> 4432 <method id="gtk_radio_tool_button_get_group" return="WidgetSList"/> 4433 <method id="gtk_radio_tool_button_new_from_widget" bind="False"/> <!-- gir file misses Group parameter--> 4434 <method id="gtk_radio_tool_button_new_with_stock_from_widget" bind="False"/> <!-- gir file misses Group parameter--> 4435 </package> 4436 4437 <package id="GtkSelectionData"> 4438 <parameter name="self" ada="Selection"/> 4439 4440 <method id="gtk_selection_data_targets_include_rich_text" bind="False"/> <!-- circular dependency on gtk.text_buffer --> 4441 <method id="gtk_selection_data_get_data_with_length" bind="False"/> <!-- not convenient, has an access gint and returns an array --> 4442 <method id="gtk_selection_data_set" bind="False"/> <!-- manual binding below --> 4443 <method id="gtk_selection_data_get_targets" bind="False"/> <!-- manual binding below --> 4444 4445 <method id="gtk_selection_data_get_data" return="System.Address"/> 4446 4447 <extra> 4448 <spec> 4449 --------------- 4450 -- Selection -- 4451 --------------- 4452 4453 function Make_Atom (Num : Gulong) return Gdk.Types.Gdk_Atom; 4454 pragma Import (C, Make_Atom, "ada_make_atom"); 4455 -- Auxiliary subprogram 4456 4457 subtype Gdk_Selection is Gdk.Types.Gdk_Atom; 4458 -- These are predefined atom values for several common selections. 4459 -- You are of course free to create new ones, but most of the time you 4460 -- should simply use Selection_Primary unless you foresee the need for 4461 -- multiple simultaneous selections. 4462 -- To access the clipboard on windows machines, you might need to create 4463 -- a new selection with Gdk.Property.Atom_Intern ("CLIPBOARD"); 4464 4465 Selection_Primary : constant Gdk_Selection := Make_Atom (1); 4466 Selection_Secondary : constant Gdk_Selection := Make_Atom (2); 4467 4468 procedure Selection_Data_Set 4469 (Selection : Gtk_Selection_Data; 4470 The_Type : Gdk.Types.Gdk_Atom; 4471 Format : Gint; 4472 Data : System.Address; 4473 Length : Gint); 4474 -- General form of Selection_Data_Set. 4475 -- Any data can be transmitted. Length is the number of bytes in Data. 4476 4477 procedure Selection_Data_Set 4478 (Selection : Gtk_Selection_Data; 4479 The_Type : Gdk.Types.Gdk_Atom; 4480 Format : Gint; 4481 Data : String); 4482 -- Set the data for a selection (special case for strings) 4483 -- This function is generally called when a drag-and-drop operation 4484 -- ask the source widget for the data to be transmitted. In that case, 4485 -- a Selection_Data was already transmitted and is given as a handler 4486 -- parameter for the signal "drag_data_get". The_Type can simply be 4487 -- extracted from the Selection_Data. 4488 4489 function Get_Targets 4490 (Selection : Gtk_Selection_Data) return Gdk.Types.Gdk_Atom_Array; 4491 -- Gets the contents of Selection_Data as an array of targets. 4492 -- This can be used to interpret the results of getting 4493 -- the standard TARGETS target that is always supplied for 4494 -- any selection. 4495 -- This is different from Get_Target, which indicate the current format 4496 -- that the selection contains. Get_Targets only applies when Get_Target 4497 -- is "TARGETS". 4498 4499 function Get_Data_As_String (Selection : Gtk_Selection_Data) return String; 4500 -- Return the data as a string. 4501 -- This is only a convenience function, since it simply creates a string 4502 -- from the return of Get_Data. 4503 </spec> 4504 4505 <with_body pkg="Gtkada.C" /> 4506 <body> 4507 package Atom_Arrays is new Gtkada.C.Unbounded_Arrays 4508 (Gdk.Types.Gdk_Atom, Gdk.Types.Gdk_None, 4509 Natural, Gdk.Types.Gdk_Atom_Array); 4510 4511 ------------------------ 4512 -- Selection_Data_Set -- 4513 ------------------------ 4514 4515 procedure Selection_Data_Set 4516 (Selection : Gtk_Selection_Data; 4517 The_Type : Gdk.Types.Gdk_Atom; 4518 Format : Gint; 4519 Data : System.Address; 4520 Length : Gint) 4521 is 4522 procedure Internal 4523 (Selection : System.Address; 4524 The_Type : Gdk.Types.Gdk_Atom; 4525 Format : Gint; 4526 Data : System.Address; 4527 Length : Gint); 4528 pragma Import (C, Internal, "gtk_selection_data_set"); 4529 4530 begin 4531 Internal (Get_Object (Selection), The_Type, Format, Data, Length); 4532 end Selection_Data_Set; 4533 4534 procedure Selection_Data_Set 4535 (Selection : Gtk_Selection_Data; 4536 The_Type : Gdk.Types.Gdk_Atom; 4537 Format : Gint; 4538 Data : String) is 4539 begin 4540 Selection_Data_Set 4541 (Selection, The_Type, Format, Data'Address, Data'Length); 4542 end Selection_Data_Set; 4543 4544 ----------------- 4545 -- Get_Targets -- 4546 ----------------- 4547 4548 function Get_Targets 4549 (Selection : Gtk_Selection_Data) return Gdk.Types.Gdk_Atom_Array 4550 is 4551 use Atom_Arrays; 4552 function Internal 4553 (Selection : System.Address; 4554 Targets : access Unbounded_Array_Access; 4555 N_Atoms : access Gint) return Gboolean; 4556 pragma Import (C, Internal, "gtk_selection_data_get_targets"); 4557 4558 Output : aliased Unbounded_Array_Access; 4559 N : aliased Gint; 4560 begin 4561 if Internal 4562 (Get_Object (Selection), 4563 Output'Unchecked_Access, 4564 N'Unchecked_Access) = 0 4565 then 4566 Output := null; 4567 end if; 4568 4569 declare 4570 Result : constant Gdk_Atom_Array := To_Array (Output, Integer (N)); 4571 begin 4572 G_Free (Output); 4573 return Result; 4574 end; 4575 end Get_Targets; 4576 4577 ------------------------ 4578 -- Get_Data_As_String -- 4579 ------------------------ 4580 4581 function Get_Data_As_String 4582 (Selection : Gtk_Selection_Data) return String 4583 is 4584 function Internal 4585 (Selection : System.Address) return Interfaces.C.Strings.chars_ptr; 4586 pragma Import (C, Internal, "gtk_selection_data_get_data"); 4587 begin 4588 return Interfaces.C.Strings.Value (Internal (Get_Object (Selection))); 4589 end Get_Data_As_String; 4590 </body> 4591 </extra> 4592 </package> 4593 4594 4595 <package id="GtkTargetEntry"> 4596 <parameter name="self" ada="Target_Entry"/> 4597 4598 <record ctype="GtkTargetEntry"> 4599 <field name="flags" ctype="GtkTargetFlags"/> 4600 </record> 4601 4602 <method id="gtk_target_entry_copy" bind="False"/> <!-- requires From_Object --> 4603 4604 <method id="gtk_target_entry_new"> 4605 <parameter name="Flags" ctype="GtkTargetFlags"/> 4606 </method> 4607 </package> 4608 4609 <package id="GtkTargetList"> 4610 <parameter name="self" ada="List"/> 4611 <enum ctype="GtkAccelFlags" prefix="GTK_"/> 4612 4613 <method id="gtk_target_list_add_rich_text_targets" bind="False"/> <!-- circular dependency clipboard, text_buffer --> 4614 4615 <method id="gtk_target_list_new" bind="False"/> <!-- manual binding below --> 4616 <method id="gtk_target_list_add_table" bind="False"/> <!-- manual binding below --> 4617 4618 <method id="gtk_target_list_find" 4619 return_as_param="Found" /> 4620 4621 <extra> 4622 <with_spec pkg="Gtk.Target_Entry" /> 4623 <spec> 4624 type Target_Entry_Array is array (Natural range <>) of Gtk_Target_Entry; 4625 4626 Any_Target_Entry : Target_Entry_Array (1 .. 0); 4627 -- To be used for drop sites that accept any kind of data. 4628 4629 procedure Gtk_New 4630 (List : out Gtk_Target_List; 4631 Targets : Target_Entry_Array); 4632 -- Creates a new Gtk.Target_List.Gtk_Target_List from an array of 4633 -- Gtk.Target_Entry.Gtk_Target_Entry. 4634 4635 procedure Add_Table 4636 (List : Gtk_Target_List; 4637 Targets : Target_Entry_Array); 4638 -- Prepends a table of Gtk.Target_Entry.Gtk_Target_Entry to a target list. 4639 </spec> 4640 <body> 4641 ------------- 4642 -- Gtk_New -- 4643 ------------- 4644 4645 procedure Gtk_New 4646 (List : out Gtk_Target_List; 4647 Targets : Target_Entry_Array) 4648 is 4649 function Internal 4650 (Targets : System.Address; 4651 Ntargets : Guint) return System.Address; 4652 pragma Import (C, Internal, "gtk_target_list_new"); 4653 begin 4654 List.Set_Object (Internal (Targets'Address, Targets'Length)); 4655 end Gtk_New; 4656 4657 --------------- 4658 -- Add_Table -- 4659 --------------- 4660 4661 procedure Add_Table 4662 (List : Gtk_Target_List; 4663 Targets : Target_Entry_Array) 4664 is 4665 procedure Internal 4666 (List : System.Address; 4667 Targets : System.Address; 4668 Ntargets : Guint); 4669 pragma Import (C, Internal, "gtk_target_list_add_table"); 4670 begin 4671 Internal (Get_Object (List), Targets'Address, Targets'Length); 4672 end Add_Table; 4673 </body> 4674 </extra> 4675 </package> 4676 4677 <package id="GtkTooltip"/> 4678 4679 <package id="GtkRadioMenuItem"> 4680 <parameter name="self" ada="Radio_Menu_Item" /> 4681 4682 <!-- Merge two Gtk_New together --> 4683 <method id="gtk_radio_menu_item_new" bind="False"/> 4684 <method id="gtk_radio_menu_item_new_with_label" ada="Gtk_New" > 4685 <parameter name="label" default='""' allow-none="0"/> 4686 <parameter name="group" ctype="WidgetSList"/> 4687 </method> 4688 <method id="gtk_radio_menu_item_new_with_mnemonic" > 4689 <parameter name="group" ctype="WidgetSList"/> 4690 </method> 4691 <method id="gtk_radio_menu_item_set_group"> 4692 <parameter name="group" ctype="WidgetSList"/> 4693 </method> 4694 <method id="gtk_radio_menu_item_get_group" return="WidgetSList"/> 4695 <method id="gtk_radio_menu_item_new_from_widget" bind="False"/> <!-- gir file misses Group parameter--> 4696 <method id="gtk_radio_menu_item_new_with_label_from_widget" bind="False"/> <!-- gir file misses Group parameter--> 4697 <method id="gtk_radio_menu_item_new_with_mnemonic_from_widget" bind="False"/> <!-- gir file misses Group parameter--> 4698 <extra> 4699 <spec> 4700 function Selected_Button (In_Group : Widget_SList.GSlist) return Natural; 4701 -- Return the button number of the selected button in the group. 4702 -- Note: This function is not part of Gtk+ itself, but is provided as a 4703 -- convenient function 4704 </spec> 4705 <body> 4706 function Selected_Button 4707 (In_Group : Widget_SList.GSlist) return Natural 4708 is 4709 use Widget_SList; 4710 J : Natural := 0; 4711 Tmp : Widget_SList.GSlist := In_Group; 4712 begin 4713 while Tmp /= Widget_SList.Null_List loop 4714 exit when Get_Active (Gtk_Radio_Menu_Item (Get_Data (Tmp))); 4715 Tmp := Next (Tmp); 4716 J := J + 1; 4717 end loop; 4718 4719 return J; 4720 end Selected_Button; 4721 </body> 4722 </extra> 4723 </package> 4724 4725 <package id="GtkPrintContext"> 4726 <parameter name="self" ada="Context"/> 4727 </package> 4728 4729 <package id="PangoFontMetrics"> 4730 <!--<record ctype="PangoFontMetrics" private="true"/>--> 4731 </package> 4732 4733 <package id="PangoFontset"> 4734 <doc>an object containing a set of pango.Font objects</doc> 4735 </package> 4736 4737 <package id="PangoLanguage"> 4738 <enum ctype="PangoScript"/> 4739 <extra> 4740 <type ctype="Pango_Script_Array" ada="Pango_Script_Array"> 4741 type Pango_Script_Array is array (Natural range <>) of Pango_Script; 4742 </type> 4743 </extra> 4744 4745 <method id="pango_language_get_scripts" return="Pango_Script_Array"> 4746 <parameter name="num_scripts" ada=""/> 4747 <body> 4748 type script_array_bounded is array (Natural) of Pango_Script; 4749 type script_array_access is access script_array_bounded; 4750 4751 function Internal 4752 (Self : System.Address; 4753 Size : access Gint) return script_array_access; 4754 pragma Import (C, Internal, "pango_language_get_scripts"); 4755 4756 Scripts : script_array_access; 4757 Size : aliased Gint; 4758 begin 4759 Scripts := Internal (Self.Get_Object, Size'Access); 4760 4761 declare 4762 Result : Pango_Script_Array (1 .. Integer (Size)); 4763 begin 4764 for R in 0 .. Integer (Size) - 1 loop 4765 Result (R + 1) := Scripts (R); 4766 end loop; 4767 return Result; 4768 end; 4769 </body> 4770 </method> 4771 </package> 4772 4773 <package id="PangoFontMap"> 4774 <doc>An object that represents the set of fonts available for a particular 4775 rendering system</doc> 4776 4777 <extra> 4778 <with_spec pkg="Pango.Font_Family"/> 4779 </extra> 4780 4781 <method id="pango_font_map_list_families" return="Pango_Font_Family_Array"> 4782 <parameter name="families" ada=""/> 4783 <parameter name="n_families" ada=""/> 4784 <body> 4785 type font_family_array_bounded is array (Natural) of System.Address; 4786 4787 procedure Internal 4788 (Self : System.Address; 4789 Families : System.Address; 4790 Size : access Gint); 4791 pragma Import (C, Internal, "pango_font_map_list_families"); 4792 4793 procedure g_free (s : access font_family_array_bounded); 4794 pragma Import (C, g_free, "g_free"); 4795 4796 Families : aliased access font_family_array_bounded; 4797 Size : aliased Gint; 4798 Tmplt : Pango_Font_Family_Record; 4799 begin 4800 Internal (Self.Get_Object, Families'Address, Size'Access); 4801 4802 declare 4803 Result : Pango_Font_Family_Array (1 .. Integer (Size)); 4804 begin 4805 for R in 0 .. Integer (Size) - 1 loop 4806 Result (R + 1) := Pango_Font_Family 4807 (Get_User_Data (Families (R), Tmplt)); 4808 end loop; 4809 g_free (Families); 4810 4811 return Result; 4812 end; 4813 </body> 4814 </method> 4815 </package> 4816 4817 <package id="PangoFontFamily"> 4818 <extra> 4819 <with_spec pkg="Pango.Font_Face"/> 4820 4821 <!-- Needed for PangoFontMap --> 4822 <type ctype="Pango_Font_Family_Array" ada="Pango_Font_Family_Array"> 4823 type Pango_Font_Family_Array is array (Natural range <>) of Pango_Font_Family; 4824 </type> 4825 </extra> 4826 <method id="pango_font_family_list_faces" return="Pango_Font_Face_Array"> 4827 <parameter name="faces" ada=""/> 4828 <parameter name="n_faces" ada=""/> 4829 <body> 4830 type font_face_array_bounded is array (Natural) of System.Address; 4831 4832 procedure Internal 4833 (Self : System.Address; 4834 Faces : System.Address; 4835 Acc_N_Faces : access Gint); 4836 pragma Import (C, Internal, "pango_font_family_list_faces"); 4837 4838 procedure g_free (s : access font_face_array_bounded); 4839 pragma Import (C, g_free, "g_free"); 4840 4841 Faces : aliased access font_face_array_bounded; 4842 Size : aliased Gint; 4843 Tmplt : Pango_Font_Face_Record; 4844 begin 4845 Internal (Self.Get_Object, Faces'Address, Size'Access); 4846 4847 declare 4848 Result : Pango_Font_Face_Array (1 .. Integer (Size)); 4849 begin 4850 for R in 0 .. Integer (Size) - 1 loop 4851 Result (R + 1) := Pango_Font_Face 4852 (Get_User_Data (Faces (R), Tmplt)); 4853 end loop; 4854 g_free (Faces); 4855 4856 return Result; 4857 end; 4858 </body> 4859 </method> 4860 </package> 4861 4862 <package id="PangoFontFace"> 4863 <extra> 4864 <!-- Needed for PangoFontFamily --> 4865 <type ctype="Pango_Font_Face_Array" ada="Pango_Font_Face_Array"> 4866 type Pango_Font_Face_Array is array (Natural range <>) of Pango_Font_Face; 4867 </type> 4868 </extra> 4869 <method id="pango_font_face_list_sizes" return="gint**"> 4870 <parameter name="sizes" ada=""/> 4871 <parameter name="n_sizes" ada=""/> 4872 <body> 4873 type gint_array_bounded is array (Natural) of Gint; 4874 4875 procedure Internal 4876 (Self : System.Address; 4877 Sizes : System.Address; 4878 Acc_N_Sizes : access Gint); 4879 pragma Import (C, Internal, "pango_font_face_list_sizes"); 4880 4881 procedure g_free (s : access gint_array_bounded); 4882 pragma Import (C, g_free, "g_free"); 4883 4884 Sizes : aliased access gint_array_bounded; 4885 Size : aliased Gint; 4886 begin 4887 Internal (Self.Get_Object, Sizes'Address, Size'Access); 4888 4889 declare 4890 Result : Gint_Array (1 .. Integer (Size)); 4891 begin 4892 for R in 0 .. Integer (Size) - 1 loop 4893 Result (R + 1) := Sizes (R); 4894 end loop; 4895 g_free (Sizes); 4896 4897 return Result; 4898 end; 4899 </body> 4900 </method> 4901 </package> 4902 4903 <package id="PangoLayout"> 4904 <parameter name="self" ada="Layout"/> 4905 <enum ctype="PangoEllipsizeMode" prefix="PANGO_"/> 4906 <method id="pango_layout_xy_to_index" return_as_param="Exact"> 4907 <parameter name="index" ada="Byte_Index" direction="out"/> 4908 <parameter name="trailing" direction="out"/> 4909 </method> 4910 4911 <!-- Do not bind these, since they require a list of Pango_Layout_Line, 4912 which is incorrectly bound (error in From_Object) --> 4913 <method id="pango_layout_get_lines" return="PangoLayoutLineSList" bind="false"/> 4914 <method id="pango_layout_get_lines_readonly" bind="false" 4915 return="PangoLayoutLineSList"/> 4916 4917 <method id="pango_layout_get_log_attrs" bind="false"/> <!-- what is a pango_log --> 4918 <method id="pango_layout_get_log_attrs_readonly" bind="false"/> <!-- what 4919 is a pango_log --> 4920 4921 <method id="pango_layout_get_iter" classwide="true"/> 4922 4923 <method id="pango_layout_set_attributes"> 4924 <parameter name="attrs" direction="in" ctype="PangoAttrList"/> 4925 </method> 4926 4927 <method id="pango_layout_set_text"> 4928 <parameter name="length" default="-1" ada=""/> 4929 </method> 4930 <method id="pango_layout_set_markup"> 4931 <parameter name="length" default="-1" ada=""/> 4932 </method> 4933 <extra> 4934 <with_spec pkg="Gtkada.Types" /> 4935 <spec> 4936 function Get_Text (Layout : access Pango_Layout_Record) 4937 return Gtkada.Types.Chars_Ptr; 4938 -- Same a Get_Text, but return directly the C string, which is more 4939 -- efficient. The returned value should not be freed or modified. 4940 </spec> 4941 <body> 4942 function Get_Text (Layout : access Pango_Layout_Record) 4943 return Gtkada.Types.Chars_Ptr 4944 is 4945 function Internal (Layout : System.Address) 4946 return Interfaces.C.Strings.chars_ptr; 4947 pragma Import (C, Internal, "pango_layout_get_text"); 4948 begin 4949 return Internal (Get_Object (Layout)); 4950 end Get_Text; 4951 </body> 4952 </extra> 4953 </package> 4954 4955 <package id="PangoLayoutLine" into="PangoLayout"> 4956 <record ctype="PangoLayoutLine" private="true"/> 4957 4958 <method id="pango_layout_line_get_type" ada="Get_Type_Layout_Line" /> 4959 4960 <method id="pango_layout_line_get_extents" bind="false"/> <!-- forces bad pragma import on pango_layout_get_extents --> 4961 <method id="pango_layout_line_get_pixel_extents" bind="false"/> 4962 <method id="pango_layout_line_ref" bind="false"/> <!-- Not needed in Ada --> 4963 <method id="pango_layout_line_unref" bind="false"/> <!-- Not needed in Ada --> 4964 4965 <!-- Do not bind these for now, there is an error in the generator that 4966 tries to use Get_Object on a PangoLayoutLine because it doesn't know 4967 private records are implemented as C_Proxy --> 4968 <method id="pango_layout_line_get_x_ranges" bind="false"/> 4969 <method id="pango_layout_line_index_to_x" bind="false"/> 4970 <method id="pango_layout_line_x_to_index" bind="false"/> 4971 4972 </package> 4973 4974 <package id="PangoLayoutIter" into="PangoLayout"> 4975 <method id="pango_layout_iter_get_type" ada="Get_Type_Layout_Iter" /> 4976 4977 <method id="pango_layout_iter_get_run" bind="false"/> <!-- what is a pango_run --> 4978 <method id="pango_layout_iter_get_run_readonly" bind="false"/> <!-- what is a pango_run --> 4979 </package> 4980 4981 <package id="GtkPrintOperation"> 4982 <enum ctype="GtkPrintStatus" prefix="GTK_PRINT_"/> 4983 <enum ctype="GtkPrintOperationResult" prefix="GTK_PRINT_OPERATION_"/> 4984 <enum ctype="GtkPrintOperationAction" prefix="GTK_PRINT_OPERATION_"/> 4985 <enum ctype="GtkPrintError" prefix="GTK_PRINT_"/> 4986 </package> 4987 4988 <package id="GtkPrintOperationPreview"> 4989 <parameter name="self" ada="Preview"/> 4990 </package> 4991 4992 <package id="GtkAccelLabel"> 4993 <parameter name="self" ada="Accel_Label"/> 4994 </package> 4995 4996 <package id="GtkAccelMap"> 4997 <method id="gtk_accel_map_load_scanner" bind="False"/> <!-- no binding for GScanner --> 4998 <method id="gtk_accel_map_add_entry"> 4999 <parameter name="accel_key" ctype="GdkKeyType"/> 5000 </method> 5001 <method id="gtk_accel_map_change_entry"> 5002 <parameter name="accel_key" ctype="GdkKeyType"/> 5003 </method> 5004 <method id="gtk_accel_map_lookup_entry" return_as_param="Found"/> 5005 </package> 5006 5007 <package id="GtkActionGroup"> 5008 <parameter name="self" ada="Action_Group"/> 5009 5010 <list ada="Action_List" ctype="GtkAction"/> 5011 5012 <method id="gtk_action_group_list_actions" return="GtkActionList"/> 5013 <method id="gtk_action_group_add_radio_actions" bind="False"/> <!-- see below --> 5014 <method id="gtk_action_group_add_radio_actions_full" bind="False"/> <!-- see below --> 5015 <method id="gtk_action_group_add_actions" bind="False"/> <!-- see below --> 5016 <method id="gtk_action_group_add_actions_full" bind="False"/> <!-- see below --> 5017 <method id="gtk_action_group_add_toggle_actions" bind="False"/> <!-- see below --> 5018 <method id="gtk_action_group_add_toggle_actions_full" bind="False"/> <!-- see below --> 5019 5020 <extra> 5021 <with_spec pkg="Interfaces.C.Strings"/> 5022 <spec> 5023 type Action_Callback is access procedure 5024 (Action : System.Address; User_Data : System.Address); 5025 pragma Convention (C, Action_Callback); 5026 -- Profile of callbacks when an action is activated. You must convert 5027 -- Action to a Gtk_Action through: 5028 -- Act : constant Gtk_Action := Convert (Action); 5029 5030 type Action_Entry is record 5031 Name : Interfaces.C.Strings.chars_ptr; 5032 Stock_Id : Interfaces.C.Strings.chars_ptr; 5033 Label : Interfaces.C.Strings.chars_ptr; 5034 Accelerator : Interfaces.C.Strings.chars_ptr; 5035 Tooltip : Interfaces.C.Strings.chars_ptr; 5036 Callback : Action_Callback; 5037 end record; 5038 pragma Convention (C, Action_Entry); 5039 5040 type Radio_Action_Entry is record 5041 Name : Interfaces.C.Strings.chars_ptr; 5042 Stock_Id : Interfaces.C.Strings.chars_ptr; 5043 Label : Interfaces.C.Strings.chars_ptr; 5044 Accelerator : Interfaces.C.Strings.chars_ptr; 5045 Tooltip : Interfaces.C.Strings.chars_ptr; 5046 Value : Glib.Gint; 5047 end record; 5048 pragma Convention (C, Radio_Action_Entry); 5049 5050 type Toggle_Action_Entry is record 5051 Name : Interfaces.C.Strings.chars_ptr; 5052 Stock_Id : Interfaces.C.Strings.chars_ptr; 5053 Label : Interfaces.C.Strings.chars_ptr; 5054 Accelerator : Interfaces.C.Strings.chars_ptr; 5055 Tooltip : Interfaces.C.Strings.chars_ptr; 5056 Callback : Action_Callback; 5057 Is_Active : Glib.Gboolean; 5058 end record; 5059 pragma Convention (C, Toggle_Action_Entry); 5060 -- An opaque structure describing an action entry 5061 5062 type Action_Entry_Array is array (Natural range <>) of Action_Entry; 5063 type Radio_Action_Entry_Array 5064 is array (Natural range <>) of Radio_Action_Entry; 5065 type Toggle_Action_Entry_Array 5066 is array (Natural range <>) of Toggle_Action_Entry; 5067 5068 type Radio_Action_Callback is access procedure 5069 (Group : access Gtk.Action.Gtk_Action_Record'Class; 5070 Current : access Gtk.Action.Gtk_Action_Record'Class; 5071 User_Data : System.Address); 5072 -- Called when an element of the Gtk_Radio_Action group is selected 5073 5074 function Create 5075 (Name : String; 5076 Label : String := ""; 5077 Stock_Id : String := ""; 5078 Accelerator : String := ""; 5079 Tooltip : String := ""; 5080 Callback : Action_Callback := null) return Action_Entry; 5081 -- Create a new Action_Entry. The returned value must be freed by the 5082 -- caller. 5083 5084 function Create 5085 (Name : String; 5086 Label : String := ""; 5087 Stock_Id : String := ""; 5088 Accelerator : String := ""; 5089 Tooltip : String := ""; 5090 Callback : Action_Callback := null; 5091 Is_Active : Boolean := True) return Toggle_Action_Entry; 5092 -- Create a new Action_Entry. The returned value must be freed by the 5093 -- caller. Is_Active is the initial state of the button. 5094 5095 function Create 5096 (Name : String; 5097 Label : String; 5098 Stock_Id : String := ""; 5099 Accelerator : String := ""; 5100 Tooltip : String := ""; 5101 Value : Glib.Gint) return Radio_Action_Entry; 5102 -- Create a new Radio_Action_Entry. Value is the value set on the radio 5103 -- action (see Gtk.Radio_Action.Get_Current_Value) 5104 5105 procedure Free (Action : in out Action_Entry); 5106 procedure Free (Actions : in out Action_Entry_Array); 5107 procedure Free (Action : in out Radio_Action_Entry); 5108 procedure Free (Actions : in out Radio_Action_Entry_Array); 5109 procedure Free (Action : in out Toggle_Action_Entry); 5110 procedure Free (Actions : in out Toggle_Action_Entry_Array); 5111 -- Free Action and Actions 5112 5113 procedure Add_Actions 5114 (Action_Group : access Gtk_Action_Group_Record; 5115 Entries : Action_Entry_Array; 5116 User_Data : System.Address := System.Null_Address; 5117 Destroy : Glib.G_Destroy_Notify_Address := null); 5118 -- This is a convenience function to create a number of actions and add 5119 -- them to the action group. 5120 -- Destroy is called when User_Data is no longer needed. 5121 -- 5122 -- The "activate" signals of the actions are connected to the callbacks in 5123 -- Entries, and their accel paths are set to 5124 -- <Actions>/group-name/action-name. 5125 5126 procedure Add_Radio_Actions 5127 (Action_Group : access Gtk_Action_Group_Record; 5128 Entries : Radio_Action_Entry_Array; 5129 Value : Glib.Gint; 5130 On_Change : Radio_Action_Callback; 5131 User_Data : System.Address := System.Null_Address; 5132 Destroy : Glib.G_Destroy_Notify_Address := null); 5133 -- This is a convenience routine to create a group of radio actions and 5134 -- add them to the action group. 5135 -- 5136 -- The "changed" signal of the first radio action is connected to the 5137 -- On_Change callback and the accel paths of the actions are set to 5138 -- <Actions>/group-name/action-name 5139 -- 5140 -- Value is the value of the action to activate initially, or -1 if no 5141 -- action should be activated. 5142 -- Destroy is called when User_Data is no longer necessary. 5143 5144 procedure Add_Toggle_Actions 5145 (Action_Group : access Gtk_Action_Group_Record; 5146 Entries : Toggle_Action_Entry_Array; 5147 User_Data : System.Address := System.Null_Address; 5148 Destroy : Glib.G_Destroy_Notify_Address := null); 5149 -- This is a convenience function to create a number of toggle actions and 5150 -- add them to the action group. 5151 -- The "activate" signals of the actions are connected to the callbacks and 5152 -- their accel paths are set to <Actions>/group-name/action-name. 5153 -- Destroy is called when User_Data is no longer necessary. 5154 </spec> 5155 <with_body pkg="Ada.Unchecked_Deallocation" use="False" /> 5156 <body> 5157 procedure Local_Radio_Action_Callback 5158 (Group, Current, User_Data : System.Address); 5159 pragma Convention (C, Local_Radio_Action_Callback); 5160 -- Local proxy for Radio_Action_Callback 5161 5162 procedure Local_Radio_Action_Destroy 5163 (Data : in out System.Address); 5164 pragma Convention (C, Local_Radio_Action_Destroy); 5165 -- Local proxy for the Destroy notify for Radio_Action 5166 5167 type Local_Radio_Action_User_Data is record 5168 Callback : Radio_Action_Callback; 5169 User_Data : System.Address; 5170 Destroy : G_Destroy_Notify_Address; 5171 end record; 5172 type Local_Radio_Action_User_Data_Access is 5173 access Local_Radio_Action_User_Data; 5174 5175 function Convert is new Ada.Unchecked_Conversion 5176 (System.Address, Local_Radio_Action_User_Data_Access); 5177 function Convert is new Ada.Unchecked_Conversion 5178 (Local_Radio_Action_User_Data_Access, System.Address); 5179 procedure Unchecked_Free is new Ada.Unchecked_Deallocation 5180 (Local_Radio_Action_User_Data, Local_Radio_Action_User_Data_Access); 5181 5182 procedure Local_Radio_Action_Callback 5183 (Group, Current, User_Data : System.Address) 5184 is 5185 Data : constant Local_Radio_Action_User_Data_Access := 5186 Convert (User_Data); 5187 Stub : Gtk_Action_Record; 5188 G : constant Gtk_Action := Gtk_Action (Get_User_Data (Group, Stub)); 5189 C : constant Gtk_Action := Gtk_Action (Get_User_Data (Current, Stub)); 5190 begin 5191 Data.Callback (G, C, Data.User_Data); 5192 end Local_Radio_Action_Callback; 5193 5194 procedure Local_Radio_Action_Destroy 5195 (Data : in out System.Address) 5196 is 5197 D : Local_Radio_Action_User_Data_Access := Convert (Data); 5198 begin 5199 D.Destroy (D.User_Data); 5200 Unchecked_Free (D); 5201 end Local_Radio_Action_Destroy; 5202 5203 function Create 5204 (Name : String; 5205 Label : String := ""; 5206 Stock_Id : String := ""; 5207 Accelerator : String := ""; 5208 Tooltip : String := ""; 5209 Callback : Action_Callback := null) return Action_Entry is 5210 begin 5211 return (Name => String_Or_Null (Name), 5212 Label => String_Or_Null (Label), 5213 Stock_Id => String_Or_Null (Stock_Id), 5214 Accelerator => String_Or_Null (Accelerator), 5215 Tooltip => String_Or_Null (Tooltip), 5216 Callback => Callback); 5217 end Create; 5218 5219 function Create 5220 (Name : String; 5221 Label : String := ""; 5222 Stock_Id : String := ""; 5223 Accelerator : String := ""; 5224 Tooltip : String := ""; 5225 Callback : Action_Callback := null; 5226 Is_Active : Boolean := True) return Toggle_Action_Entry is 5227 begin 5228 return (Name => String_Or_Null (Name), 5229 Label => String_Or_Null (Label), 5230 Stock_Id => String_Or_Null (Stock_Id), 5231 Accelerator => String_Or_Null (Accelerator), 5232 Tooltip => String_Or_Null (Tooltip), 5233 Callback => Callback, 5234 Is_Active => Boolean'Pos (Is_Active)); 5235 end Create; 5236 5237 function Create 5238 (Name : String; 5239 Label : String; 5240 Stock_Id : String := ""; 5241 Accelerator : String := ""; 5242 Tooltip : String := ""; 5243 Value : Glib.Gint) return Radio_Action_Entry is 5244 begin 5245 return (Name => String_Or_Null (Name), 5246 Label => String_Or_Null (Label), 5247 Stock_Id => String_Or_Null (Stock_Id), 5248 Accelerator => String_Or_Null (Accelerator), 5249 Tooltip => String_Or_Null (Tooltip), 5250 Value => Value); 5251 end Create; 5252 5253 procedure Free (Action : in out Action_Entry) is 5254 begin 5255 Free (Action.Name); 5256 Free (Action.Label); 5257 Free (Action.Stock_Id); 5258 Free (Action.Accelerator); 5259 Free (Action.Tooltip); 5260 end Free; 5261 5262 procedure Free (Actions : in out Action_Entry_Array) is 5263 begin 5264 for A in Actions'Range loop 5265 Free (Actions (A)); 5266 end loop; 5267 end Free; 5268 5269 procedure Free (Action : in out Radio_Action_Entry) is 5270 begin 5271 Free (Action.Name); 5272 Free (Action.Label); 5273 Free (Action.Stock_Id); 5274 Free (Action.Accelerator); 5275 Free (Action.Tooltip); 5276 end Free; 5277 5278 procedure Free (Actions : in out Radio_Action_Entry_Array) is 5279 begin 5280 for A in Actions'Range loop 5281 Free (Actions (A)); 5282 end loop; 5283 end Free; 5284 5285 procedure Free (Action : in out Toggle_Action_Entry) is 5286 begin 5287 Free (Action.Name); 5288 Free (Action.Label); 5289 Free (Action.Stock_Id); 5290 Free (Action.Accelerator); 5291 Free (Action.Tooltip); 5292 end Free; 5293 5294 procedure Free (Actions : in out Toggle_Action_Entry_Array) is 5295 begin 5296 for A in Actions'Range loop 5297 Free (Actions (A)); 5298 end loop; 5299 end Free; 5300 5301 procedure Add_Actions 5302 (Action_Group : access Gtk_Action_Group_Record; 5303 Entries : Action_Entry_Array; 5304 User_Data : System.Address := System.Null_Address; 5305 Destroy : Glib.G_Destroy_Notify_Address := null) 5306 is 5307 procedure Internal 5308 (Action_Group : System.Address; 5309 Entries : System.Address; 5310 N_Entries : Guint; 5311 User_Data : System.Address; 5312 Destroy : G_Destroy_Notify_Address); 5313 pragma Import (C, Internal, "gtk_action_group_add_actions_full"); 5314 begin 5315 Internal (Get_Object (Action_Group), 5316 Entries (Entries'First)'Address, 5317 Entries'Length, 5318 User_Data, Destroy); 5319 end Add_Actions; 5320 5321 procedure Add_Radio_Actions 5322 (Action_Group : access Gtk_Action_Group_Record; 5323 Entries : Radio_Action_Entry_Array; 5324 Value : Glib.Gint; 5325 On_Change : Radio_Action_Callback; 5326 User_Data : System.Address := System.Null_Address; 5327 Destroy : Glib.G_Destroy_Notify_Address := null) 5328 is 5329 procedure Internal 5330 (Action_Group : System.Address; 5331 Entries : System.Address; 5332 N_Entries : Guint; 5333 Value : Gint; 5334 On_Change : System.Address; 5335 User_Data : System.Address; 5336 Destroy : System.Address); 5337 pragma Import (C, Internal, "gtk_action_group_add_radio_actions_full"); 5338 Data : constant Local_Radio_Action_User_Data_Access := 5339 new Local_Radio_Action_User_Data' 5340 (Callback => On_Change, 5341 User_Data => User_Data, 5342 Destroy => Destroy); 5343 begin 5344 Internal (Get_Object (Action_Group), 5345 Entries (Entries'First)'Address, Entries'Length, 5346 Value, 5347 Local_Radio_Action_Callback'Address, 5348 Convert (Data), 5349 Local_Radio_Action_Destroy'Address); 5350 end Add_Radio_Actions; 5351 5352 procedure Add_Toggle_Actions 5353 (Action_Group : access Gtk_Action_Group_Record; 5354 Entries : Toggle_Action_Entry_Array; 5355 User_Data : System.Address := System.Null_Address; 5356 Destroy : G_Destroy_Notify_Address := null) 5357 is 5358 procedure Internal 5359 (Action_Group : System.Address; 5360 Entries : System.Address; 5361 N_Entries : Guint; 5362 User_Data : System.Address; 5363 Destroy : G_Destroy_Notify_Address); 5364 pragma Import (C, Internal, "gtk_action_group_add_toggle_actions_full"); 5365 begin 5366 Internal (Get_Object (Action_Group), 5367 Entries (Entries'First)'Address, Entries'Length, User_Data, 5368 Destroy); 5369 end Add_Toggle_Actions; 5370 </body> 5371 </extra> 5372 </package> 5373 5374 <package id="GtkMessageDialog"> 5375 <parameter name="self" ada="Dialog"/> 5376 <enum ctype="GtkMessageType" prefix="GTK_"/> 5377 <enum ctype="GtkButtonsType" prefix="GTK_"/> 5378 <method id="gtk_message_dialog_new"> 5379 <parameter name="message_format" ada="message" default='""'/> 5380 <parameter name="varargs" ada="" ctype="gpointer" default="System.Null_Address"/> <!-- remove varargs argument --> 5381 </method> 5382 <method id="gtk_message_dialog_new_with_markup"> 5383 <parameter name="message_format" ada="message" default='""'/> 5384 <parameter name="varargs" ada="" ctype="gpointer" default="System.Null_Address"/> <!-- remove varargs argument --> 5385 </method> 5386 <method id="gtk_message_dialog_format_secondary_markup"> 5387 <parameter name="message_format" ada="message" default='""'/> 5388 <parameter name="varargs" ada="" ctype="gpointer" default="System.Null_Address"/> <!-- remove varargs argument --> 5389 </method> 5390 </package> 5391 5392 <package id="GtkPrintSettings"> 5393 <method id="gtk_print_settings_set_page_ranges"> 5394 <parameter name="page_ranges" type="Gtk_Page_Range_Array"/> 5395 <parameter name="num_ranges" ada="" default="-1" /> 5396 <body> 5397 procedure Internal 5398 (Settings : System.Address; 5399 Page_Ranges : System.Address; 5400 Num_Ranges : Gint); 5401 pragma Import (C, Internal, "gtk_print_settings_set_page_ranges"); 5402 begin 5403 Internal 5404 (Get_Object (Self), 5405 Page_Ranges (Page_Ranges'First)'Address, 5406 Page_Ranges'Length); 5407 </body> 5408 </method> 5409 <method id="gtk_print_settings_get_page_ranges" return="Gtk_Page_Range_Array"> 5410 <parameter name="num_ranges" ada="" default="-1" /> 5411 <body> 5412 type Internal_Page_Range_Array is 5413 array (Natural) of Gtk_Page_Range_Record; 5414 pragma Convention (C, Internal_Page_Range_Array); 5415 5416 type Internal_Page_Range_Array_Access is 5417 access Internal_Page_Range_Array; 5418 pragma Convention (C, Internal_Page_Range_Array_Access); 5419 5420 procedure Free (Item : in out Internal_Page_Range_Array_Access); 5421 pragma Import (C, Free, "g_free"); 5422 5423 function Internal 5424 (Settings : System.Address; 5425 Num_Ranges : access Gint) 5426 return Internal_Page_Range_Array_Access; 5427 pragma Import (C, Internal, "gtk_print_settings_get_page_ranges"); 5428 5429 Len : aliased Gint; 5430 Result : Internal_Page_Range_Array_Access; 5431 begin 5432 Result := Internal (Get_Object (Self), Len'Access); 5433 declare 5434 Ranges : constant Gtk_Page_Range_Array := 5435 Gtk_Page_Range_Array (Result (0 .. Natural (Len))); 5436 begin 5437 Free (Result); 5438 return Ranges; 5439 end; 5440 </body> 5441 </method> 5442 <extra> 5443 <type ctype="GtkPageRange" ada="Gtk_Page_Range_Record"> 5444 type Gtk_Page_Range_Record is record 5445 Range_Start : Gint; 5446 Range_End : Gint; 5447 end record; 5448 pragma Convention (C, Gtk_Page_Range_Record); 5449 type Gtk_Page_Range_Array is array (Integer range <>) of Gtk_Page_Range_Record; 5450 pragma Convention (C, Gtk_Page_Range_Array); 5451 -- Page range specification(s). 5452 </type> 5453 </extra> 5454 </package> 5455 5456 <package id="GtkBuilder"> 5457 <parameter name="self" ada="Builder"/> 5458 <parameter name="error" direction="out" /> 5459 <callback id="Gtk_Builder_Connect_Func"> 5460 <parameter name="signal_name" ctype="SignalName"/> 5461 </callback> 5462 <method id="gtk_builder_add_from_string"> 5463 <parameter name="length" default="-1" ada=""/> 5464 </method> 5465 <method id="gtk_builder_get_objects" return="ObjectSList" /> 5466 <method id="gtk_builder_value_from_string" return_as_param="Success" /> 5467 5468 <method id="gtk_builder_set_application" bind="False"/> <!-- circular dep with GtkWidget --> 5469 <method id="gtk_builder_get_application" bind="False"/> <!-- circular dep with GtkWidget --> 5470 5471 <method id="gtk_builder_add_callback_symbol" bind="False"/> <!-- error in generated binding --> 5472 </package> 5473 5474 <package id="GtkUIManager"> 5475 <enum ctype="GtkUIManagerItemType" prefix="GTK_UI_" 5476 ada="Manager_Item_Type"/> 5477 <method id="gtk_ui_manager_add_ui" ada="Add_UI"> 5478 <parameter name="type" default="Manager_Auto"/> 5479 <parameter name="top" default="False"/> 5480 </method> 5481 <method id="gtk_ui_manager_remove_ui" ada="Remove_UI"/> 5482 <method id="gtk_ui_manager_add_ui_from_file" ada="Add_UI_From_File"> 5483 <parameter name="error" direction="out"/> 5484 </method> 5485 <method id="gtk_ui_manager_add_ui_from_resource" ada="Add_UI_From_Resource"> 5486 <parameter name="error" direction="out"/> 5487 </method> 5488 <method id="gtk_ui_manager_add_ui_from_string" ada="Add_UI_From_String"> 5489 <parameter name="error" direction="out"/> 5490 <parameter name="length" ada="" default="-1"/> 5491 </method> 5492 <method id="gtk_ui_manager_get_action_groups" return="ObjectList"/> 5493 <method id="gtk_ui_manager_get_toplevels" return="WidgetSList"/> 5494 </package> 5495 5496 <package id="GtkIconSet"> 5497 <doc> 5498 An icon set represents a single icon in various sizes and widget states. 5499 It can provide a Gdk_Pixbuf for a given size and state on request, and 5500 automatically caches some of the rendered Gdk_Pixbuf objects. 5501 5502 Normally you would use Gtk.Widget.Render_Icon instead of using icon sets 5503 directly. The one case where you'd use an icon set is to create 5504 application-specific icon sets to place in an icon factory. 5505 </doc> 5506 5507 <extra> 5508 <spec> 5509 function Lookup_Icon_Set 5510 (Style : access Gtk.Style_Context.Gtk_Style_Context_Record'Class; 5511 Stock_Id : String) 5512 return Gtk_Icon_Set; 5513 -- Retrieve an icon set by its name. The icon might exist in various sizes, 5514 -- that can be manipulated through the result set 5515 </spec> 5516 <body> 5517 function Lookup_Icon_Set 5518 (Style : access Gtk.Style_Context.Gtk_Style_Context_Record'Class; 5519 Stock_Id : String) 5520 return Gtk_Icon_Set 5521 is 5522 function Internal 5523 (Style : System.Address; 5524 Stock_Id : String) 5525 return System.Address; 5526 pragma Import (C, Internal, "gtk_style_context_lookup_icon_set"); 5527 begin 5528 return From_Object (Internal (Get_Object (Style), Stock_Id & ASCII.NUL)); 5529 end Lookup_Icon_Set; 5530 </body> 5531 </extra> 5532 5533 <method id="gtk_icon_set_get_sizes" return="Gint_Array"> 5534 <parameter name="n_sizes" ada=""/> 5535 <parameter name="sizes" ada=""/> 5536 <body> 5537 type gint_array_bounded is array (Natural) of Gint; 5538 5539 procedure Internal 5540 (Self : System.Address; 5541 Sizes : System.Address; 5542 Acc_N_Sizes : access Gint); 5543 pragma Import (C, Internal, "gtk_icon_set_get_sizes"); 5544 5545 procedure g_free (s : access gint_array_bounded); 5546 pragma Import (C, g_free, "g_free"); 5547 5548 Sizes : aliased access gint_array_bounded; 5549 Size : aliased Gint; 5550 begin 5551 Internal (Self.Get_Object, Sizes'Address, Size'Access); 5552 5553 declare 5554 Result : Gint_Array (1 .. Integer (Size)); 5555 begin 5556 for R in 0 .. Integer (Size) - 1 loop 5557 Result (R + 1) := Sizes (R); 5558 end loop; 5559 g_free (Sizes); 5560 5561 return Result; 5562 end; 5563 </body> 5564 </method> 5565 </package> 5566 5567 <package id="GtkIconSource"> 5568 <doc> 5569An icon source contains a Gdk_Pixbuf (or image filename) that serves as 5570the base image for one or more of the icons in an icon set, along with a 5571specification for which icons in the icon set will be based on that 5572pixbuf or image file. An icon set contains a set of icons that represent 5573"the same" logical concept in different states, different global text 5574directions, and different sizes. 5575 5576So for example a web browser's "Back to Previous Page" icon might point 5577in a different direction in Hebrew and in English; it might look 5578different when insensitive; and it might change size depending on 5579toolbar mode (small/large icons). So a single icon set would contain all 5580those variants of the icon. An icon set contains a list of icon sources 5581from which it can derive specific icon variants in the set. 5582 5583In the simplest case, an icon set contains one source pixbuf from which 5584it derives all variants. 5585 5586If you want to use a different base pixbuf for different icon variants, 5587you create multiple icon sources, mark which variants they'll be used to 5588create, and add them to the icon set with Add_Source (see below). 5589 5590By default, the icon source has all parameters wildcarded. That is, the 5591icon source will be used as the base icon for any desired text 5592direction, widget state, or icon size. 5593 </doc> 5594 </package> 5595 5596 <package id="GtkIconFactory"> 5597 5598 <function id="gtk_icon_size_lookup" return_as_param="Result" /> 5599 <function id="gtk_icon_size_lookup_for_settings" return_as_param="Result" /> 5600 <function id="gtk_icon_size_register" /> 5601 <function id="gtk_icon_size_register_alias" /> 5602 5603 <extra> 5604 <with_spec pkg="Gtk.Style_Provider"/> 5605 <with_spec pkg="Gtk.Widget"/> 5606 <spec> 5607 function Get_Icon_Factory 5608 (Self : Gtk.Style_Provider.Gtk_Style_Provider; 5609 Path : Gtk.Widget.Gtk_Widget_Path) 5610 return Gtk_Icon_Factory; 5611 -- Returns the Gtk.Icon_Factory.Gtk_Icon_Factory defined to be in use for 5612 -- Path, or null if none is defined. 5613 -- Since: gtk+ 3.0 5614 </spec> 5615 <body> 5616 function Get_Icon_Factory 5617 (Self : Gtk_Style_Provider; 5618 Path : Gtk.Widget.Gtk_Widget_Path) 5619 return Gtk.Icon_Factory.Gtk_Icon_Factory 5620 is 5621 function Internal 5622 (Self : Gtk_Style_Provider; 5623 Path : Gtk.Widget.Gtk_Widget_Path) return System.Address; 5624 pragma Import (C, Internal, "gtk_style_provider_get_icon_factory"); 5625 Stub_Gtk_Icon_Factory : Gtk.Icon_Factory.Gtk_Icon_Factory_Record; 5626 begin 5627 return Gtk.Icon_Factory.Gtk_Icon_Factory (Get_User_Data (Internal (Self, Path), Stub_Gtk_Icon_Factory)); 5628 end Get_Icon_Factory; 5629 </body> 5630 </extra> 5631 </package> 5632 5633 <package id="GtkIconTheme"> 5634 <parameter name="self" ada="Icon_Theme" /> 5635 <enum ctype="GtkIconLookupFlags" prefix="GTK_"/> 5636 <method id="gtk_icon_theme_lookup_by_gicon" classwide="true" /> 5637 <method id="gtk_icon_theme_lookup_icon" classwide="true" /> 5638 <method id="gtk_icon_theme_choose_icon" classwide="true" /> 5639 <method id="gtk_icon_theme_set_search_path"> 5640 <parameter name="n_elements" ada="" default="Path'Length"/> 5641 </method> 5642 <method id="gtk_icon_theme_get_search_path" return="GNAT.Strings.String_List"> 5643 <parameter name="path" ada=""/> 5644 <parameter name="n_elements" ada=""/> 5645 <body> 5646 procedure Internal 5647 (Icon_Theme : System.Address; 5648 Path : out chars_ptr_array_access; 5649 N_Elements : out Gint); 5650 pragma Import (C, Internal, "gtk_icon_theme_get_search_path"); 5651 5652 P : chars_ptr_array_access; 5653 N : Gint; 5654 begin 5655 Internal (Get_Object (Icon_Theme), P, N); 5656 declare 5657 Result : constant GNAT.Strings.String_List := 5658 To_String_List (P.all, N); 5659 begin 5660 Free (P.all); 5661 return Result; 5662 end; 5663 </body> 5664 </method> 5665 <method id="gtk_icon_theme_get_icon_sizes"> 5666 <body> 5667 use Gint_Arrays; 5668 function Internal 5669 (Icon_Theme : System.Address; 5670 Icon_Name : String) return Unbounded_Array_Access; 5671 pragma Import (C, Internal, "gtk_icon_theme_get_icon_sizes"); 5672 5673 Res : constant Unbounded_Array_Access := Internal 5674 (Get_Object (Icon_Theme), Icon_Name & ASCII.NUL); 5675 Result : constant Gint_Array := To_Gint_Array_Zero_Terminated (Res); 5676 begin 5677 G_Free (Res); 5678 return Result; 5679 </body> 5680 </method> 5681 <method id="gtk_icon_theme_list_icons" return="StringList"/> 5682 <method id="gtk_icon_theme_list_contexts" return="StringList"/> 5683 <extra> 5684 <with_body pkg="Gtkada.Bindings"/> 5685 </extra> 5686 </package> 5687 5688 <package id="GtkIconInfo" into="GtkIconTheme"> 5689 <parameter name="self" ada="Icon_Info" /> 5690 <method id="gtk_icon_info_get_type" ada="Icon_Info_Get_Type"/> 5691 <method id="gtk_icon_info_load_icon_async" bind="False"/> <!-- requires GAsync --> 5692 <method id="gtk_icon_info_load_symbolic_async" bind="False"/> <!-- requires GAsync --> 5693 <method id="gtk_icon_info_load_icon_finish" bind="False"/> <!-- requires GAsync --> 5694 <method id="gtk_icon_info_load_symbolic_finish" bind="False"/> <!-- requires GAsync --> 5695 <method id="gtk_icon_info_load_symbolic_for_context_async" bind="False"/> <!-- requires GAsync --> 5696 <method id="gtk_icon_info_load_symbolic_for_context_finish" bind="False"/> <!-- requires GAsync --> 5697 <method id="gtk_icon_info_get_embedded_rect" return_as_param="Has_Embedded_Rectangle"/> 5698 <method id="gtk_icon_info_get_attach_points" return="Gdk.Types.Gdk_Points_Array"> 5699 <parameter name="n_points" ada=""/> 5700 <parameter name="points" ada=""/> 5701 <body> 5702 use Points_Arrays; 5703 function Internal 5704 (Icon_Info : System.Address; 5705 Result : access Unbounded_Array_Access; 5706 N_Points : access Gint) return Gboolean; 5707 pragma Import (C, Internal, "gtk_icon_info_get_attach_points"); 5708 5709 R : aliased Unbounded_Array_Access; 5710 N : aliased Gint; 5711 begin 5712 if Internal (Icon_Info.Get_Object, R'Unchecked_Access, 5713 N'Unchecked_Access) = 0 5714 then 5715 R := null; 5716 end if; 5717 5718 declare 5719 Result : constant Gdk_Points_Array := To_Array (R, Integer (N)); 5720 begin 5721 G_Free (R); 5722 return Result; 5723 end; 5724 </body> 5725 </method> 5726 <extra> 5727 <with_body pkg="Gtkada.C"/> 5728 <body> 5729 package Points_Arrays is new Gtkada.C.Unbounded_Arrays 5730 (Gdk.Types.Gdk_Point, (0, 0), Positive, Gdk.Types.Gdk_Points_Array); 5731 </body> 5732 </extra> 5733 </package> 5734 5735 <package id="GtkSettings"> 5736 <method id="gtk_settings_install_property_parser" bind="False"/> <!-- not needed in Ada --> 5737 <method id="gtk_settings_set_property_value" bind="False"/> <!-- see below --> 5738 <extra> 5739 <spec> 5740 procedure Set_Property_Value 5741 (Settings : not null access Gtk_Settings_Record; 5742 Name : String; 5743 Value : GValue; 5744 Origin : String); 5745 5746 function Get_Settings 5747 (Widget : not null access Gtk_Widget_Record'Class) 5748 return Gtk_Settings; 5749 -- Get the settings object holding the settings used for this widget. 5750 -- 5751 -- Note that this function can only be called when the widget is 5752 -- attached to a toplevel, since the settings object is specific to a 5753 -- particular Gdk.Screen.Gdk_Screen. 5754 </spec> 5755 <body> 5756 function Get_Settings 5757 (Widget : not null access Gtk_Widget_Record'Class) 5758 return Gtk_Settings 5759 is 5760 function Internal (W : System.Address) return System.Address; 5761 pragma Import (C, Internal, "gtk_widget_get_settings"); 5762 Stub : Gtk_Settings_Record; 5763 begin 5764 return Gtk_Settings (Get_User_Data (Internal (Get_Object (Widget)), Stub)); 5765 end Get_Settings; 5766 5767 procedure Set_Property_Value 5768 (Settings : not null access Gtk_Settings_Record; 5769 Name : String; 5770 Value : GValue; 5771 Origin : String) 5772 is 5773 type Property_Value is record 5774 Origin : Interfaces.C.Strings.chars_ptr; 5775 Value : GValue; 5776 end record; 5777 pragma Convention (C, Property_Value); 5778 5779 procedure Internal 5780 (Settings : System.Address; 5781 Name : String; 5782 Svalue : System.Address); 5783 pragma Import (C, Internal, "gtk_settings_set_property_value"); 5784 5785 Val : aliased Property_Value := 5786 (Origin => New_String (Origin), 5787 Value => Value); 5788 begin 5789 Internal (Get_Object (Settings), Name & ASCII.NUL, Val'Address); 5790 Free (Val.Origin); 5791 end Set_Property_Value; 5792 </body> 5793 </extra> 5794 </package> 5795 5796 <package id="GtkBorder" into="GtkStyle"> 5797 <record ctype="GtkBorder"/> 5798 <method id="gtk_border_copy" bind="False" /> <!-- not needed in Ada --> 5799 <method id="gtk_border_free" bind="False" /> <!-- not needed in Ada --> 5800 <method id="gtk_border_get_type" ada="Border_Get_Type"/> 5801 </package> 5802 5803 <package id="GtkStockItem" ada="Gtk.Stock"> 5804 <record ctype="GtkStockItem" private="True"/> 5805 <constant prefix_regexp="GTK_STOCK_.*" prefix="GTK_"/> 5806 <function id="gtk_stock_add" ada="Add"> 5807 <parameter name="items" type="Gtk_Stock_Item_Array"/> 5808 <parameter name="n_items" ada="" default="Items'Length"/> 5809 </function> 5810 <function id="gtk_stock_add_static" ada="Add_Static"> 5811 <parameter name="items" type="Gtk_Stock_Item_Array"/> 5812 <parameter name="n_items" ada="" default="Items'Length"/> 5813 </function> 5814 <function id="gtk_stock_lookup" ada="Lookup" return_as_param="Success"/> 5815 <method id="gtk_stock_item_free" bind="False" /> <!-- see below --> 5816 <extra> 5817 <type ada="Gtk_Stock_Item_Array" ctype="GtkStockItemArray"> 5818 type Gtk_Stock_Item_Array is array (Natural range <>) of Gtk_Stock_Item; 5819 </type> 5820 <spec> 5821 procedure Gtk_New 5822 (Item : out Gtk_Stock_Item; 5823 Stock_Id : String; 5824 Label : UTF8_String; 5825 Modifier : Gdk.Types.Gdk_Modifier_Type; 5826 Keyval : Gdk.Types.Gdk_Key_Type; 5827 Translation_Domain : String); 5828 -- Create a new stock item. 5829 5830 procedure Free (Item : in out Gtk_Stock_Item); 5831 -- Free memory allocated in Item. 5832 5833 procedure Add (Item : Gtk_Stock_Item); 5834 -- Register Item. 5835 -- If an item already exists with the same stock ID as one of the items, 5836 -- the old item gets replaced. The stock item is copied, so GtkAda does 5837 -- not hold any pointer into item and item can be freed. Use 5838 -- Add_Static if item is persistent and GtkAda need not copy the array. 5839 </spec> 5840 <with_body pkg="Interfaces.C.Strings" /> 5841 <body> 5842 procedure Gtk_New 5843 (Item : out Gtk_Stock_Item; 5844 Stock_Id : String; 5845 Label : UTF8_String; 5846 Modifier : Gdk.Types.Gdk_Modifier_Type; 5847 Keyval : Gdk.Types.Gdk_Key_Type; 5848 Translation_Domain : String) is 5849 begin 5850 Item.Stock_Id := Interfaces.C.Strings.New_String (Stock_Id); 5851 Item.Label := Interfaces.C.Strings.New_String (Label); 5852 Item.Modifier := Modifier; 5853 Item.Keyval := Guint (Keyval); 5854 Item.Translation_Domain := Interfaces.C.Strings.New_String (Translation_Domain); 5855 end Gtk_New; 5856 5857 procedure Free (Item : in out Gtk_Stock_Item) is 5858 begin 5859 Interfaces.C.Strings.Free (Item.Stock_Id); 5860 Interfaces.C.Strings.Free (Item.Label); 5861 Interfaces.C.Strings.Free (Item.Translation_Domain); 5862 end Free; 5863 5864 --------- 5865 -- Add -- 5866 --------- 5867 5868 procedure Add (Item : Gtk_Stock_Item) is 5869 procedure Internal (Item : Gtk_Stock_Item; N_Items : Guint := 1); 5870 pragma Import (C, Internal, "gtk_stock_add"); 5871 5872 begin 5873 Internal (Item); 5874 end Add; 5875 </body> 5876 </extra> 5877 </package> 5878 5879 <package id="GtkTextIter"> 5880 <parameter name="self" ada="Iter"/> 5881 <record ctype="GtkTextIter" private="True"/> 5882 <enum ctype="GtkTextSearchFlags" prefix="GTK_TEXT_SEARCH_"/> 5883 5884 <method id="gtk_text_iter_get_buffer" bind="False"/> <!-- circular dependency --> 5885 <method id="gtk_text_iter_get_child_anchor" bind="False"/> <!-- circular dependency --> 5886 <method id="gtk_text_iter_copy" bind="False"/> <!-- manual binding below --> 5887 <method id="gtk_text_iter_get_marks" return="ObjectSList" /> 5888 <method id="gtk_text_iter_get_tags" return="TextTagList" /> 5889 <method id="gtk_text_iter_get_toggled_tags" return="TextTagList" /> 5890 5891 <method id="gtk_text_iter_forward_char" return_as_param="Result"> 5892 <parameter name="self" ada="Iter" direction="inout"/> 5893 </method> 5894 <method id="gtk_text_iter_forward_chars" return_as_param="Result"> 5895 <parameter name="self" ada="Iter" direction="inout"/> 5896 </method> 5897 <method id="gtk_text_iter_backward_char" return_as_param="Result"> 5898 <parameter name="self" ada="Iter" direction="inout"/> 5899 </method> 5900 <method id="gtk_text_iter_backward_chars" return_as_param="Result"> 5901 <parameter name="self" ada="Iter" direction="inout"/> 5902 </method> 5903 <method id="gtk_text_iter_forward_word_end" return_as_param="Result"> 5904 <parameter name="self" ada="Iter" direction="inout"/> 5905 </method> 5906 <method id="gtk_text_iter_forward_word_ends" return_as_param="Result"> 5907 <parameter name="self" ada="Iter" direction="inout"/> 5908 </method> 5909 <method id="gtk_text_iter_forward_visible_word_end" return_as_param="Result"> 5910 <parameter name="self" ada="Iter" direction="inout"/> 5911 </method> 5912 <method id="gtk_text_iter_forward_visible_word_ends" return_as_param="Result"> 5913 <parameter name="self" ada="Iter" direction="inout"/> 5914 </method> 5915 <method id="gtk_text_iter_backward_word_start" return_as_param="Result"> 5916 <parameter name="self" ada="Iter" direction="inout"/> 5917 </method> 5918 <method id="gtk_text_iter_backward_word_starts" return_as_param="Result"> 5919 <parameter name="self" ada="Iter" direction="inout"/> 5920 </method> 5921 <method id="gtk_text_iter_backward_visible_word_start" return_as_param="Result"> 5922 <parameter name="self" ada="Iter" direction="inout"/> 5923 </method> 5924 <method id="gtk_text_iter_backward_visible_word_starts" return_as_param="Result"> 5925 <parameter name="self" ada="Iter" direction="inout"/> 5926 </method> 5927 <method id="gtk_text_iter_forward_sentence_end" return_as_param="Result"> 5928 <parameter name="self" ada="Iter" direction="inout"/> 5929 </method> 5930 <method id="gtk_text_iter_forward_sentence_ends" return_as_param="Result"> 5931 <parameter name="self" ada="Iter" direction="inout"/> 5932 </method> 5933 <method id="gtk_text_iter_backward_sentence_start" return_as_param="Result"> 5934 <parameter name="self" ada="Iter" direction="inout"/> 5935 </method> 5936 <method id="gtk_text_iter_backward_sentence_starts" return_as_param="Result"> 5937 <parameter name="self" ada="Iter" direction="inout"/> 5938 </method> 5939 5940 <method id="gtk_text_iter_set_offset"> 5941 <parameter name="self" ada="Iter" direction="inout"/> 5942 </method> 5943 <method id="gtk_text_iter_set_line"> 5944 <parameter name="self" ada="Iter" direction="inout"/> 5945 </method> 5946 <method id="gtk_text_iter_set_line_offset"> 5947 <parameter name="self" ada="Iter" direction="inout"/> 5948 </method> 5949 <method id="gtk_text_iter_set_line_index"> 5950 <parameter name="self" ada="Iter" direction="inout"/> 5951 </method> 5952 <method id="gtk_text_iter_set_visible_line_offset"> 5953 <parameter name="self" ada="Iter" direction="inout"/> 5954 </method> 5955 <method id="gtk_text_iter_set_visible_line_index"> 5956 <parameter name="self" ada="Iter" direction="inout"/> 5957 </method> 5958 5959 <method id="gtk_text_iter_forward_line" return_as_param="Result"> 5960 <parameter name="self" ada="Iter" direction="inout"/> 5961 </method> 5962 <method id="gtk_text_iter_forward_lines" return_as_param="Result"> 5963 <parameter name="self" ada="Iter" direction="inout"/> 5964 </method> 5965 <method id="gtk_text_iter_forward_visible_line" return_as_param="Result"> 5966 <parameter name="self" ada="Iter" direction="inout"/> 5967 </method> 5968 <method id="gtk_text_iter_forward_visible_lines" return_as_param="Result"> 5969 <parameter name="self" ada="Iter" direction="inout"/> 5970 </method> 5971 <method id="gtk_text_iter_forward_to_line_end" return_as_param="Result"> 5972 <parameter name="self" ada="Iter" direction="inout"/> 5973 </method> 5974 5975 <method id="gtk_text_iter_backward_line" return_as_param="Result"> 5976 <parameter name="self" ada="Iter" direction="inout"/> 5977 </method> 5978 <method id="gtk_text_iter_backward_lines" return_as_param="Result"> 5979 <parameter name="self" ada="Iter" direction="inout"/> 5980 </method> 5981 <method id="gtk_text_iter_backward_visible_line" return_as_param="Result"> 5982 <parameter name="self" ada="Iter" direction="inout"/> 5983 </method> 5984 <method id="gtk_text_iter_backward_visible_lines" return_as_param="Result"> 5985 <parameter name="self" ada="Iter" direction="inout"/> 5986 </method> 5987 5988 <method id="gtk_text_iter_forward_to_end"> 5989 <parameter name="self" ada="Iter" direction="inout"/> 5990 </method> 5991 5992 <method id="gtk_text_iter_forward_to_tag_toggle" return_as_param="Result"> 5993 <parameter name="self" ada="Iter" direction="inout"/> 5994 <parameter name="tag" default="null"/> 5995 </method> 5996 <method id="gtk_text_iter_backward_to_tag_toggle" return_as_param="Result"> 5997 <parameter name="self" ada="Iter" direction="inout"/> 5998 <parameter name="tag" default="null"/> 5999 </method> 6000 6001 <method id="gtk_text_iter_forward_cursor_position" return_as_param="Result"> 6002 <parameter name="self" ada="Iter" direction="inout"/> 6003 </method> 6004 <method id="gtk_text_iter_forward_cursor_positions" return_as_param="Result"> 6005 <parameter name="self" ada="Iter" direction="inout"/> 6006 </method> 6007 <method id="gtk_text_iter_backward_cursor_position" return_as_param="Result"> 6008 <parameter name="self" ada="Iter" direction="inout"/> 6009 </method> 6010 <method id="gtk_text_iter_backward_cursor_positions" return_as_param="Result"> 6011 <parameter name="self" ada="Iter" direction="inout"/> 6012 </method> 6013 <method id="gtk_text_iter_forward_visible_cursor_position" return_as_param="Result"> 6014 <parameter name="self" ada="Iter" direction="inout"/> 6015 </method> 6016 <method id="gtk_text_iter_forward_visible_cursor_positions" return_as_param="Result"> 6017 <parameter name="self" ada="Iter" direction="inout"/> 6018 </method> 6019 <method id="gtk_text_iter_backward_visible_cursor_position" return_as_param="Result"> 6020 <parameter name="self" ada="Iter" direction="inout"/> 6021 </method> 6022 <method id="gtk_text_iter_backward_visible_cursor_positions" return_as_param="Result"> 6023 <parameter name="self" ada="Iter" direction="inout"/> 6024 </method> 6025 6026 <method id="gtk_text_iter_forward_search" return_as_param="Result"> 6027 <parameter name="self" ada="Iter" direction="inout"/> 6028 <parameter name="limit" default="Null_Text_Iter"/> 6029 </method> 6030 <method id="gtk_text_iter_backward_search" return_as_param="Result"> 6031 <parameter name="self" ada="Iter" direction="inout"/> 6032 <parameter name="limit" default="Null_Text_Iter"/> 6033 </method> 6034 <method id="gtk_text_iter_forward_find_char" return_as_param="Result" 6035 bind="false"> <!-- Need func with callback and return_as_param --> 6036 <parameter name="self" ada="Iter" direction="inout"/> 6037 </method> 6038 <method id="gtk_text_iter_backward_find_char" return_as_param="Result" 6039 bind="false"> <!-- Need func with callback and return_as_param --> 6040 <parameter name="self" ada="Iter" direction="inout"/> 6041 </method> 6042 <extra> 6043 <with_spec pkg="Glib.Values"/> 6044 <with_spec pkg="Interfaces.C.Strings"/> 6045 <with_body pkg="Ada.Unchecked_Conversion" use="False"/> 6046 <with_body pkg="System.Address_To_Access_Conversions" use="False"/> 6047 <type> 6048 Null_Text_Iter : constant Gtk_Text_Iter; 6049 </type> 6050 <spec private="True"> 6051 Null_Text_Iter : constant Gtk_Text_Iter := 6052 (System.Null_Address, System.Null_Address, 0, 0, 0, 0, 0, 0, 6053 System.Null_Address, System.Null_Address, 0, 0, 0, 6054 System.Null_Address); 6055 </spec> 6056 <spec> 6057 procedure Copy (Source : Gtk_Text_Iter; Dest : out Gtk_Text_Iter); 6058 pragma Inline (Copy); 6059 -- Create a copy of Source. 6060 6061 function Get_Char (Iter : Gtk_Text_Iter) return Character; 6062 -- Return the character immediately following Iter. If Iter is at the 6063 -- end of the buffer, then return ASCII.NUL. 6064 -- Note that this function assumes that the text is encoded in ASCII 6065 -- format. If this is not the case, use the Get_Char function that 6066 -- returns a Gunichar instead. 6067 6068 function Iter_Or_Null (Iter : System.Address) return System.Address; 6069 -- Internal function for GtkAda 6070 6071 ------------------------------- 6072 -- Converting to/from GValue -- 6073 ------------------------------- 6074 6075 procedure Set_Text_Iter 6076 (Val : in out Glib.Values.GValue; 6077 Iter : Gtk_Text_Iter); 6078 pragma Import (C, Set_Text_Iter, "g_value_set_pointer"); 6079 -- Set the value of the given GValue to Iter. 6080 -- Note that Iter is stored by reference, which means no copy of Iter 6081 -- is made. Iter should remain allocated as long as Val is being used. 6082 6083 procedure Get_Text_Iter 6084 (Val : Glib.Values.GValue; 6085 Iter : out Gtk_Text_Iter); 6086 -- Extract the iterator from the given GValue. 6087 -- Note that the iterator returned is a copy of the iterator referenced 6088 -- by the give GValue. Modifying the iterator returned does not modify 6089 -- the iterator referenced by the GValue. 6090 6091 function Get_Slice 6092 (Start : Gtk_Text_Iter; 6093 The_End : Gtk_Text_Iter) return Interfaces.C.Strings.chars_ptr; 6094 -- Same as Get_Slice above, but returns the raw C string. 6095 -- The caller is responsible for freeing the string returned. 6096 6097 </spec> 6098 <body> 6099 6100 type Gtk_Text_Iter_Access is access Gtk_Text_Iter; 6101 function Convert is new Ada.Unchecked_Conversion 6102 (System.Address, Gtk_Text_Iter_Access); 6103 use type System.Address; 6104 6105 ------------------ 6106 -- Iter_Or_Null -- 6107 ------------------ 6108 6109 function Iter_Or_Null (Iter : System.Address) return System.Address is 6110 begin 6111 if Convert (Iter).all = Null_Text_Iter then-- null iter 6112 return System.Null_Address; 6113 else 6114 return Iter; 6115 end if; 6116 end Iter_Or_Null; 6117 6118 ---------- 6119 -- Copy -- 6120 ---------- 6121 6122 procedure Copy (Source : Gtk_Text_Iter; Dest : out Gtk_Text_Iter) is 6123 begin 6124 Dest := Source; 6125 end Copy; 6126 6127 -------------- 6128 -- Get_Char -- 6129 -------------- 6130 6131 function Get_Char (Iter : Gtk_Text_Iter) return Character is 6132 Result : constant Gunichar := Get_Char (Iter); 6133 Eight_LSB_Mask : constant := 2#1111_1111#; 6134 6135 begin 6136 -- This function relies on the Get_Char function provided by gtk+, 6137 -- which returns a gunichar value. Only the 8 least significant bits 6138 -- are then kept to deduce the associated character. 6139 6140 return Character'Val (Result and Eight_LSB_Mask); 6141 end Get_Char; 6142 6143 ------------------- 6144 -- Get_Text_Iter -- 6145 ------------------- 6146 6147 package Iter_Access_Address_Conversions is 6148 new System.Address_To_Access_Conversions (Gtk_Text_Iter); 6149 6150 procedure Get_Text_Iter 6151 (Val : Glib.Values.GValue; 6152 Iter : out Gtk_Text_Iter) is 6153 begin 6154 Copy 6155 (Source => Iter_Access_Address_Conversions.To_Pointer 6156 (Glib.Values.Get_Address (Val)).all, 6157 Dest => Iter); 6158 end Get_Text_Iter; 6159 6160 --------------- 6161 -- Get_Slice -- 6162 --------------- 6163 6164 function Get_Slice 6165 (Start : Gtk_Text_Iter; 6166 The_End : Gtk_Text_Iter) return Interfaces.C.Strings.chars_ptr 6167 is 6168 function Internal 6169 (Start : Gtk_Text_Iter; 6170 The_End : Gtk_Text_Iter) return Interfaces.C.Strings.chars_ptr; 6171 pragma Import (C, Internal, "gtk_text_iter_get_slice"); 6172 6173 begin 6174 return Internal (Start, The_End); 6175 end Get_Slice; 6176 </body> 6177 </extra> 6178 </package> 6179 6180 <package id="GIcon" ada="Glib.G_Icon"> 6181 <virtual-method id='*' bind='False'/> 6182 <method id="g_icon_hash"> 6183 <parameter name="icon" type="G_Icon"/> 6184 </method> 6185 </package> 6186 6187 <package id="GtkToolPalette"> 6188 <enum ctype="GtkDestDefaults"/> 6189 <enum ctype="GtkToolPaletteDragTargets"/> 6190 <method id="gtk_tool_palette_get_hadjustment" bind="False"/> <!-- obsolete, use interface--> 6191 <method id="gtk_tool_palette_get_vadjustment" bind="False"/> <!-- obsolete, use interface--> 6192 </package> 6193 6194 <package id="PangoFont"> 6195 <parameter name="self" ada="Font" /> 6196 6197 <method id="pango_font_get_type" ada="Font_Get_Type"/> 6198 <method id="pango_font_find_shaper" bind="False"/> <!-- internal implementation of gtk --> 6199 <method id="pango_font_describe" classwide="True"/> 6200 <method id="pango_font_describe_with_absolute_size" classwide="True"/> 6201 <method id="pango_font_descriptions_free" bind="False"/> <!-- in Ada, need iteration --> 6202 <method id="pango_font_get_coverage" bind="False"/> <!-- circular dependency --> 6203 <method id="pango_font_get_font_map" bind="False"/> <!-- circular dependency --> 6204 <method id="pango_font_get_metrics"> 6205 <parameter name="language" default="Pango.Language.Null_Pango_Language"/> 6206 </method> 6207 </package> 6208 6209 <package id="PangoMatrix"> 6210 <record ctype="PangoMatrix"/> 6211 <method id="pango_matrix_rotate"> 6212 <parameter name="self" direction="inout"/> 6213 </method> 6214 <method id="pango_matrix_scale"> 6215 <parameter name="self" direction="inout"/> 6216 </method> 6217 <method id="pango_matrix_translate"> 6218 <parameter name="self" direction="inout"/> 6219 </method> 6220 </package> 6221 6222 <package id="PangoCoverage"> 6223 <method id="pango_coverage_new" ada="Pango_New"/> 6224 <method id="pango_coverage_from_bytes" bind="False"/> <!-- not used for Ada --> 6225 <method id="pango_coverage_to_bytes" bind="False"/> <!-- not used for Ada --> 6226 </package> 6227 6228 <package id="PangoTabArray" ada="Pango.Tabs"> 6229 <enum ctype="PangoTabAlign"/> 6230 <method id="pango_tab_array_get_tabs" bind="False"/> <!-- Require manual binding --> 6231 </package> 6232 6233 <package id="PangoAttribute" ada="Pango.Attributes"> 6234 <method id="pango_attribute_init" bind="False"/> <!-- low-level --> 6235 <function id="pango_attr_underline_new"/> 6236 <function id="pango_attr_background_new"/> 6237 <function id="pango_attr_foreground_new"/> 6238 <function id="pango_attr_family_new"/> 6239 <function id="pango_attr_strikethrough_new"/> 6240 <function id="pango_attr_variant_new"/> 6241 <function id="pango_attr_weight_new"/> 6242 <function id="pango_attr_stretch_new"/> 6243 <function id="pango_attr_scale_new"/> 6244 <function id="pango_attr_rise_new"/> 6245 <function id="pango_attr_gravity_new"/> 6246 </package> 6247 6248 <package id="PangoAttrList" into="PangoAttribute"> 6249 <method id="pango_attr_list_get_iterator" bind="False"/> <!-- Not needed ? --> 6250 </package> 6251 6252 <package id="PangoContext"> 6253 <method id="pango_context_get_font_map" bind="False" /> <!-- circular dep --> 6254 <method id="pango_context_set_font_map" bind="False" /> <!-- circular dep --> 6255 <extra> 6256 <with_spec pkg="Pango.Font_Family"/> 6257 </extra> 6258 <method id="pango_context_list_families" return="Pango_Font_Family_Array"> 6259 <parameter name="families" ada=""/> 6260 <parameter name="n_families" ada=""/> 6261 <body> 6262 type font_family_array_bounded is array (Natural) of System.Address; 6263 6264 procedure Internal 6265 (Self : System.Address; 6266 Families : System.Address; 6267 Size : access Gint); 6268 pragma Import (C, Internal, "pango_context_list_families"); 6269 6270 procedure g_free (s : access font_family_array_bounded); 6271 pragma Import (C, g_free, "g_free"); 6272 6273 Families : aliased access font_family_array_bounded; 6274 Size : aliased Gint; 6275 Tmplt : Pango_Font_Family_Record; 6276 begin 6277 Internal (Get_Object (Self), Families'Address, Size'Access); 6278 6279 declare 6280 Result : Pango_Font_Family_Array (1 .. Integer (Size)); 6281 begin 6282 for R in 0 .. Integer (Size) - 1 loop 6283 Result (R + 1) := Pango_Font_Family 6284 (Get_User_Data (Families (R), Tmplt)); 6285 end loop; 6286 g_free (Families); 6287 6288 return Result; 6289 end; 6290 </body> 6291 </method> 6292 </package> 6293 6294 <package id="PangoFontDescription" into="PangoFont"> 6295 <method id="pango_font_description_free" bind="False" /> <!-- manual binding below --> 6296 <extra> 6297 <with_spec pkg="Glib.Generic_Properties"/> 6298 <spec> 6299 function To_Font_Description 6300 (Family_Name : String := ""; 6301 Style : Pango.Enums.Style := Pango.Enums.Pango_Style_Normal; 6302 Variant : Pango.Enums.Variant := Pango.Enums.Pango_Variant_Normal; 6303 Weight : Pango.Enums.Weight := Pango.Enums.Pango_Weight_Normal; 6304 Stretch : Pango.Enums.Stretch := Pango.Enums.Pango_Stretch_Normal; 6305 Size : Gint := 0) return Pango_Font_Description; 6306 -- Create a new font decription from the given parameters. 6307 6308 function To_Address 6309 (F : Pango_Font_Description; Add : System.Address) return System.Address; 6310 package Desc_Properties is new Generic_Internal_Boxed_Property 6311 (Pango_Font_Description, Get_Type, To_Address); 6312 type Property_Font_Description is new Desc_Properties.Property; 6313 6314 procedure Free (Desc : in out Pango_Font_Description); 6315 -- Deallocate the given font description. 6316 </spec> 6317 <body> 6318 subtype String7 is String (1 .. 7); 6319 Style_Map : constant array (Enums.Style) of String7 := 6320 (Enums.Pango_Style_Normal => " ", 6321 Enums.Pango_Style_Oblique => "Oblique", 6322 Enums.Pango_Style_Italic => "Italic "); 6323 6324 subtype String10 is String (1 .. 10); 6325 Variant_Map : constant array (Enums.Variant) of String10 := 6326 (Enums.Pango_Variant_Normal => " ", 6327 Enums.Pango_Variant_Small_Caps => "Small-Caps"); 6328 6329 subtype String15 is String (1 .. 15); 6330 Stretch_Map : constant array (Enums.Stretch) of String15 := 6331 (Enums.Pango_Stretch_Ultra_Condensed => "Ultra-Condensed", 6332 Enums.Pango_Stretch_Extra_Condensed => "Extra-Condensed", 6333 Enums.Pango_Stretch_Condensed => "Condensed ", 6334 Enums.Pango_Stretch_Semi_Condensed => "Semi-Condensed ", 6335 Enums.Pango_Stretch_Normal => " ", 6336 Enums.Pango_Stretch_Semi_Expanded => "Semi-Expanded ", 6337 Enums.Pango_Stretch_Expanded => "Expanded ", 6338 Enums.Pango_Stretch_Extra_Expanded => "Extra-Expanded ", 6339 Enums.Pango_Stretch_Ultra_Expanded => "Ultra-Expanded "); 6340 6341 -- Some of the values are not directly supported by pango. 6342 -- ??? See fonts.c in pango 6343 6344 Weight_Map : constant array (Enums.Weight) of String10 := 6345 (Enums.Pango_Weight_Ultralight => "Light ", 6346 Enums.Pango_Weight_Thin => "Thin ", 6347 Enums.Pango_Weight_Light => "Light ", 6348 Enums.Pango_Weight_Normal => " ", 6349 Enums.Pango_Weight_Book => "Book ", 6350 Enums.Pango_Weight_Medium => "Medium ", 6351 Enums.Pango_Weight_Semibold => "Semi-Bold ", 6352 Enums.Pango_Weight_Bold => "Bold ", 6353 Enums.Pango_Weight_Semilight => "Semi-Light", 6354 Enums.Pango_Weight_Ultrabold => "Bold ", 6355 Enums.Pango_Weight_Ultraheavy => "Ultraheavy", 6356 Enums.Pango_Weight_Heavy => "Heavy "); 6357 6358 function To_Font_Description 6359 (Family_Name : String := ""; 6360 Style : Enums.Style := Enums.Pango_Style_Normal; 6361 Variant : Enums.Variant := Enums.Pango_Variant_Normal; 6362 Weight : Enums.Weight := Enums.Pango_Weight_Normal; 6363 Stretch : Enums.Stretch := Enums.Pango_Stretch_Normal; 6364 Size : Gint := 0) return Pango_Font_Description 6365 is 6366 begin 6367 return From_String (Family_Name & " " & 6368 Style_Map (Style) & " " & 6369 Variant_Map (Variant) & 6370 Weight_Map (Weight) & " " & 6371 Stretch_Map (Stretch) & Gint'Image (Size)); 6372 end To_Font_Description; 6373 6374 function To_Address 6375 (F : Pango_Font_Description; Add : System.Address) 6376 return System.Address 6377 is 6378 pragma Unreferenced (Add); 6379 begin 6380 return F.all'Address; 6381 end To_Address; 6382 6383 ---------- 6384 -- Free -- 6385 ---------- 6386 6387 procedure Free (Desc : in out Pango_Font_Description) is 6388 procedure Internal (Desc : Pango_Font_Description); 6389 pragma Import (C, Internal, "pango_font_description_free"); 6390 6391 begin 6392 Internal (Desc); 6393 Desc := null; 6394 end Free; 6395 </body> 6396 </extra> 6397 </package> 6398 6399 <package id="GtkCellView"> 6400 <parameter name="self" ada="Cell_View"/> 6401 </package> 6402 6403 <package id="GtkTreeView"> 6404 <parameter name="self" ada="Tree_View"/> 6405 <enum ctype="GtkTreeViewDropPosition" /> 6406 <method id="gtk_tree_view_get_columns" return="GtkTreeViewColumnList"/> 6407 6408 <method id="gtk_tree_view_new_with_model" ada="Gtk_New" /> 6409 <method id="gtk_tree_view_insert_column"> 6410 <parameter name="position" default="-1"/> 6411 </method> 6412 <method id="gtk_tree_view_get_path_at_pos" return_as_param="Row_Found"/> 6413 <method id="gtk_tree_view_get_visible_range" return_as_param="Success"/> 6414 <method id="gtk_tree_view_get_tooltip_context" return_as_param="Success"/> 6415 <method id="gtk_tree_view_set_expander_column"> 6416 <parameter name="column" allow-none="1"/> 6417 </method> 6418 6419 <method id="gtk_tree_view_get_hadjustment" bind="False" /> <!-- from scrollable --> 6420 <method id="gtk_tree_view_get_vadjustment" bind="False" /> <!-- from scrollable --> 6421 <method id="gtk_tree_view_set_hadjustment" bind="False" /> <!-- from scrollable --> 6422 <method id="gtk_tree_view_set_vadjustment" bind="False" /> <!-- from scrollable --> 6423 6424 <method id="gtk_tree_view_enable_model_drag_source"> 6425 <parameter name="targets" ctype="Gtk.Target_List.Target_Entry_Array"/> 6426 <parameter name="n_targets" ada="" default="Targets'Length" /> 6427 </method> 6428 <method id="gtk_tree_view_enable_model_drag_dest"> 6429 <parameter name="targets" ctype="Gtk.Target_List.Target_Entry_Array"/> 6430 <parameter name="n_targets" ada="" default="Targets'Length" /> 6431 </method> 6432 6433 <extra> 6434 <spec> 6435 procedure Gtk_New 6436 (Tree_View : out Gtk_Tree_View; 6437 Model : access Gtk.Tree_Model.Gtk_Root_Tree_Model_Record'Class); 6438 -- A convenience function so that one can directly pass a model, without 6439 -- converting to a Gtk_Tree_Model via the "+" operator. 6440 </spec> 6441 <body> 6442 procedure Gtk_New 6443 (Tree_View : out Gtk_Tree_View; 6444 Model : access Gtk.Tree_Model.Gtk_Root_Tree_Model_Record'Class) 6445 is 6446 begin 6447 Gtk_New (Tree_View, To_Interface (Model)); 6448 end Gtk_New; 6449 </body> 6450 </extra> 6451 </package> 6452 6453 <package id="GtkTreeViewColumn"> 6454 <parameter name="self" ada="Tree_Column"/> 6455 <enum ctype="GtkTreeViewColumnSizing"/> 6456 <list ctype="GtkTreeViewColumn" ada="Column_List" /> 6457 <method id="gtk_tree_view_column_cell_get_position" return_as_param="Success"/> 6458 6459 <method id="gtk_tree_view_column_add_attribute" bind="False" /> <!-- overridden --> 6460 <method id="gtk_tree_view_column_clear" bind="False" /> <!-- from cell_layout --> 6461 <method id="gtk_tree_view_column_clear_attributes" bind="False" /> <!-- from cell_layout --> 6462 <method id="gtk_tree_view_column_pack_start" bind="False" /> <!-- from cell_layout --> 6463 <method id="gtk_tree_view_column_pack_end" bind="False" /> <!-- from cell_layout --> 6464 <method id="gtk_tree_view_column_set_cell_data_func" bind="False" /> <!-- from cell_layout --> 6465 </package> 6466 6467 <package id="GtkTreeSortable"> 6468 <parameter name="self" ada="Sortable"/> 6469 <method id="gtk_tree_sortable_get_sort_column_id" return="void"/> 6470 <extra> 6471 <spec> 6472 Default_Sort_Column_Id : constant Gint := -1; 6473 Unsorted_Sort_Column_Id : constant Gint := -2; 6474 -- Two special values for the sort column 6475 </spec> 6476 </extra> 6477 </package> 6478 6479 <package id="GtkTreeDragSource"> 6480 <function id="gtk_tree_set_row_drag_data" ada="Set_Row_Drag_Data"/> 6481 <function id="gtk_tree_get_row_drag_data" ada="Get_Row_Drag_Data" return_as_param="succes"/> 6482 </package> 6483 6484 <package id="GtkTreeModel"> 6485 <parameter name="self" ada="Tree_Model"/> 6486 <enum ctype="GtkTreeModelFlags" ada="Tree_Model_Flags" /> 6487 <method id="gtk_tree_model_get" bind="False"/> <!-- varargs --> 6488 <method id="gtk_tree_model_get_valist" bind="False"/> <!-- varargs --> 6489 <method id="gtk_tree_model_get_iter" return="Gtk_Tree_Iter"> 6490 <parameter name="iter" ada=""/> 6491 <body> 6492 function Internal 6493 (Tree_Model : Gtk_Tree_Model; 6494 Iter : System.Address; Path : System.Address) return Gint; 6495 pragma Import (C, Internal, "gtk_tree_model_get_iter"); 6496 Iter : aliased Gtk_Tree_Iter; 6497 begin 6498 if Internal (+Tree_Model, Iter'Address, Get_Object (Path)) /= 0 then 6499 return Iter; 6500 else 6501 return Null_Iter; 6502 end if; 6503 </body> 6504 </method> 6505 <method id="gtk_tree_model_get_iter_from_string" return="Gtk_Tree_Iter"> 6506 <parameter name="iter" ada=""/> 6507 <body> 6508 function Internal 6509 (Tree_Model : Gtk_Tree_Model; 6510 Iter : System.Address; Str : String) return Gint; 6511 pragma Import (C, Internal, "gtk_tree_model_get_iter_from_string"); 6512 Iter : aliased Gtk_Tree_Iter; 6513 begin 6514 if Internal 6515 (+Tree_Model, Iter'Address, Path_String & ASCII.NUL) /= 0 6516 then 6517 return Iter; 6518 else 6519 return Null_Iter; 6520 end if; 6521 </body> 6522 </method> 6523 <method id="gtk_tree_model_get_iter_first" return="Gtk_Tree_Iter"> 6524 <parameter name="iter" ada=""/> 6525 <body> 6526 function Internal 6527 (Tree_Model : Gtk_Tree_Model; Iter : System.Address) return Gint; 6528 pragma Import (C, Internal, "gtk_tree_model_get_iter_first"); 6529 Iter : aliased Gtk_Tree_Iter; 6530 begin 6531 if Internal (+Tree_Model, Iter'Address) /= 0 then 6532 return Iter; 6533 else 6534 return Null_Iter; 6535 end if; 6536 </body> 6537 </method> 6538 <method id="gtk_tree_model_iter_next" ada="Next" return="void"> 6539 <parameter name="iter" direction="inout"/> 6540 <body> 6541 function Internal 6542 (Tree_Model : Gtk_Tree_Model; Iter : System.Address) return Gint; 6543 pragma Import (C, Internal, "gtk_tree_model_iter_next"); 6544 Local_Iter : aliased Gtk_Tree_Iter := Iter; 6545 begin 6546 if Internal (+Tree_Model, Local_Iter'Address) = 0 then 6547 Iter := Null_Iter; 6548 else 6549 Iter := Local_Iter; 6550 end if; 6551 </body> 6552 </method> 6553 <method id="gtk_tree_model_iter_previous" ada="Previous" return="void"> 6554 <parameter name="iter" direction="inout"/> 6555 <body> 6556 function Internal 6557 (Tree_Model : Gtk_Tree_Model; Iter : System.Address) return Gint; 6558 pragma Import (C, Internal, "gtk_tree_model_iter_previous"); 6559 Local_Iter : aliased Gtk_Tree_Iter := Iter; 6560 begin 6561 if Internal (+Tree_Model, Local_Iter'Address) = 0 then 6562 Iter := Null_Iter; 6563 else 6564 Iter := Local_Iter; 6565 end if; 6566 </body> 6567 </method> 6568 <method id="gtk_tree_model_iter_children" ada="Children" return="Gtk_Tree_Iter"> 6569 <parameter name="iter" ada=""/> 6570 <body> 6571 function Internal 6572 (Tree_Model : Gtk_Tree_Model; 6573 Iter : System.Address; 6574 Parent : System.Address) return Gint; 6575 pragma Import (C, Internal, "gtk_tree_model_iter_children"); 6576 It : aliased Gtk_Tree_Iter; 6577 begin 6578 if Internal (+Tree_Model, It'Address, Iter_Or_Null (Parent'Address)) /= 0 then 6579 return It; 6580 else 6581 return Null_Iter; 6582 end if; 6583 </body> 6584 </method> 6585 <method id="gtk_tree_model_iter_has_child" ada="Has_Child"/> 6586 <method id="gtk_tree_model_iter_n_children" ada="N_Children"> 6587 <parameter name="iter" default="Gtk.Tree_Model.Null_Iter"/> 6588 <body> 6589 function Internal 6590 (Tree_Model : Gtk_Tree_Model; Iter : System.Address) return Gint; 6591 pragma Import (C, Internal, "gtk_tree_model_iter_n_children"); 6592 begin 6593 return Internal (+Tree_Model, Iter_Or_Null (Iter'Address)); 6594 </body> 6595 </method> 6596 <method id="gtk_tree_model_iter_nth_child" ada="Nth_Child" return="Gtk_Tree_Iter"> 6597 <parameter name="iter" ada=""/> 6598 <body> 6599 function Internal 6600 (Tree_Model : Gtk_Tree_Model; 6601 Iter, Parent : System.Address; N : Gint) return Gint; 6602 pragma Import (C, Internal, "gtk_tree_model_iter_nth_child"); 6603 Iter : aliased Gtk_Tree_Iter; 6604 begin 6605 if Internal (+Tree_Model, Iter'Address, Iter_Or_Null (Parent'Address), N) /= 0 then 6606 return Iter; 6607 else 6608 return Null_Iter; 6609 end if; 6610 </body> 6611 </method> 6612 <method id="gtk_tree_model_iter_parent" ada="Parent" return="Gtk_Tree_Iter"> 6613 <parameter name="iter" ada=""/> 6614 <body> 6615 function Internal 6616 (Tree_Model : Gtk_Tree_Model; 6617 Iter : System.Address; 6618 Child : Gtk_Tree_Iter) return Gint; 6619 pragma Import (C, Internal, "gtk_tree_model_iter_parent"); 6620 Iter : aliased Gtk_Tree_Iter; 6621 begin 6622 if Internal (+Tree_Model, Iter'Address, Child) /= 0 then 6623 return Iter; 6624 else 6625 return Null_Iter; 6626 end if; 6627 </body> 6628 </method> 6629 <method id="gtk_tree_model_rows_reordered"> 6630 <parameter name="new_order" type="Gint_Array"/> 6631 </method> 6632 <extra> 6633 <spec> 6634 type Gtk_Root_Tree_Model_Record is new Glib.Object.GObject_Record 6635 with null record; 6636 type Gtk_Root_Tree_Model is 6637 access all Gtk_Root_Tree_Model_Record'Class; 6638 -- A common base type for all objects that implement GtkTreeModel. This 6639 -- is used to conveniently provide a number of primitive operations. 6640 6641 function Get_Int 6642 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6643 Iter : Gtk_Tree_Iter; 6644 Column : Gint) return Gint; 6645 function Get_Ulong 6646 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6647 Iter : Gtk_Tree_Iter; 6648 Column : Gint) return Gulong; 6649 function Get_Boolean 6650 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6651 Iter : Gtk_Tree_Iter; 6652 Column : Gint) return Boolean; 6653 function Get_Object 6654 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6655 Iter : Gtk_Tree_Iter; 6656 Column : Gint) return Glib.Object.GObject; 6657 function Get_C_Proxy 6658 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6659 Iter : Gtk_Tree_Iter; 6660 Column : Gint) return Glib.C_Proxy; 6661 function Get_String 6662 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6663 Iter : Gtk_Tree_Iter; 6664 Column : Gint) return UTF8_String; 6665 function Get_Address 6666 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6667 Iter : Gtk_Tree_Iter; 6668 Column : Gint) return System.Address; 6669 -- Get the value of one cell of the model 6670 6671 function Get_Int 6672 (Tree_Model : Gtk_Tree_Model; 6673 Iter : Gtk_Tree_Iter; 6674 Column : Gint) return Gint; 6675 function Get_Ulong 6676 (Tree_Model : Gtk_Tree_Model; 6677 Iter : Gtk_Tree_Iter; 6678 Column : Gint) return Gulong; 6679 function Get_Boolean 6680 (Tree_Model : Gtk_Tree_Model; 6681 Iter : Gtk_Tree_Iter; 6682 Column : Gint) return Boolean; 6683 function Get_Object 6684 (Tree_Model : Gtk_Tree_Model; 6685 Iter : Gtk_Tree_Iter; 6686 Column : Gint) return Glib.Object.GObject; 6687 function Get_C_Proxy 6688 (Tree_Model : Gtk_Tree_Model; 6689 Iter : Gtk_Tree_Iter; 6690 Column : Gint) return Glib.C_Proxy; 6691 function Get_String 6692 (Tree_Model : Gtk_Tree_Model; 6693 Iter : Gtk_Tree_Iter; 6694 Column : Gint) return UTF8_String; 6695 function Get_Address 6696 (Tree_Model : Gtk_Tree_Model; 6697 Iter : Gtk_Tree_Iter; 6698 Column : Gint) return System.Address; 6699 6700 package Implements_Gtk_Tree_Model is new Glib.Types.Implements 6701 (Gtk_Tree_Model, Gtk_Root_Tree_Model_Record, Gtk_Root_Tree_Model); 6702 function To_Interface 6703 (Widget : access Gtk_Root_Tree_Model_Record'Class) 6704 return Gtk_Tree_Model renames Implements_Gtk_Tree_Model.To_Interface; 6705 function "-" 6706 (Interf : Gtk_Tree_Model) return Gtk_Root_Tree_Model 6707 renames Implements_Gtk_Tree_Model.To_Object; 6708 -- Convert from the gtk+ interface to an actual object. The return type 6709 -- depends on the exact model, and will likely be an instance of 6710 -- Gtk_Tree_Store'Class or Gtk_List_Store'Class depending on how you 6711 -- created it. 6712 </spec> 6713 <body> 6714 function Get_Int 6715 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6716 Iter : Gtk_Tree_Iter; 6717 Column : Gint) return Gint is 6718 begin 6719 return Get_Int (To_Interface (Tree_Model), Iter, Column); 6720 end Get_Int; 6721 6722 function Get_Int 6723 (Tree_Model : Gtk_Tree_Model; 6724 Iter : Gtk_Tree_Iter; 6725 Column : Gint) return Gint 6726 is 6727 procedure Internal 6728 (Tree_Model : Gtk_Tree_Model; 6729 Iter : Gtk_Tree_Iter; 6730 Column : Gint; 6731 Value : out Gint); 6732 pragma Import (C, Internal, "ada_gtk_tree_model_get"); 6733 A : Gint; 6734 begin 6735 if Iter = Null_Iter then 6736 raise Program_Error with "Get_Int with null_iter"; 6737 end if; 6738 Internal (Tree_Model, Iter, Column, A); 6739 return A; 6740 end Get_Int; 6741 6742 function Get_Ulong 6743 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6744 Iter : Gtk_Tree_Iter; 6745 Column : Gint) return Gulong is 6746 begin 6747 return Get_Ulong (To_Interface (Tree_Model), Iter, Column); 6748 end Get_Ulong; 6749 6750 function Get_Ulong 6751 (Tree_Model : Gtk_Tree_Model; 6752 Iter : Gtk_Tree_Iter; 6753 Column : Gint) return Gulong 6754 is 6755 procedure Internal 6756 (Tree_Model : Gtk_Tree_Model; 6757 Iter : Gtk_Tree_Iter; 6758 Column : Gint; 6759 Value : out Gulong); 6760 pragma Import (C, Internal, "ada_gtk_tree_model_get"); 6761 A : Gulong; 6762 begin 6763 if Iter = Null_Iter then 6764 raise Program_Error with "Get_Ulong with null_iter"; 6765 end if; 6766 Internal (Tree_Model, Iter, Column, A); 6767 return A; 6768 end Get_Ulong; 6769 6770 function Get_Boolean 6771 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6772 Iter : Gtk_Tree_Iter; 6773 Column : Gint) return Boolean is 6774 begin 6775 return Get_Boolean (To_Interface (Tree_Model), Iter, Column); 6776 end Get_Boolean; 6777 6778 function Get_Boolean 6779 (Tree_Model : Gtk_Tree_Model; 6780 Iter : Gtk_Tree_Iter; 6781 Column : Gint) return Boolean is 6782 begin 6783 return Get_Int (Tree_Model, Iter, Column) /= 0; 6784 end Get_Boolean; 6785 6786 function Get_Object 6787 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6788 Iter : Gtk_Tree_Iter; 6789 Column : Gint) return Glib.Object.GObject 6790 is 6791 begin 6792 return Get_Object (To_Interface (Tree_Model), Iter, Column); 6793 end Get_Object; 6794 6795 function Get_Object 6796 (Tree_Model : Gtk_Tree_Model; 6797 Iter : Gtk_Tree_Iter; 6798 Column : Gint) return Glib.Object.GObject 6799 is 6800 Stub : Glib.Object.GObject_Record; 6801 begin 6802 return Get_User_Data 6803 (Get_Address (Tree_Model, Iter, Column), Stub); 6804 end Get_Object; 6805 6806 function Get_C_Proxy 6807 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6808 Iter : Gtk_Tree_Iter; 6809 Column : Gint) return Glib.C_Proxy is 6810 begin 6811 return Get_C_Proxy (To_Interface (Tree_Model), Iter, Column); 6812 end Get_C_Proxy; 6813 6814 function Get_C_Proxy 6815 (Tree_Model : Gtk_Tree_Model; 6816 Iter : Gtk_Tree_Iter; 6817 Column : Gint) return Glib.C_Proxy 6818 is 6819 procedure Internal 6820 (Tree_Model : Gtk_Tree_Model; 6821 Iter : Gtk_Tree_Iter; 6822 Column : Gint; 6823 Value : out Glib.C_Proxy); 6824 pragma Import (C, Internal, "ada_gtk_tree_model_get"); 6825 A : Glib.C_Proxy; 6826 begin 6827 if Iter = Null_Iter then 6828 raise Program_Error with "Get_C_Proxy with null_iter"; 6829 end if; 6830 Internal (Tree_Model, Iter, Column, A); 6831 return A; 6832 end Get_C_Proxy; 6833 6834 function Get_String 6835 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6836 Iter : Gtk_Tree_Iter; 6837 Column : Gint) return UTF8_String 6838 is 6839 begin 6840 return Get_String (To_Interface (Tree_Model), Iter, Column); 6841 end Get_String; 6842 6843 function Get_String 6844 (Tree_Model : Gtk_Tree_Model; 6845 Iter : Gtk_Tree_Iter; 6846 Column : Gint) return UTF8_String 6847 is 6848 procedure Internal 6849 (Tree_Model : Gtk_Tree_Model; 6850 Iter : Gtk_Tree_Iter; 6851 Column : Gint; 6852 Value : out Interfaces.C.Strings.chars_ptr); 6853 pragma Import (C, Internal, "ada_gtk_tree_model_get"); 6854 A : Interfaces.C.Strings.chars_ptr; 6855 begin 6856 if Iter = Null_Iter then 6857 raise Program_Error with "Get_String with null_iter"; 6858 end if; 6859 Internal (Tree_Model, Iter, Column, A); 6860 if A = Interfaces.C.Strings.Null_Ptr then 6861 return ""; 6862 else 6863 declare 6864 S : constant String := Interfaces.C.Strings.Value (A); 6865 6866 procedure C_Free (S : Interfaces.C.Strings.chars_ptr); 6867 pragma Import (C, C_Free, "free"); 6868 6869 begin 6870 -- Since A was allocated by gtk+ via malloc(), and not via 6871 -- System.Memory, we should not be using Interfaces.C.Strings.Free 6872 -- which goes through System.Memory. So we call free() directly 6873 -- instead. 6874 C_Free (A); 6875 return S; 6876 end; 6877 end if; 6878 end Get_String; 6879 6880 function Get_Address 6881 (Tree_Model : access Gtk_Root_Tree_Model_Record; 6882 Iter : Gtk_Tree_Iter; 6883 Column : Gint) return System.Address 6884 is 6885 begin 6886 return Get_Address (To_Interface (Tree_Model), Iter, Column); 6887 end Get_Address; 6888 6889 function Get_Address 6890 (Tree_Model : Gtk_Tree_Model; 6891 Iter : Gtk_Tree_Iter; 6892 Column : Gint) return System.Address 6893 is 6894 procedure Internal 6895 (Tree_Model : Gtk_Tree_Model; 6896 Iter : Gtk_Tree_Iter; 6897 Column : Gint; 6898 Value : out System.Address); 6899 pragma Import (C, Internal, "ada_gtk_tree_model_get"); 6900 A : System.Address; 6901 begin 6902 if Iter = Null_Iter then 6903 raise Program_Error with "Get_Address with null_iter"; 6904 end if; 6905 Internal (Tree_Model, Iter, Column, A); 6906 return A; 6907 end Get_Address; 6908 </body> 6909 </extra> 6910 </package> 6911 6912 <package id="GtkTreeIter" into="GtkTreeModel"> 6913 <record ctype="GtkTreeIter" private="True"/> 6914 <method id="gtk_tree_iter_get_type" ada="Iter_Get_Type" /> 6915 <method id="gtk_tree_iter_copy" ada="Iter_Copy" /> 6916 <extra> 6917 <type> 6918 Null_Iter : constant Gtk_Tree_Iter; 6919 </type> 6920 <spec> 6921 function "=" (Left : Gtk_Tree_Iter; Right : Gtk_Tree_Iter) return Boolean; 6922 6923 procedure Set_Tree_Iter 6924 (Val : in out Glib.Values.GValue; 6925 Iter : Gtk_Tree_Iter); 6926 pragma Import (C, Set_Tree_Iter, "g_value_set_pointer"); 6927 -- Set the value of the given GValue to Iter. 6928 -- Note that Iter is stored by reference, which means no copy of Iter 6929 -- is made. Iter should remain allocated as long as Val is being used. 6930 6931 procedure Get_Tree_Iter 6932 (Val : Glib.Values.GValue; 6933 Iter : out Gtk_Tree_Iter); 6934 -- Extract the iterator from the given GValue. 6935 -- Note that the iterator returned is a copy of the iterator referenced 6936 -- by the give GValue. Modifying the iterator returned does not modify 6937 -- the iterator referenced by the GValue. 6938 6939 function Get_Tree_Iter (Val : Glib.Values.GValue) return Gtk_Tree_Iter; 6940 -- Extract the iterator from the given GValue. 6941 6942 function To_Address (Iter : Gtk_Tree_Iter) return System.Address; 6943 pragma Convention (C, To_Address); 6944 -- Return address of the specified iterator. 6945 -- Note: To_Address needs a pass-by-reference semantic to work properly 6946 -- On some ABIs (e.g. IA64), Gtk_Tree_Iter is passed by copy, since it's 6947 -- a "small enough" record. 6948 6949 function Iter_Or_Null (Iter : System.Address) return System.Address; 6950 -- Internal function for GtkAda 6951 </spec> 6952 <spec private="True"> 6953 Null_Iter : constant Gtk_Tree_Iter := 6954 (0, System.Null_Address, System.Null_Address, System.Null_Address); 6955 </spec> 6956 <body> 6957 function "=" (Left : Gtk_Tree_Iter; Right : Gtk_Tree_Iter) return Boolean is 6958 use type System.Address; 6959 begin 6960 if Left.Stamp = Right.Stamp then 6961 if Left.Stamp = 0 then 6962 -- Stamp = 0 means the iterator is null iterator, we need not to 6963 -- compare other fields in this case. 6964 return True; 6965 else 6966 return Left.User_Data = Right.User_Data 6967 and then Left.User_Data2 = Right.User_Data2 6968 and then Left.User_Data3 = Right.User_Data3; 6969 end if; 6970 else 6971 return False; 6972 end if; 6973 end "="; 6974 6975 type Gtk_Tree_Iter_Access is access Gtk_Tree_Iter; 6976 function Convert is new Ada.Unchecked_Conversion 6977 (System.Address, Gtk_Tree_Iter_Access); 6978 use type System.Address; 6979 6980 function Iter_Or_Null (Iter : System.Address) return System.Address is 6981 begin 6982 if Convert (Iter).Stamp = 0 then -- null iter 6983 return System.Null_Address; 6984 else 6985 return Iter; 6986 end if; 6987 end Iter_Or_Null; 6988 6989 procedure Get_Tree_Iter 6990 (Val : Glib.Values.GValue; 6991 Iter : out Gtk_Tree_Iter) is 6992 begin 6993 Iter := Convert (Glib.Values.Get_Address (Val)).all; 6994 end Get_Tree_Iter; 6995 6996 function Get_Tree_Iter (Val : Glib.Values.GValue) return Gtk_Tree_Iter is 6997 Result : Gtk_Tree_Iter; 6998 begin 6999 Get_Tree_Iter (Val, Result); 7000 return Result; 7001 end Get_Tree_Iter; 7002 7003 function To_Address (Iter : Gtk_Tree_Iter) return System.Address is 7004 begin 7005 return Iter'Address; 7006 end To_Address; 7007 </body> 7008 </extra> 7009 </package> 7010 7011 <package id="GtkTreeRowReference"> 7012 <parameter name="self" ada="Reference"/> 7013 </package> 7014 7015 <package id="GtkTreePath" into="GtkTreeModel"> 7016 <parameter name="self" ada="Path" /> 7017 <list ctype="GtkTreePath" ada="Gtk_Tree_Path_List" section="Lists"/> 7018 <method id="gtk_tree_path_new_from_string" ada="Gtk_New"> 7019 <parameter name="self" ada="Self" /> 7020 </method> 7021 <method id="gtk_tree_path_get_type" ada="Path_Get_Type" /> 7022 <method id="gtk_tree_path_free" ada="Path_Free" /> 7023 <method id="gtk_tree_path_get_indices_with_depth" bind="False"/> <!-- duplicates Get_Indices, in Ada --> 7024 <method id="gtk_tree_path_get_indices" return="Glib.Gint_Array"> 7025 <body> 7026 Depth : constant Integer := Integer (Get_Depth (Path)); 7027 7028 subtype Result_Array is Gint_Array (0 .. Depth - 1); 7029 type Result_Array_Access is access all Result_Array; 7030 pragma Convention (C, Result_Array_Access); 7031 7032 function Internal (Path : System.Address) return Result_Array_Access; 7033 pragma Import (C, Internal, "gtk_tree_path_get_indices"); 7034 7035 -- Do not free the result of gtk_tree_path_get_indices since this is 7036 -- not a copy, but the currently used data. 7037 Result : constant Result_Array_Access := Internal (Get_Object (Path)); 7038 7039 begin 7040 if Result = null then 7041 return (0 .. -1 => 0); 7042 else 7043 return Result.all; 7044 end if; 7045 </body> 7046 </method> 7047 <extra> 7048 <spec> 7049 function Get_Tree_Path (Val : Glib.Values.GValue) return Gtk_Tree_Path; 7050 -- Extract the path from the given GValue. 7051 7052 </spec> 7053 <with_body pkg="Glib.Values"/> 7054 <body> 7055 function Get_Tree_Path (Val : Glib.Values.GValue) return Gtk_Tree_Path is 7056 begin 7057 return From_Object (Glib.Values.Get_Address (Val)); 7058 end Get_Tree_Path; 7059 </body> 7060 </extra> 7061 </package> 7062 7063 <package id="GtkTreeModelSort" parent="Gtk.Tree_Model.Gtk_Root_Tree_Model"> 7064 <method id="gtk_tree_model_sort_new_with_model" ada="Gtk_New_With_Model"/> 7065 </package> 7066 7067 <package id="GtkTreeModelFilter" parent="Gtk.Tree_Model.Gtk_Root_Tree_Model"> 7068 <method id="gtk_tree_model_filter_new" ada="Gtk_New"> 7069 <parameter name="root" default="Null_Gtk_Tree_Path" /> 7070 </method> 7071 <method id="gtk_tree_model_filter_convert_child_iter_to_iter" return="void" /> 7072 <method id="gtk_tree_model_filter_set_modify_func"> <!-- function with callback and custom parameter --> 7073 <parameter name="types" type="Glib.GType_Array"/> 7074 <parameter name="n_columns" ada="" default="Types'Length" /> 7075 </method> 7076 </package> 7077 7078 <package id="GtkTreeSelection"> 7079 <parameter name="self" ada="Selection" /> 7080 <method id="gtk_tree_selection_get_selected" return="void"> 7081 <body> 7082 function Internal 7083 (Selection : System.Address; 7084 Model : access Gtk_Tree_Model; 7085 Iter : access Gtk_Tree_Iter) return Gboolean; 7086 pragma Import (C, Internal, "gtk_tree_selection_get_selected"); 7087 M : aliased Gtk_Tree_Model := Null_Gtk_Tree_Model; 7088 It : aliased Gtk_Tree_Iter; 7089 begin 7090 if Internal (Get_Object (Selection), M'Access, It'Access) = 0 then 7091 Iter := Null_Iter; 7092 else 7093 Iter := It; 7094 end if; 7095 Model := M; 7096 </body> 7097 </method> 7098 <method id="gtk_tree_selection_get_selected_rows" bind="False"/><!-- see below --> 7099 <method id="gtk_tree_selection_get_tree_view" return="Gtk_Widget"/> <!-- avoid circular dep --> 7100 <extra> 7101 <spec> 7102 procedure Get_Selected_Rows 7103 (Selection : access Gtk_Tree_Selection_Record; 7104 Model : out Gtk.Tree_Model.Gtk_Tree_Model; 7105 Path_List : out Gtk.Tree_Model.Gtk_Tree_Path_List.Glist); 7106 -- Creates a list of path of all selected rows. Additionally, if you are 7107 -- planning on modifying the model after calling this function, you may 7108 -- want to convert the returned list into a list of Gtk_Tree_Row_Reference. 7109 -- 7110 -- You must free the resulting list by calling Path_Free on each item, and 7111 -- then freeing the list itself. 7112 </spec> 7113 <body> 7114 procedure Get_Selected_Rows 7115 (Selection : access Gtk_Tree_Selection_Record; 7116 Model : out Gtk_Tree_Model; 7117 Path_List : out Gtk_Tree_Path_List.Glist) 7118 is 7119 use type System.Address; 7120 function Internal 7121 (Selection : System.Address; 7122 Model : access Gtk_Tree_Model) return System.Address; 7123 pragma Import (C, Internal, "gtk_tree_selection_get_selected_rows"); 7124 M : aliased Gtk_Tree_Model; 7125 Selected : System.Address; -- list of paths 7126 begin 7127 Selected := Internal (Get_Object (Selection), M'Access); 7128 Model := M; 7129 if Selected = System.Null_Address then 7130 Path_List := Gtk_Tree_Path_List.Null_List; 7131 else 7132 Gtk_Tree_Path_List.Set_Object (Path_List, Selected); 7133 end if; 7134 end Get_Selected_Rows; 7135 </body> 7136 </extra> 7137 </package> 7138 7139 <package id="GtkListStore" parent="Gtk.Tree_Model.Gtk_Root_Tree_Model"> 7140 <parameter name="self" ada="List_Store" /> 7141 <method id="gtk_list_store_newv" ada="Gtk_New"> 7142 <parameter name="types" type="GType_Array"/> 7143 <parameter name="n_columns" ada="" default="Types'Length"/> 7144 </method> 7145 <method id="gtk_list_store_set_column_types"> 7146 <parameter name="types" type="GType_Array"/> 7147 <parameter name="n_columns" ada="" default="Types'Length"/> 7148 </method> 7149 <method id="gtk_list_store_insert_with_valuesv" bind="False"/> <!-- valist --> 7150 <method id="gtk_list_store_set_value"> 7151 <parameter name="value" ctype="GValue" /> 7152 </method> 7153 <method id="gtk_list_store_set_valist" bind="False"/> <!-- valist --> 7154 <method id="gtk_list_store_set_valuesv" bind="False"/> <!-- manually --> 7155 <method id="gtk_list_store_remove" return="void"> 7156 <parameter name="iter" direction="inout"/> 7157 <body>%(auto)s 7158Iter := Gtk.Tree_Model.Null_Iter; 7159 </body> 7160 </method> 7161 <extra> 7162 <with_spec pkg="Gdk.Pixbuf" /> 7163 <spec> 7164 procedure Set 7165 (Tree_Store : access Gtk_List_Store_Record; 7166 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7167 Column : Gint; 7168 Value : UTF8_String); 7169 procedure Set 7170 (Tree_Store : access Gtk_List_Store_Record; 7171 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7172 Column : Gint; 7173 Value : Boolean); 7174 procedure Set 7175 (Tree_Store : access Gtk_List_Store_Record; 7176 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7177 Column : Gint; 7178 Value : Gint); 7179 procedure Set 7180 (Tree_Store : access Gtk_List_Store_Record; 7181 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7182 Column : Gint; 7183 Value : Gdk.Pixbuf.Gdk_Pixbuf); 7184 7185 procedure Set 7186 (Self : not null access Gtk_List_Store_Record; 7187 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7188 Columns : Glib.Gint_Array; 7189 Values : Glib.Values.GValue_Array); 7190 pragma Precondition (Columns'Length = Values'Length); 7191 -- A variant of Set which takes the columns and valus as two arrays. 7192 -- This is more efficient when changing multiple values than calling 7193 -- one of the Set procedures above multiple times. 7194 7195 procedure Set 7196 (Self : not null access Gtk_List_Store_Record; 7197 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7198 Values : Glib.Values.GValue_Array); 7199 -- A variant of the above that is used to set all the columns. 7200 7201 </spec> 7202 <body> 7203 procedure Set 7204 (Tree_Store : access Gtk_List_Store_Record; 7205 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7206 Column : Gint; 7207 Value : UTF8_String) 7208 is 7209 procedure Internal 7210 (Tree_Store : System.Address; 7211 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7212 Column : Gint; 7213 Value : UTF8_String); 7214 pragma Import (C, Internal, "ada_gtk_list_store_set_ptr"); 7215 begin 7216 Internal (Get_Object (Tree_Store), Iter, Column, Value & ASCII.NUL); 7217 end Set; 7218 7219 procedure Set 7220 (Tree_Store : access Gtk_List_Store_Record; 7221 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7222 Column : Gint; 7223 Value : Gint) 7224 is 7225 procedure Internal 7226 (Tree_Store : System.Address; 7227 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7228 Column : Gint; 7229 Value : Gint); 7230 pragma Import (C, Internal, "ada_gtk_list_store_set_int"); 7231 begin 7232 Internal (Get_Object (Tree_Store), Iter, Column, Value); 7233 end Set; 7234 7235 procedure Set 7236 (Tree_Store : access Gtk_List_Store_Record; 7237 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7238 Column : Gint; 7239 Value : Boolean) 7240 is 7241 procedure Internal 7242 (Tree_Store : System.Address; 7243 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7244 Column : Gint; 7245 Value : Gboolean); 7246 pragma Import (C, Internal, "ada_gtk_list_store_set_int"); 7247 begin 7248 Internal (Get_Object (Tree_Store), Iter, Column, Boolean'Pos (Value)); 7249 end Set; 7250 7251 procedure Set 7252 (Tree_Store : access Gtk_List_Store_Record; 7253 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7254 Column : Gint; 7255 Value : Gdk.Pixbuf.Gdk_Pixbuf) 7256 is 7257 procedure Internal 7258 (Tree_Store : System.Address; 7259 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7260 Column : Gint; 7261 Value : System.Address); 7262 pragma Import (C, Internal, "ada_gtk_list_store_set_ptr"); 7263 begin 7264 Internal (Get_Object (Tree_Store), Iter, Column, Get_Object (Value)); 7265 end Set; 7266 7267 procedure Set 7268 (Self : not null access Gtk_List_Store_Record; 7269 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7270 Columns : Glib.Gint_Array; 7271 Values : Glib.Values.GValue_Array) 7272 is 7273 procedure Internal 7274 (Self : System.Address; 7275 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7276 Columns : System.Address; 7277 Values : System.Address; 7278 N_Values : Gint); 7279 pragma Import (C, Internal, "gtk_tree_store_set_valuesv"); 7280 begin 7281 if Columns'Length = Values'Length then 7282 Internal (Get_Object (Self), Iter, 7283 Columns (Columns'First)'Address, 7284 Values (Values'First)'Address, Values'Length); 7285 end if; 7286 end Set; 7287 7288 procedure Set 7289 (Self : not null access Gtk_List_Store_Record; 7290 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7291 Values : Glib.Values.GValue_Array) 7292 is 7293 Columns : Gint_Array (Integer (Values'First) .. Integer (Values'Last)); 7294 begin 7295 for C in Columns'Range loop 7296 Columns (C) := Gint (C); 7297 end loop; 7298 Set (Self, Iter, Columns, Values); 7299 end Set; 7300 </body> 7301 </extra> 7302 </package> 7303 7304 <package id="GtkTreeStore" parent="Gtk.Tree_Model.Gtk_Root_Tree_Model"> 7305 <parameter name="self" ada="Tree_Store" /> 7306 <method id="gtk_tree_store_newv" ada="Gtk_New"> 7307 <parameter name="types" type="GType_Array"/> 7308 <parameter name="n_columns" ada="" default="Types'Length"/> 7309 </method> 7310 <method id="gtk_tree_store_set_column_types"> 7311 <parameter name="types" type="GType_Array"/> 7312 <parameter name="n_columns" ada="" default="Types'Length"/> 7313 </method> 7314 <method id="gtk_tree_store_remove" return="void"> 7315 <parameter name="iter" direction="inout"/> 7316 <body>%(auto)s 7317Iter := Gtk.Tree_Model.Null_Iter; 7318 </body> 7319 </method> 7320 <method id="gtk_tree_store_reorder"> 7321 <parameter name="new_order" type="Gint_Array"/> 7322 </method> 7323 <method id="gtk_tree_store_set_value"> 7324 <parameter name="value" ctype="GValue" /> 7325 </method> 7326 <method id="gtk_tree_store_insert_with_valuesv" bind="False"/> <!-- valist --> 7327 <method id="gtk_tree_store_set_valist" bind="False"/> <!-- valist --> 7328 <method id="gtk_tree_store_set_valuesv" bind="False"/> <!-- manually --> 7329 <extra> 7330 <spec> 7331 generic 7332 type Data_Type is private; 7333 package Generic_Set is 7334 type Data_Type_Access is access all Data_Type; 7335 7336 procedure Set 7337 (Tree_Store : access Gtk_Tree_Store_Record'Class; 7338 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7339 Column : Gint; 7340 Value : Data_Type_Access); 7341 -- Generic procedure used to store access objects in the model. 7342 -- For GObject and all of its descendents (including all widgets), 7343 -- you should use the Set procedure below that takes a GObject as 7344 -- parameter. 7345 -- 7346 -- Please see the example at the end for more information on how to 7347 -- create your own Set procedures adapted to your model. Also consider 7348 -- using Set_Value for complex cases 7349 7350 function Get 7351 (Tree_Store : access Gtk_Tree_Store_Record'Class; 7352 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7353 Column : Gint) return Data_Type_Access; 7354 -- Generic procedure used to get access objects back from the model. 7355 -- For GObject and all of its descendents (including all widgets), 7356 -- you should use the Get_Object function defined in Gtk-Tree_Model 7357 -- that returns a GObject. 7358 7359 end Generic_Set; 7360 7361 procedure Set 7362 (Tree_Store : access Gtk_Tree_Store_Record; 7363 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7364 Column : Gint; 7365 Value : UTF8_String); 7366 procedure Set 7367 (Tree_Store : access Gtk_Tree_Store_Record; 7368 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7369 Column : Gint; 7370 Value : Boolean); 7371 procedure Set_Ulong 7372 (Tree_Store : access Gtk_Tree_Store_Record; 7373 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7374 Column : Gint; 7375 Value : Gulong); 7376 procedure Set 7377 (Tree_Store : access Gtk_Tree_Store_Record; 7378 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7379 Column : Gint; 7380 Value : Gint); 7381 procedure Set 7382 (Tree_Store : access Gtk_Tree_Store_Record; 7383 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7384 Column : Gint; 7385 Value : Glib.C_Proxy); 7386 procedure Set 7387 (Tree_Store : access Gtk_Tree_Store_Record; 7388 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7389 Column : Gint; 7390 Address : System.Address); 7391 procedure Set 7392 (Tree_Store : access Gtk_Tree_Store_Record; 7393 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7394 Column : Gint; 7395 Value : Glib.Object.GObject); 7396 7397 procedure Set 7398 (Self : not null access Gtk_Tree_Store_Record; 7399 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7400 Columns : Glib.Gint_Array; 7401 Values : Glib.Values.GValue_Array); 7402 pragma Precondition (Columns'Length = Values'Length); 7403 -- A variant of Set which takes the columns and valus as two arrays. 7404 -- This is more efficient when changing multiple values than calling 7405 -- one of the Set procedures above multiple times. 7406 7407 procedure Set 7408 (Self : not null access Gtk_Tree_Store_Record; 7409 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7410 Values : Glib.Values.GValue_Array); 7411 -- A variant of the above that is used to set all the columns. 7412 7413 function Freeze_Sort 7414 (Tree : access Gtk.Tree_Store.Gtk_Tree_Store_Record'Class) 7415 return Gint; 7416 -- Freeze the sorting in the tree view, and returns the current 7417 -- sort_column_id, which should be used when thawing. (See Thaw_Sort) 7418 7419 procedure Thaw_Sort 7420 (Tree : access Gtk.Tree_Store.Gtk_Tree_Store_Record'Class; 7421 Column_Id : Gint); 7422 -- Thaw a frozen tree_view. Column_Id should be the value returned by 7423 -- the corresponding call to Freeze_Sort. 7424 </spec> 7425 <body> 7426 function Freeze_Sort 7427 (Tree : access Gtk.Tree_Store.Gtk_Tree_Store_Record'Class) 7428 return Gint 7429 is 7430 function Internal (Tree : System.Address) return Gint; 7431 pragma Import (C, Internal, "ada_gtk_tree_view_freeze_sort"); 7432 begin 7433 return Internal (Get_Object (Tree)); 7434 end Freeze_Sort; 7435 7436 procedure Thaw_Sort 7437 (Tree : access Gtk.Tree_Store.Gtk_Tree_Store_Record'Class; 7438 Column_Id : Gint) 7439 is 7440 procedure Internal (Tree : System.Address; Id : Gint); 7441 pragma Import (C, Internal, "ada_gtk_tree_view_thaw_sort"); 7442 begin 7443 Internal (Get_Object (Tree), Column_Id); 7444 end Thaw_Sort; 7445 7446package body Generic_Set is 7447 7448 pragma Warnings (Off); 7449 -- Disable warnings on strict aliasing, since there's no aliasing 7450 -- issue here. 7451 7452 function To_Address is new 7453 Ada.Unchecked_Conversion (Data_Type_Access, System.Address); 7454 7455 function To_Access is new 7456 Ada.Unchecked_Conversion (System.Address, Data_Type_Access); 7457 7458 pragma Warnings (On); 7459 7460 procedure Set 7461 (Tree_Store : access Gtk_Tree_Store_Record'Class; 7462 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7463 Column : Gint; 7464 Value : Data_Type_Access) is 7465 begin 7466 Set (Tree_Store, Iter, Column, To_Address (Value)); 7467 end Set; 7468 7469 function Get 7470 (Tree_Store : access Gtk_Tree_Store_Record'Class; 7471 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7472 Column : Gint) return Data_Type_Access is 7473 begin 7474 return To_Access (Get_Address (+Tree_Store, Iter, Column)); 7475 end Get; 7476 end Generic_Set; 7477 7478 procedure Set 7479 (Tree_Store : access Gtk_Tree_Store_Record; 7480 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7481 Column : Gint; 7482 Address : System.Address) 7483 is 7484 procedure Internal 7485 (Tree_Store : System.Address; 7486 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7487 Column : Gint; 7488 Value : System.Address); 7489 pragma Import (C, Internal, "ada_gtk_tree_store_set_ptr"); 7490 begin 7491 Internal (Get_Object (Tree_Store), Iter, Column, Address); 7492 end Set; 7493 7494 procedure Set 7495 (Tree_Store : access Gtk_Tree_Store_Record; 7496 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7497 Column : Gint; 7498 Value : UTF8_String) 7499 is 7500 procedure Internal 7501 (Tree_Store : System.Address; 7502 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7503 Column : Gint; 7504 Value : UTF8_String); 7505 pragma Import (C, Internal, "ada_gtk_tree_store_set_ptr"); 7506 begin 7507 Internal (Get_Object (Tree_Store), Iter, Column, Value & ASCII.NUL); 7508 end Set; 7509 7510 procedure Set 7511 (Tree_Store : access Gtk_Tree_Store_Record; 7512 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7513 Column : Gint; 7514 Value : Gint) 7515 is 7516 procedure Internal 7517 (Tree_Store : System.Address; 7518 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7519 Column : Gint; 7520 Value : Gint); 7521 pragma Import (C, Internal, "ada_gtk_tree_store_set_int"); 7522 begin 7523 Internal (Get_Object (Tree_Store), Iter, Column, Value); 7524 end Set; 7525 7526 procedure Set_Ulong 7527 (Tree_Store : access Gtk_Tree_Store_Record; 7528 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7529 Column : Gint; 7530 Value : Gulong) 7531 is 7532 procedure Internal 7533 (Tree_Store : System.Address; 7534 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7535 Column : Gint; 7536 Value : Gulong); 7537 pragma Import (C, Internal, "ada_gtk_tree_store_set_ulong"); 7538 begin 7539 Internal (Get_Object (Tree_Store), Iter, Column, Value); 7540 end Set_Ulong; 7541 7542 procedure Set 7543 (Tree_Store : access Gtk_Tree_Store_Record; 7544 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7545 Column : Gint; 7546 Value : Boolean) 7547 is 7548 procedure Internal 7549 (Tree_Store : System.Address; 7550 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7551 Column : Gint; 7552 Value : Gboolean); 7553 pragma Import (C, Internal, "ada_gtk_tree_store_set_int"); 7554 begin 7555 Internal (Get_Object (Tree_Store), Iter, Column, Boolean'Pos (Value)); 7556 end Set; 7557 7558 procedure Set 7559 (Tree_Store : access Gtk_Tree_Store_Record; 7560 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7561 Column : Gint; 7562 Value : Glib.C_Proxy) 7563 is 7564 procedure Internal 7565 (Tree_Store : System.Address; 7566 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7567 Column : Gint; 7568 Value : Glib.C_Proxy); 7569 pragma Import (C, Internal, "ada_gtk_tree_store_set_ptr"); 7570 begin 7571 Internal (Get_Object (Tree_Store), Iter, Column, Value); 7572 end Set; 7573 7574 procedure Set 7575 (Tree_Store : access Gtk_Tree_Store_Record; 7576 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7577 Column : Gint; 7578 Value : Glib.Object.GObject) 7579 is 7580 procedure Internal 7581 (Tree_Store : System.Address; 7582 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7583 Column : Gint; 7584 Value : System.Address); 7585 pragma Import (C, Internal, "ada_gtk_tree_store_set_ptr"); 7586 begin 7587 if Value = null then 7588 Internal (Get_Object (Tree_Store), Iter, Column, System.Null_Address); 7589 else 7590 Internal (Get_Object (Tree_Store), Iter, Column, Get_Object (Value)); 7591 end if; 7592 end Set; 7593 7594 procedure Set 7595 (Self : not null access Gtk_Tree_Store_Record; 7596 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7597 Columns : Glib.Gint_Array; 7598 Values : Glib.Values.GValue_Array) 7599 is 7600 procedure Internal 7601 (Self : System.Address; 7602 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7603 Columns : System.Address; 7604 Values : System.Address; 7605 N_Values : Gint); 7606 pragma Import (C, Internal, "gtk_tree_store_set_valuesv"); 7607 begin 7608 if Columns'Length = Values'Length then 7609 Internal (Get_Object (Self), Iter, 7610 Columns (Columns'First)'Address, 7611 Values (Values'First)'Address, Values'Length); 7612 end if; 7613 end Set; 7614 7615 procedure Set 7616 (Self : not null access Gtk_Tree_Store_Record; 7617 Iter : Gtk.Tree_Model.Gtk_Tree_Iter; 7618 Values : Glib.Values.GValue_Array) 7619 is 7620 Columns : Gint_Array (Integer (Values'First) .. Integer (Values'Last)); 7621 begin 7622 for C in Columns'Range loop 7623 Columns (C) := Gint (C); 7624 end loop; 7625 Set (Self, Iter, Columns, Values); 7626 end Set; 7627 7628 </body> 7629 </extra> 7630 </package> 7631 7632 <package id="GtkGrid"> 7633 <method id="gtk_grid_attach"> 7634 <parameter name="width" default='1'/> 7635 <parameter name="height" default='1'/> 7636 </method> 7637 <method id="gtk_grid_attach_next_to"> 7638 <parameter name="width" default='1'/> 7639 <parameter name="height" default='1'/> 7640 </method> 7641 </package> 7642 7643 <package id="GtkCssSection"> 7644 <enum ctype="GtkCssSectionType"/> 7645 7646 <method id="gtk_css_section_get_file" bind="False"/> <!-- needs GFile --> 7647 </package> 7648 7649 <package id="GdkFrameClock"> 7650 <enum ctype="GdkFrameClockPhase"/> 7651 </package> 7652 7653 <package id="GtkMenuButton"> 7654 </package> 7655 7656 <package id="GtkActionable"> 7657 </package> 7658 7659 <package id="GtkThemingEngine"> 7660 <method id="gtk_theming_engine_get_style_valist" bind="False"/> <!-- valist --> 7661 <method id="gtk_theming_engine_get_valist" bind="False"/> <!-- valist --> 7662 7663 <method id="gtk_theming_engine_register_property" bind="False"/> <!-- obsolete and requires GtkStylePropertyParser --> 7664 </package> 7665 7666 <package id="GtkBindingSet"> 7667 <method id="gtk_binding_set_new" ada="Gtk_New"/> 7668 <record ctype="GtkBindingSet"> 7669 <field name="widget_path_pspecs" ctype="gpointer"/> <!-- unused in C --> 7670 <field name="widget_class_pspecs" ctype="gpointer"/> <!-- unused in C --> 7671 <field name="class_branch_pspecs" ctype="gpointer"/> <!-- unused in C --> 7672 <field name="current" ctype="gpointer"/> <!-- implementation detail in C --> 7673 </record> 7674 </package> 7675 7676 <package id="GtkBindingEntry" into="GtkBindingSet"> 7677 </package> 7678 7679 <package id="GIO" ada="Glib.IO"/> 7680 7681 <package id="GVariant" ada="Glib.Variant"> 7682 <enum ctype="GVariantClass" prefix="G_VARIANT_"/> 7683 <method id="g_variant_new_from_bytes" bind="False"/> <!-- requires GByte --> 7684 <method id="g_variant_get_data_as_bytes" bind="False"/> <!-- requires GByte --> 7685 <method id="g_variant_new_parsed_va" bind="False" /> <!-- va_list --> 7686 <method id="g_variant_new_va" bind="False" /> <!-- va_list --> 7687 <method id="g_variant_get_va" bind="False" /> <!-- va_list --> 7688 <method id="g_variant_new_array" bind="False"/> <!-- c arrays --> 7689 <method id="g_variant_new_fixed_array" bind="False"/> <!-- c arrays --> 7690 <method id="g_variant_new_from_data" bind="False"/> <!-- c arrays --> 7691 <method id="g_variant_new_maybe" bind="False"/> <!-- c arrays --> 7692 <method id="g_variant_new_tuple" bind="False"/> <!-- c arrays --> 7693 <method id="g_variant_get_fixed_array" bind="False"/> <!-- c arrays --> 7694 <method id="g_variant_compare" bind="False"/> <!-- c arrays --> 7695 <method id="g_variant_equal" bind="False"/> <!-- c arrays --> 7696 <method id="g_variant_get_data" bind="False"/> <!-- c arrays --> 7697 <method id="g_variant_dup_bytestring" bind="False"/> <!-- c arrays --> 7698 <method id="g_variant_get_bytestring" bind="False"/> <!-- c arrays --> 7699 </package> 7700 7701 <package id="GVariantIter" into="GVariant" ada="Glib.Variant"> 7702 <method id="g_variant_iter_copy" bind="False"/> <!-- results in duplicate import --> 7703 <method id="g_variant_iter_free" bind="False"/> <!-- results in duplicate import --> 7704 <method id="g_variant_iter_n_children" bind="False"/> <!-- duplicate import --> 7705 </package> 7706 7707 <package id="GVariantType" into="GVariant" ada="Glib.Variant"> 7708 <method id="g_variant_type_checked_" bind="False"/> <!-- implementation detail --> 7709 <method id="g_variant_type_new_from_bytes" bind="False"/> <!-- requires GByte --> 7710 <method id="g_variant_type_new_tuple" bind="False"/> <!-- c arrays --> 7711 <method id="g_variant_type_new_maybe" bind="False"/> <!-- c arrays --> 7712 <method id="g_variant_type_new_array" bind="False"/> <!-- c arrays --> 7713 <method id="g_variant_type_equal" bind="False"/> <!-- c arrays --> 7714 <method id="g_variant_type_hash" bind="False"/> <!-- duplicate import --> 7715 <method id="g_variant_type_string_scan" bind="False"/> <!-- c arrays --> 7716 <extra> 7717 <spec> 7718 Gvariant_Type_Boolean : constant Gvariant_Type; -- value is 0 or 1 7719 Gvariant_Type_Byte : constant Gvariant_Type; -- from 0 to 255 7720 Gvariant_Type_Int16 : constant Gvariant_Type; -- from -32768..32767 7721 Gvariant_Type_Uint16 : constant Gvariant_Type; -- from 0 to 65535 7722 Gvariant_Type_Int32 : constant Gvariant_Type; 7723 Gvariant_Type_Uint32 : constant Gvariant_Type; 7724 Gvariant_Type_Int64 : constant Gvariant_Type; 7725 Gvariant_Type_Uint64 : constant Gvariant_Type; 7726 Gvariant_Type_Double : constant Gvariant_Type; 7727 Gvariant_Type_String : constant Gvariant_Type; 7728 7729 pragma Import (C, Gvariant_Type_Boolean, "ada_gvariant_type_boolean"); 7730 pragma Import (C, Gvariant_Type_Byte, "ada_gvariant_type_byte"); 7731 pragma Import (C, Gvariant_Type_Int16, "ada_gvariant_type_int16"); 7732 pragma Import (C, Gvariant_Type_Uint16, "ada_gvariant_type_uint16"); 7733 pragma Import (C, Gvariant_Type_Int32, "ada_gvariant_type_int32"); 7734 pragma Import (C, Gvariant_Type_Uint32, "ada_gvariant_type_uint32"); 7735 pragma Import (C, Gvariant_Type_Int64, "ada_gvariant_type_int64"); 7736 pragma Import (C, Gvariant_Type_Uint64, "ada_gvariant_type_uint64"); 7737 pragma Import (C, Gvariant_Type_Double, "ada_gvariant_type_double"); 7738 pragma Import (C, Gvariant_Type_String, "ada_gvariant_type_string"); 7739 </spec> 7740 </extra> 7741 </package> 7742 7743 <package id="GBytes" ada="Glib.Bytes" /> 7744 7745 <package id="GString" ada="Glib.String"> 7746 <record ctype="GString"/> 7747 <method id="g_string_append_vprintf" bind="False"/> <!-- valist --> 7748 <method id="g_string_vprintf" bind="False"/> <!-- valist --> 7749 <method id="g_string_free_to_bytes" bind="False"/> <!-- requires GByte --> 7750 </package> 7751 7752 <package id="GMenu" ada="Glib.Menu"> 7753 <method id="g_menu_get_type" ada="Get_Type_Menu" /> 7754 </package> 7755 7756 <package id="GMenuItem" into="GMenu" ada="Glib.Menu"> 7757 <method id="g_menu_item_get_type" ada="Get_Type_Menu_Item" /> 7758 </package> 7759 7760 <package id="GMenuModel" ada="Glib.Menu_Model"> 7761 <method id="g_menu_model_get_type" ada="Get_Type_Menu_Model" /> 7762 </package> 7763 7764 <package id="GMenuAttributeIter" into="GMenuModel" ada="Glib.Menu_Model"> 7765 <method id="g_menu_attribute_iter_get_type" ada="Get_Type_Menu_Attribute_Iter" /> 7766 <method id="g_menu_attribute_iter_get_next" bind="False"/> <!-- parameter out String --> 7767 </package> 7768 7769 <package id="GMenuLinkIter" into="GMenuModel" ada="Glib.Menu_Model"> 7770 <method id="g_menu_link_iter_get_type" ada="Get_Type_Menu_Link_Iter" /> 7771 <method id="g_menu_link_iter_get_next" bind="False"/> <!-- parameter out String --> 7772 </package> 7773 7774 <package id="GApplication" ada="Glib.Application"> 7775 <virtual-method id='command_line' bind='True'/> 7776 <virtual-method id='local_command_line' bind='True'> 7777 <parameter name='arguments' type='Gtkada.Bindings.chars_ptr_array_access' direction='access'/> 7778 </virtual-method> 7779 <enum ctype="GApplicationFlags"/> 7780 <method id="g_application_get_dbus_connection" bind="False"/> <!-- requires DBus --> 7781 <method id="g_application_open" bind="False" /> <!-- requires GFile --> 7782 <method id="::open" bind="False"/> <!-- requires GFile --> 7783 <method id="g_application_add_main_option_entries" bind="False"/> <!-- requires GOptionEntry --> 7784 <method id="g_application_add_main_option" bind="False" /> <!-- circular dependency --> 7785 <method id="g_application_add_option_group" bind="False"/> <!-- circular dependency --> 7786 <method id="::handle-local-options" bind="False"/> <!-- require GVariant --> 7787 </package> 7788 7789 <package id="GNotification" ada="Glib.Notification"> 7790 <method id="g_notification_set_body"> 7791 <parameter name="body" ada="the_body"/> 7792 </method> 7793 <enum ctype='GNotificationPriority'/> 7794 </package> 7795 7796 <package id="GApplicationCommandLine" into="GApplication" ada="Glib.Application"> 7797 <method id="g_application_command_line_create_file_for_arg" bind="False" /> <!-- requires GFile --> 7798 <method id="g_application_command_line_get_stdin" bind="False" /> <!-- requires GInputStream --> 7799 <method id="g_application_command_line_get_type" ada="Get_Type_Command_Line" /> 7800 <method id="g_application_command_line_get_options_dict" bind="False"/> <!-- requires GVariant --> 7801 <method id="g_application_command_line_get_arguments"> 7802 <parameter name="argc" ada="" default="null"/> 7803 <return-value transfer-ownership="full"/> 7804 </method> 7805 <extra> 7806 <spec> 7807 function Run 7808 (Self : not null access Gapplication_Record) return Gint; 7809 -- Same as above, but automatically sets argc argv from actual values. 7810 </spec> 7811 <body> 7812 gnat_argc : Interfaces.C.int; 7813 pragma Import (C, gnat_argc); 7814 7815 gnat_argv : System.Address; 7816 pragma Import (C, gnat_argv); 7817 7818 function Run 7819 (Self : not null access Gapplication_Record) return Gint 7820 is 7821 function Internal 7822 (Self : System.Address; 7823 Argc : Gint; 7824 Argv : System.Address) return Gint; 7825 pragma Import (C, Internal, "g_application_run"); 7826 begin 7827 return Internal (Self.Get_Object, Gint (gnat_argc), gnat_argv); 7828 end Run; 7829 </body> 7830 </extra> 7831 </package> 7832 7833 <package id="GOptionContext" ada="Glib.Option"> 7834 <record ctype="GOptionGroup"/> 7835 <record ctype="GOptionEntry"> 7836 <field name="flags" ctype="GOptionFlags"/> 7837 </record> 7838 <enum ctype="GOptionError"/> 7839 <enum ctype="GOptionArg"/> 7840 <enum ctype="GOptionFlags"/> 7841 <method id="g_option_context_new" ada="G_New"/> 7842 <method id="g_option_group_new" ada="G_New"/> 7843 <method id="g_option_context_parse" bind="False"/> <!-- Invalid binding generated --> 7844 <method id="g_option_context_parse_strv" bind="False"/> <!-- low-level --> 7845 <method id="g_option_context_add_main_entries"> 7846 <parameter name="entries" type="GOption_Entry_Array"/> 7847 </method> 7848 <extra> 7849 <type ctype="array_of_GOptionEntry" ada="GOption_Entry_Array"> 7850 type GOption_Entry_Array is array (Natural range <>) of GOption_Entry; 7851 </type> 7852 <with_spec pkg="Glib.Application"/> 7853 <with_spec pkg="Glib.Error"/> 7854 <with_spec pkg="Interfaces.C.Strings"/> 7855 <with_spec pkg="Gtkada.Bindings"/> 7856 <with_body pkg="Ada.Unchecked_Conversion" use='false'/> 7857 <spec> 7858 Null_GOption_Entry : constant GOption_Entry; 7859 7860 type Parse_Filter is access function (Param : String) return Boolean; 7861 -- Returns True if the parameter is to be passed from Command_Line to 7862 -- Goption_Context 7863 7864 procedure Parse 7865 (Self : Goption_Context; 7866 Command_Line : not null access Glib.Application.Gapplication_Command_Line_Record'Class; 7867 Filter : Parse_Filter := null; 7868 Success : out Boolean; 7869 Error : out Glib.Error.GError); 7870 -- Parses the arguments given via Command_Line, removing from the arguments 7871 -- list all parsed switches. 7872 7873 procedure Parse 7874 (Self : Goption_Context; 7875 Argv : access chars_ptr_array_access; -- Null-terminated 7876 Success : out Boolean; 7877 Error : out Glib.Error.GError); 7878 -- This version is suitable for use from Glib.Application.Local_Command_Line 7879 </spec> 7880 <spec private="True"> 7881 Null_GOption_Entry : constant GOption_Entry := 7882 (ICS.Null_Ptr, Gchar(ASCII.NUL), 7883 0, G_Option_Arg_None, System.Null_Address, 7884 ICS.Null_Ptr, ICS.Null_Ptr); 7885 </spec> 7886 <body> 7887 ----------- 7888 -- Parse -- 7889 ----------- 7890 7891 procedure Parse 7892 (Self : Goption_Context; 7893 Command_Line : not null access Glib.Application.Gapplication_Command_Line_Record'Class; 7894 Filter : Parse_Filter := null; 7895 Success : out Boolean; 7896 Error : out Glib.Error.GError) 7897 is 7898 function Get_Args 7899 (Self : System.Address; 7900 Argc : access Glib.Gint) return chars_ptr_array_access; 7901 pragma Import (C, Get_Args, "g_application_command_line_get_arguments"); 7902 7903 function Internal 7904 (Self : System.Address; 7905 Argc : access Glib.Gint; 7906 Argv : System.Address; 7907 Error : System.Address) return Glib.Gboolean; 7908 pragma Import (C, Internal, "g_option_context_parse"); 7909 7910 pragma Warnings (Off, "possible aliasing problem for*"); 7911 function Convert is new Ada.Unchecked_Conversion 7912 (System.Address, chars_ptr_array_access); 7913 pragma Warnings (On, "possible aliasing problem for*"); 7914 7915 Argc : aliased Glib.Gint; 7916 Argv : chars_ptr_array_access; 7917 Err : Glib.Error.GError; 7918 Ret : Glib.Gboolean; 7919 begin 7920 Argv := Get_Args (Command_Line.Get_Object, Argc'Access); 7921 7922 if Filter = null then 7923 Ret := Internal (Get_Object (Self), Argc'Access, Argv'Address, Err'Address); 7924 else 7925 declare 7926 Args : aliased ICS.chars_ptr_array := To_Chars_Ptr (Argv); 7927 Idx : aliased Glib.Gint := 1; 7928 begin 7929 -- Copy command name argument 7930 Args (0) := Argv (0); 7931 Idx := 1; 7932 7933 for J in 1 .. Argc - 1 loop 7934 if Filter (ICS.Value (Argv (Interfaces.C.size_t (J)))) then 7935 Args (Interfaces.C.size_t (Idx)) := 7936 Argv (Interfaces.C.size_t (J)); 7937 Idx := Idx + 1; 7938 end if; 7939 end loop; 7940 7941 Argv := Convert (Args'Address); 7942 Ret := Internal 7943 (Get_Object (Self), Idx'Access, Argv'Address, Err'Address); 7944 end; 7945 end if; 7946 7947 Error := Err; 7948 Success := Ret /= 0; 7949 end Parse; 7950 7951 ----------- 7952 -- Parse -- 7953 ----------- 7954 7955 procedure Parse 7956 (Self : Goption_Context; 7957 Argv : access chars_ptr_array_access; -- Null-terminated 7958 Success : out Boolean; 7959 Error : out Glib.Error.GError) 7960 is 7961 use Interfaces.C; 7962 function Internal 7963 (Self : System.Address; 7964 Argc : access Glib.Gint; 7965 Argv : access chars_ptr_array_access; 7966 Error : System.Address) return Glib.Gboolean; 7967 pragma Import (C, Internal, "g_option_context_parse"); 7968 7969 Err : Glib.Error.GError; 7970 Ret : Glib.Gboolean; 7971 Argc : aliased Glib.Gint := 0; 7972 7973 begin 7974 while Argv.all (size_t (Argc)) /= Null_Ptr loop 7975 Argc := Argc + 1; 7976 end loop; 7977 7978 Ret := Internal (Get_Object (Self), Argc'Access, Argv, Err'Address); 7979 Argv.all (size_t (Argc)) := Null_Ptr; 7980 Error := Err; 7981 Success := Ret /= 0; 7982 end Parse; 7983 </body> 7984 </extra> 7985 </package> 7986 7987 <package id="GAction" ada="Glib.Action"> 7988 <method id="g_action_parse_detailed_name" bind="False"/> <!-- incorrect generated binding --> 7989 </package> 7990 7991 <package id="GSimpleAction" ada="Glib.Simple_Action"> 7992 </package> 7993 7994 <package id="GActionGroup" ada="Glib.Action_Group"> 7995 </package> 7996 7997 <package id="GSimpleActionGroup" ada="Glib.Simple_Action_Group"> 7998 <method id="g_simple_action_group_add_entries"> 7999 <parameter name="entries" type="Glib.Action_Map.GAction_Entry_Array"/> 8000 <parameter name="n_entries" ada="" default="Entries'Length"/> 8001 <parameter name="user_data" default="System.Null_Address"/> 8002 </method> 8003 </package> 8004 8005 <package id="GActionMap" ada="Glib.Action_Map"> 8006 <record ctype="GActionEntry" private="true" /> 8007 <method id="g_action_map_add_action_entries"> 8008 <parameter name="n_entries" ada="" default="Entries'Length"/> 8009 <parameter name="user_data" default="System.Null_Address"/> 8010 </method> 8011 <extra> 8012 <type ctype="array_of_ActionEntry" ada="GAction_Entry_Array"> 8013 type GAction_Entry_Array is array (Natural range <>) of GAction_Entry; 8014 </type> 8015 <with_spec pkg="Glib.Variant"/> 8016 <with_spec pkg="Glib.Simple_Action"/> 8017 <spec> 8018 type Activate_Callback is access procedure 8019 (Action : access Glib.Simple_Action.Gsimple_Action; 8020 Parameter : Glib.Variant.Gvariant; 8021 Data : System.Address); 8022 pragma Convention (C, Activate_Callback); 8023 8024 type Change_State_Callback is access procedure 8025 (Action : access Glib.Simple_Action.Gsimple_Action; 8026 Parameter : Glib.Variant.Gvariant; 8027 Data : System.Address); 8028 pragma Convention (C, Change_State_Callback); 8029 8030 function Build 8031 (Name : String; 8032 Activate : Activate_Callback := null; 8033 Parameter_Type : String := ""; 8034 State : String := ""; 8035 Change_State : Change_State_Callback := null) 8036 return GAction_Entry; 8037 -- Return a newly allocation action entry. 8038 -- This will be freed by the the action_map when needed. 8039 -- 8040 -- Name is the name of the action. 8041 -- Activate is the callback to connect to the "activate" signal of 8042 -- the action. 8043 -- Parameter_Type is the type of the parameter that must be passed 8044 -- to the activate function for this action, given as a single 8045 -- Gvariant (or the empty string for no parameter). 8046 -- State is the initial state of this action, given in Gvariant 8047 -- text format. The state is parsed with no extra type information 8048 -- so type tags must be added to the string if they are necessary. 8049 -- Change_State is the callback for the "change-state" signal. 8050 </spec> 8051 <with_body pkg="Ada.Unchecked_Conversion" use="false" /> 8052 <body> 8053 function Convert is new Ada.Unchecked_Conversion 8054 (Activate_Callback, System.Address); 8055 function Convert is new Ada.Unchecked_Conversion 8056 (Change_State_Callback, System.Address); 8057 8058 function Build 8059 (Name : String; 8060 Activate : Activate_Callback := null; 8061 Parameter_Type : String := ""; 8062 State : String := ""; 8063 Change_State : Change_State_Callback := null) 8064 return GAction_Entry 8065 is 8066 P, S : chars_ptr := null_ptr; 8067 begin 8068 if Parameter_Type /= "" then 8069 P := New_String (Parameter_Type); 8070 end if; 8071 if State /= "" then 8072 S := New_String (State); 8073 end if; 8074 return GAction_Entry' 8075 (Name => New_String (Name), 8076 Activate => Convert (Activate), 8077 Parameter_Type => P, 8078 State => S, 8079 Change_State => Convert (Change_State), 8080 Padding => <>); 8081 end Build; 8082 </body> 8083 </extra> 8084 </package> 8085 8086 <package id="GtkApplication"> 8087 <enum ctype="GtkApplicationInhibitFlags"/> 8088 <method id="gtk_application_get_windows" return="WidgetList"/> 8089 </package> 8090 8091 <package id="GCancellable" ada="Glib.Cancellable"> 8092 <method id="g_cancellable_make_pollfd" bind="False"/> <!-- requires GPoll_FD --> 8093 </package> 8094 8095 <package id="GdkDeviceManager"> 8096 <method id="gdk_device_manager_list_devices" return="DeviceList"/> 8097 <method id="::device-added" bind="False"/> 8098 <method id="::device-changed" bind="False"/> 8099 <method id="::device-removed" bind="False"/> 8100 <extra> 8101 <spec> 8102 function Get_Device_Manager 8103 (Self : not null access Gdk.Display.Gdk_Display_Record'Class) 8104 return Gdk.Device_Manager.Gdk_Device_Manager; 8105 -- Returns the Gdk.Device_Manager.Gdk_Device_Manager associated to 8106 -- Display. 8107 -- Since: gtk+ 3.0 8108 </spec> 8109 <body> 8110 function Get_Device_Manager 8111 (Self : not null access Gdk.Display.Gdk_Display_Record'Class) 8112 return Gdk.Device_Manager.Gdk_Device_Manager 8113 is 8114 function Internal (Self : System.Address) return System.Address; 8115 pragma Import (C, Internal, "gdk_display_get_device_manager"); 8116 Stub_Gdk_Device_Manager : Gdk.Device_Manager.Gdk_Device_Manager_Record; 8117 begin 8118 return Gdk.Device_Manager.Gdk_Device_Manager (Get_User_Data (Internal (Get_Object (Self)), Stub_Gdk_Device_Manager)); 8119 end Get_Device_Manager; 8120 </body> 8121 </extra> 8122 </package> 8123 8124 <package id="GdkDisplay"> 8125 <method id="gdk_display_get_app_launch_context" bind="False"/> <!-- requires GdkAppLaunchContext --> 8126 <method id="gdk_display_list_devices" bind="False"/> <!-- deprecated --> 8127 <method id="gdk_display_get_default_screen" bind="False"/> <!-- in gdk-screen.ads --> 8128 <method id="gdk_display_get_screen" bind="False"/> <!-- in gdk-screen.ads --> 8129 <method id="gdk_display_get_pointer" bind="False"/> <!-- deprecated by Gdk.Device.Get_Position --> 8130 <method id="gdk_display_warp_pointer" bind="False"/> <!-- deprecated, Gdk.Device.Warp --> 8131 <method id="gdk_display_get_device_manager" bind="False"/> <!-- in gdk-device_manager.ads --> 8132 <method id="gdk_display_device_is_grabbed" bind="False"/> <!-- circular dependency --> 8133 <method id="gdk_display_store_clipboard" bind="False"/> <!-- see below --> 8134 <method id="gdk_display_get_window_at_pointer" bind="False"/> <!-- see below --> 8135 <extra> 8136 <spec> 8137 procedure Store_Clipboard 8138 (Display : not null access Gdk_Display_Record; 8139 Clipboard_Window : Gdk.Gdk_Window; 8140 Time : Guint32; 8141 Targets : Gdk.Types.Gdk_Atom_Array); 8142 -- Issues a request to the clipboard manager to store the clipboard data. 8143 -- On X11, this is a special program that works according to the 8144 -- freedesktop clipboard specification, available at <ulink 8145 -- url="http://www.freedesktop.org/Standards/clipboard-manager-spec"> 8146 -- http://www.freedesktop.org/Standards/clipboard-manager-spec</ulink>>. 8147 -- Since: gtk+ 2.6 8148 -- "clipboard_window": a Gdk.Gdk_Window belonging to the clipboard owner 8149 -- "time_": a timestamp 8150 -- "targets": an array of targets that should be saved, or null if all 8151 -- available targets should be saved. 8152 -- "n_targets": length of the Targets array 8153 8154 procedure Get_Window_At_Pointer 8155 (Display : access Gdk_Display_Record; 8156 Win_X : out Glib.Gint; 8157 Win_Y : out Glib.Gint; 8158 Win : out Gdk.Gdk_Window); 8159 -- Obtains the window underneath the mouse pointer, returning the location 8160 -- of that window in Win_X, Win_Y. Returns nullif the window 8161 -- under the mouse pointer is not known to GDK (for example, belongs to 8162 -- another application). 8163 -- (Win_X, Win_Y) are relative to the origin of the window under the 8164 -- pointer. 8165 -- 8166 -- Obsolescent: use Gdk.Device.Get_Window_At_Position instead. 8167 </spec> 8168 <body> 8169 procedure Store_Clipboard 8170 (Display : not null access Gdk_Display_Record; 8171 Clipboard_Window : Gdk_Window; 8172 Time : Guint32; 8173 Targets : Gdk.Types.Gdk_Atom_Array) 8174 is 8175 procedure Internal 8176 (Display : System.Address; 8177 Clipboard_Window : Gdk_Window; 8178 Time : Guint32; 8179 Targets : System.Address; 8180 N_Targets : Gint); 8181 pragma Import (C, Internal, "gdk_display_store_clipboard"); 8182 begin 8183 Internal (Get_Object (Display), Clipboard_Window, Time, 8184 Targets (Targets'First)'Address, Targets'Length); 8185 end Store_Clipboard; 8186 8187 procedure Get_Window_At_Pointer 8188 (Display : access Gdk_Display_Record; 8189 Win_X : out Gint; 8190 Win_Y : out Gint; 8191 Win : out Gdk_Window) 8192 is 8193 function Internal 8194 (Display : System.Address; 8195 Win_X : access Gint; 8196 Win_Y : access Gint) return Gdk_Window; 8197 pragma Import (C, Internal, "gdk_display_get_window_at_pointer"); 8198 X, Y : aliased Gint; 8199 begin 8200 Win := Internal (Get_Object (Display), X'Access, Y'Access); 8201 Win_X := X; 8202 Win_Y := Y; 8203 end Get_Window_At_Pointer; 8204 </body> 8205 </extra> 8206 </package> 8207 8208 <package id='GtkActivatable'> 8209 <virtual-method id='*' bind='False'/> 8210 </package> 8211 8212 <package id='GtkListBoxRow'> 8213 <list ctype="GtkListBoxRow" ada="List_Box_Row_List" /> 8214 </package> 8215 <package id='GtkListBox'> 8216 <method id='gtk_list_box_get_selected_rows' return='ListBoxRowList'> 8217 </method> 8218 </package> 8219 8220 <package id='GtkGesture'> 8221 <list ctype='GtkGesture' ada='Gesture_List'/> 8222 <list ctype='GdkEventSequence' ada='Gdk_Event_Sequence_List'/> 8223 <method id='gtk_gesture_get_group' return='GestureList'/> 8224 <method id='gtk_gesture_get_sequences' return='GdkEventSequenceList'/> 8225 </package> 8226 8227 8228 <!-- Below were added just for the sake of parsing the files to get information 8229 on their symbols, and properly substitute them in the docs. 8230 No file is generated from them. 8231 --> 8232 8233 <package id="GtkNumerableIcon"> 8234 <method id="gtk_numerable_icon_new" ada="Gtk_New"/> 8235 <method id="gtk_numerable_icon_new_with_style_context" ada="Gtk_New_With_Style_Context"/> 8236 </package> 8237 8238 <package id="GtkIMContext"> 8239 <!-- There are issues with binding string parameters for the following 8240 two methods: --> 8241 <method id="gtk_im_context_get_preedit_string" bind="False" /> 8242 <method id="gtk_im_context_get_surrounding" bind="False" /> 8243 </package> 8244 8245 <package id="GtkRevealer"> 8246 <enum ctype="GtkRevealerTransitionType"/> 8247 </package> 8248 8249 <package id="GtkStack"> 8250 <enum ctype="GtkStackTransitionType"/> 8251 </package> 8252 8253 <package id="GtkFlowBox"> 8254 <method id="gtk_flow_box_get_selected_children" return="WidgetList" /> 8255 </package> 8256</GIR> 8257