Use x11 for now

This commit is contained in:
luboslenco
2025-09-14 17:26:36 +02:00
parent 26b3e7318a
commit 6c99b5e24e
3 changed files with 375 additions and 588 deletions
+2
View File
@@ -267,6 +267,8 @@ if (flags.with_nfd && (platform == "windows" || platform == "linux" || platform
project.add_lib("glib-2.0");
project.add_lib("X11");
project.add_lib("Xi");
project.add_lib("Xcursor");
project.add_lib("Xrandr");
}
else if (platform == "macos") {
project.add_cfiles("sources/libs/nfd.m");
File diff suppressed because it is too large Load Diff
-114
View File
@@ -31,115 +31,6 @@ struct iron_x11_display {
RRCrtc crtc;
};
struct iron_x11_atoms {
Atom XdndAware;
Atom XdndDrop;
Atom XdndEnter;
Atom XdndTextUriList;
Atom XdndStatus;
Atom XdndActionCopy;
Atom XdndSelection;
Atom CLIPBOARD;
Atom UTF8_STRING;
Atom XSEL_DATA;
Atom TARGETS;
Atom MULTIPLE;
Atom TEXT_PLAIN;
Atom WM_DELETE_WINDOW;
Atom MOTIF_WM_HINTS;
Atom NET_WM_NAME;
Atom NET_WM_ICON_NAME;
Atom NET_WM_STATE;
Atom NET_WM_STATE_FULLSCREEN;
Atom MOUSE;
Atom TABLET;
Atom KEYBOARD;
Atom TOUCHSCREEN;
Atom TOUCHPAD;
Atom BUTTONBOX;
Atom BARCODE;
Atom TRACKBALL;
Atom QUADRATURE;
Atom ID_MODULE;
Atom ONE_KNOB;
Atom NINE_KNOB;
Atom KNOB_BOX;
Atom SPACEBALL;
Atom DATAGLOVE;
Atom EYETRACKER;
Atom CURSORKEYS;
Atom FOOTMOUSE;
Atom JOYSTICK;
};
struct iron_x11_libs {
void *X11;
void *Xcursor;
void *Xi;
void *Xrandr;
};
struct iron_x11_procs {
Display *(*XOpenDisplay)(const char *name);
Status (*XInternAtoms)(Display *display, char **names, int count, Bool only_if_exists, Atom *atoms_return);
int (*XCloseDisplay)(Display *display);
int (*XInitThreads)(void);
XErrorHandler (*XSetErrorHandler)(XErrorHandler handler);
int (*XGetErrorText)(Display *, int, char *, int);
int (*XPending)(Display *display);
int (*XFlush)(Display *display);
int (*XNextEvent)(Display *display, XEvent *event_return);
int (*XPeekEvent)(Display *display, XEvent *event_return);
int (*XRefreshKeyboardMapping)(XMappingEvent *event_map);
int (*XwcLookupString)(XIC, XKeyPressedEvent *, wchar_t *, int, KeySym *, int *);
int (*XFilterEvent)(XEvent *, Window);
int (*XConvertSelection)(Display *, Atom, Atom, Atom, Window, Time);
int (*XSetSelectionOwner)(Display *, Atom, Window, Time);
int (*XLookupString)(XKeyEvent *, char *, int, KeySym *, XComposeStatus *);
KeySym (*XkbKeycodeToKeysym)(Display *, KeyCode, int, int);
int (*XSendEvent)(Display *, Window, int, long, XEvent *);
int (*XGetWindowProperty)(Display *, Window, Atom, long, long, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
int (*XFree)(void *);
int (*XChangeProperty)(Display *, Window, Atom, Atom, int, int, const unsigned char *, int);
int (*XDefineCursor)(Display *, Window, Cursor);
int (*XUndefineCursor)(Display *, Window);
Pixmap (*XCreateBitmapFromData)(Display *, Drawable, const char *, unsigned int, unsigned int);
Cursor (*XCreatePixmapCursor)(Display *, Pixmap, Pixmap, XColor *, XColor *, unsigned int, unsigned int);
int (*XFreePixmap)(Display *, Pixmap);
Cursor (*XcursorLibraryLoadCursor)(Display *, const char *);
int (*XWarpPointer)(Display *, Window, Window, int, int, unsigned int, unsigned int, int, int);
int (*XQueryPointer)(Display *, Window, Window *, Window *, int *, int *, int *, int *, unsigned int *);
Colormap (*XCreateColormap)(Display *, Window, Visual *, int);
Window (*XCreateWindow)(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth,
unsigned int class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes);
int (*XMoveWindow)(Display *, Window, int, int);
int (*XResizeWindow)(Display *, Window, unsigned int, unsigned int);
int (*XDestroyWindow)(Display *, Window);
int (*XSetClassHint)(Display *, Window, XClassHint *);
char *(*XSetLocaleModifiers)(const char *);
XIM (*XOpenIM)(Display *, struct _XrmHashBucketRec *, char *, char *);
int (*XCloseIM)(XIM);
XIC (*XCreateIC)(XIM, ...);
void (*XDestroyIC)(XIC);
void (*XSetICFocus)(XIC);
int (*XMapWindow)(Display *, Window);
int (*XUnmapWindow)(Display *, Window);
int (*XSetWMProtocols)(Display *, Window, Atom *, int);
int (*XAllocColor)(Display *, Colormap, XColor *);
XDeviceInfo *(*XListInputDevices)(Display *, int *);
void (*XFreeDeviceList)(XDeviceInfo *);
XDevice *(*XOpenDevice)(Display *display, XID device_id);
int (*XCloseDevice)(Display *display, XDevice *device);
int (*XSelectExtensionEvent)(Display *, Window, XEventClass *, int);
XRRScreenResources *(*XRRGetScreenResourcesCurrent)(Display *dpy, Window window);
RROutput (*XRRGetOutputPrimary)(Display *dpy, Window window);
XRROutputInfo *(*XRRGetOutputInfo)(Display *dpy, XRRScreenResources *resources, RROutput output);
void (*XRRFreeOutputInfo)(XRROutputInfo *outputInfo);
XRRCrtcInfo *(*XRRGetCrtcInfo)(Display *dpy, XRRScreenResources *resources, RRCrtc crtc);
void (*XRRFreeCrtcInfo)(XRRCrtcInfo *crtcInfo);
void (*XRRFreeScreenResources)(XRRScreenResources *resources);
};
struct x11_pen_device {
int id;
int pressure_index;
@@ -152,8 +43,6 @@ struct x11_pen_device {
struct x11_context {
Display *display;
struct iron_x11_libs libs;
struct iron_x11_atoms atoms;
struct x11_pen_device pen;
struct x11_pen_device eraser;
struct iron_x11_window windows[1];
@@ -161,9 +50,6 @@ struct x11_context {
struct iron_x11_display displays[MAXIMUM_DISPLAYS];
};
struct iron_x11_procs xlib;
struct x11_context x11_ctx;
#ifdef WITH_GAMEPAD
void iron_linux_initHIDGamepads();
void iron_linux_updateHIDGamepads();