home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / PMEXAM / MENU / GPI.ADS < prev    next >
Text File  |  1995-11-27  |  11KB  |  314 lines

  1. with OS2;Use OS2;
  2. with OS2.Gpi;Use OS2.Gpi;
  3. package GPI is
  4.  
  5.    GPI_Error  : exception;
  6.  
  7.    type Status_Type is (Okay, Hits, Error);
  8.  
  9.    type Background_Mix_Type is (
  10.        Bm_Error,
  11.        Bm_Default,
  12.        Bm_Or,
  13.        Bm_Overpaint,
  14.        Bm_Leave_Alone,
  15.        Bm_Xor,
  16.        Bm_And,
  17.        Bm_Subtract,
  18.        Bm_Mask_Src_Not,
  19.        Bm_Zero,
  20.        Bm_Not_Merge_Src,
  21.        Bm_Not_Xor_Src,
  22.        Bm_Invert,
  23.        Bm_Merge_Src_Not,
  24.        Bm_Not_Copy_Src,
  25.        Bm_Merge_Not_Src,
  26.        Bm_Not_Mask_Src,
  27.        Bm_One,
  28.        Bm_Src_Transparent,
  29.        Bm_Dest_Transparent);
  30.  
  31.    function Set_Background_Mix (
  32.               Ps  : Hps;
  33.               Mix : Background_Mix_Type) return Boolean;
  34.  
  35.    procedure Set_Background_Mix (
  36.               Ps  : Hps;
  37.               Mix : Background_Mix_Type);
  38.  
  39.    type Color_Type is private;
  40.  
  41.    Clr_False        : constant Color_Type;
  42.    Clr_True         : constant Color_Type;
  43.    Clr_Error        : constant Color_Type;
  44.    Clr_Default      : constant Color_Type;
  45.  
  46.    Clr_White        : constant Color_Type;
  47.    Clr_Black        : constant Color_Type;
  48.    Clr_Background   : constant Color_Type;
  49.    Clr_Blue         : constant Color_Type;
  50.    Clr_Red          : constant Color_Type;
  51.    Clr_Pink         : constant Color_Type;
  52.    Clr_Green        : constant Color_Type;
  53.    Clr_Cyan         : constant Color_Type;
  54.    Clr_Yellow       : constant Color_Type;
  55.    Clr_Neutral      : constant Color_Type;
  56.  
  57.    Clr_Dark_Gray    : constant Color_Type;
  58.    Clr_Dark_Blue    : constant Color_Type;
  59.    Clr_Dark_Red     : constant Color_Type;
  60.    Clr_Dark_Pink    : constant Color_Type;
  61.    Clr_Dark_Green   : constant Color_Type;
  62.    Clr_Dark_Cyan    : constant Color_Type;
  63.    Clr_Brown        : constant Color_Type;
  64.    Clr_Pale_Gray    : constant Color_Type;
  65.  
  66.    RGB_Error        : constant Color_Type;
  67.    RGB_Black        : constant Color_Type;
  68.    RGB_Blue         : constant Color_Type;
  69.    RGB_Green        : constant Color_Type;
  70.    RGB_Cyan         : constant Color_Type;
  71.    RGB_Red          : constant Color_Type;
  72.    RGB_Pink         : constant Color_Type;
  73.    RGB_Yellow       : constant Color_Type;
  74.    RGB_White        : constant Color_Type;
  75.  
  76.   ---------------------------------------------
  77.  
  78.    function Set_Background_Color (
  79.                   Ps    : Hps;
  80.                   Color : Color_Type) return Boolean;
  81.  
  82.    procedure Set_Background_Color (
  83.                   Ps    : Hps;
  84.                   Color : Color_Type);
  85.  
  86.   ---------------------------------------------
  87.    function Set_Color (
  88.                   Ps    : Hps;
  89.                   Color : Color_Type) return Boolean;
  90.  
  91.    procedure Set_Color (
  92.                   Ps    : Hps;
  93.                   Color : Color_Type);
  94.   ---------------------------------------------
  95.    function Char_String_At (
  96.                   Ps    : Hps;
  97.                   Point : PointL;
  98.                   Text  : String) return Status_Type;
  99.  
  100.    procedure Char_String_At (
  101.                   Ps    : in Hps;
  102.                   Point : in PointL;
  103.                   Text  : in String);
  104.  
  105.    function Char_String (
  106.                   Ps    : Hps;
  107.                   Text  : String) return Status_Type;
  108.  
  109.    procedure Char_String (
  110.                   Ps    : in Hps;
  111.                   Text  : in String);
  112.  
  113.   ---------------------------------------------
  114.  
  115.    function Set_Current_Position (
  116.               Ps    : Hps;
  117.               Point : PointL) return Boolean;
  118.  
  119.    procedure Set_Current_Position (
  120.               Ps    : Hps;
  121.               Point : PointL);
  122.  
  123.   ---------------------------------------------
  124.  
  125.    function Query_Current_Position (
  126.               Ps    : Hps;
  127.               Point : PPointL) return Boolean;
  128.  
  129.    procedure Query_Current_Position (
  130.               Ps    : in     Hps;
  131.               Point :    out PointL);
  132.  
  133.   ---------------------------------------------
  134.    function Erase (Ps : Hps) return Boolean;
  135.    procedure Erase (Ps : Hps);
  136.   ---------------------------------------------
  137.    function Destroy_Ps (Ps : Hps) return Boolean;
  138.    procedure Destroy_Ps (Ps : in Hps);
  139.   ---------------------------------------------
  140.    function Move (
  141.               Ps    : Hps;
  142.               Point : PointL) return Boolean;
  143.  
  144.    procedure Move (
  145.               Ps    : Hps;
  146.               Point : PointL);
  147.   ---------------------------------------------
  148.    type Line_End_Style_Type is (
  149.          Line_End_Error,
  150.          Line_End_Default,
  151.          Line_End_Flat,
  152.          Line_End_Square,
  153.          Line_End_Round);
  154.  
  155.    type Line_Join_Style_Type is (
  156.          Line_Join_Error,
  157.          Line_Join_Default,
  158.          Line_Join_Bevel,
  159.          Line_Join_Round,
  160.          Line_Join_Mitre);
  161.  
  162.   ---------------------------------------------
  163.    function Set_Line_End (
  164.               Ps        : Hps;
  165.               Style     : Line_End_Style_Type) return Boolean;
  166.    procedure Set_Line_End (
  167.               Ps        : in Hps;
  168.               Style     : in Line_End_Style_Type);
  169.   ---------------------------------------------
  170.    function Query_Line_End (Ps : Hps) return Line_End_Style_Type;
  171.   ---------------------------------------------
  172.    function Set_Line_Join (
  173.               Ps        : Hps;
  174.               Style     : Line_Join_Style_Type) return Boolean;
  175.  
  176.    procedure Set_Line_Join (
  177.               Ps        : in Hps;
  178.               Style     : in Line_Join_Style_Type);
  179.   ---------------------------------------------
  180.    function Query_Line_Join (Ps : Hps) return Line_Join_Style_Type;
  181.   ---------------------------------------------
  182.    function Line (
  183.               Ps        : Hps;
  184.               End_Point : PointL) return Status_Type;
  185.  
  186.    procedure Line (
  187.               Ps        : Hps;
  188.               End_Point : PointL);
  189.  
  190.    procedure Line (
  191.               Ps          : Hps;
  192.               Start_Point : PointL;
  193.               End_Point   : PointL);
  194.   ---------------------------------------------
  195.    type Outline_Style_Type is (
  196.       Dro_Fill,          --Fill the interior of the box without drawing
  197.                          --the outline.
  198.       Dro_Outline,       --Draw the outline of the box.
  199.       Dro_Outline_Fill); --Draw the outline of the box and fill the interior.
  200.  
  201.    function Box (
  202.               Ps            : Hps;
  203.               Corner_Point  : PointL;
  204.               Outline_Style : Outline_Style_Type;
  205.               Horz_Rounding : Long;
  206.               Vert_Rounding : Long) return Status_Type;
  207.  
  208.    procedure Box (
  209.               Ps            : in Hps;
  210.               Corner_Point  : in PointL;
  211.               Outline_Style : in Outline_Style_Type;
  212.               Horz_Rounding : in Long;
  213.               Vert_Rounding : in Long);
  214.  
  215.    procedure Box (
  216.               Ps            : in Hps;
  217.               Start_Corner  : in PointL;
  218.               End_Corner    : in PointL;
  219.               Outline_Style : in Outline_Style_Type;
  220.               Horz_Rounding : in Long;
  221.               Vert_Rounding : in Long);
  222.  ---------------------------------------------
  223.  
  224.    function Set_Arc_Parameters (
  225.               Ps         : Hps;
  226.               Parameters : ArcParams) return Boolean;
  227.  
  228.    procedure Set_Arc_Parameters (
  229.               Ps         : in Hps;
  230.               Parameters : in ArcParams);
  231.  ---------------------------------------------
  232.    function Query_Arc_Parameters (
  233.               Ps         : Hps;
  234.               Parameters : PArcParams) return Boolean;
  235.  
  236.    procedure Query_Arc_Parameters (
  237.               Ps         : in     Hps;
  238.               Parameters :    out ArcParams);
  239.  ---------------------------------------------
  240.    function Set_Default_Arc_Parameters (
  241.               Ps         : Hps;
  242.               Parameters : ArcParams) return Boolean;
  243.  
  244.    procedure Set_Default_Arc_Parameters (
  245.               Ps         : in Hps;
  246.               Parameters : in ArcParams);
  247.  ---------------------------------------------
  248.    function Query_Default_Arc_Parameters (
  249.               Ps         : Hps;
  250.               Parameters : PArcParams) return Boolean;
  251.  
  252.    procedure Query_Default_Arc_Parameters (
  253.               Ps         : in     Hps;
  254.               Parameters :    out ArcParams);
  255.  ---------------------------------------------
  256.      type Multipler_Type is range 0 .. 255;  --Will be converted to fixed
  257.                                              --type when implement.
  258.  
  259.    function Full_Arc (
  260.               Ps            : Hps;
  261.               Outline_Style : Outline_Style_Type;
  262.               Multiplier    : Multipler_Type) return Status_Type;
  263.  
  264.    procedure Full_Arc (
  265.               Ps            : in Hps;
  266.               Outline_Style : in Outline_Style_Type;
  267.               Multiplier    : in Multipler_Type);
  268.  
  269.    procedure Full_Arc (
  270.               Ps            : in Hps;
  271.               Center        : in PointL;
  272.               Arc_Params    : in ArcParams;
  273.               Outline_Style : in Outline_Style_Type;
  274.               Multiplier    : in Multipler_Type);
  275.  ---------------------------------------------
  276.  private
  277.    type Color_Type is new Long;
  278.  
  279.    Clr_False        : constant Color_Type := -5;
  280.    Clr_True         : constant Color_Type := -4;
  281.    Clr_Error        : constant Color_Type := -255;
  282.    Clr_Default      : constant Color_Type := -3;
  283.  
  284.    Clr_White        : constant Color_Type := -2;
  285.    Clr_Black        : constant Color_Type := -1;
  286.    Clr_Background   : constant Color_Type := 0;
  287.    Clr_Blue         : constant Color_Type := 1;
  288.    Clr_Red          : constant Color_Type := 2;
  289.    Clr_Pink         : constant Color_Type := 3;
  290.    Clr_Green        : constant Color_Type := 4;
  291.    Clr_Cyan         : constant Color_Type := 5;
  292.    Clr_Yellow       : constant Color_Type := 6;
  293.    Clr_Neutral      : constant Color_Type := 7;
  294.  
  295.    Clr_Dark_Gray    : constant Color_Type := 8;
  296.    Clr_Dark_Blue    : constant Color_Type := 9;
  297.    Clr_Dark_Red     : constant Color_Type := 10;
  298.    Clr_Dark_Pink    : constant Color_Type := 11;
  299.    Clr_Dark_Green   : constant Color_Type := 12;
  300.    Clr_Dark_Cyan    : constant Color_Type := 13;
  301.    Clr_Brown        : constant Color_Type := 14;
  302.    Clr_Pale_Gray    : constant Color_Type := 15;
  303.  
  304.    RGB_Error        : constant Color_Type := -255;
  305.    RGB_Black        : constant Color_Type := 16#0000_0000#;
  306.    RGB_Blue         : constant Color_Type := 16#0000_00FF#;
  307.    RGB_Green        : constant Color_Type := 16#0000_FF00#;
  308.    RGB_Cyan         : constant Color_Type := 16#0000_FFFF#;
  309.    RGB_Red          : constant Color_Type := 16#00FF_0000#;
  310.    RGB_Pink         : constant Color_Type := 16#00FF_00FF#;
  311.    RGB_Yellow       : constant Color_Type := 16#00FF_FF00#;
  312.    RGB_White        : constant Color_Type := 16#00FF_FFFF#;
  313. end GPI;
  314.