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

« back to all changes in this revision

Viewing changes to src/gdk-rgb.ads

  • 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:
2
2
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
3
3
--                                                                   --
4
4
--   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --
 
5
--                Copyright (C) 2000-2007, AdaCore                   --
5
6
--                                                                   --
6
7
-- This library is free software; you can redistribute it and/or     --
7
8
-- modify it under the terms of the GNU General Public               --
68
68
   --  The drawable you intend to copy the RGB buffer to must use this visual
69
69
   --  and this colormap. Therefore, before creating the widget, you need to do
70
70
   --  the following:
71
 
   --    - Gtk.Widget.Push_Visual (Gdk.Rgb.Get_Visual);
72
71
   --    - Gtk.Widget.Push_Colormap (Gdk.Rgb.Get_Cmap);
73
72
   --    - Gtk_New (....)
74
 
   --    - Gtk.Widget.Pop_Visual;
75
73
   --    - Gtk.Widget.Pop_Colormap;
76
74
 
77
 
   type Rgb_Buffer is array (Natural) of Glib.Guchar;
78
 
   pragma Convention (C, Rgb_Buffer);
 
75
   type Rgb_Record is record
 
76
      Red, Green, Blue : Glib.Guchar;
 
77
   end record;
 
78
   pragma Convention (C, Rgb_Record);
 
79
 
 
80
   type Rgb_Buffer is array (Glib.Guint range <>) of Rgb_Record;
 
81
   pragma Pack (Rgb_Buffer);
79
82
   --  This is the buffer that will contain the image. You can manipulate each
80
83
   --  byte in it independantly, although there is no high level routine
81
84
   --  to draw lines, circles, ...
83
86
   --  drawable on the screen, *if* the widget was created with the correct
84
87
   --  visual and colormap (see above).
85
88
 
86
 
   type Rgb_Buffer_Access is access all Rgb_Buffer;
 
89
   type Unchecked_Rgb_Buffer is array (Glib.Guint) of Rgb_Record;
 
90
   pragma Convention (C, Unchecked_Rgb_Buffer);
 
91
   type Rgb_Buffer_Access is access all Unchecked_Rgb_Buffer;
87
92
   pragma Convention (C, Rgb_Buffer_Access);
88
 
   --  Type used By Gdk.Pixbufs.Get_Pixels below to return an array with no
89
 
   --  bound checks that is comatible with C (also known as a flat array).
 
93
   --  Type used By Gdk.Pixbufs.Get_Pixels to return an array with no
 
94
   --  bound checks that is compatible with C (also known as a flat array).
90
95
 
91
96
   type Gdk_Rgb_Dither is (Dither_None, Dither_Normal, Dither_Max);
92
97
   --  The three kinds of dithering that are implemented in this package:
155
160
      Dith          : Gdk_Rgb_Dither;
156
161
      Rgb_Buf       : Rgb_Buffer;
157
162
      Rowstride     : Glib.Gint);
 
163
   procedure Draw_Rgb_Image
 
164
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
165
      GC            : Gdk.GC.Gdk_GC;
 
166
      X, Y          : Glib.Gint;
 
167
      Width, Height : Glib.Gint;
 
168
      Dith          : Gdk_Rgb_Dither;
 
169
      Rgb_Buf       : Unchecked_Rgb_Buffer;
 
170
      Rowstride     : Glib.Gint);
158
171
   --  Render a Gdk buffer with 24 bit Data.
159
172
   --  Such a buffer is a one dimensional array of bytes, where every byte
160
173
   --  triplet makes up a pixel (byte 0 is red, byte 1 is green and byte 2 is
177
190
      Rgb_Buf       : Rgb_Buffer;
178
191
      Rowstride     : Glib.Gint;
179
192
      Xdith, Ydith  : Glib.Gint);
180
 
   --  Same kind of function as above, but for different buffer types (???).
181
 
 
182
 
   procedure Draw_Rgb_32_Image
183
 
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
184
 
      GC            : Gdk.GC.Gdk_GC;
185
 
      X, Y          : Glib.Gint;
186
 
      Width, Height : Glib.Gint;
187
 
      Dith          : Gdk_Rgb_Dither;
188
 
      Rgb_Buf       : Rgb_Buffer;
189
 
      Rowstride     : Glib.Gint);
190
 
   --  Same kind of function as above, but for different buffer types (???).
191
 
 
192
 
   procedure Draw_Rgb_32_Image_Dithalign
193
 
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
194
 
      GC            : Gdk.GC.Gdk_GC;
195
 
      X, Y          : Glib.Gint;
196
 
      Width, Height : Glib.Gint;
197
 
      Dith          : Gdk_Rgb_Dither;
198
 
      Rgb_Buf       : Rgb_Buffer;
199
 
      Rowstride     : Glib.Gint;
200
 
      Xdith, Ydith  : Glib.Gint);
201
 
   --  Same kind of function as above, but for different buffer types (???).
202
 
 
203
 
   procedure Draw_Gray_Image
204
 
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
205
 
      GC            : Gdk.GC.Gdk_GC;
206
 
      X, Y          : Glib.Gint;
207
 
      Width, Height : Glib.Gint;
208
 
      Dith          : Gdk_Rgb_Dither;
209
 
      Rgb_Buf       : Rgb_Buffer;
210
 
      Rowstride     : Glib.Gint);
211
 
   --  Same kind of function as above, but for different buffer types (???).
212
 
 
213
 
   procedure Draw_Indexed_Image
214
 
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
215
 
      GC            : Gdk.GC.Gdk_GC;
216
 
      X, Y          : Glib.Gint;
217
 
      Width, Height : Glib.Gint;
