home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / OS2API / OS2-PMA.ADS < prev    next >
Text File  |  1996-08-10  |  4KB  |  97 lines

  1.  
  2. -- ╔═══════════════════════════════════════════════════════════════════╗
  3. -- ║       D E S I G N   E N G I N E R I N G              ║D║S║        ║
  4. -- ║            S O F T W A R E                           ╚═╩═╝        ║
  5. -- ║                                                                   ║
  6. -- ║        Package     Os2.PMa                                        ║
  7. -- ║                                                                   ║
  8. -- ║        Author :  Leonid Dulman     1995                           ║
  9. -- ║                                                                   ║
  10. -- ║             GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS            ║
  11. -- ║                                                                   ║
  12. -- ║               PM       Accelerator   functions                    ║
  13. -- ║                                                                   ║
  14. -- ╚═══════════════════════════════════════════════════════════════════╝
  15.  
  16.  
  17. with Interfaces.C;         use Interfaces.C;
  18. with Interfaces.C.Strings; use Interfaces.C.Strings;
  19.  
  20. package Os2.PMa is
  21. pragma Preelaborate (PMa);
  22. --     Accelerator ; functions
  23.  
  24. subtype HACCEL is  LHANDLE ; -- haccel
  25. --
  26. --   ACCEL fs bits
  27. --
  28. --  NOTE: the first six AF_ code bits have the same value
  29. --  as their KC_ counterparts
  30.  
  31.   AF_CHAR       :constant Long:=              16#0001#;
  32.   AF_VIRTUALKEY :constant Long:=              16#0002#;
  33.   AF_SCANCODE   :constant Long:=              16#0004#;
  34.   AF_SHIFT      :constant Long:=              16#0008#;
  35.   AF_CONTROL    :constant Long:=              16#0010#;
  36.   AF_ALT        :constant Long:=              16#0020#;
  37.   AF_LONEKEY    :constant Long:=              16#0040#;
  38.   AF_SYSCOMMAND :constant Long:=              16#0100#;
  39.   AF_HELP       :constant Long:=              16#0200#;
  40.  
  41. --   Binary resources may be bound into application executables or
  42. --   passed as a parameter when creating a window or dialog
  43. --   Currently they must be the same for both 16-bit and 32-bit
  44. --   so we pack the structures.
  45.  
  46. type ACCEL  is record    -- acc
  47.   fs    :USHORT  ;
  48.   key   :USHORT  ;
  49.   cmd   :USHORT  ;
  50. end record; -- ACCEL;
  51. type PACCEL  is access all ACCEL;
  52.  
  53. --   Binary resources may be bound into application executables or
  54. --   passed as a parameter when creating a window or dialog
  55. --   Currently they must be the same for both 16-bit and 32-bit
  56. --   so we pack the structures.
  57.  
  58. type ACCELTABLE  is record    -- acct
  59.    cAccel   :USHORT  ;
  60.    codepage :USHORT  ;
  61.    aaccel   :ACCEL   ;      -- [1];
  62. end record; -- ACCELTABLE;
  63. type PACCELTABLE  is access all ACCELTABLE;
  64.  
  65. function WinLoadAccelTable(ha           :HAB     ;
  66.                            hmod         :HMODULE ;
  67.                            idAccelTable :ULONG   )return HACCEL;
  68. pragma Import(c,WinLoadAccelTable, Link_name=>"_WinLoadAccelTable");
  69.  
  70. function WinCopyAccelTable(haccl      :HACCEL      ;
  71.                            pAccelTab  :PACCELTABLE ;
  72.                            cbCopyMax  :ULONG       )return ULONG;
  73. pragma Import(c,WinCopyAccelTable, Link_name=>"_WinCopyAccelTable");
  74.  
  75. function WinCreateAccelTable(ha         :HAB         ;
  76.                              pAccelTab  :PACCELTABLE )return HACCEL;
  77. pragma Import(c,WinCreateAccelTable, Link_name=>"_WinCreateAccelTable");
  78.  
  79. function WinDestroyAccelTable(haccl:HACCEL )return BOOL32  ;
  80. pragma Import(c,WinDestroyAccelTable, Link_name=>"_WinDestroyAccelTable");
  81.  
  82. function WinTranslateAccel(ha   :HAB    ;
  83.                            hwn  :HWND   ;
  84.                            haccl:HACCEL ;
  85.                            pqm  :PQMSG  )return BOOL32  ;
  86. pragma Import(c,WinTranslateAccel, Link_name=>"_WinTranslateAccel");
  87.  
  88. function WinSetAccelTable(ha       :HAB    ;
  89.                           haccl    :HACCEL ;
  90.                           hwndFrame:HWND   )return BOOL32  ;
  91. pragma Import(c,WinSetAccelTable, Link_name=>"_WinSetAccelTable");
  92.  
  93. function WinQueryAccelTable(ha       :HAB  ;
  94.                             hwndFrame:HWND )return HACCEL;
  95. pragma Import(c,WinQueryAccelTable, Link_name=>"_WinQueryAccelTable");
  96. end os2.PMa;
  97.