home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / watcoapi.zip / incl16 / bsesub.h < prev    next >
C/C++ Source or Header  |  2002-09-30  |  14KB  |  412 lines

  1. /*
  2.     OS/2 Base subsystems include file for 16-bit development.
  3. */
  4.  
  5.  
  6. #ifdef INCL_SUB
  7.     #define INCL_KBD
  8.     #define INCL_MOU
  9.     #define INCL_VIO
  10. #endif
  11.  
  12. #ifdef INCL_KBD
  13.  
  14. #define KR_KBDCHARIN       0x00000001
  15. #define KR_KBDPEEK         0x00000002
  16. #define KR_KBDFLUSHBUFFER  0x00000004
  17. #define KR_KBDGETSTATUS    0x00000008
  18. #define KR_KBDSETSTATUS    0x00000010
  19. #define KR_KBDSTRINGIN     0x00000020
  20. #define KR_KBDOPEN         0x00000040
  21. #define KR_KBDCLOSE        0x00000080
  22. #define KR_KBDGETFOCUS     0x00000100
  23. #define KR_KBDFREEFOCUS    0x00000200
  24. #define KR_KBDGETCP        0x00000400
  25. #define KR_KBDSETCP        0x00000800
  26. #define KR_KBDXLATE        0x00001000
  27. #define KR_KBDSETCUSTXT    0x00002000
  28.  
  29. #define IO_WAIT            0
  30. #define IO_NOWAIT          1
  31.  
  32. typedef SHANDLE    HKBD;
  33. typedef HKBD FAR   *PHKBD;
  34.  
  35. typedef struct _KBDKEYINFO {
  36.     UCHAR  chChar;
  37.     UCHAR  chScan;
  38.     UCHAR  fbStatus;
  39.     UCHAR  bNlsShift;
  40.     USHORT fsState;
  41.     ULONG  time;
  42. }KBDKEYINFO, FAR *PKBDKEYINFO;
  43.  
  44. typedef struct _KBDHWID {
  45.     USHORT length;
  46.     USHORT kbd_id;
  47.     USHORT reserved1;
  48.     USHORT reserved2;
  49. }KBDHWID, FAR *PKBDHWID;
  50.  
  51. typedef struct _KBDINFO {
  52.     USHORT cb;
  53.     USHORT fsMask;
  54.     USHORT chTurnAround;
  55.     USHORT fsInterim;
  56.     USHORT fsState;
  57. } KBDINFO, FAR *PKBDINFO;
  58.  
  59. typedef struct _STRINGINBUF {
  60.     USHORT cb;
  61.     USHORT cchIn;
  62. } STRINGINBUF, FAR *PSTRINGINBUF;
  63.  
  64. typedef struct _KBDTRANS {
  65.     UCHAR  chChar;
  66.     UCHAR  chScan;
  67.     UCHAR  fbStatus;
  68.     UCHAR  bNlsShift;
  69.     USHORT fsState;
  70.     ULONG  time;
  71.     USHORT fsDD;
  72.     USHORT fsXlate;
  73.     USHORT fsShift;
  74.     USHORT sZero;
  75. } KBDTRANS, FAR *PKBDTRANS;
  76.  
  77. USHORT APIENTRY KbdCharIn(PKBDKEYINFO CharData, USHORT IOWait, HKBD KbdHandle);
  78. USHORT APIENTRY KbdClose(HKBD KbdHandle);
  79. USHORT APIENTRY KbdDeRegister(VOID);
  80. USHORT APIENTRY KbdFlushBuffer(HKBD KbdHandle);
  81. USHORT APIENTRY KbdFreeFocus(HKBD KbdHandle);
  82. USHORT APIENTRY KbdGetCp(ULONG Reserved, PUSHORT CodePageID, HKBD KbdHandle);
  83. USHORT APIENTRY KbdGetFocus(USHORT IOWait, HKBD KbdHandle);
  84. USHORT APIENTRY KbdGetHWId(PKBDHWID KeyboardID, HKBD KbdHandle);
  85. USHORT APIENTRY KbdGetStatus(PKBDINFO Structure, HKBD KbdHandle);
  86. USHORT APIENTRY KbdOpen(PHKBD KbdHandle);
  87. USHORT APIENTRY KbdPeek(PKBDKEYINFO CharData, HKBD KbdHandle);
  88. USHORT APIENTRY KbdRegister(PSZ ModuleName, PSZ EntryPoint, ULONG FunctionMask);
  89. USHORT APIENTRY KbdSetCp(USHORT Reserved, USHORT CodePageID, HKBD KbdHandle);
  90. USHORT APIENTRY KbdSetCustXt(PUSHORT Xlatetable, HKBD KbdHandle);
  91. USHORT APIENTRY KbdSetFgnd(VOID);
  92. USHORT APIENTRY KbdSetStatus(PKBDINFO Structure, HKBD KbdHandle);
  93. USHORT APIENTRY KbdStringIn(PCH CharBuffer, PSTRINGINBUF Length, USHORT IOWait, HKBD KbdHandle);
  94. USHORT APIENTRY KbdSynch(USHORT IOWait);
  95. USHORT APIENTRY KbdXlate(PKBDTRANS XlateRecord, HKBD KbdHandle);
  96.  
  97. #endif
  98.  
  99. #ifdef INCL_MOU
  100.  
  101. #define MR_MOUGETNUMBUTTONS 0x00000001
  102. #define MR_MOUGETNUMMICKEYS 0x00000002
  103. #define MR_MOUGETDEVSTATUS  0x00000004
  104. #define MR_MOUGETNUMQUEEL   0x00000008
  105. #define MR_MOUREADEVENTQUE  0x00000010
  106. #define MR_MOUGETSCALEFACT  0x00000020
  107. #define MR_MOUGETEVENTMASK  0x00000040
  108. #define MR_MOUSETSCALEFACT  0x00000080
  109. #define MR_MOUSETEVENTMASK  0x00000100
  110. #define MR_MOUOPEN          0x00000800
  111. #define MR_MOUCLOSE         0x00001000
  112. #define MR_MOUGETPTRSHAPE   0x00002000
  113. #define MR_MOUSETPTRSHAPE   0x00004000
  114. #define MR_MOUDRAWPTR       0x00008000
  115. #define MR_MOUREMOVEPTR     0x00010000
  116. #define MR_MOUGETPTRPOS     0x00020000
  117. #define MR_MOUSETPTRPOS     0x00040000
  118. #define MR_MOUINITREAL      0x00080000
  119. #define MR_MOUSETDEVSTATUS  0x00100000
  120.  
  121. #define MHK_BUTTON1 1
  122. #define MHK_BUTTON2 2
  123. #define MHK_BUTTON3 4
  124.  
  125. #define MOU_NODRAW  1
  126. #define MOU_DRAW    0
  127. #define MOU_MICKEYS 2
  128. #define MOU_PELS    0
  129.  
  130.  
  131. typedef SHANDLE    HMOU;
  132. typedef HMOU FAR   *PHMOU;
  133.  
  134. typedef struct _MOUQUEINFO {
  135.     USHORT cEvents;
  136.     USHORT cmaxEvents;
  137. } MOUQUEINFO, FAR *PMOUQUEINFO;
  138.  
  139. typedef struct _PTRLOC {
  140.     USHORT row;
  141.     USHORT col;
  142. } PTRLOC, FAR *PPTRLOC;
  143.  
  144. typedef struct _PTRSHAPE {
  145.     USHORT cb;
  146.     USHORT col;
  147.     USHORT row;
  148.     USHORT colHot;
  149.     USHORT rowHot;
  150. } PTRSHAPE, FAR *PPTRSHAPE;
  151.  
  152. typedef struct _SCALEFACT {
  153.     USHORT rowScale;
  154.     USHORT colScale;
  155. } SCALEFACT, FAR *PSCALEFACT;
  156.  
  157. typedef struct _MOUEVENTINFO {
  158.     USHORT fs;
  159.     ULONG  time;
  160.     USHORT row;
  161.     USHORT col;
  162. } MOUEVENTINFO, FAR *PMOUEVENTINFO;
  163.  
  164. typedef struct _NOPTRRECT {
  165.     USHORT row;
  166.     USHORT col;
  167.     USHORT cRow;
  168.     USHORT cCol;
  169. } NOPTRRECT, FAR *PNOPTRRECT;
  170.  
  171. USHORT APIENTRY MouClose(HMOU DeviceHandle);
  172. USHORT APIENTRY MouDeRegister(VOID);
  173. USHORT APIENTRY MouDrawPtr(HMOU DeviceHandle);
  174. USHORT APIENTRY MouFlushQue(HMOU DeviceHandle);
  175. USHORT APIENTRY MouGetDevStatus(PUSHORT DeviceStatus, HMOU DeviceHandle);
  176. USHORT APIENTRY MouGetEventMask(PUSHORT EventMask, HMOU DeviceHandle);
  177. USHORT APIENTRY MouGetNumButtons(PUSHORT NumberOfButtons, HMOU DeviceHandle);
  178. USHORT APIENTRY MouGetNumMickeys(PUSHORT NumberOfMickeys, HMOU DeviceHandle);
  179. USHORT APIENTRY MouGetNumQueEl(PMOUQUEINFO QueDataRecord, HMOU DeviceHandle);
  180. USHORT APIENTRY MouGetPtrPos(PPTRLOC PtrPos, HMOU DeviceHandle);
  181. USHORT APIENTRY MouGetPtrShape(PBYTE PtrBuffer, PPTRSHAPE PtrDefRec, HMOU DeviceHandle);
  182. USHORT APIENTRY MouGetScaleFact(PSCALEFACT ScaleStruct, HMOU DeviceHandle);
  183. USHORT APIENTRY MouInitReal(PSZ DriverName);
  184. USHORT APIENTRY MouOpen(PSZ DriverName, PHMOU DeviceHandle);
  185. USHORT APIENTRY MouReadEventQue(PMOUEVENTINFO Buffer, PUSHORT ReadType, HMOU DeviceHandle);
  186. USHORT APIENTRY MouRegister(PSZ ModuleName, PSZ EntryName, ULONG Mask);
  187. USHORT APIENTRY MouRemovePtr(PNOPTRRECT PtrArea, HMOU DeviceHandle);
  188. USHORT APIENTRY MouSetDevStatus(PUSHORT DeviceStatus, HMOU DeviceHandle);
  189. USHORT APIENTRY MouSetEventMask(PUSHORT EventMask, HMOU DeviceHandle);
  190. USHORT APIENTRY MouSetPtrPos(PPTRLOC PtrPos, HMOU DeviceHandle);
  191. USHORT APIENTRY MouSetPtrShape(PBYTE PtrBuffer, PPTRSHAPE PtrDefRec, HMOU DeviceHandle);
  192. USHORT APIENTRY MouSetScaleFact(PSCALEFACT ScaleStruct, HMOU DeviceHandle);
  193. USHORT APIENTRY MouSynch(USHORT IOWait);
  194.  
  195. #endif
  196.  
  197. #ifdef INCL_VIO
  198.  
  199. #define VR_VIOGETCURPOS    0x00000001
  200. #define VR_VIOGETCURTYPE   0x00000002
  201. #define VR_VIOGETMODE      0x00000004
  202. #define VR_VIOGETBUF       0x00000008
  203. #define VR_VIOGETPHYSBUF   0x00000010
  204. #define VR_VIOSETCURPOS    0x00000020
  205. #define VR_VIOSETCURTYPE   0x00000040
  206. #define VR_VIOSETMODE      0x00000080
  207. #define VR_VIOSHOWBUF      0x00000100
  208. #define VR_VIOREADCHARSTR  0x00000200
  209. #define VR_VIOREADCELLSTR  0x00000400
  210. #define VR_VIOWRTNCHAR     0x00000800
  211. #define VR_VIOWRTNATTR     0x00001000
  212. #define VR_VIOWRTNCELL     0x00002000
  213. #define VR_VIOWRTTTY       0x00004000
  214. #define VR_VIOWRTCHARSTR   0x00008000
  215.  
  216. #define VR_VIOWRTCHARSTRATT  0x00010000
  217. #define VR_VIOWRTCELLSTR     0x00020000
  218. #define VR_VIOSCROLLUP       0x00040000
  219. #define VR_VIOSCROLLDN       0x00080000
  220. #define VR_VIOSCROLLLF       0x00100000
  221. #define VR_VIOSCROLLRT       0x00200000
  222. #define VR_VIOSETANSI        0x00400000
  223. #define VR_VIOGETANSI        0x00800000
  224. #define VR_VIOPRTSC          0x01000000
  225. #define VR_VIOSCRLOCK        0x02000000
  226. #define VR_VIOSCRUNLOCK      0x04000000
  227. #define VR_VIOSAVREDRAWWAIT  0x08000000
  228. #define VR_VIOSAVREDRAWUNDO  0x10000000
  229. #define VR_VIOPOPUP          0x20000000
  230. #define VR_VIOENDPOPUP       0x40000000
  231. #define VR_VIOPRTSCTOGGLE    0x80000000
  232.  
  233. #define VGMT_OTHER         1
  234. #define VGMT_GRAPHICS      2
  235. #define VGMT_DISABLEBURST  4
  236.  
  237. #define VSRWI_SAVEANDREDRAW 0
  238. #define VSRWI_REDRAW        1
  239.  
  240. #define VSRWN_SAVE          0
  241. #define VSRWN_REDRAW        1
  242.  
  243. #define UNDOI_GETOWNER      0
  244. #define UNDOI_RELEASEOWNER  1
  245.  
  246. #define UNDOK_ERRORCODE     0
  247. #define UNDOK_TERMINATE     1
  248.  
  249. #define LOCKIO_NOWAIT 0
  250. #define LOCKIO_WAIT   1
  251.  
  252. #define LOCK_SUCCESS  0
  253. #define LOCK_FAIL     1
  254.  
  255. #define VP_NOWAIT      0
  256. #define VP_WAIT        1
  257. #define VP_OPAQUE      0
  258. #define VP_TRANSPARENT 2
  259.  
  260. typedef SHANDLE    HVIO;
  261. typedef HVIO FAR   *PHVIO;
  262.  
  263. typedef struct _VIOCONFIGINFO {
  264.     USHORT  cb;
  265.     USHORT  adapter;
  266.     USHORT  display;
  267.     ULONG   cbMemory;
  268.     USHORT  Configuration;
  269.     USHORT  VDHVersion;
  270.     USHORT  Flags;
  271.     ULONG   HWBufferSize;
  272.     ULONG   FullSaveSize;
  273.     ULONG   PartSaveSize;
  274.     USHORT  EMAdaptersOFF;
  275.     USHORT  EMDisplaysOFF;
  276. } VIOCONFIGINFO, FAR *PVIOCONFIGINFO;
  277.  
  278. typedef struct _VIOCURSORINFO {
  279.     USHORT   yStart;
  280.     USHORT   cEnd;
  281.     USHORT   cx;
  282.     USHORT   attr;
  283. } VIOCURSORINFO, FAR *PVIOCURSORINFO;
  284.  
  285. typedef struct _VIOFONTINFO {
  286.     USHORT  cb;
  287.     USHORT  type;
  288.     USHORT  cxCell;
  289.     USHORT  cyCell;
  290.     PVOID   pbData;
  291.     USHORT  cbData;
  292. } VIOFONTINFO, FAR *PVIOFONTINFO;
  293.  
  294. typedef struct _VIOMODEINFO {
  295.     USHORT cb;
  296.     UCHAR  fbType;
  297.     UCHAR  color;
  298.     USHORT col;
  299.     USHORT row;
  300.     USHORT hres;
  301.     USHORT vres;
  302.     UCHAR  fmt_ID;
  303.     UCHAR  attrib;
  304.     ULONG  buf_addr;
  305.     ULONG  buf_length;
  306.     ULONG  full_length;
  307.     ULONG  partial_length;
  308.     PCH    ext_data_addr;
  309. } VIOMODEINFO, FAR *PVIOMODEINFO;
  310.  
  311. typedef struct _VIOPHYSBUF {
  312.     PBYTE    pBuf;
  313.     ULONG    cb;
  314.     SEL      asel[1];
  315. } VIOPHYSBUF, FAR *PVIOPHYSBUF;
  316.  
  317. typedef struct _VIOPALSTATE {
  318.     USHORT  cb;
  319.     USHORT  type;
  320.     USHORT  iFirst;
  321.     USHORT  acolor[1];
  322. } VIOPALSTATE, FAR *PVIOPALSTATE;
  323.  
  324. typedef struct _VIOOVERSCAN {
  325.     USHORT  cb;
  326.     USHORT  type;
  327.     USHORT  color;
  328. } VIOOVERSCAN, FAR *PVIOOVERSCAN;
  329.  
  330. typedef struct _VIOINTENSITY {
  331.     USHORT  cb;
  332.     USHORT  type;
  333.     USHORT  fs;
  334. } VIOINTENSITY, FAR *PVIOINTENSITY;
  335.  
  336. typedef struct _VIOCOLORREG {
  337.     USHORT  cb;
  338.     USHORT  type;
  339.     USHORT  firstcolorreg;
  340.     USHORT  numcolorregs;
  341.     PCH     colorregaddr;
  342. } VIOCOLORREG, FAR *PVIOCOLORREG;
  343.  
  344. typedef struct _VIOSETULINELOC {
  345.     USHORT  cb;
  346.     USHORT  type;
  347.     USHORT  scanline;
  348. } VIOSETULINELOC, FAR *PVIOSETULINELOC;
  349.  
  350. typedef struct _VIOSETTARGET {
  351.     USHORT  cb;
  352.     USHORT  type;
  353.     USHORT  defaultalgorithm;
  354. } VIOSETTARGET, FAR *PVIOSETTARGET;
  355.  
  356. USHORT APIENTRY VioDeRegister(VOID);
  357. USHORT APIENTRY VioEndPopUp(HVIO VioHandle);
  358. USHORT APIENTRY VioGetAnsi(PUSHORT Indicator, HVIO VioHandle);
  359. USHORT APIENTRY VioGetBuf(PULONG LVBPtr, PUSHORT Length, HVIO VioHandle);
  360. USHORT APIENTRY VioGetConfig(USHORT ConfigID, PVIOCONFIGINFO ConfigData, HVIO VioHandle);
  361. USHORT APIENTRY VioGetCp(USHORT Reserved, PUSHORT CodePageID, HVIO VioHandle);
  362. USHORT APIENTRY VioGetCurPos(PUSHORT Row, PUSHORT Column, HVIO VioHandle);
  363. USHORT APIENTRY VioGetCurType(PVIOCURSORINFO CursorData, HVIO VioHandle);
  364. USHORT APIENTRY VioGetMode(PVIOMODEINFO ModeData, HVIO VioHandle);
  365. USHORT APIENTRY VioGetPhysBuf(PVIOPHYSBUF Structure, USHORT Reserved);
  366. USHORT APIENTRY VioGetState(PVOID RequestBlock, HVIO VioHandle);
  367. USHORT APIENTRY VioGlobalReg(PSZ ModuleName, PSZ EntryPoint, ULONG FunctionMask1,
  368.                        ULONG FunctionMask2, LONG Reserved);
  369. USHORT APIENTRY VioModeUndo(USHORT OwnerIndic, USHORT KillIndic, USHORT Reserved);
  370. USHORT APIENTRY VioModeWait(USHORT RequestType, PUSHORT NotifyType, USHORT Reserved);
  371. USHORT APIENTRY VioPopUp(PUSHORT Options, HVIO VioHandle);
  372. USHORT APIENTRY VioPrtSc(HVIO VioHandle);
  373. USHORT APIENTRY VioPrtScToggle(HVIO VioHandle);
  374. USHORT APIENTRY VioReadCellStr(PCH CellStr, PUSHORT Length, USHORT Row,
  375.                        USHORT Column, HVIO VioHandle);
  376. USHORT APIENTRY VioReadCharStr(PCH CharStr, PUSHORT Length, USHORT Row,
  377.                        USHORT Column, HVIO VioHandle);
  378. USHORT APIENTRY VioRegister(PSZ ModuleName, PSZ EntryPoint, ULONG FunctionMask1,
  379.                        ULONG FunctionMask2);
  380. USHORT APIENTRY VioSavRedrawUndo(USHORT OwnerIndic, USHORT KillIndic, HVIO VioHandle);
  381. USHORT APIENTRY VioSavRedrawWait(USHORT SavRedrawIndic, PUSHORT NotifyType, HVIO VioHandle);
  382. USHORT APIENTRY VioScrLock(USHORT WaitFlag, PUCHAR Status, HVIO VioHandle);
  383. USHORT APIENTRY VioScrollDn(USHORT TopRow, USHORT LeftCol, USHORT BotRow, USHORT RightCol,
  384.                        USHORT Lines, PBYTE Cell, HVIO VioHandle);
  385. USHORT APIENTRY VioScrollLf(USHORT TopRow, USHORT LeftCol, USHORT BotRow, USHORT RightCol,
  386.                        USHORT Lines, PBYTE Cell, HVIO VioHandle);
  387. USHORT APIENTRY VioScrollRt(USHORT TopRow, USHORT LeftCol, USHORT BotRow, USHORT RightCol,
  388.                        USHORT Lines, PBYTE Cell, HVIO VioHandle);
  389. USHORT APIENTRY VioScrollUp(USHORT TopRow, USHORT LeftCol, USHORT BotRow, USHORT RightCol,
  390.                        USHORT Lines, PBYTE Cell, HVIO VioHandle);
  391. USHORT APIENTRY VioScrUnLock(HVIO VioHandle);
  392. USHORT APIENTRY VioSetAnsi(USHORT Indicator, HVIO VioHandle);
  393. USHORT APIENTRY VioSetCp(USHORT Reserved, USHORT CodePageID, HVIO VioHandle);
  394. USHORT APIENTRY VioSetCurPos(USHORT Row, USHORT Column, HVIO VioHandle);
  395. USHORT APIENTRY VioSetCurType(PVIOCURSORINFO CursorData, HVIO VioHandle);
  396. USHORT APIENTRY VioSetFont(PVIOFONTINFO RequestBlock, HVIO VioHandle);
  397. USHORT APIENTRY VioSetMode(PVIOMODEINFO ModeData, HVIO VioHandle);
  398. USHORT APIENTRY VioSetState(PVOID RequestBlock, HVIO VioHandle);
  399. USHORT APIENTRY VioShowBuf(USHORT Offset, USHORT Length, HVIO VioHandle);
  400. USHORT APIENTRY VioWrtCellStr(PCH CellStr, USHORT Length, USHORT Row, USHORT Column,
  401.                        HVIO VioHandle);
  402. USHORT APIENTRY VioWrtCharStr(PCH CharStr, USHORT Length, USHORT Row, USHORT Column,
  403.                        HVIO VioHandle);
  404. USHORT APIENTRY VioWrtCharStrAtt(PCH CharStr, USHORT Length, USHORT Row, USHORT Column,
  405.                        PBYTE Attr, HVIO VioHandle);
  406. USHORT APIENTRY VioWrtNAttr(PBYTE Attr, USHORT Times, USHORT Row, USHORT Column, HVIO VioHandle);
  407. USHORT APIENTRY VioWrtNCell(PBYTE Cell, USHORT Times, USHORT Row, USHORT Column, HVIO VioHandle);
  408. USHORT APIENTRY VioWrtNChar(PBYTE Cell, USHORT Times, USHORT Row, USHORT Column, HVIO VioHandle);
  409. USHORT APIENTRY VioWrtTTY(PCH CharStr, USHORT Length, HVIO VioHandle);
  410.  
  411. #endif
  412.