wm_abi.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* Shared window-manager ABI: kernel <-> ring-3 WM.
  2. * Only plain types and syscall numbers live here; the kernel window state and
  3. * all font/pixel decisions stay elsewhere. */
  4. #ifndef WM_ABI_H
  5. #define WM_ABI_H
  6. #define WM_MAX_WINDOWS 4
  7. /* Shared chrome layout (the WM draws it, the kernel only stores geometry). */
  8. #define WM_BAR_H 25
  9. #define WM_BTN_X 132
  10. #define WM_BTN_Y 3
  11. #define WM_BTN_W 56
  12. #define WM_BTN_H 14
  13. #define WM_TITLE_H 16
  14. #define WM_CLOSE_W 14
  15. /* Fixed user virtual addresses for the WM's mappings. The shadow is one
  16. * mapping; each window gets a private content slot (large enough for the
  17. * current canvas and future bigger ones). */
  18. #define WM_SHADOW_VA 0x58000000u
  19. #define WM_CONTENT_VA_BASE 0x59000000u
  20. #define WM_CONTENT_SLOT 0x00200000u /* 2 MB per window */
  21. /* Window content kind. */
  22. #define WM_KIND_NONE 0
  23. #define WM_KIND_TEXT 1
  24. #define WM_KIND_GFX 2
  25. struct wm_screen_info {
  26. unsigned int width;
  27. unsigned int height;
  28. unsigned int pitch;
  29. unsigned int bpp;
  30. unsigned int bytes;
  31. void *fb;
  32. };
  33. struct wm_mouse_info {
  34. unsigned int x;
  35. unsigned int y;
  36. unsigned int buttons; /* bit0 left, bit1 right, bit2 middle */
  37. };
  38. struct wm_status {
  39. struct wm_mouse_info mouse;
  40. unsigned int full_redraw;
  41. unsigned int kexec_busy;
  42. unsigned int kexec_progress;
  43. unsigned int kexec_total;
  44. };
  45. struct wm_window_info {
  46. unsigned int used;
  47. unsigned int kind; /* WM_KIND_* */
  48. unsigned int focused;
  49. unsigned int pid;
  50. int x, y;
  51. unsigned int w, h; /* outer window rectangle */
  52. unsigned int content_w, content_h;
  53. unsigned int cols, rows; /* text cells (0 for gfx) */
  54. unsigned int cursor;
  55. unsigned int cursor_visible;
  56. unsigned int dirty;
  57. unsigned int dirty_seq;
  58. unsigned int dmg_col0, dmg_row0, dmg_cols, dmg_rows;
  59. unsigned int content_gen;
  60. char title[16];
  61. };
  62. struct wm_map_info {
  63. void *va;
  64. unsigned int kind;
  65. unsigned int w, h;
  66. unsigned int stride; /* bytes per row for gfx, cells*2 for text */
  67. unsigned int generation;
  68. };
  69. struct wm_rect {
  70. int x, y;
  71. unsigned int w, h;
  72. };
  73. struct wm_present_info {
  74. unsigned int count; /* 0..4 */
  75. unsigned int immediate; /* 1: flush now (drag); 0: budgeted */
  76. struct wm_rect rect[4];
  77. };
  78. struct wm_geom {
  79. int x, y;
  80. };
  81. /* Generic canvas-window client API (gfx commands own their own window). */
  82. struct win_create {
  83. unsigned int w, h;
  84. char title[16];
  85. };
  86. struct win_info {
  87. void *fb; /* mapped RGB565 back buffer */
  88. unsigned int width, height;
  89. unsigned int id;
  90. };
  91. #endif