Braille.Display (braille-display.adb): (Specification)

Children:


--  © Copyright 2000 by John Halleck, All Rights Reserved.
--  Display a line of Braille ASCII braille as psudo Braille.

package body Braille.Display is

   --  Functions local to this body.
   function Map (Left, Right : Cell; Suppress : Boolean) return Display_Row;


   --  Actual Implementation.

   function Map (Left, Right : Cell; Suppress : Boolean) return Display_Row is
      Result : Display_Row;
   begin

      Result := Blank_Row;
 
      if Left /= Empty then
         Result (1) := '*';
      end if;

      if Right /= Empty then
         Result (2) := '*';
      end if;
   
      return Result;
   end Map;

 
   function Translate (Given : Cell;
                       Suppress_Blanks : Boolean := True
                      ) return Display_Cell is
      Result : Display_Cell;
   begin
      if not Suppress_Blanks or Given /= Empty then
         Result (1) := Map (Dot_1 and Given, Dot_4 and Given, Suppress_Blanks);
         Result (2) := Map (Dot_2 and Given, Dot_5 and Given, Suppress_Blanks);
         Result (3) := Map (Dot_3 and Given, Dot_6 and Given, Suppress_Blanks);
      else
         Result := ("  ", "  ", "  ");
      end if;
      return Result;
   end Translate;


end Braille.Display;

Go to ...


This page is http://www.cc.utah.edu/~nahaj/ada/braille/braille-display.adb.html
© Copyright 2000 by John Halleck, All Rights Reserved.
This snapshot was last modified on August 24th, 2000