home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95source / ckocon.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  26KB  |  764 lines

  1. /*  File CKOCON.H  --  OS/2 C-Kermit keyboard verb definitions & tables.  */
  2.  
  3. /*
  4.   Author: Frank da Cruz (fdc@columbia.edu, FDCCU@CUVMA.BITNET),
  5.             The Kermit Project, Columbia University, New York City
  6.           Jeffrey E Altman (jaltman@secure-endpoints.com),
  7.             Secure Endpoints Inc., New York City.
  8.  
  9.   Copyright (C) 1993, 2004, Trustees of Columbia University in the City of New
  10.   York.
  11. */
  12. #ifndef CKOCON_H
  13. #define CKOCON_H
  14.  
  15. /*
  16.  * ============================ features =====================================
  17.  */
  18.  
  19. /*
  20.  * =============================#defines======================================
  21.  */
  22.  
  23. /* Symbols for characters used in Compose sequences */
  24.  
  25. #define C_BREVE  (CHAR)'%'              /* Breve accent */
  26. #define C_CARON  (CHAR)'&'              /* Caron (hacek) */
  27. #define C_OGONEK (CHAR)'='              /* Ogonek */
  28. #define C_ACUTE  (CHAR)0x27             /* Acute accent */
  29. #define C_DACUTE (CHAR)'#'              /* Double acute accent */
  30. #define C_RING   (CHAR)'*'              /* Ring above */
  31. #define C_DOT    (CHAR)'.'              /* Dot above */
  32. #define C_CEDILLA (CHAR)','             /* Cedilla */
  33.  
  34. #ifdef NT
  35. #ifndef APIRET
  36. #define APIRET DWORD
  37. #endif /* APIRET */
  38. #ifndef SEM_INDEFINITE_WAIT
  39. #define SEM_INDEFINITE_WAIT INFINITE
  40. #endif /* SEM_INDEFINITE_WAIT */
  41. #ifndef DCWW_WAIT
  42. #define DCWW_WAIT -1
  43. #endif /* DCWW_WAIT */
  44. #ifndef ERROR_VIO_ROW
  45. #define ERROR_VIO_ROW 1
  46. #endif
  47. #ifndef ERROR_VIO_COL
  48. #define ERROR_VIO_COL 2
  49. #endif
  50. #ifndef CCHMAXPATH
  51. #define CCHMAXPATH _MAX_PATH
  52. #endif
  53. #ifndef TID
  54. #define TID HANDLE
  55. #endif
  56. #ifndef PIB
  57. #define PIB HANDLE
  58. #define PPIB HANDLE*
  59. #endif
  60. #ifndef TIB
  61. #define TIB HANDLE
  62. #define PTIB HANDLE*
  63. #endif
  64. #ifndef HVIO
  65. #define HVIO HANDLE
  66. #endif
  67. #ifndef HMTX
  68. #define HMTX HANDLE
  69. #endif
  70. #ifndef HAB
  71. #define HAB HANDLE
  72. #endif
  73. #ifndef HKBD
  74. #define HKBD HANDLE
  75. #endif
  76. #ifndef HDIR
  77. #define HDIR HANDLE
  78. #endif
  79. #endif /* NT */
  80.  
  81. #ifndef min
  82. #define min(a,b) ((a) <= (b) ? (a) : (b))
  83. #endif /* min */
  84.  
  85. #ifdef NT
  86. #define MAXSCRNCOL  256            /* Maximum screen columns */
  87. #define MAXSCRNROW  128            /* Maximum screen rows    */
  88. #define MAXTERMSIZE (MAXSCRNCOL*MAXSCRNROW)
  89. #else /* NT */
  90. /* OS/2 WARP allows for screen widths up to 255 characters.
  91.    WARP says the max number of
  92.    characters on the screen can be 8192.  8192 / 132 = 62.06 so
  93.    we allow a maximum of 62 rows on the screen.
  94.  
  95.    The 8192 limit is enforced by the command parser.
  96. */
  97. #define MAXSCRNCOL 162            /* Maximum screen columns - upto 255 */
  98. #define MAXSCRNROW 102            /* Maximum screen rows  - upto 102   */
  99. #define MAXTERMSIZE 8192
  100. #endif /* NT */
  101. #define MAXTERMCOL MAXSCRNCOL
  102. #define MAXTERMROW (MAXSCRNROW-1)
  103.  
  104.  
  105. #ifdef TRUE
  106. #undef TRUE
  107. #endif /* TRUE */
  108. #define TRUE 1
  109.  
  110. #ifdef FALSE
  111. #undef FALSE
  112. #endif /* FALSE */
  113. #define FALSE 0
  114.  
  115. #define UPWARD   6                      /* Scroll up */
  116. #define DOWNWARD 7                      /* Scroll down */
  117. #define LBUFSIZE roll.bufsize           /* Maximum lines in rollback buffer */
  118.  
  119. /*
  120.   The video adapter stores each screen character in a two-byte cell.  The
  121.   first byte of each cell contains the 8-bit character value.  The second byte
  122.   contains the video attributes for the character, and looks like this:
  123.  
  124.          Background      Foreground
  125.          Color           Color
  126.     +---+---+---+---+---+---+---+---+
  127.     | b | R | G | B | i | R | G | B |
  128.     +---+---+---+---+---+---+---+---+
  129.       b = blink       i = intensity
  130.       0 = nonblinking 0 = normal
  131.       1 = blinking    1 = high
  132.  
  133.   The i bit applies to the foreground color.  The meaning of the b bit depends
  134.   on the VIO state; it can mean (a) the foreground character blinks, or (b) the
  135.   background color is high-intensity.  C-Kermit uses (b) because blinking only
  136.   works in a fullscreen session.  See the call to VioSetState().  The RGB
  137.   bits select the desired mixture of Red, Green, and Blue.
  138.  
  139.   The swapcolors macro exchanges the fore- and background colors (the RGB
  140.   bits) but leaves the intensity/blink bits where there are.  Thus if the
  141.   foreground color is bold and the background color is not bold, the same
  142.   will be true after swapcolors().
  143. */
  144. #define swapcolors(x) (((x)&(unsigned)0x88)|(((x)&0x70)>>4)|(((x)&0x07)<<4))
  145. #define byteswapcolors(x) ((((x)&0x70)>>4)|(((x)&0x07)<<4)|((x)&(unsigned char)0x88))
  146.  
  147. /*
  148.  *
  149.  * =============================typedefs======================================
  150.  */
  151. #ifndef __cplusplus
  152. typedef int bool;
  153. #endif
  154.  
  155. #ifndef KUI
  156. #ifdef OS2ONLY
  157. typedef struct _CK_VIDEOMODEINFO {
  158.       UCHAR  fbType;
  159.       UCHAR  color;
  160.       USHORT col;
  161.       USHORT row;
  162.       USHORT hres;
  163.       USHORT vres;
  164.       USHORT wcol;
  165.       USHORT wrow;
  166. } CK_VIDEOMODEINFO, *PCK_VIDEOMODEINFO ;
  167. #else /* OS2ONLY */
  168. typedef struct _CK_VIDEOMODEINFO {
  169.       UCHAR  color;
  170.       USHORT col;
  171.       USHORT row;
  172.       USHORT sbcol;
  173.       USHORT sbrow;
  174. } CK_VIDEOMODEINFO, *PCK_VIDEOMODEINFO ;
  175. #endif /* OS2ONLY */
  176. #endif /* KUI */
  177.  
  178. typedef struct _CK_CURSORINFO {
  179.       USHORT   yStart;             /* top (negative is percentage) */
  180.       USHORT   cEnd;               /* bottom (negative is percentage) */
  181.       USHORT   cx;                 /* width */
  182.       USHORT   attr;               /* -1 means hidden */
  183. } CK_CURSORINFO, *PCK_CURSORINFO ;
  184.  
  185. typedef struct ascreen_rec {    /* Structure for saving screen info */
  186. #ifndef KUI
  187.     CK_VIDEOMODEINFO    mi;
  188. #endif /* KUI */
  189.     unsigned char       ox;
  190.     unsigned char       oy;
  191.     unsigned char       att;
  192.     struct cell_struct  *scrncpy;
  193. } ascreen;
  194.  
  195. /*
  196.   Note, the following are related to the VT terminal screen, not the PC video
  197.   adapter.  That is, 'attribute' (above) is the PC video attribute byte,
  198.   'attrib' (below) is the VT terminal attribute structure.  etc.
  199. */
  200. typedef struct _vtattrib {      /* Character (SGR) attributes, 1 bit each */
  201.     unsigned reversed:1;        /* Reverse video */
  202.     unsigned blinking:1;        /* Blinking */
  203.     unsigned underlined:1;      /* Underlined (simulated) */
  204.     unsigned bold:1;            /* Bold (high intensity) */
  205.     unsigned invisible:1;       /* Invisible */
  206.     unsigned unerasable:1;      /* Uneraseable by DECSCA */
  207.     unsigned graphic:1;         /* Graphic character */
  208.     unsigned dim:1;             /* Dim */
  209.     unsigned wyseattr:1;        /* Wyse Attribute */
  210.     unsigned italic:1;          /* Italic */
  211.     unsigned hyperlink:1;       /* Hyperlink */
  212.     unsigned short linkid;      /* Hyperlink Index */
  213. } vtattrib ;
  214.  
  215. /*
  216.  *
  217.  *  Virtual buffer stuff
  218.  *
  219.  */
  220. #define VT_CHAR_ATTR_NORMAL           ((USHORT) 0x0000)
  221. #define VT_CHAR_ATTR_BOLD             ((USHORT) 0x0001)
  222. #define VT_CHAR_ATTR_UNDERLINE        ((USHORT) 0x0002)
  223. #define VT_CHAR_ATTR_BLINK            ((USHORT) 0x0004)
  224. #define VT_CHAR_ATTR_REVERSE          ((USHORT) 0x0008)
  225. #define VT_CHAR_ATTR_INVISIBLE        ((USHORT) 0x0010)
  226. #define VT_CHAR_ATTR_PROTECTED        ((USHORT) 0x0020)
  227. #define VT_CHAR_ATTR_GRAPHIC          ((USHORT) 0x0040)
  228. #define VT_CHAR_ATTR_DIM              ((USHORT) 0x0080)
  229. #define WY_CHAR_ATTR                  ((USHORT) 0x0100)
  230. #define KUI_CHAR_ATTR_UPPER_HALF      ((USHORT) 0x0200)
  231. #define KUI_CHAR_ATTR_LOWER_HALF      ((USHORT) 0x0400)
  232. #define VT_CHAR_ATTR_ITALIC           ((USHORT) 0x0800)
  233. #define VT_CHAR_ATTR_HYPERLINK        ((USHORT) 0x1000)
  234.  
  235. #define VT_LINE_ATTR_NORMAL           ((USHORT) 0x00)
  236. #define VT_LINE_ATTR_DOUBLE_WIDE      ((USHORT) 0x01)
  237. #define VT_LINE_ATTR_DOUBLE_HIGH      ((USHORT) 0x02)
  238. #define VT_LINE_ATTR_UPPER_HALF       ((USHORT) 0x04)
  239. #define VT_LINE_ATTR_LOWER_HALF       ((USHORT) 0x00)
  240.  
  241. #define WY_LINE_ATTR_BG_NORMAL        ((USHORT) 0x00)
  242. #define WY_LINE_ATTR_BG_BOLD          ((USHORT) 0x10)
  243. #define WY_LINE_ATTR_BG_INVISIBLE     ((USHORT) 0x20)
  244. #define WY_LINE_ATTR_BG_DIM           ((USHORT) 0x40)
  245.  
  246. #define WY_LINE_ATTR_PROTECTED        ((USHORT) 0x08)
  247.  
  248. typedef struct cell_struct {          /* to be used with VioWrtNCell() */
  249. #ifdef NT
  250.     unsigned short c ;                /* unicode character */
  251. #else /* CKOUNI_OUT */
  252.     unsigned char c ;                 /* character */
  253. #endif /* CKOUNI_OUT */
  254.     unsigned char a ;                 /* attribute */
  255. } viocell ;
  256.  
  257. typedef struct videoline_struct {
  258.     unsigned short      width ;           /* number of valid chars */
  259.     viocell *           cells ;           /* valid to length width */
  260.     unsigned short *    vt_char_attrs ;   /* bitwise & of VT_CHAR_ATTR Values */
  261.     unsigned short *    hyperlinks;       /* hyperlink index values */
  262.     unsigned short      vt_line_attr ;
  263.     short               markbeg ;
  264.     short               markshowend ;
  265.     short               markend ;
  266.     } videoline ;
  267.  
  268. typedef struct pos_struct {
  269.     unsigned short x, y ;
  270.     } position ;
  271.  
  272. typedef struct popup_struct {
  273.     unsigned short height,
  274.                    width ;                     /* before centering */
  275.     unsigned char  a ;                         /* attribute */
  276.     unsigned char  c[MAXTERMROW][MAXTERMCOL] ; /* character */
  277.     unsigned char  gui;                        /* gui? */
  278.     } videopopup ;
  279.  
  280. typedef struct videobuffer_struct {
  281.     unsigned long linecount ;
  282.     videoline *   lines ;      /* of count linecount */
  283.     unsigned long beg,         /* beginning of scrollable region */
  284.                   top,         /* first line of write to terminal screen */
  285.                   scrolltop,   /* top of scroll screen */
  286.                   end ;        /* end of scrollable region */
  287.     position      cursor ;     /* cursor position */
  288.     videopopup *  popup ;      /* popup menu      */
  289.     long          marktop,     /* first line marked */
  290.                   markbot ;    /* last line marked  */
  291.     int           width,       /* width of virtual screen */
  292.                   height ;     /* height of virtual screen */
  293.     int           bookmark[10];/* bookmarks */
  294.     int           hscroll ;    /* column to display from */
  295.     int           display_height;
  296.    } videobuffer ;
  297.  
  298. /* Video Buffer IDs */
  299. #define VCMD    0   /* command mode */
  300. #define VTERM   1   /* terminal mode */
  301. #define VCS     2   /* client-server mode */
  302. #define VSTATUS 3   /* Terminal Mode Status Line */
  303. #define VNUM    4   /* number of video modes */
  304.  
  305. /* Escape-sequence parser state definitions. */
  306. /* For explanation, see ckucon.c, where this code is copied from. */
  307.  
  308. #define ES_NORMAL   0                   /* Normal, not in escape sequence */
  309. #define ES_GOTESC   1                   /* Current character is ESC */
  310. #define ES_ESCSEQ   2                   /* Inside an escape sequence */
  311. #define ES_GOTCSI   3                   /* Inside a control sequence */
  312. #define ES_STRING   4                   /* Inside DCS,OSC,PM, or APC string */
  313. #define ES_TERMIN   5                   /* 1st char of string terminator */
  314. #define ES_GOTTILDE 6                   /* Beginning of HZ sequence */
  315. #define ES_TILDESEQ 7
  316.  
  317. #define ESCBUFLEN 128
  318.  
  319. /* DECSASD settings */
  320. #define SASD_TERMINAL 0
  321. #define SASD_STATUS   1
  322.  
  323. /* DECSSDT settings */
  324. #define  SSDT_BLANK 0
  325. #define  SSDT_INDICATOR 1
  326. #define  SSDT_HOST_WRITABLE 2
  327.  
  328. _PROTOTYP( void setdecssdt, (int));
  329. _PROTOTYP( void setdecsasd, (bool));
  330.  
  331. enum charsetsize { cs94, cs96, cs128, csmb } ;
  332. struct _vtG {
  333.     unsigned char designation, def_designation ;
  334.     enum charsetsize size, def_size ;
  335.     bool national ;
  336.     bool c1, def_c1 ;
  337. #ifndef CKOUNI
  338.     CHAR (*rtoi)(CHAR) ;
  339.     CHAR (*itol)(CHAR) ;
  340.     CHAR (*ltoi)(CHAR) ;
  341.     CHAR (*itor)(CHAR) ;
  342. #else /* CKOUNI */
  343.     USHORT (*rtoi)(CHAR) ;
  344.     int    (*itol)(USHORT) ;
  345.     USHORT (*ltoi)(CHAR) ;
  346.     int    (*itor)(USHORT) ;
  347. #endif /* CKOUNI */
  348.     BOOL init ;
  349.     };
  350.  
  351. enum markmodes { notmarking, inmarkmode, marking } ;
  352. enum helpscreen { hlp_normal, hlp_rollback, hlp_markmode, hlp_compose,
  353.     hlp_escape, hlp_mouse, hlp_bookmark, hlp_search, hlp_ucs2 } ;
  354.  
  355. /*
  356.  *
  357.  * =============================prototypes====================================
  358.  */
  359.  
  360. _PROTOTYP( void rdcomwrtscr, (void *) ) ;
  361. _PROTOTYP( int  scriptwrtbuf, (unsigned short) ) ;
  362. _PROTOTYP( void savescreen, (ascreen *,int,int) ) ;
  363. _PROTOTYP( int restorescreen, (ascreen *) ) ;
  364. _PROTOTYP( void reverserange, (SHORT, SHORT, SHORT, SHORT) ) ;
  365. _PROTOTYP( USHORT ReadCellStr, ( viocell *, PUSHORT, USHORT, USHORT ) );
  366. _PROTOTYP( USHORT WrtCellStr, ( viocell *, USHORT, USHORT, USHORT ) );
  367. _PROTOTYP( USHORT ReadCharStr, ( viocell *, PUSHORT, USHORT, USHORT ) );
  368. _PROTOTYP( USHORT WrtCharStrAtt, ( PCH, USHORT, USHORT, USHORT, PBYTE ) );
  369. _PROTOTYP( USHORT WrtNCell, ( viocell, USHORT, USHORT, USHORT ) );
  370. #ifndef KUI
  371. _PROTOTYP( USHORT GetMode, ( PCK_VIDEOMODEINFO ) );
  372. _PROTOTYP( USHORT SetMode, ( PCK_VIDEOMODEINFO ) );
  373. #endif /* KUI */
  374. _PROTOTYP( USHORT GetCurType, ( PCK_CURSORINFO ) );
  375. _PROTOTYP( USHORT SetCurType, ( PCK_CURSORINFO ) );
  376. _PROTOTYP( USHORT GetCurPos, ( PUSHORT, PUSHORT ) );
  377. _PROTOTYP( USHORT SetCurPos, ( USHORT, USHORT ) );
  378. _PROTOTYP( USHORT ShowBuf, ( USHORT, USHORT ) );
  379. _PROTOTYP( USHORT Set132Cols, ( int ) );
  380. _PROTOTYP( USHORT Set80Cols, ( int ) );
  381. _PROTOTYP( USHORT SetCols, ( int ) );
  382. _PROTOTYP( APIRET VscrnInit, ( BYTE ) ) ;
  383. _PROTOTYP( USHORT VscrnScrollLf, ( BYTE, USHORT, USHORT, USHORT, USHORT, USHORT, viocell ) );
  384. _PROTOTYP( USHORT VscrnScrollRt, ( BYTE, USHORT, USHORT, USHORT, USHORT, USHORT, viocell ) );
  385. _PROTOTYP( USHORT VscrnScrollUp, ( BYTE, USHORT, USHORT, USHORT, USHORT, USHORT, viocell ) );
  386. _PROTOTYP( USHORT VscrnScrollDn, ( BYTE, USHORT, USHORT, USHORT, USHORT, USHORT, viocell ) );
  387. _PROTOTYP( USHORT VscrnWrtCell, ( BYTE, viocell, vtattrib, USHORT, USHORT ) );
  388. _PROTOTYP( USHORT VscrnWrtCharStrAtt, ( BYTE vmode, PCH CharStr, USHORT Length,
  389.                          USHORT Row, USHORT Column, PBYTE Attr ) ) ;
  390. _PROTOTYP( USHORT VscrnWrtUCS2StrAtt, ( BYTE vmode, PUSHORT UCS2Str, USHORT Length,
  391.                                         USHORT Row, USHORT Column, PBYTE Attr ) ) ;
  392. _PROTOTYP( void   TermScrnUpd, ( void * ) ) ;
  393.  
  394. _PROTOTYP( videoline * VscrnGetLineFromTop, ( BYTE, SHORT ) ) ;
  395. _PROTOTYP( videoline * VscrnGetLine, ( BYTE, SHORT ) ) ;
  396. _PROTOTYP( USHORT VscrnGetLineVtAttr, ( BYTE, SHORT ) ) ;
  397. _PROTOTYP( USHORT VscrnSetLineVtAttr, ( BYTE, SHORT, USHORT ) ) ;
  398. _PROTOTYP( vtattrib VscrnGetVtCharAttr, ( BYTE, SHORT, SHORT ) ) ;
  399. _PROTOTYP( USHORT VscrnSetVtCharAttr, ( BYTE, SHORT, SHORT, vtattrib ) ) ;
  400. _PROTOTYP( viocell * VscrnGetCells, ( BYTE, SHORT ) ) ;
  401. _PROTOTYP( viocell * VscrnGetCell, ( BYTE, SHORT, SHORT ) ) ;
  402. _PROTOTYP( LONG VscrnMoveTop, ( BYTE, LONG ) ) ;
  403. _PROTOTYP( LONG VscrnMoveScrollTop, ( BYTE, LONG ) ) ;
  404. _PROTOTYP( LONG VscrnMoveBegin, ( BYTE, LONG ) ) ;
  405. _PROTOTYP( LONG VscrnMoveEnd, ( BYTE, LONG ) ) ;
  406. _PROTOTYP( UCHAR VscrnGetLineWidth, ( BYTE, SHORT ) ) ;
  407. _PROTOTYP( ULONG VscrnGetTop, ( BYTE ) ) ;
  408. _PROTOTYP( ULONG VscrnGetScrollTop, ( BYTE ) ) ;
  409. _PROTOTYP( ULONG VscrnGetScrollHorz, ( BYTE ) ) ;
  410. _PROTOTYP( ULONG VscrnGetBegin, ( BYTE ) ) ;
  411. _PROTOTYP( ULONG VscrnGetEnd, ( BYTE ) ) ;
  412. _PROTOTYP( LONG VscrnSetTop, ( BYTE, LONG ) ) ;
  413. _PROTOTYP( LONG VscrnSetScrollTop, ( BYTE, LONG ) ) ;
  414. _PROTOTYP( LONG VscrnSetScrollHorz, ( BYTE, LONG ) ) ;
  415. _PROTOTYP( LONG VscrnSetBegin, ( BYTE, LONG ) ) ;
  416. _PROTOTYP( LONG VscrnSetEnd, ( BYTE, LONG ) ) ;
  417. _PROTOTYP( ULONG VscrnGetBufferSize, ( BYTE ) ) ;
  418. _PROTOTYP( ULONG VscrnSetBufferSize, ( BYTE, ULONG ) ) ;
  419. _PROTOTYP( VOID VscrnSetWidth, ( BYTE, int ) ) ;
  420. _PROTOTYP( VOID VscrnSetHeight, ( BYTE, int ) ) ;
  421. _PROTOTYP( VOID VscrnSetDisplayHeight, ( BYTE, int ) ) ;
  422. _PROTOTYP( int VscrnGetWidth, ( BYTE ) ) ;
  423. _PROTOTYP( int VscrnGetHeight, ( BYTE ) ) ;
  424. _PROTOTYP( int VscrnGetDisplayHeight, ( BYTE ) ) ;
  425. _PROTOTYP( position * VscrnSetCurPos, ( BYTE, SHORT, SHORT ) ) ;
  426. _PROTOTYP( position * VscrnGetCurPos, ( BYTE ) ) ;
  427. _PROTOTYP( VOID VscrnSetBookmark, ( BYTE, int, int ) ) ;
  428. _PROTOTYP( int VscrnGetBookmark, ( BYTE, int ) ) ;
  429.  
  430.  
  431. _PROTOTYP( bool IsWARPed, ( void ) ) ;
  432. _PROTOTYP( APIRET VscrnIsDirty, ( int ) ) ;
  433. _PROTOTYP( void VscrnScroll, (BYTE, int, int, int, int,int, CHAR) ) ;
  434. _PROTOTYP( BOOL IsOS2FullScreen, (void) ) ;
  435. _PROTOTYP( void SmoothScroll, (void) ) ;
  436. _PROTOTYP( void JumpScroll, (void ) ) ;
  437.  
  438.  
  439. _PROTOTYP( APIRET VscrnSelect, ( BYTE, int ) ) ;
  440. _PROTOTYP( APIRET VscrnURL, ( BYTE, USHORT, USHORT       ) ) ;
  441. _PROTOTYP( APIRET CopyVscrnToKbdBuffer, ( BYTE, int ) ) ;
  442. _PROTOTYP( APIRET CopyVscrnToClipboard, ( BYTE, int ) ) ;
  443. _PROTOTYP( APIRET CopyVscrnToPrinter, ( BYTE, int ) ) ;
  444. _PROTOTYP( APIRET CopyClipboardToKbdBuffer, ( BYTE ) ) ;
  445. _PROTOTYP( BOOL   VscrnIsLineMarked, ( BYTE, LONG ) ) ;
  446. _PROTOTYP( BOOL   VscrnIsMarked, ( BYTE, LONG, SHORT ) ) ;
  447. _PROTOTYP( BOOL   VscrnIsClear, ( BYTE ) ) ;
  448. _PROTOTYP( void   VscrnSetPopup, ( BYTE, videopopup * ) ) ;
  449. _PROTOTYP( void   VscrnResetPopup, ( BYTE ) ) ;
  450. _PROTOTYP( bool   VscrnIsPopup, ( BYTE) ) ;
  451. _PROTOTYP( void   VscrnMark, ( BYTE, LONG, SHORT, SHORT ) ) ;
  452. _PROTOTYP( void   VscrnUnmark, ( BYTE, LONG, SHORT, SHORT ) ) ;
  453. _PROTOTYP( void   VscrnUnmarkAll, ( BYTE ) ) ;
  454. _PROTOTYP( void   shovscrn, ( void ) ) ;
  455. _PROTOTYP( void   markdownone, ( BYTE ) ) ;
  456. _PROTOTYP( void   markupone, ( BYTE ) ) ;
  457. _PROTOTYP( void   markstart, ( BYTE ) ) ;
  458. _PROTOTYP( void   markcancel, ( BYTE ) ) ;
  459. _PROTOTYP( void   markleftone, ( BYTE ) ) ;
  460. _PROTOTYP( void   markrightone, ( BYTE ) ) ;
  461. _PROTOTYP( void   markdownscreen, ( BYTE ) ) ;
  462. _PROTOTYP( void   markupscreen, ( BYTE ) ) ;
  463. _PROTOTYP( void   markleftpage, ( BYTE ) ) ;
  464. _PROTOTYP( void   markrightpage, ( BYTE ) ) ;
  465. _PROTOTYP( void   markhomescreen, ( BYTE ) ) ;
  466. _PROTOTYP( void   markendscreen, ( BYTE ) ) ;
  467.  
  468. _PROTOTYP( void   markcopyclip, ( BYTE, int ) ) ;
  469. _PROTOTYP( void   markselect, ( BYTE, int ) ) ;
  470. _PROTOTYP( void   markcopyhost, ( BYTE, int ) ) ;
  471. _PROTOTYP( void   markprint, ( BYTE, int ) ) ;
  472.  
  473. _PROTOTYP( USHORT getshiftstate, ( void ) ) ;
  474.  
  475. _PROTOTYP(int popuphelp, (int,enum helpscreen));/* Pop-up help panel maker */
  476. _PROTOTYP(int popuperror, (int,char *));        /* Pop-up error message */
  477. _PROTOTYP(int fkeypopup, (int));                /* Pop-up fkey labels */
  478. _PROTOTYP(void ipadl25, (void));                /* Default status-line maker */
  479. _PROTOTYP(char * line25, (int));                /* General-purpose status-line maker */
  480. _PROTOTYP(void xline25, (char *));
  481. _PROTOTYP(void save_status_line, (void));
  482. _PROTOTYP(void restore_status_line, (void));
  483. _PROTOTYP(void setenglishmode, (void));
  484. _PROTOTYP(void setrussianmode, (void));
  485. _PROTOTYP(void RestoreTermMode, (void));
  486. _PROTOTYP(void RestoreCmdMode, (void));
  487. _PROTOTYP(int sendchar, (unsigned char));
  488. _PROTOTYP(int sendchars, (unsigned char *, int));
  489. _PROTOTYP(void sendcharduplex, (unsigned char, int));
  490. _PROTOTYP(void sendcharsduplex, (unsigned char *, int, int));
  491. _PROTOTYP(void sendkeydef, (unsigned char *, int));
  492. _PROTOTYP(void checkscreenmode, (void));
  493. _PROTOTYP(void clearcmdscreen, (void));
  494. _PROTOTYP(void cleartermscreen, (BYTE));
  495. _PROTOTYP(void clearscrollback, (BYTE) ) ;
  496. _PROTOTYP( unsigned char geterasecolor, (int));
  497. _PROTOTYP(void clrtoeoln, (BYTE,CHAR));
  498. _PROTOTYP(void clrbol_escape, (BYTE,CHAR));
  499. _PROTOTYP(void clrbos_escape, (BYTE,CHAR));
  500. _PROTOTYP(void clreoscr_escape, (BYTE,CHAR));
  501. _PROTOTYP(void clrline_escape, (BYTE,CHAR));
  502. _PROTOTYP(void clrcol_escape, (BYTE,CHAR));
  503. _PROTOTYP(void clrrect_escape, (BYTE, int, int, int, int, CHAR)) ;
  504. _PROTOTYP(void selclrtoeoln, (BYTE,CHAR));
  505. _PROTOTYP(void selclrbol_escape, (BYTE,CHAR));
  506. _PROTOTYP(void selclrbos_escape, (BYTE,CHAR));
  507. _PROTOTYP(void selclreoscr_escape, (BYTE,CHAR));
  508. _PROTOTYP(void selclrline_escape, (BYTE,CHAR));
  509. _PROTOTYP(void selclrcol_escape, (BYTE,CHAR));
  510. _PROTOTYP(void selclrrect_escape, (BYTE, int, int, int, int, CHAR)) ;
  511. _PROTOTYP(void cursorleft, (int));
  512. _PROTOTYP(void cursorright, (int));
  513. _PROTOTYP(void cursorup, (int));
  514. _PROTOTYP(void cursordown, (int));
  515. _PROTOTYP(void boxrect_escape, (BYTE, int, int)) ;
  516. _PROTOTYP(void esc25, (int));
  517. _PROTOTYP(void flipscreen, (BYTE));
  518. _PROTOTYP(void killcursor, (BYTE));
  519. _PROTOTYP(void lgotoxy, (BYTE, int, int));
  520. _PROTOTYP(void markmode, ( BYTE, int ) );
  521. _PROTOTYP(void movetoscreen, (char *, int, int, int));
  522. _PROTOTYP(void newcursor, (BYTE));
  523. _PROTOTYP(void printeron, (void));
  524. _PROTOTYP(int  printeropen, (void));
  525. _PROTOTYP(int  printerclose, (void));
  526. _PROTOTYP(void printeroff, (void));
  527. _PROTOTYP(int  is_aprint,(void));
  528. _PROTOTYP(int  is_xprint,(void));
  529. _PROTOTYP(int  is_cprint,(void));
  530. _PROTOTYP(int  is_uprint,(void));
  531. _PROTOTYP(void prtchar, (BYTE));
  532. _PROTOTYP(void prtstr, (char *,int));
  533. _PROTOTYP(void prtscreen, (BYTE,int, int));
  534. #ifdef BPRINT
  535.     _PROTOTYP(int bprtstart, ( void ));
  536.     _PROTOTYP(int bprtstop, ( void ));
  537.     _PROTOTYP(void bprtthread, ( void * ));
  538.     _PROTOTYP(int bprtwrite, ( char *, int ));
  539. #endif /* BPRINT */
  540. _PROTOTYP(void restorecursormode, (void));
  541. _PROTOTYP(void scrninit, (void));
  542. _PROTOTYP(void scrninit2, (void));
  543. _PROTOTYP(void SaveTermMode, (int, int));
  544. _PROTOTYP(void SaveCmdMode, (int, int));
  545. _PROTOTYP(void scrollback, (BYTE,int));
  546. _PROTOTYP(void setcursormode, (void));
  547. _PROTOTYP(void setmargins, (int, int));
  548. _PROTOTYP(void strinsert, (char *, char *));
  549. _PROTOTYP(void wrtch, (unsigned short));
  550. _PROTOTYP(int sendescseq, (char *));
  551. _PROTOTYP(int ckcgetc, (int));
  552. _PROTOTYP(void cwrite, (unsigned short));
  553. _PROTOTYP(int concooked, (void));
  554. _PROTOTYP(int conraw, (void));
  555. _PROTOTYP(int xxesc, (char **));
  556. _PROTOTYP( void updanswerbk, (void) ) ;
  557. _PROTOTYP( void dokverb, (int,int) ) ;
  558. _PROTOTYP( void settermtype, (int,int) );
  559. _PROTOTYP( void settermstatus, (int) ) ;
  560. _PROTOTYP( void debugses, (unsigned char) ) ;
  561. _PROTOTYP( int kbdlocked, (void));
  562.  
  563. _PROTOTYP( APIRET OpenClipboardServer, (void) ) ;
  564. _PROTOTYP( APIRET CloseClipboardServer, (void) ) ;
  565. _PROTOTYP( PCHAR  GetTextFromClipboardServer, (void) ) ;
  566. _PROTOTYP( BOOL   PutTextToClipboardServer, ( PCHAR ) ) ;
  567.  
  568. _PROTOTYP( BOOL   IsConnectMode, ( void ) ) ;
  569. _PROTOTYP( void   SetConnectMode, ( BOOL, int ) ) ;
  570. _PROTOTYP( void   getcmdcolor, ( void ) ) ;
  571. _PROTOTYP( unsigned char ComputeColorFromAttr, (int, unsigned char, unsigned short));
  572. _PROTOTYP( void   Win32ConsoleInit, (void));
  573.  
  574. #ifdef PCFONTS
  575. _PROTOTYP( APIRET os2LoadPCFonts, ( void ) ) ;
  576. _PROTOTYP( APIRET os2SetFont, (void) ) ;
  577. _PROTOTYP( APIRET os2ResetFont, (void) ) ;
  578. #endif /* PCFONTS */
  579.  
  580. _PROTOTYP( char * get_reg_name, (void) ) ;
  581. _PROTOTYP( char * get_reg_corp, (void) ) ;
  582. _PROTOTYP( char * get_reg_sn, (void) ) ;
  583. _PROTOTYP( int shoreg, (VOID) ) ;
  584. _PROTOTYP( int chkexp, (VOID) ) ;
  585.  
  586. _PROTOTYP( int CSisNRC, ( int ) );
  587. _PROTOTYP( int ltorxlat, ( int, CHAR **));
  588. _PROTOTYP( int rtolxlat, ( int ));
  589. _PROTOTYP( int utolxlat, ( int ));
  590. _PROTOTYP( int utorxlat, ( int, CHAR **));
  591.  
  592. _PROTOTYP( VOID SNI_bitmode, (int));
  593. _PROTOTYP( VOID SNI_chcode, (int));
  594.  
  595. _PROTOTYP( const char * GetSelection,(void));
  596. _PROTOTYP( const char * GetURL,(void));
  597. _PROTOTYP( int          GetURLType, (void));
  598. _PROTOTYP( int IsCellPartOfURL,( BYTE mode, USHORT row, USHORT col ));
  599. _PROTOTYP( int IsURLChar, (USHORT));
  600.  
  601. _PROTOTYP( int os2_settermheight,(int));
  602. _PROTOTYP( int os2_setcmdheight,(int));
  603. _PROTOTYP( int os2_settermwidth,(int));
  604. _PROTOTYP( int os2_setcmdwidth,(int));
  605. #ifdef KUI
  606. _PROTOTYP( int kui_setheightwidth,(int,int));
  607. #endif /* KUI */
  608.  
  609. typedef struct _hyperlink {
  610.     int index;
  611.     int type;
  612.     char * str;
  613. } hyperlink;
  614.  
  615. #define HYPERLINK_URL 1
  616. #define HYPERLINK_UNC 2
  617.  
  618. _PROTOTYP( int hyperlink_add, (int, char *));
  619. _PROTOTYP( hyperlink * hyperlink_get, (int));
  620.  
  621. #ifdef putchar
  622. #undef putchar
  623. #endif /* putchar */
  624. #define putchar(x) conoc(x)
  625.  
  626. #ifdef printf
  627. #undef printf
  628. #endif /* printf */
  629. #define printf Vscrnprintf
  630. #ifdef fprintf
  631. #undef fprintf
  632. #endif /* fprintf */
  633. #define fprintf Vscrnfprintf
  634.  
  635. #ifdef SV_NOTEFREQ
  636. #define DEF_BEEP_FREQ SV_NOTEFREQ
  637. #else
  638. #define DEF_BEEP_FREQ 440
  639. #endif
  640.  
  641. #ifdef SV_NOTEDURATION
  642. #define DEF_BEEP_TIME SV_NOTEDURATION
  643. #else
  644. #define DEF_BEEP_TIME 100
  645. #endif
  646.  
  647. #define ATTR_MODE_REAL 1
  648. #define ATTR_MODE_INTENSITY 2
  649. #define ATTR_MODE_COLOR 4
  650.  
  651. #define ATTR_PAGE_MODE 1
  652. #define ATTR_LINE_MODE 2
  653. #define ATTR_CHAR_MODE 4
  654.  
  655. _PROTOTYP( void loadtod, ( int, int ) ) ;
  656.  
  657. #ifndef NT
  658.  
  659. typedef struct _COORD {
  660.     SHORT X;
  661.     SHORT Y;
  662. } COORD, *PCOORD;
  663.  
  664. typedef struct _SMALL_RECT {
  665.     SHORT Left;
  666.     SHORT Top;
  667.     SHORT Right;
  668.     SHORT Bottom;
  669. } SMALL_RECT, *PSMALL_RECT;
  670.  
  671. typedef struct _CHAR_INFO {
  672.     union {
  673.         USHORT UnicodeChar;
  674.         CHAR   AsciiChar;
  675.     } Char;
  676.     USHORT Attributes;
  677. } CHAR_INFO, *PCHAR_INFO;
  678.  
  679. typedef struct _KEY_EVENT_RECORD {
  680.     ULONG bKeyDown;
  681.     USHORT wRepeatCount;
  682.     USHORT wVirtualKeyCode;
  683.     USHORT wVirtualScanCode;
  684.     union {
  685.         USHORT UnicodeChar;
  686.         CHAR   AsciiChar;
  687.     } uChar;
  688.     ULONG dwControlKeyState;
  689. } KEY_EVENT_RECORD, *PKEY_EVENT_RECORD;
  690.  
  691. typedef struct _MOUSE_EVENT_RECORD {
  692.     COORD dwMousePosition;
  693.     ULONG dwButtonState;
  694.     ULONG dwControlKeyState;
  695.     ULONG dwEventFlags;
  696. } MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD;
  697.  
  698. typedef struct _WINDOW_BUFFER_SIZE_RECORD {
  699.     COORD dwSize;
  700. } WINDOW_BUFFER_SIZE_RECORD, *PWINDOW_BUFFER_SIZE_RECORD;
  701.  
  702. typedef struct _MENU_EVENT_RECORD {
  703.     ULONG dwCommandId;
  704. } MENU_EVENT_RECORD, *PMENU_EVENT_RECORD;
  705.  
  706. typedef struct _FOCUS_EVENT_RECORD {
  707.     ULONG bSetFocus;
  708. } FOCUS_EVENT_RECORD, *PFOCUS_EVENT_RECORD;
  709.  
  710. typedef struct _INPUT_RECORD {
  711.     USHORT EventType;
  712.     union {
  713.         KEY_EVENT_RECORD KeyEvent;
  714.         MOUSE_EVENT_RECORD MouseEvent;
  715.         WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
  716.         MENU_EVENT_RECORD MenuEvent;
  717.         FOCUS_EVENT_RECORD FocusEvent;
  718.     } Event;
  719. } INPUT_RECORD, *PINPUT_RECORD;
  720.  
  721. typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
  722.     COORD dwSize;
  723.     COORD dwCursorPosition;
  724.     USHORT  wAttributes;
  725.     SMALL_RECT srWindow;
  726.     COORD dwMaximumWindowSize;
  727. } CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO;
  728. #endif /* NT */
  729.  
  730. #include "ckothr.h"
  731. #include "ckosyn.h"
  732.  
  733. #ifdef CKLEARN
  734. extern FILE * learnfp;
  735. extern int learning;
  736. extern ULONG learnt1;
  737. extern char learnbuf[LEARNBUFSIZ];
  738. extern int  learnbc;
  739. extern int  learnbp;
  740. extern int  learnst;
  741.  
  742. #define LEARN_NEUTRAL  0
  743. #define LEARN_NET      1
  744. #define LEARN_KEYBOARD 2
  745. #endif /* CKLEARN */
  746.  
  747. extern int ConnectMode;
  748. #ifdef NT
  749. _inline
  750. #else
  751. _Inline
  752. #endif
  753. BOOL
  754. IsConnectMode( void ) {
  755.     extern int apcactive;
  756.     return ConnectMode && !apcactive;
  757. }
  758.  
  759. int gui_text_popup_create(char * title, int h, int w);
  760. int gui_text_popup_append(unsigned short uch);
  761. int gui_text_popup_close(void);
  762. int gui_text_popup_wait(int seconds);
  763. #endif /* CKOCON_H */
  764.