cons.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /* console state (for consctl) */
  10. typedef struct Consstate Consstate;
  11. struct Consstate{
  12. int raw;
  13. int hold;
  14. };
  15. extern Consstate* consctl(void);
  16. extern Consstate* cs;
  17. #define XMARGIN 5 /* inset from border of layer */
  18. #define YMARGIN 5
  19. #define INSET 3
  20. #define BUFS 32
  21. #define HISTSIZ 4096 /* number of history characters */
  22. #define BSIZE 1000
  23. #define SCROLL 2
  24. #define NEWLINE 1
  25. #define OTHER 0
  26. #define COOKED 0
  27. #define RAW 1
  28. /* text attributes */
  29. enum {
  30. THighIntensity = (1<<0),
  31. TUnderline = (1<<1),
  32. TBlink = (1<<2),
  33. TReverse = (1<<3),
  34. TInvisible = (1<<4),
  35. };
  36. #define button2() ((mouse.buttons & 07)==2)
  37. #define button3() ((mouse.buttons & 07)==4)
  38. struct ttystate {
  39. int crnl;
  40. int nlcr;
  41. };
  42. extern struct ttystate ttystate[];
  43. #define NKEYS 32 /* max key definitions */
  44. struct funckey {
  45. char *name;
  46. char *sequence;
  47. };
  48. extern struct funckey *fk;
  49. extern struct funckey vt100fk[], vt220fk[], ansifk[], xtermfk[];
  50. extern int x, y, xmax, ymax, olines;
  51. extern int peekc, attribute;
  52. extern char* term;
  53. extern void emulate(void);
  54. extern int host_avail(void);
  55. extern void clear(Rectangle);
  56. extern void newline(void);
  57. extern int get_next_char(void);
  58. extern void ringbell(void);
  59. extern int number(char *, int *);
  60. extern void scroll(int,int,int,int);
  61. extern void backup(int);
  62. extern void sendnchars(int, char *);
  63. extern void sendnchars2(int, char *);
  64. extern Point pt(int, int);
  65. extern void funckey(int);
  66. extern void drawstring(Point, char*, int);
  67. extern int debug;
  68. extern int yscrmin, yscrmax;
  69. extern int attr;
  70. extern int defattr;
  71. extern Image *fgcolor;
  72. extern Image *bgcolor;
  73. extern Image *colors[];
  74. extern Image *hicolors[];
  75. extern Image *bgdefault;
  76. extern Image *fgdefault;
  77. extern int cursoron;
  78. extern int nocolor;
  79. extern void curson(int);
  80. extern void cursoff(void);
  81. extern void setdim(int, int);