13#include <X11/cursorfont.h>
26#ifdef WITH_OPENGL_BACKEND
30#ifdef WITH_VULKAN_BACKEND
36# include <X11/extensions/XInput2.h>
40#include <X11/Xresource.h>
77# define HOST_NAME_MAX 64
88#define _NET_WM_STATE_REMOVE 0
89#define _NET_WM_STATE_ADD 1
92#ifdef WITH_OPENGL_BACKEND
93static XVisualInfo *get_x11_visualinfo(
Display *display)
96 XVisualInfo vinfo_template;
97 vinfo_template.screen = DefaultScreen(display);
98 return XGetVisualInfo(display, VisualScreenMask, &vinfo_template, &num_visuals);
112 const bool is_dialog,
113 const bool stereoVisual,
114 const bool exclusive,
123 m_invalid_window(
false),
124 m_empty_cursor(
None),
125 m_custom_cursor(
None),
126 m_visible_cursor(
None),
131#
if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
134 m_valid_setup(
false),
135 m_is_debug_context(is_debug),
136 m_preferred_device(preferred_device)
138#ifdef WITH_OPENGL_BACKEND
139 if (type == GHOST_kDrawingContextTypeOpenGL) {
140 m_visualInfo = get_x11_visualinfo(m_display);
145 XVisualInfo tmp = {
nullptr};
147 m_visualInfo = XGetVisualInfo(m_display, 0, &tmp, &n);
151 if (m_visualInfo ==
nullptr) {
152 fprintf(stderr,
"initial window could not find the GLX extension\n");
156 uint xattributes_valuemask = 0;
158 XSetWindowAttributes xattributes;
159 memset(&xattributes, 0,
sizeof(xattributes));
161 xattributes_valuemask |= CWBorderPixel;
162 xattributes.border_pixel = 0;
166 xattributes_valuemask |= CWEventMask;
167 xattributes.event_mask = ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask |
168 EnterWindowMask | LeaveWindowMask | ButtonPressMask |
169 ButtonReleaseMask | PointerMotionMask | FocusChangeMask |
170 PropertyChangeMask | KeymapStateMask;
173 xattributes_valuemask |= CWOverrideRedirect;
174 xattributes.override_redirect = True;
177 xattributes_valuemask |= CWColormap;
178 xattributes.colormap = XCreateColormap(
179 m_display, RootWindow(m_display, m_visualInfo->screen), m_visualInfo->visual, AllocNone);
182 m_window = XCreateWindow(m_display,
183 RootWindow(m_display, m_visualInfo->screen),
191 m_visualInfo->visual,
192 xattributes_valuemask,
205 atoms[
count++] = m_system->m_atom._NET_WM_STATE_MAXIMIZED_VERT;
206 atoms[
count++] = m_system->m_atom._NET_WM_STATE_MAXIMIZED_HORZ;
209 atoms[
count++] = m_system->m_atom._NET_WM_STATE_FULLSCREEN;
212 XChangeProperty(m_display,
214 m_system->m_atom._NET_WM_STATE,
242 if (is_dialog && parentWindow) {
249 XSizeHints *xsizehints = XAllocSizeHints();
250 xsizehints->flags = PPosition | PSize | PMinSize | PMaxSize;
251 xsizehints->x =
left;
253 xsizehints->width = width;
254 xsizehints->height = height;
255 xsizehints->min_width = 320;
256 xsizehints->min_height = 240;
257 xsizehints->max_width = 65535;
258 xsizehints->max_height = 65535;
259 XSetWMNormalHints(m_display, m_window, xsizehints);
265 XClassHint *xclasshint = XAllocClassHint();
266 const int len = strlen(title) + 1;
267 char *wmclass = (
char *)malloc(
sizeof(
char) *
len);
268 memcpy(wmclass, title,
len *
sizeof(
char));
269 xclasshint->res_name = wmclass;
270 xclasshint->res_class = wmclass;
271 XSetClassHint(m_display, m_window, xclasshint);
277 if (m_system->m_atom.WM_PROTOCOLS) {
281 if (m_system->m_atom.WM_DELETE_WINDOW) {
282 atoms[natom] = m_system->m_atom.WM_DELETE_WINDOW;
286 if (m_system->m_atom.WM_TAKE_FOCUS && m_system->m_windowFocus) {
287 atoms[natom] = m_system->m_atom.WM_TAKE_FOCUS;
293 XSetWMProtocols(m_display, m_window, atoms, natom);
299 XWMHints *xwmhints = XAllocWMHints();
300 xwmhints->initial_state = NormalState;
301 xwmhints->input = (m_system->m_windowFocus) ? True : False;
302 xwmhints->flags = InputHint | StateHint;
303 XSetWMHints(display, m_window, xwmhints);
309 Atom _NET_WM_ICON = XInternAtom(m_display,
"_NET_WM_ICON", False);
310 XChangeProperty(m_display,
322 Atom _NET_WM_PID = XInternAtom(m_display,
"_NET_WM_PID", False);
323 pid_t pid = getpid();
325 m_display, m_window, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, (
uchar *)&pid, 1);
332 XTextProperty text_prop;
334 gethostname(hostname,
sizeof(hostname));
335 hostname[
sizeof(hostname) - 1] =
'\0';
336 text_array[0] = hostname;
338 XStringListToTextProperty(text_array, 1, &text_prop);
339 XSetWMClientMachine(m_display, m_window, &text_prop);
340 XFree(text_prop.value);
343#ifdef WITH_X11_XINPUT
344 refreshXInputDevices();
349 m_valid_setup =
true;
354 "A graphics card and driver with support for OpenGL 4.3 or higher is "
355 "required.\n\nInstalling the latest driver for your graphics card might resolve the "
357 const char *help =
"https://www.blender.org/download/requirements/";
366 XMapRaised(m_display, m_window);
369 XMapWindow(m_display, m_window);
372 XLowerWindow(m_display, m_window);
380#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
381static Bool destroyICCallback(XIC , XPointer
ptr, XPointer )
386 *(XIC *)
ptr =
nullptr;
392bool GHOST_WindowX11::createX11_XIC()
394 XIM xim = m_system->getX11_XIM();
400 destroy.callback = (XICProc)destroyICCallback;
401 destroy.client_data = (XPointer)&m_xic;
402 m_xic = XCreateIC(xim,
408 XIMPreeditNothing | XIMStatusNothing,
421 XGetICValues(m_xic, XNFilterEvents, &fevent,
nullptr);
422 XSelectInput(m_display,
424 ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask |
425 EnterWindowMask | LeaveWindowMask | ButtonPressMask | ButtonReleaseMask |
426 PointerMotionMask | FocusChangeMask | PropertyChangeMask | KeymapStateMask |
432#ifdef WITH_X11_XINPUT
433void GHOST_WindowX11::refreshXInputDevices()
435 if (m_system->m_xinput_version.present) {
436 std::vector<XEventClass> xevents;
438 for (GHOST_SystemX11::GHOST_TabletX11 &xtablet : m_system->GetXTablets()) {
445 DeviceMotionNotify(xtablet.Device, xtablet.MotionEvent, ev);
447 xevents.push_back(ev);
449 DeviceButtonPress(xtablet.Device, xtablet.PressEvent, ev);
451 xevents.push_back(ev);
453 ProximityIn(xtablet.Device, xtablet.ProxInEvent, ev);
455 xevents.push_back(ev);
457 ProximityOut(xtablet.Device, xtablet.ProxOutEvent, ev);
459 xevents.push_back(ev);
463 XSelectExtensionEvent(m_display, m_window, xevents.data(),
int(xevents.size()));
481 Atom name = XInternAtom(m_display,
"_NET_WM_NAME", 0);
482 Atom utf8str = XInternAtom(m_display,
"UTF8_STRING", 0);
484 m_display, m_window, name, utf8str, 8, PropModeReplace, (
const uchar *)title, strlen(title));
488 XStoreName(m_display, m_window, title);
495 char *name =
nullptr;
497 XFetchName(m_display, m_window, &name);
498 std::string title = name ? name :
"untitled";
513 int x_return, y_return;
514 uint w_return, h_return, border_w_return, depth_return;
517 XGetGeometry(m_display,
537 XWindowChanges values;
538 uint value_mask = CWWidth;
539 values.width = width;
540 XConfigureWindow(m_display, m_window, value_mask, &values);
547 XWindowChanges values;
548 uint value_mask = CWHeight;
549 values.height = height;
550 XConfigureWindow(m_display, m_window, value_mask, &values);
556 XWindowChanges values;
557 uint value_mask = CWWidth | CWHeight;
558 values.width = width;
559 values.height = height;
560 XConfigureWindow(m_display, m_window, value_mask, &values);
571 XTranslateCoordinates(
572 m_display, RootWindow(m_display, m_visualInfo->screen), m_window, 0, 0, &ax, &ay, &temp);
582 XTranslateCoordinates(
583 m_display, m_window, RootWindow(m_display, m_visualInfo->screen), inX, inY, &ax, &ay, &temp);
591 Atom atom_window_type = XInternAtom(m_display,
"_NET_WM_WINDOW_TYPE", False);
592 Atom atom_dialog = XInternAtom(m_display,
"_NET_WM_WINDOW_TYPE_DIALOG", False);
595 XChangeProperty(m_display,
601 (
uchar *)&atom_dialog,
603 XSetTransientForHint(m_display, m_window, parentWindow->m_window);
612 XChangeProperty(m_display,
614 m_system->m_atom._MOTIF_WM_HINTS,
615 m_system->m_atom._MOTIF_WM_HINTS,
624void GHOST_WindowX11::icccmSetState(
int state)
628 if (
state != IconicState) {
632 xev.xclient.type = ClientMessage;
633 xev.xclient.serial = 0;
634 xev.xclient.send_event = True;
635 xev.xclient.display = m_display;
636 xev.xclient.window = m_window;
637 xev.xclient.format = 32;
638 xev.xclient.message_type = m_system->m_atom.WM_CHANGE_STATE;
639 xev.xclient.data.l[0] =
state;
640 XSendEvent(m_display,
641 RootWindow(m_display, m_visualInfo->screen),
643 SubstructureNotifyMask | SubstructureRedirectMask,
647int GHOST_WindowX11::icccmGetState()
const
653 ulong bytes_after, num_ret;
659 ret = XGetWindowProperty(m_display,
661 m_system->m_atom.WM_STATE,
665 m_system->m_atom.WM_STATE,
670 ((
uchar **)&prop_ret));
671 if ((
ret == Success) && (prop_ret !=
nullptr) && (num_ret == 2)) {
672 st = prop_ret->state;
685void GHOST_WindowX11::netwmMaximized(
bool set)
689 xev.xclient.type = ClientMessage;
690 xev.xclient.serial = 0;
691 xev.xclient.send_event = True;
692 xev.xclient.window = m_window;
693 xev.xclient.message_type = m_system->m_atom._NET_WM_STATE;
694 xev.xclient.format = 32;
703 xev.xclient.data.l[1] = m_system->m_atom._NET_WM_STATE_MAXIMIZED_HORZ;
704 xev.xclient.data.l[2] = m_system->m_atom._NET_WM_STATE_MAXIMIZED_VERT;
705 xev.xclient.data.l[3] = 0;
706 xev.xclient.data.l[4] = 0;
707 XSendEvent(m_display,
708 RootWindow(m_display, m_visualInfo->screen),
710 SubstructureRedirectMask | SubstructureNotifyMask,
714bool GHOST_WindowX11::netwmIsMaximized()
const
717 ulong bytes_after, num_ret,
i;
724 ret = XGetWindowProperty(m_display,
726 m_system->m_atom._NET_WM_STATE,
735 (
uchar **)&prop_ret);
736 if ((
ret == Success) && (prop_ret) && (format_ret == 32)) {
738 for (
i = 0;
i < num_ret;
i++) {
739 if (prop_ret[
i] == m_system->m_atom._NET_WM_STATE_MAXIMIZED_HORZ) {
742 if (prop_ret[
i] == m_system->m_atom._NET_WM_STATE_MAXIMIZED_VERT) {
758void GHOST_WindowX11::netwmFullScreen(
bool set)
762 xev.xclient.type = ClientMessage;
763 xev.xclient.serial = 0;
764 xev.xclient.send_event = True;
765 xev.xclient.window = m_window;
766 xev.xclient.message_type = m_system->m_atom._NET_WM_STATE;
767 xev.xclient.format = 32;
776 xev.xclient.data.l[1] = m_system->m_atom._NET_WM_STATE_FULLSCREEN;
777 xev.xclient.data.l[2] = 0;
778 xev.xclient.data.l[3] = 0;
779 xev.xclient.data.l[4] = 0;
780 XSendEvent(m_display,
781 RootWindow(m_display, m_visualInfo->screen),
783 SubstructureRedirectMask | SubstructureNotifyMask,
787bool GHOST_WindowX11::netwmIsFullScreen()
const
790 ulong bytes_after, num_ret,
i;
797 ret = XGetWindowProperty(m_display,
799 m_system->m_atom._NET_WM_STATE,
808 (
uchar **)&prop_ret);
809 if ((
ret == Success) && (prop_ret) && (format_ret == 32)) {
810 for (
i = 0;
i < num_ret;
i++) {
811 if (prop_ret[
i] == m_system->m_atom._NET_WM_STATE_FULLSCREEN) {
824void GHOST_WindowX11::motifFullScreen(
bool set)
836 XChangeProperty(m_display,
838 m_system->m_atom._MOTIF_WM_HINTS,
839 m_system->m_atom._MOTIF_WM_HINTS,
846bool GHOST_WindowX11::motifIsFullScreen()
const
848 MotifWmHints *prop_ret;
849 ulong bytes_after, num_ret;
856 st = XGetWindowProperty(m_display,
858 m_system->m_atom._MOTIF_WM_HINTS,
862 m_system->m_atom._MOTIF_WM_HINTS,
867 (
uchar **)&prop_ret);
868 if ((st == Success) && prop_ret) {
888 state = icccmGetState();
893 if (
ELEM(
state, IconicState, WithdrawnState)) {
896 else if (netwmIsFullScreen() == True) {
899 else if (motifIsFullScreen() == True) {
902 else if (netwmIsMaximized() == True) {
911 bool is_max, is_full, is_motif_full;
914 if (
state ==
int(cur_state)) {
923 is_max = netwmIsMaximized();
924 is_full = netwmIsFullScreen();
931 is_motif_full = motifIsFullScreen();
934 state = m_normal_state;
938 if (is_max == True) {
939 netwmMaximized(False);
941 if (is_full == True) {
942 netwmFullScreen(False);
944 if (is_motif_full == True) {
945 motifFullScreen(False);
947 icccmSetState(NormalState);
960 m_normal_state = cur_state;
962 if (is_max == True) {
963 netwmMaximized(False);
965 if (is_full == False) {
966 netwmFullScreen(True);
968 if (is_motif_full == False) {
969 motifFullScreen(True);
983 if (is_full == True) {
984 netwmFullScreen(False);
986 if (is_motif_full == True) {
987 motifFullScreen(False);
989 if (is_max == False) {
990 netwmMaximized(True);
1000 icccmSetState(IconicState);
1010 XWindowAttributes attr;
1017 XRaiseWindow(m_display, m_window);
1019 atom = XInternAtom(m_display,
"_NET_ACTIVE_WINDOW", True);
1026 xev.xclient.type = ClientMessage;
1027 xev.xclient.serial = 0;
1028 xev.xclient.send_event = True;
1029 xev.xclient.window = m_window;
1030 xev.xclient.message_type = atom;
1032 xev.xclient.format = 32;
1033 xev.xclient.data.l[0] = 1;
1034 xev.xclient.data.l[1] = CurrentTime;
1035 xev.xclient.data.l[2] = m_window;
1036 xev.xclient.data.l[3] = 0;
1037 xev.xclient.data.l[4] = 0;
1039 root = RootWindow(m_display, m_visualInfo->screen);
1040 eventmask = SubstructureRedirectMask | SubstructureNotifyMask;
1042 XSendEvent(m_display, root, False, eventmask, &xev);
1045 XGetWindowAttributes(m_display, m_window, &attr);
1048 if (attr.map_state == IsViewable) {
1049 XSetInputFocus(m_display, m_window, RevertToPointerRoot, CurrentTime);
1054 XLowerWindow(m_display, m_window);
1066 Atom atom_window_type = XInternAtom(m_display,
"_NET_WM_WINDOW_TYPE", False);
1067 Atom atom_dialog = XInternAtom(m_display,
"_NET_WM_WINDOW_TYPE_DIALOG", False);
1070 ulong bytes_after, num_ret;
1073 int format_ret,
ret;
1077 ret = XGetWindowProperty(m_display,
1088 (
uchar **)&prop_ret);
1089 if ((
ret == Success) && (prop_ret) && (format_ret == 32)) {
1090 if (prop_ret[0] == atom_dialog) {
1117 if (m_invalid_window ==
false) {
1118 m_system->addDirtyWindow(
this);
1119 m_invalid_window =
true;
1132 m_invalid_window =
false;
1137 std::map<uint, Cursor>::iterator it = m_standard_cursors.begin();
1138 for (; it != m_standard_cursors.end(); ++it) {
1139 XFreeCursor(m_display, it->second);
1142 if (m_empty_cursor) {
1143 XFreeCursor(m_display, m_empty_cursor);
1145 if (m_custom_cursor) {
1146 XFreeCursor(m_display, m_custom_cursor);
1149 if (m_valid_setup) {
1150 static Atom Primary_atom, Clipboard_atom;
1153 Primary_atom = XInternAtom(m_display,
"PRIMARY", False);
1154 Clipboard_atom = XInternAtom(m_display,
"CLIPBOARD", False);
1156 p_owner = XGetSelectionOwner(m_display, Primary_atom);
1157 c_owner = XGetSelectionOwner(m_display, Clipboard_atom);
1159 if (p_owner == m_window) {
1160 XSetSelectionOwner(m_display, Primary_atom,
None, CurrentTime);
1162 if (c_owner == m_window) {
1163 XSetSelectionOwner(m_display, Clipboard_atom,
None, CurrentTime);
1168 XFree(m_visualInfo);
1171#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
1178 delete m_dropTarget;
1183 if (m_valid_setup) {
1184 XDestroyWindow(m_display, m_window);
1191#ifdef WITH_VULKAN_BACKEND
1192 case GHOST_kDrawingContextTypeVulkan: {
1194 GHOST_kVulkanPlatformX11,
1203 m_preferred_device);
1204 if (context->initializeDrawingContext()) {
1212#ifdef WITH_OPENGL_BACKEND
1213 case GHOST_kDrawingContextTypeOpenGL: {
1216 for (
int minor = 6; minor >= 3; --minor) {
1220 EGLNativeWindowType(m_window),
1221 EGLNativeDisplayType(m_display),
1222 EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
1226 (m_is_debug_context ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0),
1229 if (context->initializeDrawingContext()) {
1237 for (
int minor = 6; minor >= 3; --minor) {
1242 (GLXFBConfig)m_fbconfig,
1243 GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
1248 if (context->initializeDrawingContext()) {
1269 xcursor_id = XC_question_arrow;
1272 xcursor_id = XC_watch;
1275 xcursor_id = XC_xterm;
1278 xcursor_id = XC_crosshair;
1281 xcursor_id = XC_sb_v_double_arrow;
1284 xcursor_id = XC_sb_h_double_arrow;
1287 xcursor_id = XC_top_side;
1290 xcursor_id = XC_bottom_side;
1293 xcursor_id = XC_left_side;
1296 xcursor_id = XC_right_side;
1299 xcursor_id = XC_top_left_corner;
1302 xcursor_id = XC_top_right_corner;
1305 xcursor_id = XC_bottom_right_corner;
1308 xcursor_id = XC_bottom_left_corner;
1318 xcursor = m_standard_cursors[xcursor_id];
1321 xcursor = XCreateFontCursor(m_display, xcursor_id);
1323 m_standard_cursors[xcursor_id] = xcursor;
1329Cursor GHOST_WindowX11::getEmptyCursor()
1331 if (!m_empty_cursor) {
1337 blank = XCreateBitmapFromData(
1338 m_display, RootWindow(m_display, m_visualInfo->screen),
data, 1, 1);
1340 m_empty_cursor = XCreatePixmapCursor(m_display, blank, blank, &dummy, &dummy, 0, 0);
1341 XFreePixmap(m_display, blank);
1344 return m_empty_cursor;
1352 if (m_visible_cursor) {
1353 xcursor = m_visible_cursor;
1360 xcursor = getEmptyCursor();
1363 XDefineCursor(m_display, m_window, xcursor);
1380#ifdef GHOST_X11_GRAB
1381 XGrabPointer(m_display,
1384 ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
1402#if defined(WITH_X11_XINPUT) && defined(USE_X11_XINPUT_WARP)
1403 if ((m_system->m_xinput_version.present) && (m_system->m_xinput_version.major_version >= 2))
1406 if (XIGetClientPointer(m_display,
None, &device_id) != False) {
1407 XIWarpPointer(m_display, device_id,
None,
None, 0, 0, 0, 0, 0, 0);
1413 XWarpPointer(m_display,
None,
None, 0, 0, 0, 0, 0, 0);
1426#ifdef GHOST_X11_GRAB
1427 XUngrabPointer(m_display, CurrentTime);
1443 m_visible_cursor = xcursor;
1445 XDefineCursor(m_display, m_window, xcursor);
1454 return getStandardCursor(shape, xcursor);
1465 Colormap colormap = DefaultColormap(m_display, m_visualInfo->screen);
1466 Pixmap bitmap_pix, mask_pix;
1469 if (XAllocNamedColor(m_display, colormap,
"White", &fg, &fg) == 0) {
1472 if (XAllocNamedColor(m_display, colormap,
"Black", &bg, &bg) == 0) {
1476 if (m_custom_cursor) {
1477 XFreeCursor(m_display, m_custom_cursor);
1480 bitmap_pix = XCreateBitmapFromData(m_display, m_window, (
char *)bitmap, sizex, sizey);
1481 mask_pix = XCreateBitmapFromData(m_display, m_window, (
char *)
mask, sizex, sizey);
1483 m_custom_cursor = XCreatePixmapCursor(m_display, bitmap_pix, mask_pix, &fg, &bg, hotX, hotY);
1484 XDefineCursor(m_display, m_window, m_custom_cursor);
1487 m_visible_cursor = m_custom_cursor;
1489 XFreePixmap(m_display, bitmap_pix);
1490 XFreePixmap(m_display, mask_pix);
1492 XFreeColors(m_display, colormap, &fg.pixel, 1, 0
L);
1493 XFreeColors(m_display, colormap, &bg.pixel, 1, 0
L);
1501 char *resMan = XResourceManagerString(m_display);
1503 XrmDatabase xrdb = XrmGetStringDatabase(resMan);
1506 char *type =
nullptr;
1509 int success = XrmGetResource(xrdb,
"Xft.dpi",
"Xft.Dpi", &type, &val);
1510 if (success && type) {
1511 if (
STREQ(type,
"String")) {
1512 dpi = atoi((
const char *)val.addr);
1515 XrmDestroyDatabase(xrdb);
1524 XWindowAttributes attr;
1525 if (!XGetWindowAttributes(m_display, m_window, &attr)) {
1530 Screen *screen = attr.screen;
1531 int pixelWidth = WidthOfScreen(screen);
1532 int pixelHeight = HeightOfScreen(screen);
1533 int mmWidth = WidthMMOfScreen(screen);
1534 int mmHeight = HeightMMOfScreen(screen);
1536 double pixelDiagonal =
sqrt((pixelWidth * pixelWidth) + (pixelHeight * pixelHeight));
1537 double mmDiagonal =
sqrt((mmWidth * mmWidth) + (mmHeight * mmHeight));
1538 float inchDiagonal = mmDiagonal * 0.039f;
1539 int dpi = pixelDiagonal / inchDiagonal;
void BLI_kdtree_nd_ free(KDTree *tree)
#define GHOST_OPENGL_EGL_CONTEXT_FLAGS
#define GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY
#define GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY
#define GHOST_OPENGL_GLX_CONTEXT_FLAGS
static const unsigned long BLENDER_ICONS_WM_X11[]
@ GHOST_kWindowStateMinimized
@ GHOST_kWindowStateMaximized
@ GHOST_kWindowStateNormal
@ GHOST_kWindowStateFullScreen
@ GHOST_kStandardCursorBottomLeftCorner
@ GHOST_kStandardCursorHelp
@ GHOST_kStandardCursorWait
@ GHOST_kStandardCursorTopSide
@ GHOST_kStandardCursorCrosshair
@ GHOST_kStandardCursorLeftRight
@ GHOST_kStandardCursorUpDown
@ GHOST_kStandardCursorBottomSide
@ GHOST_kStandardCursorTopLeftCorner
@ GHOST_kStandardCursorBottomRightCorner
@ GHOST_kStandardCursorDefault
@ GHOST_kStandardCursorRightSide
@ GHOST_kStandardCursorTopRightCorner
@ GHOST_kStandardCursorLeftSide
@ GHOST_kStandardCursorText
static const GHOST_TabletData GHOST_TABLET_DATA_NONE
GHOST_TDrawingContextType
@ GHOST_kWindowOrderBottom
#define _NET_WM_STATE_REMOVE
#define _NET_WM_STATE_ADD
BMesh const char void * data
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
GHOST_TSuccess showMessageBox(const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options) const override
GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parentWindow)
GHOST_Context * newDrawingContext(GHOST_TDrawingContextType type) override
bool getValid() const override
void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
GHOST_TSuccess setClientHeight(uint32_t height) override
void getWindowBounds(GHOST_Rect &bounds) const override
~GHOST_WindowX11() override
GHOST_TWindowState m_post_state
GHOST_TSuccess setState(GHOST_TWindowState state) override
GHOST_TSuccess endProgressBar() override
void getClientBounds(GHOST_Rect &bounds) const override
GHOST_WindowX11(GHOST_SystemX11 *system, Display *display, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_WindowX11 *parentWindow, GHOST_TDrawingContextType type, const bool is_dialog, const bool stereoVisual, const bool exclusive, const bool is_debug, const GHOST_GPUDevice &preferred_device)
void setTitle(const char *title) override
std::string getTitle() const override
GHOST_TSuccess setClientWidth(uint32_t width) override
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override
GHOST_TSuccess setProgressBar(float progress) override
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape) override
GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor) override
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) override
GHOST_TSuccess setWindowCursorVisibility(bool visible) override
void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
bool isDialog() const override
uint16_t getDPIHint() override
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override
GHOST_TSuccess invalidate() override
GHOST_TWindowState getState() const override
GHOST_Rect m_cursorGrabBounds
void setCursorGrabAccum(int32_t x, int32_t y)
GHOST_TGrabCursorMode m_cursorGrab
int32_t m_cursorGrabInitPos[2]
GHOST_TStandardCursor getCursorShape() const override
GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type) override
GHOST_TSuccess releaseNativeHandles()
bool getValid() const override
GHOST_Window(uint32_t width, uint32_t height, GHOST_TWindowState state, const bool wantStereoVisual=false, const bool exclusive=false)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)