home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adapm_15.zip / gpi.ads < prev    next >
Text File  |  1994-03-14  |  15KB  |  435 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                               PM Bindings                                --
  4. --                                                                          --
  5. --                                  GPI                                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: .14 $                              --
  10. --
  11. --  .11 
  12. --       First version of GPI 
  13. --       Char_String_At
  14. --
  15. --  .12  
  16. --       Background_Mix_Type
  17. --       Set_Background_Mix
  18. --       Color_Type
  19. --       Set_Background_Color
  20. --       Set_Color
  21. --
  22. --  .13
  23. --     Converted Text_Status_Type to Status_Type
  24. --     GPI_Error exception       
  25. --     Set_Current_Position
  26. --     Line    
  27. --     Box
  28. --     Set_Arc_Parameters
  29. --     Full_Arc
  30. --
  31. --  .14
  32. --    Char_String
  33. --    Move
  34. --    Set_Default_Arc_Parameters
  35. --    Query_Default_Arc_Parameters
  36. --    Query_Arc_Parameters
  37. --    Query_Current_Position
  38. --    Query_Line_End
  39. --    Set_Line_End
  40. --    Query_Line_Join
  41. --    Set_Line_Join
  42. --    Erase
  43. --    Destroy_Ps
  44. --
  45. --                                                                          --
  46. --     Copyright (c) 1994 Dimensional Media Systems, All Rights Reserved    --
  47. --                                                                          --
  48. --   The PM bindings are free software; you can redistribute them and/or    --
  49. --   modify them under terms of the GNU General Public License as published --
  50. --   by the Free Software Foundation; either version 2, or (at your         --
  51. --   option) any later version.  The PM bindings are distributed in the     --
  52. --   hope that they will be useful, but WITH OUT ANY WARRANTY; without even --
  53. --   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR    --
  54. --   PURPOSE.  See the GNU General Public License for more details.  You    --
  55. --   should have received a copy of the GNU General Public License          --
  56. --   distributed with The PM bindings; see file COPYING.  If not, write to  --
  57. --   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  --
  58. --                                                                          --
  59. ------------------------------------------------------------------------------
  60. --                                                                          --
  61. --   For more information about these PM bindings and their usage with GNAT --
  62. --   you can contact Bill Yow at                                            --
  63. --                                                                          --  
  64. --      Dimensional Media Systems (DMS)                                     --
  65. --      1522 Festival Dr.                                                   --
  66. --      Houston TX, 77062                                                   --
  67. --      Phone - (713) 488-7050                                              --
  68. --      Email - byow@mci.com                                                --
  69. --                                                                          --
  70. ------------------------------------------------------------------------------
  71.  
  72. with Pm_Types;
  73. with Win;
  74.  
  75. package GPI is
  76.  
  77.    GPI_Error  : exception;
  78.  
  79.    type Status_Type is (Okay, Hits, Error);
  80.  
  81.    type Background_Mix_Type is (
  82.        Bm_Error,
  83.        Bm_Default,
  84.        Bm_Or,
  85.        Bm_Overpaint,
  86.        Bm_Leave_Alone,
  87.        Bm_Xor,
  88.        Bm_And,
  89.        Bm_Subtract,
  90.        Bm_Mask_Src_Not,
  91.        Bm_Zero,
  92.        Bm_Not_Merge_Src,
  93.        Bm_Not_Xor_Src,
  94.        Bm_Invert,
  95.        Bm_Merge_Src_Not,
  96.        Bm_Not_Copy_Src,
  97.        Bm_Merge_Not_Src,
  98.        Bm_Not_Mask_Src,
  99.        Bm_One,
  100.        Bm_Src_Transparent,
  101.        Bm_Dest_Transparent);
  102.  
  103.    function Set_Background_Mix (
  104.               Ps  : Win.Ps_Type;
  105.               Mix : Background_Mix_Type) return Boolean;
  106.              
  107.    procedure Set_Background_Mix (
  108.               Ps  : Win.Ps_Type;
  109.               Mix : Background_Mix_Type);
  110.  
  111.    type Color_Type is private;
  112.  
  113.    Clr_False        : constant Color_Type;
  114.    Clr_True         : constant Color_Type;
  115.    Clr_Error        : constant Color_Type;
  116.    Clr_Default      : constant Color_Type;
  117.  
  118.    Clr_White        : constant Color_Type;
  119.    Clr_Black        : constant Color_Type;
  120.    Clr_Background   : constant Color_Type;
  121.    Clr_Blue         : constant Color_Type;
  122.    Clr_Red          : constant Color_Type;
  123.    Clr_Pink         : constant Color_Type;
  124.    Clr_Green        : constant Color_Type;
  125.    Clr_Cyan         : constant Color_Type;
  126.    Clr_Yellow       : constant Color_Type;
  127.    Clr_Neutral      : constant Color_Type;
  128.  
  129.    Clr_Dark_Gray    : constant Color_Type;
  130.    Clr_Dark_Blue    : constant Color_Type;
  131.    Clr_Dark_Red     : constant Color_Type;
  132.    Clr_Dark_Pink    : constant Color_Type;
  133.    Clr_Dark_Green   : constant Color_Type;
  134.    Clr_Dark_Cyan    : constant Color_Type;
  135.    Clr_Brown        : constant Color_Type;
  136.    Clr_Pale_Gray    : constant Color_Type;
  137.  
  138.    RGB_Error        : constant Color_Type;
  139.    RGB_Black        : constant Color_Type;
  140.    RGB_Blue         : constant Color_Type;
  141.    RGB_Green        : constant Color_Type;
  142.    RGB_Cyan         : constant Color_Type;
  143.    RGB_Red          : constant Color_Type;
  144.    RGB_Pink         : constant Color_Type;
  145.    RGB_Yellow       : constant Color_Type;
  146.    RGB_White        : constant Color_Type;
  147.  
  148.   ---------------------------------------------
  149.  
  150.    function Set_Background_Color (
  151.                   Ps    : Win.Ps_Type;
  152.                   Color : Color_Type) return Boolean;
  153.        
  154.    procedure Set_Background_Color (
  155.                   Ps    : Win.Ps_Type;
  156.                   Color : Color_Type);
  157.  
  158.   ---------------------------------------------
  159.  
  160.    function Set_Color (
  161.                   Ps    : Win.Ps_Type;
  162.                   Color : Color_Type) return Boolean;
  163.        
  164.    procedure Set_Color (
  165.                   Ps    : Win.Ps_Type;
  166.                   Color : Color_Type);
  167.  
  168.   ---------------------------------------------
  169.  
  170.    function Char_String_At (
  171.                   Ps    : Win.Ps_Type;
  172.                   Point : Win.Point_Type;
  173.                   Text  : String) return Status_Type;
  174.  
  175.    procedure Char_String_At (
  176.                   Ps    : in Win.Ps_Type;
  177.                   Point : in Win.Point_Type;
  178.                   Text  : in String);
  179.  
  180.   ---------------------------------------------
  181.  
  182.    function Char_String (
  183.                   Ps    : Win.Ps_Type;
  184.                   Text  : String) return Status_Type;
  185.  
  186.    procedure Char_String (
  187.                   Ps    : in Win.Ps_Type;
  188.                   Text  : in String);
  189.  
  190.   ---------------------------------------------
  191.  
  192.    function Set_Current_Position (
  193.               Ps    : Win.Ps_Type;
  194.               Point : Win.Point_Type) return Boolean;
  195.  
  196.    procedure Set_Current_Position (
  197.               Ps    : Win.Ps_Type;
  198.               Point : Win.Point_Type);
  199.  
  200.   ---------------------------------------------
  201.  
  202.    function Query_Current_Position (
  203.               Ps    : Win.Ps_Type;
  204.               Point : Win.Point_Pointer_Type) return Boolean;
  205.  
  206.    procedure Query_Current_Position (
  207.               Ps    : in     Win.Ps_Type;
  208.               Point :    out Win.Point_Type);
  209.  
  210.   ---------------------------------------------
  211.  
  212.    function Erase (Ps : Win.Ps_Type) return Boolean;
  213.  
  214.    procedure Erase (Ps : Win.Ps_Type);
  215.  
  216.   ---------------------------------------------
  217.  
  218.    function Destroy_Ps (Ps : Win.Ps_Type) return Boolean;
  219.  
  220.    procedure Destroy_Ps (Ps : in Win.Ps_Type);
  221.  
  222.   ---------------------------------------------
  223.  
  224.    function Move (
  225.               Ps    : Win.Ps_Type;
  226.               Point : Win.Point_Type) return Boolean;
  227.  
  228.    procedure Move (
  229.               Ps    : Win.Ps_Type;
  230.               Point : Win.Point_Type);
  231.  
  232.   ---------------------------------------------
  233.  
  234.    type Line_End_Style_Type is (
  235.          Line_End_Error,
  236.          Line_End_Default,
  237.          Line_End_Flat,
  238.          Line_End_Square,
  239.          Line_End_Round);
  240.  
  241.    type Line_Join_Style_Type is (
  242.          Line_Join_Error,
  243.          Line_Join_Default,
  244.          Line_Join_Bevel,
  245.          Line_Join_Round,
  246.          Line_Join_Mitre);
  247.  
  248.   ---------------------------------------------
  249.  
  250.    function Set_Line_End (
  251.               Ps        : Win.Ps_Type;
  252.               Style     : Line_End_Style_Type) return Boolean;
  253.  
  254.    procedure Set_Line_End (
  255.               Ps        : in Win.Ps_Type;
  256.               Style     : in Line_End_Style_Type);
  257.  
  258.   ---------------------------------------------
  259.  
  260.    function Query_Line_End (Ps : Win.Ps_Type) return Line_End_Style_Type;
  261.  
  262.   ---------------------------------------------
  263.  
  264.    function Set_Line_Join (
  265.               Ps        : Win.Ps_Type;
  266.               Style     : Line_Join_Style_Type) return Boolean;
  267.  
  268.    procedure Set_Line_Join (
  269.               Ps        : in Win.Ps_Type;
  270.               Style     : in Line_Join_Style_Type);
  271.  
  272.   ---------------------------------------------
  273.  
  274.    function Query_Line_Join (Ps : Win.Ps_Type) return Line_Join_Style_Type;
  275.  
  276.   ---------------------------------------------
  277.  
  278.    function Line (
  279.               Ps        : Win.Ps_Type;
  280.               End_Point : Win.Point_Type) return Status_Type;
  281.  
  282.    procedure Line (
  283.               Ps        : Win.Ps_Type;
  284.               End_Point : Win.Point_Type);
  285.  
  286.    procedure Line (
  287.               Ps          : Win.Ps_Type;
  288.               Start_Point : Win.Point_Type;
  289.               End_Point   : Win.Point_Type);
  290.  
  291.   ---------------------------------------------
  292.  
  293.    type Outline_Style_Type is (
  294.       Dro_Fill,          --Fill the interior of the box without drawing 
  295.                          --the outline.
  296.       Dro_Outline,       --Draw the outline of the box.
  297.       Dro_Outline_Fill); --Draw the outline of the box and fill the interior.
  298.  
  299.    function Box (
  300.               Ps            : Win.Ps_Type;
  301.               Corner_Point  : Win.Point_Type;
  302.               Outline_Style : Outline_Style_Type;
  303.               Horz_Rounding : Pm_Types.Long;
  304.               Vert_Rounding : Pm_Types.Long) return Status_Type; 
  305.  
  306.    procedure Box (
  307.               Ps            : in Win.Ps_Type;
  308.               Corner_Point  : in Win.Point_Type;
  309.               Outline_Style : in Outline_Style_Type;
  310.               Horz_Rounding : in Pm_Types.Long;
  311.               Vert_Rounding : in Pm_Types.Long);
  312.  
  313.    procedure Box (
  314.               Ps            : in Win.Ps_Type;
  315.               Start_Corner  : in Win.Point_Type;
  316.               End_Corner    : in Win.Point_Type;
  317.               Outline_Style : in Outline_Style_Type;
  318.               Horz_Rounding : in Pm_Types.Long;
  319.               Vert_Rounding : in Pm_Types.Long);
  320.  
  321.  ---------------------------------------------
  322.    type Arc_Parameter_Type is
  323.      record
  324.        lP : Pm_Types.Long;
  325.        lQ : Pm_Types.Long;
  326.        lR : Pm_Types.Long;
  327.        lS : Pm_Types.Long;
  328.      end record;
  329.  
  330.    type Arc_Parameter_Pointer_Type is access Arc_Parameter_Type;
  331.  
  332.    function Set_Arc_Parameters (
  333.               Ps         : Win.Ps_Type;
  334.               Parameters : Arc_Parameter_Type) return Boolean;
  335.  
  336.    procedure Set_Arc_Parameters (
  337.               Ps         : in Win.Ps_Type;
  338.               Parameters : in Arc_Parameter_Type);
  339.  
  340.  ---------------------------------------------
  341.  
  342.    function Query_Arc_Parameters (
  343.               Ps         : Win.Ps_Type;
  344.               Parameters : Arc_Parameter_Pointer_Type) return Boolean;
  345.  
  346.    procedure Query_Arc_Parameters (
  347.               Ps         : in     Win.Ps_Type;
  348.               Parameters :    out Arc_Parameter_Type);
  349.  
  350.  ---------------------------------------------
  351.  
  352.    function Set_Default_Arc_Parameters (
  353.               Ps         : Win.Ps_Type;
  354.               Parameters : Arc_Parameter_Type) return Boolean;
  355.  
  356.    procedure Set_Default_Arc_Parameters (
  357.               Ps         : in Win.Ps_Type;
  358.               Parameters : in Arc_Parameter_Type);
  359.  
  360.  ---------------------------------------------
  361.  
  362.    function Query_Default_Arc_Parameters (
  363.               Ps         : Win.Ps_Type;
  364.               Parameters : Arc_Parameter_Pointer_Type) return Boolean;
  365.  
  366.    procedure Query_Default_Arc_Parameters (
  367.               Ps         : in     Win.Ps_Type;
  368.               Parameters :    out Arc_Parameter_Type);
  369.  
  370.  ---------------------------------------------
  371.  
  372. --   type Multipler_Type is delta 0.001 range 0.0 .. 255.0;
  373.      type Multipler_Type is range 0 .. 255;  --Will be converted to fixed 
  374.                                              --type when implement.
  375.  
  376.    function Full_Arc (
  377.               Ps            : Win.Ps_Type;
  378.               Outline_Style : Outline_Style_Type;
  379.               Multiplier    : Multipler_Type) return Status_Type;
  380.  
  381.    procedure Full_Arc (
  382.               Ps            : in Win.Ps_Type;
  383.               Outline_Style : in Outline_Style_Type;
  384.               Multiplier    : in Multipler_Type);
  385.  
  386.    procedure Full_Arc (
  387.               Ps            : in Win.Ps_Type;
  388.               Center        : in Win.Point_Type;
  389.               Arc_Params    : in Arc_Parameter_Type;
  390.               Outline_Style : in Outline_Style_Type;
  391.               Multiplier    : in Multipler_Type);
  392.  
  393.  ---------------------------------------------
  394.  
  395.  private 
  396.  
  397.    type Color_Type is new Pm_Types.Long;
  398.  
  399.    Clr_False        : constant Color_Type := -5;
  400.    Clr_True         : constant Color_Type := -4;
  401.    Clr_Error        : constant Color_Type := -255;
  402.    Clr_Default      : constant Color_Type := -3;
  403.  
  404.    Clr_White        : constant Color_Type := -2;
  405.    Clr_Black        : constant Color_Type := -1;
  406.    Clr_Background   : constant Color_Type := 0;
  407.    Clr_Blue         : constant Color_Type := 1;
  408.    Clr_Red          : constant Color_Type := 2;
  409.    Clr_Pink         : constant Color_Type := 3;
  410.    Clr_Green        : constant Color_Type := 4;
  411.    Clr_Cyan         : constant Color_Type := 5;
  412.    Clr_Yellow       : constant Color_Type := 6;
  413.    Clr_Neutral      : constant Color_Type := 7;
  414.  
  415.    Clr_Dark_Gray    : constant Color_Type := 8;
  416.    Clr_Dark_Blue    : constant Color_Type := 9;
  417.    Clr_Dark_Red     : constant Color_Type := 10;
  418.    Clr_Dark_Pink    : constant Color_Type := 11;
  419.    Clr_Dark_Green   : constant Color_Type := 12;
  420.    Clr_Dark_Cyan    : constant Color_Type := 13;
  421.    Clr_Brown        : constant Color_Type := 14;
  422.    Clr_Pale_Gray    : constant Color_Type := 15;
  423.  
  424.    RGB_Error        : constant Color_Type := -255;
  425.    RGB_Black        : constant Color_Type := 16#0000_0000#;
  426.    RGB_Blue         : constant Color_Type := 16#0000_00FF#;
  427.    RGB_Green        : constant Color_Type := 16#0000_FF00#;
  428.    RGB_Cyan         : constant Color_Type := 16#0000_FFFF#;
  429.    RGB_Red          : constant Color_Type := 16#00FF_0000#;
  430.    RGB_Pink         : constant Color_Type := 16#00FF_00FF#;
  431.    RGB_Yellow       : constant Color_Type := 16#00FF_FF00#;
  432.    RGB_White        : constant Color_Type := 16#00FF_FFFF#;
  433.  
  434. end GPI;
  435.