1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2006 AdaCore                    -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. -- 
  27. --  This widget provides an empty canvas on which the application can draw 
  28. --  anything. 
  29. --  Note that this widget is simply an empty space, and that you need to 
  30. --  connect it to events to make it useful. For instance, you might want to do 
  31. --  one of the following : 
  32. -- 
  33. --  * Connect it to "expose_event": The handlers are called every time the 
  34. --    widget needs to be redrawn. You can then draw anything you want on the 
  35. --    canvas, after getting its associated window with a call to 
  36. --    Gtk.Widget.Get_Window. Note that the event mask is automatically set up 
  37. --    to accept expose_events. 
  38. -- 
  39. --  * Connect it to "button_press_event" and "button_release_event" events, 
  40. --    when you want it to react to user input. Note that you need to set up the 
  41. --    event mask with a call to Gtk.Widget.Set_Events. 
  42. -- 
  43. --  See also the Double_Buffer widget provided in the GtkAda examples for an 
  44. --  advanced example that demonstrates how to use double buffering, to avoid 
  45. --  flickering in your drawings. 
  46. -- 
  47. --  </description> 
  48. --  <c_version>2.8.17</c_version> 
  49. --  <group>Drawing</group> 
  50. --  <testgtk>libart_demo.adb</testgtk> 
  51.  
  52. with Gtk.Widget; 
  53.  
  54. package Gtk.Drawing_Area is 
  55.  
  56.    type Gtk_Drawing_Area_Record is new 
  57.      Gtk.Widget.Gtk_Widget_Record with private; 
  58.    type Gtk_Drawing_Area is access all Gtk_Drawing_Area_Record'Class; 
  59.  
  60.    procedure Gtk_New (Drawing_Area : out Gtk_Drawing_Area); 
  61.    --  Create a new blank Drawing_Area. 
  62.    --  Note that the background of the widget is uninitialized, and that you 
  63.    --  have to draw on it yourself. 
  64.  
  65.    procedure Initialize (Drawing_Area : access Gtk_Drawing_Area_Record'Class); 
  66.    --  Internal initialization function. 
  67.    --  See the section "Creating your own widgets" in the documentation. 
  68.  
  69.    function Get_Type return Gtk.Gtk_Type; 
  70.    --  Return the internal value associated with a Gtk_Drawing_Area. 
  71.  
  72.    ----------------- 
  73.    -- Obsolescent -- 
  74.    ----------------- 
  75.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  76.    --  from future versions of gtk+ (and therefore GtkAda). 
  77.    --  To find out whether your code uses any of these, we recommend compiling 
  78.    --  with the -gnatwj switch 
  79.    --  <doc_ignore> 
  80.  
  81.    procedure Size 
  82.      (Darea  : access Gtk_Drawing_Area_Record; 
  83.       Width  : Gint; 
  84.       Height : Gint); 
  85.    pragma Obsolescent;  --  Size 
  86.    --  Request a new size for the area. 
  87.    --  This queues a resize request for the area. 
  88.  
  89.    --  </doc_ignore> 
  90.  
  91.    ---------------- 
  92.    -- Properties -- 
  93.    ---------------- 
  94.  
  95.    --  <properties> 
  96.    --  The following properties are defined for this widget. See 
  97.    --  Glib.Properties for more information on properties. 
  98.    -- 
  99.    --  </properties> 
  100.  
  101.    ------------- 
  102.    -- Signals -- 
  103.    ------------- 
  104.  
  105.    --  <signals> 
  106.    --  The following new signals are defined for this widget: 
  107.    --  </signals> 
  108.  
  109. private 
  110.    type Gtk_Drawing_Area_Record is new Gtk.Widget.Gtk_Widget_Record 
  111.      with null record; 
  112.    pragma Import (C, Get_Type, "gtk_drawing_area_get_type"); 
  113. end Gtk.Drawing_Area;