~ubuntu-branches/ubuntu/intrepid/libgtkada2/intrepid

« back to all changes in this revision

Viewing changes to src/opengl/gtk-glarea.adb

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-08-11 09:46:51 UTC
  • mfrom: (6.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20080811094651-9mjd6acwa98ffw5c
Tags: 2.12.0-2ubuntu1
Add lpia to supported architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
-----------------------------------------------------------------------
2
2
--          GtkAda - Ada95 binding for the Gimp Toolkit              --
3
3
--                                                                   --
 
4
--   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --
 
5
--               Copyright (C) 2001-2008, AdaCore                    --
4
6
--                                                                   --
5
7
-- This library is free software; you can redistribute it and/or     --
6
8
-- modify it under the terms of the GNU General Public               --
30
28
 
31
29
package body Gtk.GLArea is
32
30
 
33
 
   function Type_Conversion (Type_Name : String) return GObject;
 
31
   package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
 
32
     (Get_Type'Access, Gtk_GLArea_Record);
 
33
   pragma Warnings (Off, Type_Conversion);
 
34
   --  This package is used to implement a minimal automated type conversion
 
35
   --  without having to drag the whole Gtk.Type_Conversion package for the
 
36
   --  most common widgets.
34
37
 
35
38
   procedure On_Destroy (Widget : access Gtk_Widget_Record'Class);
36
39
 
52
55
   -------------
53
56
 
54
57
   procedure Gtk_New (Widget    : out Gtk_GLArea;
55
 
                      Attr_List : in  Attributes_Array) is
 
58
                      Attr_List : Attributes_Array) is
56
59
   begin
57
60
      Widget := new Gtk_GLArea_Record;
58
61
      Initialize (Widget, Attr_List);
63
66
   ----------------
64
67
 
65
68
   procedure Initialize (Widget    : access Gtk_GLArea_Record;
66
 
                         Attr_List : in     Attributes_Array)
 
69
                         Attr_List : Attributes_Array)
67
70
   is
68
71
      function Internal (Attr_List : System.Address) return System.Address;
69
72
      pragma Import (C, Internal, "gtk_gl_area_new");
90
93
   -------------
91
94
 
92
95
   procedure Gtk_New
93
 
     (Widget    :    out Gtk_GLArea;
94
 
      Attr_List : in     Attributes_Array;
 
96
     (Widget    : out Gtk_GLArea;
 
97
      Attr_List : Attributes_Array;
95
98
      Share     : access Gtk_GLArea_Record'Class) is
96
99
   begin
97
100
      Widget := new Gtk_GLArea_Record;
104
107
 
105
108
   procedure Initialize
106
109
     (Widget    : access Gtk_GLArea_Record;
107
 
      Attr_List : in     Attributes_Array;
 
110
      Attr_List : Attributes_Array;
108
111
      Share     : access Gtk_GLArea_Record'Class)
109
112
   is
110
113
      function Internal (Attr_List : System.Address;
146
149
      Internal (Get_Object (Glarea));
147
150
   end Swap_Buffers;
148
151
 
149
 
   ---------------------
150
 
   -- Type_Conversion --
151
 
   ---------------------
152
 
 
153
 
   function Type_Conversion (Type_Name : String) return GObject is
154
 
   begin
155
 
      if Type_Name = "GtkGlArea" then
156
 
         return new Gtk.GLArea.Gtk_GLArea_Record;
157
 
      end if;
158
 
      return null;
159
 
   end Type_Conversion;
160
 
 
161
 
begin
162
 
   Glib.Type_Conversion_Hooks.Add_Hook (Type_Conversion'Access);
163
152
end Gtk.GLArea;