1. with Allegro.Bitmaps;                   use Allegro.Bitmaps; 
  2. with Allegro.Fixed_Point_Math;          use Allegro.Fixed_Point_Math; 
  3. with Allegro.Truecolor;                 use Allegro.Truecolor; 
  4.  
  5. -- Allegro 4.4.2 - Drawing primitives 
  6. -- This package is missing: 
  7. -- _putpixel, _putpixel15, _putpixel16, _putpixel24, _putpixel32, _getpixel, 
  8. -- _getpixel15, _getpixel16, _getpixel24, _getpixel32, calc_spline, spline 
  9. package Allegro.Drawing is 
  10.  
  11.     type Point is 
  12.         record 
  13.             x, y : Integer; 
  14.         end record; 
  15.  
  16.     type Point_Array is array (Integer range <>) of Point; 
  17.  
  18.     type A_Draw_Proc is 
  19.         access procedure( bmp : A_Bitmap; x, y : Integer; d : Integer ); 
  20.  
  21.     --------------------------------------------------------------------------- 
  22.  
  23.     procedure Arc( bmp   : not null A_Bitmap; 
  24.                    x, y  : Integer; 
  25.                    ang1, 
  26.                    ang2  : Fixed; 
  27.                    r     : Integer; 
  28.                    color : Color_Type ); 
  29.  
  30.     procedure Circle( bmp    : not null A_Bitmap; 
  31.                       x, y, 
  32.                       radius : Integer; 
  33.                       color  : Color_Type ); 
  34.  
  35.     procedure Circlefill( bmp    : not null A_Bitmap; 
  36.                           x, y, 
  37.                           radius : Integer; 
  38.                           color  : Color_Type ); 
  39.  
  40.     procedure Clear_Bitmap( bmp : not null A_Bitmap ); 
  41.  
  42.     procedure Clear_To_Color( bmp : not null A_Bitmap; color : Color_Type ); 
  43.  
  44.     procedure Clear_To_Transparent( bmp : not null A_Bitmap ); 
  45.  
  46.     procedure Do_Arc( bmp    : not null A_Bitmap; 
  47.                       x, y, 
  48.                       a1, a2 : Fixed; 
  49.                       r      : Integer; 
  50.                       d      : Integer; 
  51.                       proc   : not null A_Draw_Proc ); 
  52.  
  53.     procedure Do_Circle( bmp    : not null A_Bitmap; 
  54.                          x, y, 
  55.                          radius : Integer; 
  56.                          d      : Integer; 
  57.                          proc   : not null A_Draw_Proc ); 
  58.  
  59.     procedure Do_Ellipse( bmp    : not null A_Bitmap; 
  60.                           x, y, 
  61.                           rx, ry : Integer; 
  62.                           d      : Integer; 
  63.                           proc   : not null A_Draw_Proc ); 
  64.  
  65.     procedure Do_Line( bmp    : not null A_Bitmap; 
  66.                        x1, y1, 
  67.                        x2, y2 : Integer; 
  68.                        d      : Integer; 
  69.                        proc   : not null A_Draw_Proc ); 
  70.  
  71.     procedure Ellipse( bmp    : not null A_Bitmap; 
  72.                        x, y, 
  73.                        rx, ry : Integer; 
  74.                        color  : Color_Type ); 
  75.  
  76.     procedure Ellipsefill( bmp    : not null A_Bitmap; 
  77.                            x, y, 
  78.                            rx, ry : Integer; 
  79.                            color  : Color_Type ); 
  80.  
  81.     procedure Fastline( bmp    : not null A_Bitmap; 
  82.                         x1, y1, 
  83.                         x2, y2 : Integer; 
  84.                         color  : Color_Type ); 
  85.  
  86.     procedure Floodfill( bmp   : not null A_Bitmap; 
  87.                          x, y  : Integer; 
  88.                          color : Color_Type ); 
  89.  
  90.     function Getpixel( bmp : not null A_Bitmap; x, y : Integer ) return Color_Type; 
  91.  
  92.     procedure Hline( bmp       : not null A_Bitmap; 
  93.                      x1, y, x2 : Integer; 
  94.                      color     : Color_Type ); 
  95.  
  96.     procedure Line( bmp    : not null A_Bitmap; 
  97.                     x1, y1, 
  98.                     x2, y2 : Integer; 
  99.                     color  : Color_Type ); 
  100.  
  101.     procedure Polygon( bmp    : not null A_Bitmap; 
  102.                        points : Point_Array; 
  103.                        color  : Color_Type ); 
  104.  
  105.     procedure Putpixel( bmp   : not null A_Bitmap; 
  106.                         x, y  : Integer; 
  107.                         color : Color_Type ); 
  108.  
  109.     procedure Rect( bmp    : not null A_Bitmap; 
  110.                     x1, y1, 
  111.                     x2, y2 : Integer; 
  112.                     color  : Color_Type ); 
  113.  
  114.     procedure Rectfill( bmp    : not null A_Bitmap; 
  115.                         x1, y1, 
  116.                         x2, y2 : Integer; 
  117.                         color  : Color_Type ); 
  118.  
  119.     procedure Triangle( bmp    : not null A_Bitmap; 
  120.                         x1, y1, 
  121.                         x2, y2, 
  122.                         x3, y3 : Integer; 
  123.                         color  : Color_Type ); 
  124.  
  125.     procedure Vline( bmp       : not null A_Bitmap; 
  126.                      x, y1, y2 : Integer; 
  127.                      color     : Color_Type ); 
  128.  
  129. private 
  130.  
  131.     pragma Convention( C, Point ); 
  132.     pragma Convention( C, Point_Array ); 
  133.     pragma Convention( C, A_Draw_Proc ); 
  134.  
  135.     pragma Import( C, Arc, "arc" ); 
  136.     pragma Import( C, Circle, "circle" ); 
  137.     pragma Import( C, Circlefill, "circlefill" ); 
  138.     pragma Import( C, Clear_Bitmap, "clear_bitmap" ); 
  139.     pragma Import( C, Clear_To_Color, "clear_to_color" ); 
  140.     pragma Import( C, Do_Arc, "do_arc" ); 
  141.     pragma Import( C, Do_Circle, "do_circle" ); 
  142.     pragma Import( C, Do_Ellipse, "do_ellipse" ); 
  143.     pragma Import( C, Do_Line, "do_line" ); 
  144.     pragma Import( C, Ellipsefill, "ellipsefill" ); 
  145.     pragma Import( C, Ellipse, "ellipse" ); 
  146.     pragma Import( C, Fastline, "fastline" ); 
  147.     pragma Import( C, Floodfill, "floodfill" ); 
  148.     pragma Import( C, Getpixel, "getpixel" ); 
  149.     pragma Import( C, Hline, "hline" ); 
  150.     pragma Import( C, Line, "line" ); 
  151.     pragma Import( C, Putpixel, "putpixel" ); 
  152.     pragma Import( C, Rect, "rect" ); 
  153.     pragma Import( C, Rectfill, "rectfill" ); 
  154.     pragma Import( C, Triangle, "triangle" ); 
  155.     pragma Import( C, Vline, "vline" ); 
  156.  
  157. end Allegro.Drawing;