home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / OS2API / OS2-MOU.ADS < prev    next >
Text File  |  1996-07-16  |  10KB  |  233 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.MOU                                        ║
  7. -- ║                                                                   ║
  8. -- ║        Author :  Leonid Dulman     1995                           ║
  9. -- ║                                                                   ║
  10. -- ║             GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS            ║
  11. -- ║                                                                   ║
  12. -- ║               Mouse   support    of os/2 api functions            ║
  13. -- ║                                                                   ║
  14. -- ╚═══════════════════════════════════════════════════════════════════╝
  15.  
  16. with Interfaces.C;         use Interfaces.C;
  17. with Interfaces.C.Strings; use Interfaces.C.Strings;
  18.  
  19. package Os2.Mou  is
  20. pragma Preelaborate (Mou);
  21.  
  22. subtype  HMOU is USHORT ;
  23. type PHMOU is access all HMOU;
  24.  
  25. function  MouRegister (  pszModName  :PSZ ;
  26.                          pszEntryName:PSZ ;
  27.                          flFuns      :ULONG) return apiret16;
  28. pragma Import(c,MouRegister, Link_name=>"MouRegister");
  29.  
  30.  MR_MOUGETNUMBUTTONS        :constant ulong:=16#00000001#;
  31.  MR_MOUGETNUMMICKEYS        :constant ulong:=16#00000002#;
  32.  MR_MOUGETDEVSTATUS         :constant ulong:=16#00000004#;
  33.  MR_MOUGETNUMQUEEL          :constant ulong:=16#00000008#;
  34.  MR_MOUREADEVENTQUE         :constant ulong:=16#00000010#;
  35.  MR_MOUGETSCALEFACT         :constant ulong:=16#00000020#;
  36.  MR_MOUGETEVENTMASK         :constant ulong:=16#00000040#;
  37.  MR_MOUSETSCALEFACT         :constant ulong:=16#00000080#;
  38.  MR_MOUSETEVENTMASK         :constant ulong:=16#00000100#;
  39.  MR_MOUOPEN                 :constant ulong:=16#00000800#;
  40.  MR_MOUCLOSE                :constant ulong:=16#00001000#;
  41.  MR_MOUGETPTRSHAPE          :constant ulong:=16#00002000#;
  42.  MR_MOUSETPTRSHAPE          :constant ulong:=16#00004000#;
  43.  MR_MOUDRAWPTR              :constant ulong:=16#00008000#;
  44.  MR_MOUREMOVEPTR            :constant ulong:=16#00010000#;
  45.  MR_MOUGETPTRPOS            :constant ulong:=16#00020000#;
  46.  MR_MOUSETPTRPOS            :constant ulong:=16#00040000#;
  47.  MR_MOUINITREAL             :constant ulong:=16#00080000#;
  48.  MR_MOUSETDEVSTATUS         :constant ulong:=16#00100000#;
  49.  
  50. function   MouDeRegister return apiret16;
  51. pragma Import(c,MouDeRegister, Link_name=>"MouDeRegister");
  52.  
  53. function  MouFlushQue ( mou:HMOU) return apiret16;
  54. pragma Import(c,MouFlushQue, Link_name=>"MouFlushQue");
  55.  
  56.  MHKBUTTON1                :constant ushort:=0001;
  57.  MHKBUTTON2                :constant ushort:=0002;
  58.  MHKBUTTON3                :constant ushort:=0004;
  59.  
  60.        -- ure for MouGet/SetPtrPos() --
  61. type  PTRLOC  is record    -- moupl --
  62.   row        :USHORT ;
  63.   col        :USHORT ;
  64. end record; --PTRLOC;
  65. type PPTRLOC is access all PTRLOC;
  66.  
  67. function MouGetPtrPos (pmouLoc:PPTRLOC;
  68.                        mou    :HMOU    )  return apiret16;
  69. pragma Import(c,MouGetPtrPos, Link_name=>"_MouGetPtrPos");
  70.  
  71. function MouSetPtrPos (pmouLoc:PPTRLOC ;
  72.                        mou    :HMOU    ) return apiret16;
  73. pragma Import(c,MouSetPtrPos, Link_name=>"_MouSetPtrPos");
  74.  
  75. -- ure for MouGet/SetPtrShape() --
  76. type  PTRSHAPE  is record    -- moups --
  77.   cb            :USHORT ;
  78.   col           :USHORT ;
  79.   row           :USHORT ;
  80.   colHot        :USHORT ;
  81.   rowHot        :USHORT ;
  82. end record; --PTRSHAPE;
  83. type PPTRSHAPE is access all PTRSHAPE;
  84.  
  85. function  MouSetPtrShape (pBuf       :PBYTE      ;
  86.                           pmoupsInfo :PPTRSHAPE ;
  87.                           mou        :HMOU      ) return apiret16;
  88. pragma Import(c,MouSetPtrShape, Link_name=>"_MouSetPtrShape");
  89.  
  90. function  MouGetPtrShape (pBuf       :PBYTE      ;
  91.                           pmoupsInfo :PPTRSHAPE ;
  92.                           mou        :HMOU      ) return apiret16;
  93. pragma Import(c,MouGetPtrShape, Link_name=>"_MouGetPtrShape");
  94.  
  95.        -- MouGetDevStatus/MouSetDevStatus device status constants --
  96.  MOUSEQUEUEBUSY        :constant ushort:=16#0001#;
  97.  MOUSEBLOCKREAD        :constant ushort:=16#0002#;
  98.  MOUSEFLUSH            :constant ushort:=16#0004#;
  99.  MOUSEUNSUPPORTEDMODE  :constant ushort:=16#0008#;
  100.  MOUSEDISABLED         :constant ushort:=16#0100#;
  101.  MOUSEMICKEYS          :constant ushort:=16#0200#;
  102.  
  103. function  MouGetDevStatus (pfsDevStatus:PUSHORT ;
  104.                            mou         :HMOU    ) return apiret16;
  105. pragma Import(c,MouGetDevStatus, Link_name=>"_MouGetDevStatus");
  106.  
  107. function  MouGetNumButtons (pcButtons:PUSHORT ;
  108.                             mou      :HMOU    ) return apiret16;
  109. pragma Import(c,MouGetNumButtons, Link_name=>"_MouGetNumButtons");
  110.  
  111. function MouGetNumMickeys (pcMickeys:PUSHORT ;
  112.                            mou      :HMOU    ) return apiret16;
  113. pragma Import(c,MouGetNumMickeys, Link_name=>"_MouGetNumMickeys");
  114.  
  115.        -- MouReadEventQue --
  116.  MOUNOWAIT      :constant ushort:=0000;
  117.  MOUWAIT        :constant ushort:=0001;
  118.  
  119.        -- ure for MouReadEventQue() --
  120. type   MOUEVENTINFO is record    -- mouev --
  121.       fs      :USHORT ;
  122.       time    :ULONG  ;
  123.       row     :SHORT  ;
  124.       col     :SHORT  ;
  125. end record; --MOUEVENTINFO;
  126. type PMOUEVENTINFO is access all MOUEVENTINFO;
  127.  
  128. function  MouReadEventQue (mouevEvent:PMOUEVENTINFO ;
  129.                            pfWait    :PUSHORT       ;
  130.                            mou       :HMOU          ) return apiret16;
  131. pragma Import(c,MouReadEventQue, Link_name=>"_MouReadEventQue");
  132.  
  133.  -- ure for MouGetNumQueEl() --
  134. type  MOUQUEINFO is record      -- mouqi --
  135.       cEvents       :USHORT ;
  136.       cmaxEvents    :USHORT ;
  137. end record; --MOUQUEINFO;
  138. type PMOUQUEINFO is access all MOUQUEINFO;
  139.  
  140. function  MouGetNumQueEl (qmouqi:PMOUQUEINFO ;
  141.                           mou   :HMOU        ) return apiret16;
  142. pragma Import(c,MouGetNumQueEl, Link_name=>"_MouGetNumQueEl");
  143.  
  144.        -- MouGetEventMask/MouSetEventMask events --
  145.  MOUSEMOTION              :constant ushort :=16#0001#;
  146.  MOUSEMOTIONWITHBN1DOWN   :constant ushort :=16#0002#;
  147.  MOUSEBN1DOWN             :constant ushort :=16#0004#;
  148.  MOUSEMOTIONWITHBN2DOWN   :constant ushort :=16#0008#;
  149.  MOUSEBN2DOWN             :constant ushort :=16#0010#;
  150.  MOUSEMOTIONWITHBN3DOWN   :constant ushort :=16#0020#;
  151.  MOUSEBN3DOWN             :constant ushort :=16#0040#;
  152.  
  153. function MouGetEventMask (pfsEvents:PUSHORT ;
  154.                          mou      :HMOU    ) return apiret16;
  155. pragma Import(c,MouGetEventMask, Link_name=>"_MouGetEventMask");
  156.  
  157. function  MouSetEventMask (pfsEvents:PUSHORT ;
  158.                            mou      :HMOU    ) return apiret16;
  159. pragma Import(c,MouSetEventMask, Link_name=>"_MouSetEventMask");
  160.  
  161.        -- ure for MouGet/SetScaleFact() --
  162. type   SCALEFACT is record   -- mousc --
  163.     rowScale      :USHORT ;
  164.     colScale      :USHORT ;
  165. end record; --SCALEFACT;
  166. type PSCALEFACT is access all SCALEFACT;
  167.  
  168. function  MouGetScaleFact (pmouscFactors:PSCALEFACT ;
  169.                            mou          :HMOU       )return apiret16;
  170. pragma Import(c,MouGetScaleFact, Link_name=>"_MouGetScaleFact");
  171.  
  172. function  MouSetScaleFact (pmouscFactors:PSCALEFACT ;
  173.                            mou          :HMOU       )return apiret16;
  174. pragma Import(c,MouSetScaleFact, Link_name=>"_MouSetScaleFact");
  175.  
  176. function  MouOpen (pszDvrName:PSZ   ;
  177.                    pmou      :PHMOU ) return apiret16;
  178. pragma Import(c,MouOpen, Link_name=>"_MouOpen");
  179.  
  180. function  MouClose (mou:HMOU  ) return apiret16;
  181. pragma Import(c,MouClose, Link_name=>"_MouClose");
  182.  
  183.        -- ure for MouRemovePtr() --
  184. type  NOPTRRECT is record    -- mourt --
  185.     row       :USHORT ;
  186.     col       :USHORT ;
  187.     cRow      :USHORT ;
  188.     cCol      :USHORT ;
  189. end record; --NOPTRRECT;
  190. type PNOPTRRECT is access all NOPTRRECT;
  191.  
  192. function  MouRemovePtr (pmourtRect:PNOPTRRECT ;
  193.                         mou       :HMOU       ) return apiret16;
  194. pragma Import(c,MouRemovePtr, Link_name=>"_MouRemovePtr");
  195.  
  196. function MouDrawPtr (mou:HMOU  ) return apiret16;
  197. pragma Import(c,MouDrawPtr, Link_name=>"_MouDrawPtr");
  198.  
  199.  MOUNODRAW      :constant ushort:=0001;
  200.  MOUDRAW        :constant ushort:=0000;
  201.  MOUMICKEYS     :constant ushort:=0002;
  202.  MOUPELS        :constant ushort:=0000;
  203.  
  204.  
  205. function MouSetDevStatus (pfsDevStatus:PUSHORT ;
  206.                           mou         :HMOU    ) return apiret16;
  207. pragma Import(c,MouSetDevStatus, Link_name=>"_MouSetDevStatus");
  208.  
  209. function  MouInitReal (ps:PSZ) return apiret16;
  210. pragma Import(c,MouInitReal, Link_name=>"_MouInitReal");
  211.  
  212. function  MouSynch(pszDvrName:USHORT ) return apiret16;
  213. pragma Import(c,MouSynch, Link_name=>"_MouSynch");
  214.  
  215. type  THRESHOLD  is record      -- threshold --
  216.    Length         :USHORT ;        -- Length Field            --
  217.    Level1         :USHORT ;        -- First movement level    --
  218.    Lev1Mult       :USHORT ;        -- First level multiplier  --
  219.    Level2         :USHORT ;        -- Second movement level   --
  220.    lev2Mult       :USHORT ;        -- Second level multiplier --
  221. end record; --THRESHOLD;
  222. type PTHRESHOLD is access all THRESHOLD;
  223.  
  224. function  MouGetThreshold(pthresh:PTHRESHOLD ;
  225.                           mou    :HMOU       ) return apiret16;
  226. pragma Import(c,MouGetThreshold, Link_name=>"_MouGetThreshold");
  227.  
  228. function  MouSetThreshold(pthresh:PTHRESHOLD ;
  229.                           mou    :HMOU       ) return apiret16;
  230. pragma Import(c,MouSetThreshold, Link_name=>"_MouSetThreshold");
  231.  
  232. end Os2.mou;
  233.