2025-11-18 16:19:05 +00:00
|
|
|
/*!
|
|
|
|
|
* @file Mw/LowLevel/X11.h
|
|
|
|
|
* @brief X11 Backend
|
|
|
|
|
* @warning This is used internally
|
|
|
|
|
*/
|
|
|
|
|
#ifndef __MW_LOWLEVEL_X11_H__
|
|
|
|
|
#define __MW_LOWLEVEL_X11_H__
|
2025-09-28 02:51:15 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
#include <Mw/MachDep.h>
|
|
|
|
|
#include <Mw/TypeDefs.h>
|
|
|
|
|
#include <Mw/LowLevel.h>
|
2025-09-28 07:03:05 +00:00
|
|
|
|
2025-10-04 04:10:45 +00:00
|
|
|
#include <X11/Xlib.h>
|
2025-09-28 02:51:15 +00:00
|
|
|
#include <X11/Xutil.h>
|
2025-10-11 06:21:43 +00:00
|
|
|
#include <X11/Xatom.h>
|
2025-11-08 22:47:11 +00:00
|
|
|
#ifdef USE_XRENDER
|
2025-09-30 00:52:43 +00:00
|
|
|
#include <X11/extensions/Xrender.h>
|
2025-11-08 22:47:11 +00:00
|
|
|
#endif
|
2025-09-28 02:51:15 +00:00
|
|
|
|
2025-11-13 02:27:31 +00:00
|
|
|
struct _MwLLX11 {
|
|
|
|
|
struct _MwLLCommon common;
|
|
|
|
|
|
|
|
|
|
unsigned int width;
|
|
|
|
|
unsigned int height;
|
|
|
|
|
|
2025-10-21 16:14:09 +00:00
|
|
|
Display* display;
|
|
|
|
|
Window window;
|
|
|
|
|
Pixmap pixmap;
|
|
|
|
|
GC gc;
|
|
|
|
|
Colormap colormap;
|
|
|
|
|
Atom wm_delete;
|
2025-12-31 00:48:44 +09:00
|
|
|
Atom wm_protocols;
|
2026-03-27 14:40:07 +09:00
|
|
|
Atom utf8_string;
|
|
|
|
|
Atom compound_text;
|
|
|
|
|
Atom text;
|
|
|
|
|
Atom clipboard;
|
|
|
|
|
Atom selection;
|
2025-10-21 16:14:09 +00:00
|
|
|
XIM xim;
|
|
|
|
|
XIC xic;
|
2025-09-28 09:50:28 +00:00
|
|
|
|
2026-03-27 14:40:07 +09:00
|
|
|
long clipboard_time;
|
|
|
|
|
int clipboard_pending; /* 1 if UTF8_STRING, 2 if COMPOUNd_TEXT, 3 if TEXT, 4 if STRING, otherwise 0 */
|
|
|
|
|
|
2025-11-09 08:36:57 +00:00
|
|
|
int top;
|
2025-12-05 13:08:27 +09:00
|
|
|
int toplevel;
|
2025-10-17 19:11:32 +00:00
|
|
|
int grabbed;
|
2025-11-20 12:45:07 +00:00
|
|
|
int force_render;
|
2025-10-21 16:14:09 +00:00
|
|
|
|
|
|
|
|
unsigned long red_mask;
|
|
|
|
|
unsigned long red_max;
|
|
|
|
|
unsigned long red_shift;
|
|
|
|
|
|
|
|
|
|
unsigned long green_mask;
|
|
|
|
|
unsigned long green_max;
|
|
|
|
|
unsigned long green_shift;
|
|
|
|
|
|
|
|
|
|
unsigned long blue_mask;
|
|
|
|
|
unsigned long blue_max;
|
|
|
|
|
unsigned long blue_shift;
|
2026-04-15 16:12:38 -07:00
|
|
|
|
|
|
|
|
#ifdef USE_DBUS
|
|
|
|
|
MwLLDBusContext dbus;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
MwBool dark_theme_detection;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 02:51:15 +00:00
|
|
|
|
2025-11-13 02:27:31 +00:00
|
|
|
struct _MwLLX11Color {
|
|
|
|
|
struct _MwLLCommonColor common;
|
|
|
|
|
|
2025-09-28 02:51:15 +00:00
|
|
|
unsigned long pixel;
|
2025-09-28 21:55:50 +00:00
|
|
|
};
|
2025-09-28 02:51:15 +00:00
|
|
|
|
2025-11-13 02:27:31 +00:00
|
|
|
struct _MwLLX11Pixmap {
|
|
|
|
|
struct _MwLLCommonPixmap common;
|
2025-09-30 00:52:43 +00:00
|
|
|
|
2025-11-02 21:03:50 +00:00
|
|
|
int depth;
|
2025-11-02 20:43:55 +00:00
|
|
|
unsigned char* data;
|
2025-11-02 21:03:50 +00:00
|
|
|
MwLL handle;
|
2025-11-08 22:47:11 +00:00
|
|
|
int use_xrender;
|
2025-11-02 21:03:50 +00:00
|
|
|
Display* display;
|
|
|
|
|
XImage* image;
|
|
|
|
|
XImage* mask;
|
2025-09-30 00:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
2025-12-08 14:38:01 +09:00
|
|
|
MWDECL int MwLLX11CallInit(void);
|
2025-12-08 14:42:16 +09:00
|
|
|
MWDECL Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask);
|
2025-11-29 22:04:23 +00:00
|
|
|
|
2025-09-28 02:51:15 +00:00
|
|
|
#endif
|