2024-11-10 22:11:29 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <X11/Xatom.h>
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
#include <X11/extensions/XInput.h>
|
2025-09-14 16:40:34 +02:00
|
|
|
#include <X11/extensions/XInput2.h>
|
2024-11-10 22:11:29 +01:00
|
|
|
#include <X11/extensions/Xrandr.h>
|
2025-10-15 13:06:40 +02:00
|
|
|
#include <iron_system.h>
|
2024-11-10 22:11:29 +01:00
|
|
|
|
2025-08-03 12:02:59 +02:00
|
|
|
#define MAXIMUM_DISPLAYS 8
|
2024-11-10 22:11:29 +01:00
|
|
|
|
2025-03-09 17:02:12 +01:00
|
|
|
struct iron_x11_window {
|
2025-10-15 13:06:40 +02:00
|
|
|
int display_index;
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
2025-03-09 17:02:12 +01:00
|
|
|
iron_window_mode_t mode;
|
2025-10-15 13:06:40 +02:00
|
|
|
Window window;
|
|
|
|
|
XIM xInputMethod;
|
|
|
|
|
XIC xInputContext;
|
2024-11-10 22:11:29 +01:00
|
|
|
};
|
|
|
|
|
|
2025-03-09 17:02:12 +01:00
|
|
|
struct iron_x11_display {
|
2025-10-15 13:06:40 +02:00
|
|
|
int index;
|
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
bool primary;
|
2024-11-10 22:11:29 +01:00
|
|
|
RROutput output;
|
2025-10-15 13:06:40 +02:00
|
|
|
RRCrtc crtc;
|
2024-11-10 22:11:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct x11_pen_device {
|
2025-10-15 13:06:40 +02:00
|
|
|
int id;
|
|
|
|
|
int pressure_index;
|
2025-09-14 16:40:34 +02:00
|
|
|
double pressure_max;
|
2025-10-15 13:06:40 +02:00
|
|
|
float pressure_current;
|
2025-02-15 18:32:13 +01:00
|
|
|
void (*press)(int /*x*/, int /*y*/, float /*pressure*/);
|
|
|
|
|
void (*move)(int /*x*/, int /*y*/, float /*pressure*/);
|
|
|
|
|
void (*release)(int /*x*/, int /*y*/, float /*pressure*/);
|
2024-11-10 22:11:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct x11_context {
|
2025-10-15 13:06:40 +02:00
|
|
|
Display *display;
|
|
|
|
|
struct x11_pen_device pen;
|
|
|
|
|
struct x11_pen_device eraser;
|
|
|
|
|
struct iron_x11_window windows[1];
|
|
|
|
|
int num_displays;
|
2025-03-09 17:02:12 +01:00
|
|
|
struct iron_x11_display displays[MAXIMUM_DISPLAYS];
|
2024-11-10 22:11:29 +01:00
|
|
|
};
|
|
|
|
|
|
2025-08-03 13:23:42 +02:00
|
|
|
#ifdef WITH_GAMEPAD
|
2025-03-09 17:02:12 +01:00
|
|
|
void iron_linux_initHIDGamepads();
|
|
|
|
|
void iron_linux_updateHIDGamepads();
|
|
|
|
|
void iron_linux_closeHIDGamepads();
|
2025-08-03 13:23:42 +02:00
|
|
|
#endif
|