linux_system.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include <X11/Xatom.h>
  3. #include <X11/Xlib.h>
  4. #include <X11/Xutil.h>
  5. #include <X11/extensions/XInput.h>
  6. #include <X11/extensions/XInput2.h>
  7. #include <X11/extensions/Xrandr.h>
  8. #include <iron_system.h>
  9. #define MAXIMUM_DISPLAYS 8
  10. struct iron_x11_window {
  11. int display_index;
  12. int width;
  13. int height;
  14. iron_window_mode_t mode;
  15. Window window;
  16. XIM xInputMethod;
  17. XIC xInputContext;
  18. };
  19. struct iron_x11_display {
  20. int index;
  21. int x;
  22. int y;
  23. int width;
  24. int height;
  25. bool primary;
  26. RROutput output;
  27. RRCrtc crtc;
  28. };
  29. struct x11_pen_device {
  30. int id;
  31. int pressure_index;
  32. double pressure_max;
  33. float pressure_current;
  34. void (*press)(int /*x*/, int /*y*/, float /*pressure*/);
  35. void (*move)(int /*x*/, int /*y*/, float /*pressure*/);
  36. void (*release)(int /*x*/, int /*y*/, float /*pressure*/);
  37. };
  38. struct x11_context {
  39. Display *display;
  40. struct x11_pen_device pen;
  41. struct x11_pen_device eraser;
  42. struct iron_x11_window windows[1];
  43. int num_displays;
  44. struct iron_x11_display displays[MAXIMUM_DISPLAYS];
  45. };
  46. #ifdef WITH_GAMEPAD
  47. void iron_linux_initHIDGamepads();
  48. void iron_linux_updateHIDGamepads();
  49. void iron_linux_closeHIDGamepads();
  50. #endif