vt.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef _LINUX_VT_H
  2. #define _LINUX_VT_H
  3. /*
  4. * These constants are also useful for user-level apps (e.g., VC
  5. * resizing).
  6. */
  7. #define MIN_NR_CONSOLES 1 /* must be at least 1 */
  8. #define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
  9. #define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
  10. /* Note: the ioctl VT_GETSTATE does not work for
  11. consoles 16 and higher (since it returns a short) */
  12. /* 0x56 is 'V', to avoid collision with termios and kd */
  13. #define VT_OPENQRY 0x5600 /* find available vt */
  14. struct vt_mode {
  15. char mode; /* vt mode */
  16. char waitv; /* if set, hang on writes if not active */
  17. short relsig; /* signal to raise on release req */
  18. short acqsig; /* signal to raise on acquisition */
  19. short frsig; /* unused (set to 0) */
  20. };
  21. #define VT_GETMODE 0x5601 /* get mode of active vt */
  22. #define VT_SETMODE 0x5602 /* set mode of active vt */
  23. #define VT_AUTO 0x00 /* auto vt switching */
  24. #define VT_PROCESS 0x01 /* process controls switching */
  25. #define VT_ACKACQ 0x02 /* acknowledge switch */
  26. struct vt_stat {
  27. unsigned short v_active; /* active vt */
  28. unsigned short v_signal; /* signal to send */
  29. unsigned short v_state; /* vt bitmask */
  30. };
  31. #define VT_GETSTATE 0x5603 /* get global vt state info */
  32. #define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
  33. #define VT_RELDISP 0x5605 /* release display */
  34. #define VT_ACTIVATE 0x5606 /* make vt active */
  35. #define VT_WAITACTIVE 0x5607 /* wait for vt active */
  36. #define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
  37. struct vt_sizes {
  38. unsigned short v_rows; /* number of rows */
  39. unsigned short v_cols; /* number of columns */
  40. unsigned short v_scrollsize; /* number of lines of scrollback */
  41. };
  42. #define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
  43. struct vt_consize {
  44. unsigned short v_rows; /* number of rows */
  45. unsigned short v_cols; /* number of columns */
  46. unsigned short v_vlin; /* number of pixel rows on screen */
  47. unsigned short v_clin; /* number of pixel rows per character */
  48. unsigned short v_vcol; /* number of pixel columns on screen */
  49. unsigned short v_ccol; /* number of pixel columns per character */
  50. };
  51. #define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
  52. #define VT_LOCKSWITCH 0x560B /* disallow vt switching */
  53. #define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
  54. #define VT_GETHIFONTMASK 0x560D /* return hi font mask */
  55. struct vt_event {
  56. unsigned int event;
  57. #define VT_EVENT_SWITCH 0x0001 /* Console switch */
  58. #define VT_EVENT_BLANK 0x0002 /* Screen blank */
  59. #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
  60. #define VT_EVENT_RESIZE 0x0008 /* Resize display */
  61. #define VT_MAX_EVENT 0x000F
  62. unsigned int oldev; /* Old console */
  63. unsigned int newev; /* New console (if changing) */
  64. unsigned int pad[4]; /* Padding for expansion */
  65. };
  66. #define VT_WAITEVENT 0x560E /* Wait for an event */
  67. struct vt_setactivate {
  68. unsigned int console;
  69. struct vt_mode mode;
  70. };
  71. #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
  72. #endif /* _LINUX_VT_H */