vt.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef VT_H
  2. #define VT_H
  3. #include "misc.h"
  4. #define W 40
  5. #define H 25
  6. #define BAD_CHAR 0xb8 // substitute for chars with bad parity
  7. struct vt_event
  8. {
  9. int type;
  10. void *resource; /* struct xio_win *, struct vbi *, ... */
  11. int i1, i2, i3, i4;
  12. void *p1;
  13. };
  14. #define EV_CLOSE 1
  15. #define EV_KEY 2 // i1:KEY_xxx i2:shift-flag
  16. #define EV_MOUSE 3 // i1:button i2:shift-flag i3:x i4:y
  17. #define EV_SELECTION 4 // i1:len p1:data
  18. #define EV_PAGE 5 // p1:vt_page i1:query-flag
  19. #define EV_HEADER 6 // i1:pgno i2:subno i3:flags p1:data
  20. #define EV_XPACKET 7 // i1:mag i2:pkt i3:errors p1:data
  21. #define EV_RESET 8 // ./.
  22. #define EV_TIMER 9 // ./.
  23. #define EV_ERR 10 // p1: errmsg
  24. #define KEY_F(i) (1000+i)
  25. #define KEY_LEFT 2001
  26. #define KEY_RIGHT 2002
  27. #define KEY_UP 2003
  28. #define KEY_DOWN 2004
  29. #define KEY_PUP 2005
  30. #define KEY_PDOWN 2006
  31. #define KEY_DEL 2007
  32. #define KEY_INS 2008
  33. struct vt_page
  34. {
  35. int pgno, subno; // the wanted page number
  36. int lang; // language code
  37. int flags; // misc flags (see PG_xxx below)
  38. int errors; // number of single bit errors in page
  39. u32 lines; // 1 bit for each line received
  40. u8 data[25][40]; // page contents
  41. int flof; // page has FastText links
  42. struct {
  43. int pgno;
  44. int subno;
  45. } link[6]; // FastText links (FLOF)
  46. };
  47. #define PG_SUPPHEADER 0x01 // C7 row 0 is not to be displayed
  48. #define PG_OUTOFSEQ 0x04 // C9 page out of numerical order
  49. #define PG_NODISPLAY 0x08 // C10 rows 1-24 is not to be displayed
  50. #define PG_MAGSERIAL 0x10 // C11 serial trans. (any pkt0 terminates page)
  51. #define PG_ERASE 0x20 // C4 clear previously stored lines
  52. #define PG_NEWSFLASH 0x40 // C5 box it and insert into normal video pict.
  53. #define PG_SUBTITLE 0x80 // C6 box it and insert into normal video pict.
  54. #define PG_ACTIVE 0x100 // currently fetching this page
  55. #define ANY_SUB 0x3f7f // universal subpage number
  56. #endif