218
 
      Dith          : Gdk_Rgb_Dither;
219
 
      Rgb_Buf       : Rgb_Buffer;
 
193
   procedure Draw_Rgb_Image_Dithalign
 
194
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
195
      GC            : Gdk.GC.Gdk_GC;
 
196
      X, Y          : Glib.Gint;
 
197
      Width, Height : Glib.Gint;
 
198
      Dith          : Gdk_Rgb_Dither;
 
199
      Rgb_Buf       : Unchecked_Rgb_Buffer;
 
200
      Rowstride     : Glib.Gint;
 
201
      Xdith, Ydith  : Glib.Gint);
 
202
   --  Same kind of function as above, but for different buffer types (???).
 
203
 
 
204
   procedure Draw_Rgb_32_Image
 
205
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
206
      GC            : Gdk.GC.Gdk_GC;
 
207
      X, Y          : Glib.Gint;
 
208
      Width, Height : Glib.Gint;
 
209
      Dith          : Gdk_Rgb_Dither;
 
210
      Rgb_Buf       : Rgb_Buffer;
 
211
      Rowstride     : Glib.Gint);
 
212
   procedure Draw_Rgb_32_Image
 
213
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
214
      GC            : Gdk.GC.Gdk_GC;
 
215
      X, Y          : Glib.Gint;
 
216
      Width, Height : Glib.Gint;
 
217
      Dith          : Gdk_Rgb_Dither;
 
218
      Rgb_Buf       : Unchecked_Rgb_Buffer;
 
219
      Rowstride     : Glib.Gint);
 
220
   --  Same kind of function as above, but for different buffer types (???).
 
221
 
 
222
   procedure Draw_Rgb_32_Image_Dithalign
 
223
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
224
      GC            : Gdk.GC.Gdk_GC;
 
225
      X, Y          : Glib.Gint;
 
226
      Width, Height : Glib.Gint;
 
227
      Dith          : Gdk_Rgb_Dither;
 
228
      Rgb_Buf       : Rgb_Buffer;
 
229
      Rowstride     : Glib.Gint;
 
230
      Xdith, Ydith  : Glib.Gint);
 
231
   procedure Draw_Rgb_32_Image_Dithalign
 
232
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
233
      GC            : Gdk.GC.Gdk_GC;
 
234
      X, Y          : Glib.Gint;
 
235
      Width, Height : Glib.Gint;
 
236
      Dith          : Gdk_Rgb_Dither;
 
237
      Rgb_Buf       : Unchecked_Rgb_Buffer;
 
238
      Rowstride     : Glib.Gint;
 
239
      Xdith, Ydith  : Glib.Gint);
 
240
   --  Same kind of function as above, but for different buffer types (???).
 
241
 
 
242
   procedure Draw_Gray_Image
 
243
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
244
      GC            : Gdk.GC.Gdk_GC;
 
245
      X, Y          : Glib.Gint;
 
246
      Width, Height : Glib.Gint;
 
247
      Dith          : Gdk_Rgb_Dither;
 
248
      Rgb_Buf       : Rgb_Buffer;
 
249
      Rowstride     : Glib.Gint);
 
250
   procedure Draw_Gray_Image
 
251
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
252
      GC            : Gdk.GC.Gdk_GC;
 
253
      X, Y          : Glib.Gint;
 
254
      Width, Height : Glib.Gint;
 
255
      Dith          : Gdk_Rgb_Dither;
 
256
      Rgb_Buf       : Unchecked_Rgb_Buffer;
 
257
      Rowstride     : Glib.Gint);
 
258
   --  Same kind of function as above, but for different buffer types (???).
 
259
 
 
260
   procedure Draw_Indexed_Image
 
261
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
262
      GC            : Gdk.GC.Gdk_GC;
 
263
      X, Y          : Glib.Gint;
 
264
      Width, Height : Glib.Gint;
 
265
      Dith          : Gdk_Rgb_Dither;
 
266
      Rgb_Buf       : Rgb_Buffer;
 
267
      Rowstride     : Glib.Gint;
 
268
      Cmap          : Gdk_Rgb_Cmap);
 
269
   procedure Draw_Indexed_Image
 
270
     (Drawable      : Gdk.Drawable.Gdk_Drawable;
 
271
      GC            : Gdk.GC.Gdk_GC;
 
272
      X, Y          : Glib.Gint;
 
273
      Width, Height : Glib.Gint;
 
274
      Dith          : Gdk_Rgb_Dither;
 
275
      Rgb_Buf       : Unchecked_Rgb_Buffer;
220
276
      Rowstride     : Glib.Gint;
221
277
      Cmap          : Gdk_Rgb_Cmap);
222
278
   --  Same kind of function as above, but for different buffer types (???).
233
289
   pragma Import (C, Get, "ada_rgb_cmap_get");
234
290
   pragma Import (C, Set, "ada_rgb_cmap_set");
235
291
   pragma Import (C, Free, "gdk_rgb_cmap_free");
236
 
   pragma Import (C, Draw_Rgb_Image, "gdk_draw_rgb_image");
237
 
   pragma Import (C, Draw_Rgb_Image_Dithalign, "gdk_draw_rgb_image_dithalign");
238
 
   pragma Import (C, Draw_Rgb_32_Image, "gdk_draw_rgb_32_image");
239
 
   pragma Import
240
 
     (C, Draw_Rgb_32_Image_Dithalign, "gdk_draw_rgb_32_image_dithalign");
241
 
   pragma Import (C, Draw_Gray_Image, "gdk_draw_gray_image");
242
 
   pragma Import (C, Draw_Indexed_Image, "gdk_draw_indexed_image");
243
292
end Gdk.Rgb;