home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adapm_15.zip / win_bak2.ads < prev    next >
Text File  |  1994-03-17  |  55KB  |  1,305 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                               PM Bindings                                --
  4. --                                                                          --
  5. --                                  WIN                                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: .15 $                              --
  10. --   .14
  11. --     Point_Pointer_Type for the GPI Query_Current_Position function.
  12. --     Command_Info_is for decoding Wm_Command messages, 
  13. --     Check_Menu_Item
  14. --     Window_From_Id
  15. --
  16. --    .15
  17. --     Enable_Menu_Item
  18. --     Load_Menu
  19. --     Pop_Up_Menu     
  20. --     Convert_to_Internal
  21. --     Convert_to_External
  22. --     Query_Menu_Item
  23. --     Set_Menu_Item
  24. --     Insert_Menu_Item
  25. --     Delete_Menu_Item
  26. --
  27. --                                                                          --
  28. --     Copyright (c) 1994 Dimensional Media Systems, All Rights Reserved    --
  29. --                                                                          --
  30. --   The PM bindings are free software; you can redistribute them and/or    --
  31. --   modify them under terms of the GNU General Public License as published --
  32. --   by the Free Software Foundation; either version 2, or (at your         --
  33. --   option) any later version.  The PM bindings are distributed in the     --
  34. --   hope that they will be useful, but WITH OUT ANY WARRANTY; without even --
  35. --   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR    --
  36. --   PURPOSE.  See the GNU General Public License for more details.  You    --
  37. --   should have received a copy of the GNU General Public License          --
  38. --   distributed with The PM bindings; see file COPYING.  If not, write to  --
  39. --   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  --
  40. --                                                                          --
  41. ------------------------------------------------------------------------------
  42. --                                                                          --
  43. --   For more information about these PM bindings and their usage with GNAT --
  44. --   you can contact Bill Yow at                                            --
  45. --                                                                          --  
  46. --      Dimensional Media Systems (DMS)                                     --
  47. --      1522 Festival Dr.                                                   --
  48. --      Houston TX, 77062                                                   --
  49. --      Phone - (713) 488-7050                                              --
  50. --      Email - Byow@mci.com                                                --
  51. --                                                                          --
  52. ------------------------------------------------------------------------------
  53.  
  54. with Pm_Types;
  55.  
  56. package Win is
  57.  
  58.   Win_Error : exception;
  59.  
  60.   System_Default : constant := 0;
  61.  
  62.   type PULong is access Pm_Types.U_Long;
  63.  
  64.  ---------------------------------------------------------------
  65.  
  66.  --Window Handle type
  67.  
  68.   type Handle_Type is private;                     --PM's HWND
  69.  
  70.   type Handle_Pointer_Type is access Handle_Type;  --PM's PHWND
  71.  
  72.   Null_Window           : constant Handle_Type;
  73.   Null_HWND             : constant Handle_Type;  
  74.   Desktop_Window        : constant Handle_Type;  --PM's HWND_DESKTOP
  75.   Top_Window            : constant Handle_Type;  --PM's HWND_TOP
  76.   Bottom_Windw          : constant Handle_Type;  --PM's HWND_BOTTOM
  77.   Object_Handle         : constant Handle_Type;  --PM's HWND_OBJECT
  78.   Thread_Capture_Handle : constant Handle_Type;  --PM's HWND_THREADCAPTURE 
  79.  
  80.   type Id_Type is new Pm_Types.U_Long;
  81.  
  82.  ------------------------------------------------------------
  83.  
  84.   type Void_Type is new PM_Types.U_Long;
  85.  
  86.   function To_Boolean   (Void : Void_Type) return Boolean;
  87.   function To_Short     (Void : Void_Type) return Pm_Types.Short;
  88.   function To_U_Short   (Void : Void_Type) return Pm_Types.U_Short;
  89.  
  90.  ------------------------------------------------------------
  91.  
  92.   type Queue_Handle_Type is private;        --HMQ
  93.   Null_Queue : constant Queue_Handle_Type;
  94.  
  95.   Null_HMQ : constant Queue_Handle_Type;
  96.  
  97.  ----------------------------------------------------------- 
  98.  
  99.   type Anchor_Block_Handle_Type is private;  --HAB
  100.   Null_Anchor_Block : constant Anchor_Block_Handle_Type;
  101.  
  102.   Null_HAB : constant Anchor_Block_Handle_Type;
  103.  
  104.   ----------------------------------------------------------
  105.  
  106.   type Ps_Type is private;  --Hps
  107.   Null_PS : constant PS_Type;
  108.  
  109.   ----------------------------------------------------------
  110.  
  111.   type Bitmap_Handle_Type is private;
  112.   Null_Bitmap : constant Bitmap_Handle_Type;
  113.  
  114.   ----------------------------------------------------------
  115.  
  116.   type Parameter_Type is new Pm_Types.Long;
  117.  
  118.   type Time_Type is new Pm_Types.Long;
  119.  
  120.   type Pixel_Type is new Pm_Types.Long;
  121.  
  122.   subtype World_Model_Space_Type 
  123.               is Pixel_Type range -134_217_728 .. 134_217_727;
  124.  
  125.   subtype Device_Screen_Space_Type 
  126.               is Pixel_Type range -32_768 .. 32_767;
  127.  
  128.  ---------------------------------------------------
  129.  -- Messages
  130.  
  131.   type Message_Type is new Pm_Types.U_Long;
  132.  
  133.   --Standard Window Messages
  134.  
  135.   Wm_Null                  : constant Message_Type := 16#0000#;
  136.   Wm_Create                : constant Message_Type := 16#0001#;
  137.   Wm_Destroy               : constant Message_Type := 16#0002#;
  138.  
  139.   Wm_Enable                : constant Message_Type := 16#0004#;
  140.   Wm_Show                  : constant Message_Type := 16#0005#;
  141.   Wm_Move                  : constant Message_Type := 16#0006#;
  142.   Wm_Size                  : constant Message_Type := 16#0007#;
  143.   Wm_Adjust_Window_Pos     : constant Message_Type := 16#0008#;
  144.  
  145.   Wm_Calc_Valid_Rects      : constant Message_Type := 16#0009#;
  146.  
  147.   Wm_Set_Window_Params     : constant Message_Type := 16#000A#;
  148.   Wm_Query_Window_Params   : constant Message_Type := 16#000B#;
  149.   Wm_Hit_Test              : constant Message_Type := 16#000C#;
  150.   Wm_Activate              : constant Message_Type := 16#000D#;
  151.   Wm_Set_Focus             : constant Message_Type := 16#000F#;
  152.   Wm_Set_Selection         : constant Message_Type := 16#0010#;
  153.  
  154.   --Language Support Winproc
  155.   Wm_P_Paint               : constant Message_Type := 16#0011#;
  156.   Wm_P_Set_Focus           : constant Message_Type := 16#0012#;
  157.   Wm_P_Sys_Color_Change    : constant Message_Type := 16#0013#;
  158.   Wm_P_Size                : constant Message_Type := 16#0014#;
  159.   Wm_P_Activate            : constant Message_Type := 16#0015#;
  160.   Wm_P_Control             : constant Message_Type := 16#0016#;
  161.  
  162.   Wm_Command               : constant Message_Type := 16#0020#;
  163.   Wm_Sys_Command           : constant Message_Type := 16#0021#;
  164.   Wm_Help                  : constant Message_Type := 16#0022#;
  165.   Wm_Paint                 : constant Message_Type := 16#0023#;
  166.  
  167.   --Used for SAA 
  168.   Wm_Timer                 : constant Message_Type := 16#0024#;
  169.   Wm_Sem_1                 : constant Message_Type := 16#0025#;
  170.   Wm_Sem_2                 : constant Message_Type := 16#0026#;
  171.   Wm_Sem_3                 : constant Message_Type := 16#0027#;
  172.   Wm_Sem_4                 : constant Message_Type := 16#0028#;
  173.  
  174.   Wm_Close                 : constant Message_Type := 16#0029#;
  175.   Wm_Quit                  : constant Message_Type := 16#002A#;
  176.   Wm_Sys_Color_Change      : constant Message_Type := 16#002B#;
  177.   Wm_Sys_Value_Changed     : constant Message_Type := 16#002D#;
  178.   Wm_App_Terminate_Notify  : constant Message_Type := 16#002E#;
  179.   Wm_Pres_Param_Changed    : constant Message_Type := 16#002F#;
  180.  
  181.   --Control notification messages
  182.  
  183.   Wm_Control               : constant Message_Type := 16#0030#;
  184.   Wm_V_Scroll              : constant Message_Type := 16#0031#;
  185.   Wm_H_Scroll              : constant Message_Type := 16#0032#;
  186.   Wm_Init_Menu             : constant Message_Type := 16#0033#;
  187.   Wm_Menu_Select           : constant Message_Type := 16#0034#;
  188.   Wm_Menu_End              : constant Message_Type := 16#0035#;
  189.   Wm_Draw_Item             : constant Message_Type := 16#0036#;
  190.   Wm_Measure_Item          : constant Message_Type := 16#0037#;
  191.   Wm_Control_Pointer       : constant Message_Type := 16#0038#;
  192.   Wm_Query_Dlg_Code        : constant Message_Type := 16#003A#;
  193.   Wm_Init_Dgl              : constant Message_Type := 16#003B#;
  194.   Wm_Substitute_String     : constant Message_Type := 16#003C#;
  195.   Wm_Match_Menonic         : constant Message_Type := 16#003D#;
  196.   Wm_Save_Application      : constant Message_Type := 16#003E#;
  197.  
  198.   --Mouse Messages
  199.   
  200.   Wm_Mouse_First           : constant Message_Type := 16#0070#;
  201.   Wm_Mouse_Last            : constant Message_Type := 16#0079#;
  202.   Wm_Button_Click_First    : constant Message_Type := 16#0071#;
  203.   Wm_Button_Click_Last     : constant Message_Type := 16#0079#;
  204.  
  205.   Wm_Mouse_Move            : constant Message_Type := 16#0070#;
  206.  
  207.   Wm_Button_1_Down         : constant Message_Type := 16#0071#;
  208.   Wm_Button_1_Up           : constant Message_Type := 16#0072#;
  209.   Wm_Button_1_Dbl_Clk      : constant Message_Type := 16#0073#;
  210.   Wm_Button_2_Down         : constant Message_Type := 16#0074#;
  211.   Wm_Button_2_Up           : constant Message_Type := 16#0075#;
  212.   Wm_Button_2_Dbl_Clk      : constant Message_Type := 16#0076#;
  213.   Wm_Button_3_Down         : constant Message_Type := 16#0077#;
  214.   Wm_Button_3_Up           : constant Message_Type := 16#0078#;
  215.   Wm_Button_3_Dbl_Clk      : constant Message_Type := 16#0079#;
  216.  
  217.   Wm_Ext_Mouse_First       : constant Message_Type := 16#0410#;
  218.   Wm_Ext_Mouse_Last        : constant Message_Type := 16#0419#;
  219.  
  220.   Wm_Chord                 : constant Message_Type := 16#0410#;
  221.   Wm_Button_1_Motion_Start : constant Message_Type := 16#0411#;
  222.   Wm_Button_1_Motion_End   : constant Message_Type := 16#0412#;
  223.   Wm_Button_1_Click        : constant Message_Type := 16#0413#;
  224.   Wm_Button_2_Motion_Start : constant Message_Type := 16#0414#;
  225.   Wm_Button_2_Motion_End   : constant Message_Type := 16#0415#;
  226.   Wm_Button_2_Click        : constant Message_Type := 16#0416#;
  227.   Wm_Button_3_Motion_Start : constant Message_Type := 16#0417#;
  228.   Wm_Button_3_Motion_End   : constant Message_Type := 16#0418#;
  229.   Wm_Button_3_Click        : constant Message_Type := 16#0419#;
  230.  
  231.   --Messages 16#041A# - 16#041F# are reserved
  232.  
  233.   Wm_Mouse_Translate_First : constant Message_Type := 16#0420#;
  234.   Wm_Mouse_Translate_Last  : constant Message_Type := 16#0428#;
  235.   Wm_Begin_Drag            : constant Message_Type := 16#0420#;
  236.   Wm_End_Drag              : constant Message_Type := 16#0421#;
  237.   Wm_Single_Select         : constant Message_Type := 16#0422#;
  238.   Wm_Open                  : constant Message_Type := 16#0423#;
  239.   Wm_Context_Menu          : constant Message_Type := 16#0424#;
  240.   Wm_Text_Edit             : constant Message_Type := 16#0426#;
  241.   Wm_Begin_Select          : constant Message_Type := 16#0427#;
  242.   Wm_End_Select            : constant Message_Type := 16#0428#;
  243.  
  244.   -- Key/Character input messages
  245.  
  246.   Wm_Char                  : constant Message_Type := 16#007A#;
  247.   Wm_VIO_Char              : constant Message_Type := 16#007B#;
  248.  
  249.   Wm_Journal_Notify        : constant Message_Type := 16#007C#;
  250.  
  251.   --Frame window related message
  252.  
  253.   Wm_Flash_Window          : constant Message_Type := 16#0040#;
  254.   Wm_Format_Frame          : constant Message_Type := 16#0041#;
  255.   Wm_Update_Frame          : constant Message_Type := 16#0042#;
  256.   Wm_Focus_Change          : constant Message_Type := 16#0043#;
  257.  
  258.   Wm_Set_Border_Size       : constant Message_Type := 16#0044#;
  259.   Wm_Track_Frame           : constant Message_Type := 16#0045#;
  260.   Wm_Min_Max_Frame         : constant Message_Type := 16#0046#;
  261.   Wm_Set_Icon              : constant Message_Type := 16#0047#;
  262.   Wm_Query_Icon            : constant Message_Type := 16#0048#;
  263.   Wm_Set_Accel_Table       : constant Message_Type := 16#0049#;
  264.   Wm_Query_Accel_Table     : constant Message_Type := 16#004A#;
  265.   Wm_Translate_Accel       : constant Message_Type := 16#004B#;
  266.   Wm_Query_Track_Info      : constant Message_Type := 16#004C#;
  267.   Wm_Query_Border_Size     : constant Message_Type := 16#004D#;
  268.   Wm_Next_Menu             : constant Message_Type := 16#004E#;
  269.   Wm_Erase_Background      : constant Message_Type := 16#004F#;
  270.   Wm_Query_Frame_Info      : constant Message_Type := 16#0050#;
  271.   Wm_Query_Pos_Change      : constant Message_Type := 16#0051#;
  272.   Wm_Owner_Pos_Change      : constant Message_Type := 16#0052#;
  273.   Wm_Cacl_Frame_Rect       : constant Message_Type := 16#0053#;
  274.    -- Note 16#0054# is reserved
  275.   Wm_Window_Pos_Changed    : constant Message_Type := 16#0055#;
  276.   Wm_Adjust_Frame_Pos      : constant Message_Type := 16#0056#;
  277.   Wm_Query_Frame_Ctl_Count : constant Message_Type := 16#0059#;
  278.    -- Note 16#005A# is reserved
  279.   Wm_Query_Help_Info       : constant Message_Type := 16#005B#;
  280.   Wm_Set_Help_Info         : constant Message_Type := 16#005C#;
  281.   Wm_Error                 : constant Message_Type := 16#005D#;
  282.   Wm_Realize_Palette       : constant Message_Type := 16#005E#;
  283.    
  284.   --Clipboard messages
  285.  
  286.   Wm_Render_Fmt            : constant Message_Type := 16#0060#;
  287.   Wm_Render_All_Fmts       : constant Message_Type := 16#0061#;
  288.   Wm_Destroy_Clipboard     : constant Message_Type := 16#0062#;
  289.   Wm_Paint_Clipboard       : constant Message_Type := 16#0063#;
  290.   Wm_Size_Clipboard        : constant Message_Type := 16#0064#;
  291.   Wm_H_Scroll_Clipboard    : constant Message_Type := 16#0065#;
  292.   Wm_V_Scroll_Clipboard    : constant Message_Type := 16#0066#;
  293.   Wm_Draw_Clipboard        : constant Message_Type := 16#0067#;
  294.  
  295.   --Dynamic Data Exchange (DDE) messages
  296.  
  297.   Wm_DDE_First             : constant Message_Type := 16#00A0#;
  298.   Wm_DDE_Initiate          : constant Message_Type := 16#00A0#;
  299.   Wm_DDE_Request           : constant Message_Type := 16#00A1#;
  300.   Wm_DDE_Ack               : constant Message_Type := 16#00A2#;
  301.   Wm_DDE_Data              : constant Message_Type := 16#00A3#;
  302.   Wm_DDE_Advise            : constant Message_Type := 16#00A4#;
  303.   Wm_DDE_Unadvise          : constant Message_Type := 16#00A5#;
  304.   Wm_DDE_Poke              : constant Message_Type := 16#00A6#;
  305.   Wm_DDE_Execute           : constant Message_Type := 16#00A7#;
  306.   Wm_DDE_Terminate         : constant Message_Type := 16#00A8#;
  307.   Wm_DDE_Initate_Ack       : constant Message_Type := 16#00A9#;
  308.   Wm_DDE_Last              : constant Message_Type := 16#00AF#;
  309.  
  310.   Wm_Query_Convert_Pos     : constant Message_Type := 16#00B0#;
  311.   Wm_Dbcs_First            : constant Message_Type := 16#00B0#;
  312.   Wm_Dbcs_Loat             : constant Message_Type := 16#00CF#;
  313.   
  314.   --Help manager message range
  315.  
  316.   Wm_Help_Base             : constant Message_Type := 16#0F00#;
  317.   Wm_Help_Top              : constant Message_Type := 16#0FFF#;
  318.  
  319.   --Menu Control Messages
  320.  
  321.   MM_Insert_Item             : constant Message_Type := 16#0180#;
  322.   MM_Delete_Item             : constant Message_Type := 16#0181#;
  323.   MM_Query_Item              : constant Message_Type := 16#0182#;
  324.   MM_Set_Item                : constant Message_Type := 16#0183#;
  325.   MM_Query_Item_Count        : constant Message_Type := 16#0184#;
  326.   MM_Start_Menu_Mode         : constant Message_Type := 16#0185#;
  327.   MM_End_Menu_Mode           : constant Message_Type := 16#0186#;
  328.   MM_Remove_Item             : constant Message_Type := 16#0188#;
  329.   MM_Select_Item             : constant Message_Type := 16#0189#;
  330.   MM_Query_Selected_Item_Id  : constant Message_Type := 16#018a#;
  331.   MM_Query_Item_Text         : constant Message_Type := 16#018b#;
  332.   MM_Query_Item_Text_Length  : constant Message_Type := 16#018c#;
  333.   MM_Set_Item_Handle         : constant Message_Type := 16#018d#;
  334.   MM_Set_Item_Text           : constant Message_Type := 16#018e#;
  335.   MM_Item_Position_From_Id   : constant Message_Type := 16#018f#;
  336.   MM_Item_Id_From_Position   : constant Message_Type := 16#0190#;
  337.   MM_Query_Item_Attr         : constant Message_Type := 16#0191#;
  338.   MM_Set_Item_Attr           : constant Message_Type := 16#0192#;
  339.   MM_Is_Item_Valid           : constant Message_Type := 16#0193#;
  340.   MM_Query_ITem_Rect         : constant Message_Type := 16#0194#;
  341.  
  342.   MM_Query_Default_Item_Id   : constant Message_Type := 16#0431#;
  343.   MM_Set_Default_Item_Id     : constant Message_Type := 16#0432#;
  344.  
  345.  
  346.   --User messages are defined after Wm_User
  347.   Wm_User                  : constant Message_Type := 16#1000#;
  348.  
  349.  
  350.   type MB_Button_Styles_Type is (
  351.         MB_Ok,                 -- Message box contains an 
  352.                                -- Okay pushbutton.
  353.  
  354.         MB_Ok_Cancel,          -- Message box contains both Okay and 
  355.                                -- Cancel pushbuttons.
  356.  
  357.         MB_Cancel,             -- Message box contains a Cancel pushbutton.
  358.         MB_Enter,              -- Message box contains an Enter pushbutton.
  359.         MB_Enter_Cancel,       -- Message box contains both Enter and 
  360.                                -- Cancel pushbuttons.
  361.  
  362.         MB_Retry_Cancel,       -- Message box contains both Retry and 
  363.                                -- Cancel pushbuttons.
  364.  
  365.         MB_Abort_Retry_Ignore, -- Message box contains Abort, Retry, and 
  366.                                -- Ignore pushbuttons.
  367.  
  368.         MB_Yes_No,             -- Message box contains both Yes and 
  369.                                -- No pushbuttons.
  370.  
  371.         MB_Yes_No_Cancel);     -- Message box contains Yes, No, and Cancel 
  372.                                -- pushbuttons.
  373.  
  374.   type MB_Icon_Styles_Type is (
  375.       MB_No_Icon,         -- The message box does not contain an icon.
  376.       MB_Icon_Hand,       -- The message box contains a hand icon.
  377.       MB_Icon_Question,    -- The message box contains a question mark icon.
  378.       MB_Icon_Exclamation, -- The message box contains an exclamation point icon.
  379.       MB_Icon_Asterisk,    -- The message box contains an asterisk icon.
  380.       MB_Information,      -- The message box contains a black information 
  381.                            -- `i in a square box.
  382.  
  383.       MB_Query,            -- The message box contains a question mark in a 
  384.                            -- square box.
  385.  
  386.       MB_Warning,          -- The message box contains a black ! in a 
  387.                            -- square box.
  388.  
  389.       MB_Error);           -- The message box contains a Stop icon on a
  390.                            -- white background.
  391.  
  392.   type MB_Default_Action_Type is (
  393.       MB_Default_On_Button_1,  --The first button is the default selection.
  394.       MB_Default_On_Button_2,  --The second button is the default selection.
  395.       MB_Default_On_Button_3);  --The third button is the default selection.
  396.       
  397.   type MB_Modality_Type is (
  398.       MB_Application_Modal, -- The message box is application modal.  This
  399.                             -- is the default case.  The owner is disabled
  400.                             -- so do specfiy the owner as parent if this 
  401.                             -- option is used.
  402.       MB_System_Modal);     -- The entire system is stop until this message 
  403.                             -- box is cleared.
  404.  
  405.   type Mb_Response_Type is (
  406.     MB_Enter_Pressed,  -- The Enter pushbutton was pressed.
  407.     MB_Ok_Pressed,     -- The Ok pushbutton was pressed.
  408.     MB_Cancel_Pressed, -- The Cancel pushbutton was pressed.
  409.     MB_Abort_Pressed,  -- The Abort pushbutton was pressed.
  410.     MB_Retry_Pressed,  -- The Retry pushbutton was pressed.
  411.     MB_Ignore_Pressed, -- The Ignore pushbutton was pressed.
  412.     MB_Yes_Pressed,    -- The Yes pushbutton was pressed.
  413.     MB_No_Pressed,     -- The No pushbutton was pressed.
  414.     MB_Help_Pressed,    -- The Help pushbutton was pressed.
  415.     MB_Error);         -- The message box failed because of an error.           
  416.  
  417.   type Point_Type is
  418.     record
  419.       X : Pixel_Type;
  420.       Y : Pixel_Type;
  421.     end record; 
  422.  
  423.   type Point_Pointer_Type is access Point_Type;
  424.  
  425.   type Short_Point_Type is
  426.     record
  427.       X : PM_Types.U_Short;
  428.       Y : Pm_Types.U_Short;
  429.     end record; 
  430.  
  431.   type Queue_Message_Type is 
  432.     record
  433.       Win_Handle  : Handle_Type;
  434.       Message_Id  : Message_Type;   
  435.       Parameter_1 : Parameter_Type;
  436.       Parameter_2 : Parameter_Type;
  437.       Time        : Time_Type;
  438.       Pointer_Pos : Point_Type; 
  439.     end record;
  440.  
  441.   type Queue_Message_Pointer_Type is access Queue_Message_Type;
  442.  
  443.   ------------------------------------------------
  444.  
  445.   type Error_Info_Type is 
  446.     record
  447.       Size           : Pm_Types.U_Long;
  448.       Id             : Pm_Types.U_Long;
  449.       Details        : Pm_Types.U_Long;
  450.       Message_Offset : Pm_Types.U_Long;
  451.       Binary_Data    : Pm_Types.U_Long;
  452.     end record;
  453.  
  454.    type Error_Info_Pointer_Type is access Error_Info_Type;
  455.  
  456.   ------------------------------------------------
  457.  
  458.   type Class_Style_Type is (
  459.        Cs_Size_Redraw,   --Determines whether a window will be redrawn when 
  460.                          --sized.
  461.  
  462.        Cs_Sync_Paint,    --The window is synchronously repainted.
  463.        Cs_Move_Notify,   --When the window is moved a WM_Move message is 
  464.                          --posted.
  465.  
  466.        Cs_Clip_Children, --Causes a window of style WS_Clip_Children to be 
  467.                          --created.
  468.  
  469.        Cs_Clip_Siblings, --Causes a window of style WS_Clip_Siblings to be
  470.                          --created.
  471.  
  472.        Cs_Parent_Clip,   --Causes a window of style WS_Parent_Clip to be 
  473.                          --created.
  474.  
  475.        Cs_Save_Bits,     --Causes a window of WS_Save_Bits to be created.
  476.        Cs_Public,        --Causes a public window class to be registered.
  477.        Cs_Hit_Test,      --If set a Wm_Hit_Test message is send to the window 
  478.                          --before any pointing device messages are sent.
  479.                          --If it is not set then no Wm_Hit_Test message is 
  480.                          --sent.
  481.  
  482.        Cs_Frame);        --All windows are expected to behave as frame windows.
  483.  
  484.   type Class_Styles_Type is array (Class_Style_Type) of Boolean;
  485.  
  486.   type Position_Options_Type is (
  487.          Swp_Size,             --Change the size of the window.
  488.          Swp_Move,             --Move the window to the specified x, y 
  489.                                --position.
  490.  
  491.          Swp_Z_Order,          --Move the window either behind or in front of 
  492.                                --another window.
  493.  
  494.          Swp_Show,             --Show the window.
  495.          Swp_Hide,             --Hide the window.  This does not iconfiy 
  496.                                --a window.
  497.  
  498.          Swp_No_Redraw,        --Do not draw the changes.
  499.          Swp_No_Adjust,        --Do not send the WM_Adjust_Window_Pos message 
  500.                                --when moving or sizing the window.
  501.  
  502.          Swp_Activate,         --Actives the Window if it is a framed window.  
  503.                                --This option has no effect on other windows.  
  504.                                --The window is also made the top most window, 
  505.                                --unless Swp_Z_Order is used in which case the
  506.                                --Window in Behind_Window is used.
  507.  
  508.          Swp_Deactivate,       --Deactivates the Window if it is a framed 
  509.                                --window.  It has no effect on other windows.  
  510.                                --The window is made the bottom most window 
  511.                                --unless the Swp_Z_Order options is also in use.
  512.  
  513.          Swp_Ext_State_Change, --Unknown? Not in online documentation. ####
  514.  
  515.          Swp_Minimize,         --Minimizes the window.  The option has no effect 
  516.                                --if the window is already minimized.  This 
  517.                                --iconfies a window.  This option cannot be used 
  518.                                --with the Swp_Maximize or Swp_Restore options.
  519.  
  520.          Swp_Maximize,         --The window is set to the maximum screen size.  
  521.                                --The option has no effect if the window is 
  522.                                --already maximized.  This option cannot be used 
  523.                                --with the Swp_Minimize or Swp_Restore options.
  524.  
  525.          Swp_Restore,          --Restores a window to its normal state after a 
  526.                                --Swp_Minimize or Swp_Maximize.  This option cannot 
  527.                                --be used with the Swp_Minimize or Swp_Maximize 
  528.                                --options.  If the Swp_Move or Swp_Size options
  529.                                --are set the new values for size and position 
  530.                                --will be used when restoring the window.
  531.  
  532.          Swp_Focus_Active,     --Window is given the active focus.
  533.          Swp_Focus_Deactivate, --Window loses the focus.
  534.          Swp_No_Auto_Close);   --Unknown.
  535.  
  536.    type Position_Type is array (Position_Options_Type) of Boolean;
  537.  
  538.   -----------------------------------------------------------
  539.  
  540.    type Window_Style_Type is (
  541.       Ws_Sync_Paint,         --The window is synchronously repainted.  This
  542.                              --style is useful when the Class style is 
  543.                              --Cs_Sync_Paint.  An applications can the turn 
  544.                              --this style on and off to vary the repainting of
  545.                              --the window.
  546.  
  547.       Ws_Clip_Children,      --The area occupied by a child window should be
  548.                              --excluded when drawing is done to the parent 
  549.                              --window.  Normally, the child window's area is
  550.                              --included.
  551.  
  552.       Ws_Clip_Siblings,      --The area occupied by a sibling's window should 
  553.                              --be excluded when drawing is done to the window. 
  554.                              --Normally, the sibling's window area is included.
  555.  
  556.       Ws_Disabled,           --The window is disabled.  Normally a window is 
  557.                              --enabled.
  558.  
  559.       Ws_Maximized,          --The frame window is to be created at maximum 
  560.                              --size.
  561.  
  562.       Ws_Mimimized,          --The frame window is created iconfied.
  563.  
  564.       Ws_Parent_Clip,        --Controls how a window is clipped when drawing
  565.                              --takes place inside of the window.
  566.  
  567.       Ws_Save_Bits,          --The contents of the window should be saved when
  568.                              --the window is made visible.
  569.       Ws_Visible,            --The window is made visible.  Normally, the 
  570.                              --window is invisible.
  571.       Ws_Animate,            --???
  572.  
  573.       Ws_Group,              --Used when a window is part of a Dialog Box.  
  574.                              --This option identifies the dialog items that 
  575.                              --form a group.  The first window of a group 
  576.                              --should be specified with this style.  The
  577.                              --following windows should not.  The windows of 
  578.                              --a group must also be adjacent siblings.
  579.  
  580.       Ws_Tab_Stop,           --Used when a window is part of a Dialog Box.
  581.                              --This option identifies a dialog item that the 
  582.                              --user can reach by using the TAB key.
  583.  
  584.       Ws_Multi_Select,       --???
  585.  
  586.       Fs_Screen_Align,       --The dialog box coordinates are relative to
  587.                              --the top left corner of the screen, rather 
  588.                              --than the parent window's top left corner.
  589.  
  590.       Fs_Mouse_Align,        --The dialog box's top left corner is position 
  591.                              --is relative to the mouse pointer at the time 
  592.                              --of creation.  The dialog box will stay on 
  593.                              --screen if possible.
  594.  
  595.       Fs_Sizing_Border,      --The window's frame has a border that can be
  596.                              -- sized.
  597.  
  598.       Fs_Border,             --The window is drawn with a thin border that
  599.                              --cannot be sized.      
  600.  
  601.       Fs_Dialog_Border,      --Window is drawn with the standard dialog box
  602.                              --border.
  603.  
  604.       Fs_System_Modal,       --The frame window is system modal.
  605.  
  606.       Fs_No_Byte_Align,      --When set the system will not optimize movement
  607.                              --and sizing of the window.  
  608.  
  609.       Fs_Task_List,          --When set, the program's title is prepended to
  610.                              --the window title text.  The new title is also 
  611.                              --entered on the task list. The program title is
  612.                              -- the text used to start the program.
  613.  
  614.       Fs_No_Move_With_Owner, --The window is not moved when the owning window
  615.                              --is moved.
  616.  
  617.       Fs_Auto_Icon);         --When redrawing iconized windows the system 
  618.                              --redraws the icon and the Wm_Paint message is
  619.                              --not to the application.      
  620.  
  621.    type Window_Styles_Type is array (Window_Style_Type) of Boolean;
  622.  
  623.    Null_Window_Styles : constant Window_Styles_Type := (others => False); 
  624.    Use_Class_Styles   : constant Window_Styles_Type := Null_Window_Styles;
  625.  
  626.   -----------------------------------------------------------------------------
  627.  
  628.    type Frame_Control_Flag_Type is (
  629.         Fcf_Title_Bar,           --The frame should have a title bar.
  630.         Fcf_System_Menu,         --The frame should have a system menu.  
  631.                                  --The system menu is the menu under the 
  632.                                  --application's icon in the upper left corner.
  633.  
  634.         Fcf_Menu,                --The frame should have a menu bar.
  635.  
  636.         Fcf_Min_Max,             --The frame should have a Minimize and 
  637.                                  --Maximize button.  These button will appear 
  638.                                  --in the upper right corner.
  639.  
  640.         Fcf_Min_Button,          --The frame should have a Minimize button.
  641.  
  642.         Fcf_Max_Button,          --The frame should have a Maximize button.
  643.  
  644.         Fcf_Vert_Scroll_Bar,     --The frame should have a vertical scroll bar.
  645.  
  646.         Fcf_Horz_Scroll_Bar,     --The frame should have a horizontal scroll
  647.                                  -- bar.
  648.  
  649.         Fcf_Sizing_Border,       --The frame has a border that can be sized.
  650.  
  651.         Fcf_Border,              --The window is drawn with a thin border that
  652.                                  --cannot be sized.
  653.  
  654.         Fcf_Dialog_Border,       --Window is drawn with the standard dialog
  655.                                  -- box border.
  656.  
  657.         Fcf_Accel_Table,         --Loads the accelerator table from the 
  658.                                  --resource file that is identified by the 
  659.                                  --Create_Standard_Window routine.
  660.  
  661.         Fcf_Icon,                --An icon is associated with the window 
  662.                                  --when it is minimized.  The icon is
  663.                                  --specified by the 
  664.                                  --Create_Standard_Window routine.
  665.  
  666.         Fcf_Shell_Position,      --The shell determines the size and position 
  667.                                  --of the window.  Normally, the application 
  668.                                  --determines the size and position.
  669.  
  670.         Fcf_System_Modal,        --The frame window is system modal.
  671.  
  672.         Fcf_No_Byte_Align,       --When set the system will not optimize
  673.                                  --movement and sizing of the window.  
  674.  
  675.         Fcf_Task_List,           --When set, the program's title is prepended
  676.                                  --to the window title text.  The new title is 
  677.                                  --also entered on the task list. The program 
  678.                                  --title is the text used to start the program.
  679.  
  680.         Fcf_No_Move_With_Owner,  --The window is not moved when the owning
  681.                                  --window is moved.
  682.  
  683.         Fcf_Standard,            --Default window frame.  Is the same as
  684.                                  --   Fcf_Title_Bar, Fcf_System_Menu, 
  685.                                  --   Fcf_Min_Button, Fcf_Max_Button, 
  686.                                  --   Fcf_Sizing_Border, Fcf_Icon,
  687.                                  --   Fcf_Menu, Fcf_Accel_Table, 
  688.                                  --   Fcf_Shell_Position, Fcf_Tasklist.
  689.                                  --If no frame control options are provided 
  690.                                  --this is considered the default settings.
  691.  
  692.         Fcf_Screen_Align,        --The dialog box coordinates are relative
  693.                                  --to the top left corner of the screen, rather
  694.                                  --than the parent window's top left corner.
  695.  
  696.         Fcf_Mouse_Align,         --The dialog box's top left corner is position
  697.                                  --is relative to the mouse pointer at the time 
  698.                                  --of creation.  The dialog box will stay on
  699.                                  --screen if possible.
  700.  
  701.         Fcf_Auto_Icon,           --When redrawing iconized windows the system 
  702.                                  --redraws the icon and the Wm_Paint message is 
  703.                                  --not to the application.
  704.  
  705.         Fcf_Hide_Button,         --Adds a hide button to the title bar.
  706.  
  707.         Fcf_Hide_Max);           --Hides the minimize and maximize buttons.
  708.  
  709.   type Frame_Control_Flags_Type is array (Frame_Control_Flag_Type) of Boolean;
  710.  
  711.   Null_Frame_Flags : constant Frame_Control_Flags_Type := (others => False);
  712.  
  713.   type Frame_Id_Type is (
  714.          Fid_System_Menu,
  715.          Fid_Titlebar,
  716.          Fid_Min_Max,
  717.          Fid_Menu,
  718.          Fid_Vert_Scroll_Bar,
  719.          Fid_Horz_Scroll_Bar,
  720.          Fid_Client,
  721.          Fid_DBE_App_Stat,
  722.          Fid_DBE_Kbd_Stat,
  723.          Fid_DBE_Pecic,
  724.          Fid_Dbe_KK_Pop_Up);
  725.  
  726.   -----------------------------------------------------------------------------
  727.  
  728.    Min_Max_Restore_Usage_Error : exception; --Raise when Swp_Minimize,
  729.                                             --Swp_Maximize or
  730.                                             --Swp_Restore are used together.
  731.  
  732.    Clear_Position : constant Position_Type := (Others => False);
  733.    Show_Window    : constant Position_Type := (Swp_Size     => True,
  734.                                                Swp_Move     => True,
  735.                                                Swp_Show     => True,
  736.                                                Swp_Activate => True,
  737.                                                Others       => False);
  738.    Iconify_Window : constant Position_Type := (Swp_Minimize => True,
  739.                                                others       => False);
  740.    Restore_Window : constant Position_Type := (Swp_Restore  => True,
  741.                                                Swp_Activate => True,
  742.                                                others       => False);
  743.  
  744.   ------------------------------------------------
  745.  
  746.    --Keyboard Types
  747.    type Key_Flag_Type is (
  748.           Kc_None,
  749.           Kc_Char,
  750.           Kc_Virtual_Key,      --Indicates that the Virtual_Key value is valid.
  751.  
  752.           Kc_Scan_Code,        --Indicates that the scancode is valid. 
  753.                                --This is usually set when a WM_Char message 
  754.                                --is generated by a user.  If the message is 
  755.                                --sent by an application it may not be set.
  756.  
  757.           Kc_Shift,            --The Shift key was down when the key was 
  758.                                --pressed or released.
  759.  
  760.           Kc_Ctrl,             --The Control key was down when the key was 
  761.                                --pressed or released.
  762.  
  763.           Kc_Atl,              --The Alt key was down when the key was pressed
  764.                                --or released
  765.  
  766.           Kc_Key_Up,           --The event is a key-up transition.  If false
  767.                                --then the event was a key-down transition.
  768.  
  769.           Kc_Previous_Down,    --The key was previously down.  If false 
  770.                                --then the key was up.
  771.  
  772.           Kc_Lone_Key,         --Indicates that this was the only key pressed 
  773.                                --and release while the key was cycled.
  774.  
  775.           Kc_Dead_Key,         --The character code is a dead key.  The 
  776.                                --application must generate the display for 
  777.                                --the key without advancing the
  778.                                --cursor.
  779.  
  780.           Kc_Composite,        --This character code is combined with the 
  781.                                --previous dead
  782.                                --key to from the character code.
  783.  
  784.           Kc_Invalid_Composite, --The character code is not valid with the
  785.                                 --previous dead key.  The application must 
  786.                                 --advance the cursor past the
  787.                                 --dead key image.
  788.  
  789.           Kc_Toggle,
  790.           Kc_Invalid_Character,
  791.           Kc_DB_CSR_SR_VD1,
  792.           Kc_Db_CSR_SR_VD2);
  793.  
  794.    type Key_Flags_Type is array (Key_Flag_Type) of Boolean;
  795.     
  796.    type Virtual_Key_Type is (
  797.            Vk_Button_1,
  798.            Vk_Button_2,
  799.            Vk_Button_3,
  800.            Vk_Break,
  801.            Vk_Backspace,
  802.            Vk_Tab,
  803.            Vk_Back_Tab,
  804.            Vk_New_Line,
  805.            Vk_Shift,
  806.            Vk_Ctrl,
  807.            Vk_Atl,
  808.            Vk_Alt_Graf,
  809.            Vk_Pause,
  810.            Vk_Caps_Lock,
  811.            Vk_Esc,
  812.            Vk_Space,
  813.            Vk_Page_Up,
  814.            Vk_Page_Down,
  815.            Vk_End,
  816.            Vk_Home,
  817.            Vk_Left,
  818.            Vk_Up,
  819.            Vk_Right,
  820.            Vk_Down,
  821.            Vk_Print_Screen,
  822.            Vk_Insert,
  823.            Vk_Delete,
  824.            Vk_Scroll_Lock,
  825.            Vk_Num_Lock,
  826.            Vk_Enter,
  827.            Vk_Sys_Rq,
  828.            Vk_F1,
  829.            Vk_F2,
  830.            Vk_F3,
  831.            Vk_F4,
  832.            Vk_F5,
  833.            Vk_F6,
  834.            Vk_F7,
  835.            Vk_F8,
  836.            Vk_F9,
  837.            Vk_F10,
  838.            Vk_F11,
  839.            Vk_F12,
  840.            Vk_F13,
  841.            Vk_F14,
  842.            Vk_F15,
  843.            Vk_F16,
  844.            Vk_F17,
  845.            Vk_F18,
  846.            Vk_F19,
  847.            Vk_F20,
  848.            Vk_F21,
  849.            Vk_F22,
  850.            Vk_F23,
  851.            Vk_F24,
  852.            Vk_End_Drag,
  853.            Vk_Menu,
  854.            Vk_Null);
  855.  
  856.    type Key_Press_Info_Type is
  857.       record
  858.         Flags          : Key_Flags_Type;
  859.         Repeat_Count   : Pm_Types.U_Byte;
  860.         Scan_Code      : Pm_Types.U_Byte;
  861.         Character_Code : Pm_Types.U_Short;
  862.         Virtual_Key    : Virtual_Key_Type;
  863.       end record;
  864.          
  865.  
  866.   function Key_Info_Is (Message_Parameter_1 : Parameter_Type;
  867.                         Message_Parameter_2 : Parameter_Type) 
  868.                                         return Key_Press_Info_Type;
  869.    --For use after recieving a WM_Char message.  Decodes the 
  870.    --two message parameters and returns the values in the record.  
  871.    --Use with other message will cause errors.
  872.  
  873.   ------------------------------------------------
  874.  
  875.   type Command_Source_Type is (
  876.        Cmd_Src_Push_Button,
  877.        Cmd_Src_Menu,
  878.        Cmd_Src_Accelerator,
  879.        Cmd_Src_Font_Dialog,
  880.        Cmd_Src_File_Dialog,
  881.        Cmd_Src_Print_Dialog,
  882.        Cmd_Src_Color_Dialog,
  883.        Cmd_Src_Other);
  884.  
  885.   type Command_Id_Type is new Pm_Types.U_Short;
  886.  
  887.   type Command_Info_Type is
  888.     record
  889.      Id         : Command_Id_Type;
  890.      Source     : Command_Source_Type;
  891.      By_Pointer : Boolean;
  892.    end record;  
  893.  
  894.   function Command_Info_Is (Message_Parameter_1 : Parameter_Type;
  895.                             Message_Parameter_2 : Parameter_Type)
  896.                                               return Command_Info_Type;
  897.  
  898.    --For use after recieving a Wm_Command message.  Decodes the two 
  899.    --message parameters and returns the values in the Command_Info type.
  900.    --Use with other message may cause errors.
  901.  
  902.   ------------------------------------------------
  903.  
  904.    type Menu_Style_Type is (
  905.        MIS_Text,
  906.        MIS_Bitmap,
  907.        MIS_Separator,
  908.        MIS_Owner_Draw,
  909.        MIS_Submenu,
  910.        MIS_Mult_Menu,
  911.        MIS_Sys_Command,
  912.        MIS_Help,
  913.        MIS_Static,
  914.        MIS_Button_Separator,
  915.        MIS_Break,
  916.        MIS_Break_Separator,
  917.        MIS_Group,
  918.        MIS_Single);
  919.  
  920.    type Menu_Attribute_Type is (
  921.         MIA_No_Dismiss,
  922.         MIA_Framed,
  923.         MIA_Checked,
  924.         MIA_Disabled,
  925.         MIA_Highlighted);
  926.  
  927.    type Menu_Attributes_Type is array (Menu_Attribute_Type) of Boolean;
  928.  
  929.    type Menu_Position_Type is range 0 .. 1_000;
  930.  
  931.    type Menu_Item_Type is
  932.      record
  933.        Position    : Menu_Position_Type;
  934.        Style       : Menu_Style_Type;
  935.        Attributes  : Menu_Attributes_Type;
  936.        Item_Id     : Command_Id_Type;
  937.        Sub_Menu    : Handle_Type;
  938.        Item_Handle : Bitmap_Handle_Type;
  939.      end record;       
  940.  
  941.   ------------------------------------------------
  942.  
  943.    type Internal_Menu_Item_Type is private;
  944.    Null_Internal_Menu : constant Internal_Menu_Item_Type;
  945.  
  946.    function Create_Internal_Menu return Internal_Menu_Item_Type;
  947.  
  948.    procedure Destroy_Internal_Menu (Internal_Menu : in out Internal_Menu_Item_Type);
  949.  
  950.    function Convert_To_Internal (Menu_Item : Menu_Item_Type) 
  951.                                         return Internal_Menu_Item_Type;
  952.  
  953.    function Convert_To_External (Menu_Item : Internal_Menu_Item_Type) 
  954.                                                   return Menu_Item_Type;
  955.  
  956.   ------------------------------------------------
  957.  
  958.    function Query_Menu_Item (
  959.               Menu    : Handle_Type;
  960.               Item_Id : Command_Id_Type) return Menu_Item_Type;
  961.  
  962.   ------------------------------------------------
  963.  
  964.    procedure Set_Menu_Item (
  965.                       Menu      : in Handle_Type;
  966.                       Menu_Data : in Menu_Item_Type);
  967.  
  968.   ------------------------------------------------
  969.  
  970.    procedure Insert_Menu_Item (
  971.                      Menu      : in Handle_Type;
  972.                      Menu_Data : in Menu_Item_Type);
  973.  
  974.   ------------------------------------------------
  975.  
  976.    procedure Delete_Menu_Item (
  977.                      Menu      : in Handle_Type;
  978.                      Menu_Data : in Menu_Item_Type);
  979.  
  980.   ------------------------------------------------
  981.  
  982.    function Check_Menu_Item (
  983.               Menu    : Handle_Type;
  984.               Item_Id : Command_Id_Type;
  985.               Check   : Boolean) return Boolean; 
  986.  
  987.   ------------------------------------------------
  988.  
  989.    function Enable_Menu_Item (
  990.               Menu     : Handle_Type;
  991.               Item_Id  : Command_Id_Type;
  992.               Enable   : Boolean) return Boolean; 
  993.  
  994.   ------------------------------------------------
  995.  
  996.    function Load_Menu (
  997.                   Owner_Window : Handle_Type;
  998.                   Resource     : PULong;
  999.                   Menu_Id      : Id_Type) return Handle_Type;
  1000.  
  1001.   ------------------------------------------------
  1002.  
  1003.    type Pop_Up_Option_Type is (
  1004.       Pu_Position_On_Item,
  1005.       Pu_Horz_Constrained,
  1006.       Pu_Vert_Constrained,
  1007.       Pu_None,
  1008.       Pu_Mouse_Button_1_Down,
  1009.       Pu_Mouse_Button_2_Down,
  1010.       Pu_Mouse_Button_3_Down,
  1011.       Pu_Select_Item,
  1012.       Pu_Mouse_Button_1,
  1013.       Pu_Mouse_Button_2,
  1014.       Pu_Mouse_Button_3,
  1015.       Pu_Keyboard);
  1016.  
  1017.    type Pop_Up_Options_Type is array (Pop_Up_Option_Type) of Boolean;
  1018.  
  1019.    function Pop_Up_Menu (
  1020.         Window       : Handle_Type;
  1021.         Frame_Window : Handle_Type;
  1022.         Menu_Window  : Handle_Type;
  1023.         X            : Pixel_Type;
  1024.         Y            : Pixel_Type;
  1025.         Item_Id      : Command_Id_Type;
  1026.         Options      : Pop_Up_Options_Type) return Boolean;
  1027.              
  1028.    procedure Pop_Up_Menu (
  1029.         Window       : in Handle_Type;
  1030.         Frame_Window : in Handle_Type;
  1031.         Menu_Window  : in Handle_Type;
  1032.         X            : in Pixel_Type;
  1033.         Y            : in Pixel_Type;
  1034.         Item_Id      : in Command_Id_Type;
  1035.         Options      : in Pop_Up_Options_Type);
  1036.  
  1037.   ------------------------------------------------
  1038.  
  1039.    type Message_Handler_Function is access 
  1040.         function (Window              : Handle_Type;
  1041.                   Message             : Message_Type;
  1042.                   Message_Parameter_1 : Parameter_Type;  
  1043.                   Message_Parameter_2 : Parameter_Type)                  
  1044.                                                  return Pm_Types.U_Long;
  1045.  
  1046.   ------------------------------------------------
  1047.  
  1048.   function Pointer_Is (Parameter : Parameter_Type) return Point_Type;
  1049.  
  1050.   ------------------------------------------------
  1051.  
  1052.   function Get_Error_Info (Anchor_Block : Anchor_Block_Handle_Type)
  1053.                                           return Error_Info_Pointer_Type; 
  1054.  
  1055.   ------------------------------------------------
  1056.  
  1057.   function Get_Last_Error (Anchor_Block : Anchor_Block_Handle_Type) 
  1058.                                                   return Pm_Types.U_Long;
  1059.  
  1060.   ------------------------------------------------
  1061.  
  1062.   function Register_Class (Anchor_Block    : Anchor_Block_Handle_Type;
  1063.                            Class_Name      : String;
  1064.                            Message_Handler : Message_Handler_Function;
  1065.                            Class_Style     : Class_Styles_Type;
  1066.                            Extra_Storage   : Pm_Types.U_Short) return Boolean;
  1067.  
  1068.   Register_Failed : exception;
  1069.  
  1070.   procedure Register_Class (Anchor_Block    : in Anchor_Block_Handle_Type;
  1071.                             Class_Name      : in String;
  1072.                             Message_Handler : in Message_Handler_Function;
  1073.                             Class_Style     : in Class_Styles_Type;
  1074.                             Extra_Storage   : in Pm_Types.U_Short);
  1075.  
  1076.   ------------------------------------------------
  1077.  
  1078.   function Default_Window_Procedure 
  1079.                           (Window              : Handle_Type;
  1080.                            Message             : Message_Type;
  1081.                            Message_Parameter_1 : Parameter_Type;  
  1082.                            Message_Parameter_2 : Parameter_Type)                  
  1083.                                                return Pm_Types.U_Long;
  1084.  
  1085.   ------------------------------------------------
  1086.  
  1087.   function Create_Standard_Window (
  1088.             Parent_Window       : Handle_Type;
  1089.             Window_Styles       : Window_Styles_Type;
  1090.             Frame_Control_Flags : Frame_Control_Flags_Type;
  1091.             Class_Name          : String;
  1092.             Window_Title        : String;
  1093.             Class_Style         : Class_Styles_Type;
  1094.             Resource            : PULong;
  1095.             Resource_ID         : Pm_Types.U_Long;
  1096.             New_Window          : Handle_Pointer_Type) return Handle_Type;
  1097.  
  1098.   ------------------------------------------------
  1099.  
  1100.   function Window_From_Id (
  1101.             Parent_Window : Handle_Type;
  1102.             Frame_Id      : Frame_ID_Type) return Handle_Type;
  1103.  
  1104.   ------------------------------------------------
  1105.  
  1106.   
  1107.   function Set_Window_Position (
  1108.               Window           : Handle_Type;
  1109.               Behind_Window    : Handle_Type;
  1110.               X                : Device_Screen_Space_Type;
  1111.               Y                : Device_Screen_Space_Type;
  1112.               Width            : Device_Screen_Space_Type;
  1113.               Height           : Device_Screen_Space_Type;
  1114.               Position_Options : Position_Type) return Boolean; 
  1115.  
  1116.   Set_Failed : exception; 
  1117.  
  1118.   procedure Set_Window_Position (
  1119.               Window           : in Handle_Type;
  1120.               Behind_Window    : in Handle_Type;
  1121.               X                : in Device_Screen_Space_Type;
  1122.               Y                : in Device_Screen_Space_Type;
  1123.               Width            : in Device_Screen_Space_Type;
  1124.               Height           : in Device_Screen_Space_Type;
  1125.               Position_Options : in Position_Type);
  1126.  
  1127.   ------------------------------------------------
  1128.  
  1129.   function Is_Null (Window        : Handle_Type) return Boolean;
  1130.   function Is_Null (Queue         : Queue_Handle_Type) return Boolean;
  1131.   function Is_Null (Anchor_Block  : Anchor_Block_Handle_Type) return Boolean;
  1132.   function Is_Null (PS            : PS_Type) return Boolean;
  1133.   function Is_Null (Bitmap        : Bitmap_Handle_Type) return Boolean;
  1134.   function Is_Null (Internal_Menu : Internal_Menu_Item_Type) return Boolean;
  1135.  
  1136.   ------------------------------------------------
  1137.  
  1138.   Initialization_Failed : exception;
  1139.  
  1140.   function Initialize (
  1141.                        Options : Pm_Types.U_Long := System_Default   
  1142.                             --The only PM option is a value of 0.
  1143.                                    ) return Anchor_Block_Handle_Type;
  1144.  
  1145.   procedure Initialize (
  1146.              Options      : in     Pm_Types.U_Long := System_Default;
  1147.              Anchor_Block :    out Anchor_Block_Handle_Type);
  1148.  
  1149.    --Initializes the PM facilities for use by an application.
  1150.    --OS/2 PM Function WinInitialize
  1151.  
  1152.   ------------------------------------------------
  1153.  
  1154.   procedure Terminate_App (Anchor : in out Anchor_Block_Handle_Type);
  1155.  
  1156.   function Terminate_App (Anchor : Anchor_Block_Handle_Type) return Boolean;
  1157.  
  1158.   --Terminates an OS/2 application and releases the applications resources.
  1159.  
  1160.   ------------------------------------------------
  1161.  
  1162.   procedure Destroy_Message_Queue (Message_Queue : in out Queue_Handle_Type);
  1163.  
  1164.   function Destroy_Message_Queue (Message_Queue : Queue_Handle_Type)
  1165.                                                               return Boolean;
  1166.    --Destroys the applications message queue.
  1167.    --OS/2 PM Function WinDestroyMsgQueue
  1168.  
  1169.   ------------------------------------------------
  1170.  
  1171.   procedure Destroy_Window (Window : in out Handle_Type);
  1172.  
  1173.   function Destroy_Window (Window : Handle_Type) return Boolean;
  1174.  
  1175.    --Destroys the specified window.
  1176.    --OS/2 PM Function WinDestroyWindow
  1177.  
  1178.   ------------------------------------------------
  1179.  
  1180.   Message_Queue_Was_Not_Created : exception;
  1181.  
  1182.   function Create_Message_Queue (
  1183.               Anchor_Block  : Anchor_Block_Handle_Type;
  1184.               Queue_Size    : Pm_Types.Long := System_Default)
  1185.                               return Queue_Handle_Type; 
  1186.  
  1187.   procedure Create_Message_Queue (
  1188.               Anchor_Block  : in     Anchor_Block_Handle_Type;
  1189.               Queue_Size    : in     Pm_Types.Long := System_Default;
  1190.               Queue         :    out Queue_Handle_Type);
  1191.  
  1192.      --Most PM function require a Message Queue.  This function should
  1193.      --be called right after the Initialize function and before any other
  1194.      --PM calls.
  1195.  
  1196.      --OS/2 PM Function WinCreateMsgQueue
  1197.      
  1198.   ------------------------------------------------
  1199.  
  1200.    function Get_Message (
  1201.                Anchor_Block : Anchor_Block_Handle_Type;
  1202.                Message      : Queue_Message_Pointer_Type;
  1203.                Window       : Handle_Type;
  1204.                First        : Pm_Types.U_Long;
  1205.                Last         : Pm_Types.U_Long) return Boolean;
  1206.  
  1207.   ------------------------------------------------
  1208.  
  1209.    procedure Dispatch_Message (
  1210.                Anchor_Block : in Anchor_Block_Handle_Type;
  1211.                Message      : in Queue_Message_Pointer_Type);
  1212.  
  1213.   ------------------------------------------------
  1214.  
  1215.   type Help_Id_Type is new Pm_Types.U_Short;
  1216.  
  1217.   function Message_Box (
  1218.             Parent_Window  : Handle_Type;
  1219.             Request_Owner  : Handle_Type;
  1220.             Message        : String;
  1221.             Title          : String;
  1222.             Help_Id        : Help_Id_Type;
  1223.             Buttons        : MB_Button_Styles_Type;
  1224.             Icons          : MB_Icon_Styles_Type;   
  1225.             Default_Action : MB_Default_Action_Type;
  1226.             Modality       : MB_Modality_Type := MB_Application_Modal;
  1227.             Help_Button    : Boolean          := False;
  1228.             Moveable       : Boolean          := True)
  1229.                                                 return MB_Response_Type;
  1230.  
  1231.  
  1232.   ------------------------------------------------
  1233.  
  1234.    function Send_Message (   
  1235.          To_Window   : Handle_Type;
  1236.          Message     : Message_Type;
  1237.          Parameter_1 : Parameter_Type;
  1238.          Parameter_2 : Parameter_Type) return Void_Type;
  1239.  
  1240.   ------------------------------------------------
  1241.  
  1242.    function Post_Message (   
  1243.          To_Window   : Handle_Type;
  1244.          Message     : Message_Type;
  1245.          Parameter_1 : Parameter_Type;
  1246.          Parameter_2 : Parameter_Type) return Boolean;
  1247.  
  1248.   ------------------------------------------------
  1249.  
  1250.    function Get_PS (Window : Handle_Type) return PS_Type;
  1251.  
  1252.    procedure Release_Ps (Ps_Handle : in out Ps_Type);
  1253.  
  1254.   ------------------------------------------------
  1255.  
  1256.  private
  1257.  
  1258.   type Handle_Type is new Pm_Types.Long;
  1259.  
  1260.   Null_Window           : constant Handle_Type := 0;
  1261.   Null_HWND             : constant Handle_Type := Null_Window; 
  1262.   Desktop_Window        : constant Handle_Type := 1;
  1263.   Top_Window            : constant Handle_Type := 3;
  1264.   Bottom_Windw          : constant Handle_Type := 4;
  1265.   Object_Handle         : constant Handle_Type := 2;
  1266.   Thread_Capture_Handle : constant Handle_Type := 5;
  1267.  
  1268.   ------------------------------------------
  1269.  
  1270.   type Queue_Handle_Type is new Pm_Types.Long;
  1271.  
  1272.   Null_Queue : constant Queue_Handle_Type := 0;
  1273.   Null_HMQ   : constant Queue_Handle_Type := Null_Queue;
  1274.  
  1275.   ------------------------------------------
  1276.  
  1277.   type Anchor_Block_Handle_Type is new Pm_Types.Long;
  1278.  
  1279.   Null_Anchor_Block : constant Anchor_Block_Handle_Type := 0;
  1280.   Null_HAB          : constant Anchor_Block_Handle_Type := Null_Anchor_Block;
  1281.  
  1282.   ------------------------------------------
  1283.  
  1284.   type Ps_Type is new Pm_Types.U_Long;
  1285.   Null_Ps : constant PS_Type := 0;
  1286.  
  1287.   ------------------------------------------
  1288.  
  1289.   type OS2_Menu_Item_Type;
  1290.   type Internal_Menu_Item_Type is access OS2_Menu_Item_Type;
  1291.   Null_Internal_Menu : constant Internal_Menu_Item_Type := null;
  1292.  
  1293.   ------------------------------------------
  1294.  
  1295.    type Bitmap_Handle_Type is new Pm_Types.U_Long;
  1296.    Null_Bitmap : constant Bitmap_Handle_Type := 0;
  1297.  
  1298.  
  1299. end Win;
  1300.    
  1301.  
  1302.  
  1303.  
  1304.  
  1305.