2020-11-02 04:09:48 +13:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/XKBlib.h>
|
2021-01-22 08:44:09 +13:00
|
|
|
#include <X11/Xutil.h>
|
2020-11-02 04:09:48 +13:00
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#include <X11/extensions/XTest.h>
|
2021-01-10 10:58:18 +13:00
|
|
|
#include <X11/extensions/Xfixes.h>
|
2020-11-02 04:09:48 +13:00
|
|
|
#include <stdlib.h>
|
2023-02-15 09:18:47 +13:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
// for computing xrandr modelines at runtime
|
|
|
|
#include <libxcvt/libxcvt.h>
|
2020-11-02 04:09:48 +13:00
|
|
|
|
|
|
|
extern void goCreateScreenSize(int index, int width, int height, int mwidth, int mheight);
|
|
|
|
extern void goSetScreenRates(int index, int rate_index, short rate);
|
|
|
|
|
|
|
|
Display *getXDisplay(void);
|
2020-11-04 12:09:52 +13:00
|
|
|
int XDisplayOpen(char *input);
|
|
|
|
void XDisplayClose(void);
|
2020-11-02 04:09:48 +13:00
|
|
|
|
|
|
|
void XMove(int x, int y);
|
2021-02-18 09:55:11 +13:00
|
|
|
void XCursorPosition(int *x, int *y);
|
2020-11-02 04:09:48 +13:00
|
|
|
void XScroll(int x, int y);
|
|
|
|
void XButton(unsigned int button, int down);
|
2021-04-10 11:10:14 +12:00
|
|
|
|
|
|
|
typedef struct xkeyentry_t {
|
|
|
|
KeySym keysym;
|
|
|
|
KeyCode keycode;
|
|
|
|
struct xkeyentry_t *next;
|
|
|
|
} xkeyentry_t;
|
|
|
|
|
|
|
|
static void XKeyEntryAdd(KeySym keysym, KeyCode keycode);
|
|
|
|
static KeyCode XKeyEntryGet(KeySym keysym);
|
2021-04-13 01:25:10 +12:00
|
|
|
static KeyCode XkbKeysymToKeycode(Display *dpy, KeySym keysym);
|
2021-04-10 11:10:14 +12:00
|
|
|
void XKey(KeySym keysym, int down);
|
2020-11-02 04:09:48 +13:00
|
|
|
|
2023-03-14 05:55:41 +13:00
|
|
|
Status XSetScreenConfiguration(int width, int height, short rate);
|
2023-02-15 09:18:47 +13:00
|
|
|
void XGetScreenConfiguration(int *width, int *height, short *rate);
|
2020-11-02 04:09:48 +13:00
|
|
|
void XGetScreenConfigurations();
|
2023-02-15 09:18:47 +13:00
|
|
|
void XCreateScreenMode(int width, int height, short rate);
|
|
|
|
XRRModeInfo XCreateScreenModeInfo(int hdisplay, int vdisplay, short vrefresh);
|
2020-11-02 04:09:48 +13:00
|
|
|
|
2021-01-13 10:54:13 +13:00
|
|
|
void XSetKeyboardModifier(int mod, int on);
|
2021-01-13 11:35:11 +13:00
|
|
|
char XGetKeyboardModifiers();
|
2021-01-10 10:58:18 +13:00
|
|
|
XFixesCursorImage *XGetCursorImage(void);
|
2021-01-22 08:44:09 +13:00
|
|
|
|
|
|
|
char *XGetScreenshot(int *w, int *h);
|