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,
114 const bool exclusive,
118 visual_info_(nullptr),
122 invalid_window_(false),
124 custom_cursor_(None),
125 visible_cursor_(None),
127 drop_target_(nullptr),
129 tablet_data_(GHOST_TABLET_DATA_NONE),
130#
if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
134 preferred_device_(preferred_device)
136#ifdef WITH_OPENGL_BACKEND
137 if (type == GHOST_kDrawingContextTypeOpenGL) {
138 visual_info_ = get_x11_visualinfo(display_);
143 XVisualInfo tmp = {
nullptr};
145 visual_info_ = XGetVisualInfo(display_, 0, &tmp, &n);
149 if (visual_info_ ==
nullptr) {
150 fprintf(stderr,
"initial window could not find the GLX extension\n");
154 uint xattributes_valuemask = 0;
156 XSetWindowAttributes xattributes;
157 memset(&xattributes, 0,
sizeof(xattributes));
159 xattributes_valuemask |= CWBorderPixel;
160 xattributes.border_pixel = 0;
164 xattributes_valuemask |= CWEventMask;
165 xattributes.event_mask = ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask |
166 EnterWindowMask | LeaveWindowMask | ButtonPressMask |
167 ButtonReleaseMask | PointerMotionMask | FocusChangeMask |
168 PropertyChangeMask | KeymapStateMask;
171 xattributes_valuemask |= CWOverrideRedirect;
172 xattributes.override_redirect = True;
175 xattributes_valuemask |= CWColormap;
176 xattributes.colormap = XCreateColormap(
177 display_, RootWindow(display_, visual_info_->screen), visual_info_->visual, AllocNone);
180 window_ = XCreateWindow(display_,
181 RootWindow(display_, visual_info_->screen),
189 visual_info_->visual,
190 xattributes_valuemask,
203 atoms[count++] = system_->atom_._NET_WM_STATE_MAXIMIZED_VERT;
204 atoms[count++] = system_->atom_._NET_WM_STATE_MAXIMIZED_HORZ;
207 atoms[count++] = system_->atom_._NET_WM_STATE_FULLSCREEN;
210 XChangeProperty(display_,
212 system_->atom_._NET_WM_STATE,
240 if (is_dialog && parent_window) {
247 XSizeHints *xsizehints = XAllocSizeHints();
248 xsizehints->flags = PPosition | PSize | PMinSize | PMaxSize;
249 xsizehints->x = left;
251 xsizehints->width = width;
252 xsizehints->height = height;
253 xsizehints->min_width = 320;
254 xsizehints->min_height = 240;
255 xsizehints->max_width = 65535;
256 xsizehints->max_height = 65535;
257 XSetWMNormalHints(display_, window_, xsizehints);
263 XClassHint *xclasshint = XAllocClassHint();
265#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
267 xclasshint->res_name =
const_cast<char *
>(GHOST_X11_RES_NAME);
268 xclasshint->res_class =
const_cast<char *
>(GHOST_X11_RES_CLASS);
269 XSetClassHint(display_, window_, xclasshint);
271 const int len = strlen(title) + 1;
272 char *wmclass = (
char *)malloc(
sizeof(
char) *
len);
273 memcpy(wmclass, title,
len *
sizeof(
char));
274 xclasshint->res_name = wmclass;
275 xclasshint->res_class = wmclass;
276 XSetClassHint(display_, window_, xclasshint);
283 if (system_->atom_.WM_PROTOCOLS) {
287 if (system_->atom_.WM_DELETE_WINDOW) {
288 atoms[natom] = system_->atom_.WM_DELETE_WINDOW;
292 if (system_->atom_.WM_TAKE_FOCUS && system_->window_focus_) {
293 atoms[natom] = system_->atom_.WM_TAKE_FOCUS;
299 XSetWMProtocols(display_, window_, atoms, natom);
305 XWMHints *xwmhints = XAllocWMHints();
306 xwmhints->initial_state = NormalState;
307 xwmhints->input = (system_->window_focus_) ? True : False;
308 xwmhints->flags = InputHint | StateHint;
309 XSetWMHints(display, window_, xwmhints);
315 motifShowWindowFrame(
false);
320 Atom _NET_WM_ICON = XInternAtom(display_,
"_NET_WM_ICON", False);
321 XChangeProperty(display_,
327 (
uchar *)BLENDER_ICONS_WM_X11,
333 Atom _NET_WM_PID = XInternAtom(display_,
"_NET_WM_PID", False);
334 pid_t pid = getpid();
336 display_, window_, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, (
uchar *)&pid, 1);
343 XTextProperty text_prop;
345 gethostname(hostname,
sizeof(hostname));
346 hostname[
sizeof(hostname) - 1] =
'\0';
347 text_array[0] = hostname;
349 XStringListToTextProperty(text_array, 1, &text_prop);
350 XSetWMClientMachine(display_, window_, &text_prop);
351 XFree(text_prop.value);
354#ifdef WITH_X11_XINPUT
355 refreshXInputDevices();
364#ifdef WITH_OPENGL_BACKEND
365 if (type == GHOST_kDrawingContextTypeOpenGL) {
367 "A graphics card and driver with support for OpenGL 4.3 or higher is "
368 "required.\n\nInstalling the latest driver for your graphics card might resolve the "
370 const char *help =
"https://www.blender.org/download/requirements/";
375 XDestroyWindow(display_, window_);
383 XMapRaised(display_, window_);
386 XMapWindow(display_, window_);
389 XLowerWindow(display_, window_);
397#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
398static Bool destroyICCallback(XIC , XPointer ptr, XPointer )
403 *(XIC *)ptr =
nullptr;
409bool GHOST_WindowX11::createX11_XIC()
411 XIM xim = system_->getX11_XIM();
417 destroy.callback = (XICProc)destroyICCallback;
418 destroy.client_data = (XPointer)&xic_;
419 xic_ = XCreateIC(xim,
425 XIMPreeditNothing | XIMStatusNothing,
438 XGetICValues(xic_, XNFilterEvents, &fevent,
nullptr);
439 XSelectInput(display_,
441 ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask |
442 EnterWindowMask | LeaveWindowMask | ButtonPressMask | ButtonReleaseMask |
443 PointerMotionMask | FocusChangeMask | PropertyChangeMask | KeymapStateMask |
449#ifdef WITH_X11_XINPUT
450void GHOST_WindowX11::refreshXInputDevices()
452 if (system_->xinput_version_.present) {
453 std::vector<XEventClass> xevents;
455 for (GHOST_SystemX11::GHOST_TabletX11 &xtablet : system_->GetXTablets()) {
462 DeviceMotionNotify(xtablet.Device, xtablet.MotionEvent, ev);
464 xevents.push_back(ev);
466 DeviceButtonPress(xtablet.Device, xtablet.PressEvent, ev);
468 xevents.push_back(ev);
470 ProximityIn(xtablet.Device, xtablet.ProxInEvent, ev);
472 xevents.push_back(ev);
474 ProximityOut(xtablet.Device, xtablet.ProxOutEvent, ev);
476 xevents.push_back(ev);
480 XSelectExtensionEvent(display_, window_, xevents.data(),
int(xevents.size()));
498 Atom name = XInternAtom(display_,
"_NET_WM_NAME", 0);
499 Atom utf8str = XInternAtom(display_,
"UTF8_STRING", 0);
501 display_, window_, name, utf8str, 8, PropModeReplace, (
const uchar *)title, strlen(title));
505 XStoreName(display_, window_, title);
512 char *name =
nullptr;
514 XFetchName(display_, window_, &name);
515 std::string title = name ? name :
"untitled";
530 int x_return, y_return;
531 uint w_return, h_return, border_w_return, depth_return;
534 XGetGeometry(display_,
546 bounds.
l_ = screen_x;
547 bounds.
r_ = bounds.
l_ + w_return;
548 bounds.
t_ = screen_y;
549 bounds.
b_ = bounds.
t_ + h_return;
554 XWindowChanges values;
555 uint value_mask = CWWidth;
556 values.width = width;
557 XConfigureWindow(display_, window_, value_mask, &values);
564 XWindowChanges values;
565 uint value_mask = CWHeight;
566 values.height = height;
567 XConfigureWindow(display_, window_, value_mask, &values);
573 XWindowChanges values;
574 uint value_mask = CWWidth | CWHeight;
575 values.width = width;
576 values.height = height;
577 XConfigureWindow(display_, window_, value_mask, &values);
588 XTranslateCoordinates(
589 display_, RootWindow(display_, visual_info_->screen), window_, 0, 0, &ax, &ay, &temp);
599 XTranslateCoordinates(
600 display_, window_, RootWindow(display_, visual_info_->screen), inX, inY, &ax, &ay, &temp);
608 Atom atom_window_type = XInternAtom(display_,
"_NET_WM_WINDOW_TYPE", False);
609 Atom atom_dialog = XInternAtom(display_,
"_NET_WM_WINDOW_TYPE_DIALOG", False);
613 display_, window_, atom_window_type, XA_ATOM, 32, PropModeReplace, (
uchar *)&atom_dialog, 1);
614 XSetTransientForHint(display_, window_, parent_window->window_);
623 XChangeProperty(display_,
625 system_->atom_._MOTIF_WM_HINTS,
626 system_->atom_._MOTIF_WM_HINTS,
635void GHOST_WindowX11::icccmSetState(
int state)
639 if (
state != IconicState) {
643 xev.xclient.type = ClientMessage;
644 xev.xclient.serial = 0;
645 xev.xclient.send_event = True;
646 xev.xclient.display = display_;
647 xev.xclient.window = window_;
648 xev.xclient.format = 32;
649 xev.xclient.message_type = system_->atom_.WM_CHANGE_STATE;
650 xev.xclient.data.l[0] =
state;
652 RootWindow(display_, visual_info_->screen),
654 SubstructureNotifyMask | SubstructureRedirectMask,
658int GHOST_WindowX11::icccmGetState()
const
664 ulong bytes_after, num_ret;
670 ret = XGetWindowProperty(display_,
672 system_->atom_.WM_STATE,
676 system_->atom_.WM_STATE,
681 ((
uchar **)&prop_ret));
682 if ((ret == Success) && (prop_ret !=
nullptr) && (num_ret == 2)) {
683 st = prop_ret->state;
696void GHOST_WindowX11::netwmMaximized(
bool set)
700 xev.xclient.type = ClientMessage;
701 xev.xclient.serial = 0;
702 xev.xclient.send_event = True;
703 xev.xclient.window = window_;
704 xev.xclient.message_type = system_->atom_._NET_WM_STATE;
705 xev.xclient.format = 32;
714 xev.xclient.data.l[1] = system_->atom_._NET_WM_STATE_MAXIMIZED_HORZ;
715 xev.xclient.data.l[2] = system_->atom_._NET_WM_STATE_MAXIMIZED_VERT;
716 xev.xclient.data.l[3] = 0;
717 xev.xclient.data.l[4] = 0;
719 RootWindow(display_, visual_info_->screen),
721 SubstructureRedirectMask | SubstructureNotifyMask,
725bool GHOST_WindowX11::netwmIsMaximized()
const
728 ulong bytes_after, num_ret, i;
731 int format_ret,
ret, count;
735 ret = XGetWindowProperty(display_,
737 system_->atom_._NET_WM_STATE,
746 (
uchar **)&prop_ret);
747 if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
749 for (i = 0; i < num_ret; i++) {
750 if (prop_ret[i] == system_->atom_._NET_WM_STATE_MAXIMIZED_HORZ) {
753 if (prop_ret[i] == system_->atom_._NET_WM_STATE_MAXIMIZED_VERT) {
769void GHOST_WindowX11::netwmFullScreen(
bool set)
773 xev.xclient.type = ClientMessage;
774 xev.xclient.serial = 0;
775 xev.xclient.send_event = True;
776 xev.xclient.window = window_;
777 xev.xclient.message_type = system_->atom_._NET_WM_STATE;
778 xev.xclient.format = 32;
787 xev.xclient.data.l[1] = system_->atom_._NET_WM_STATE_FULLSCREEN;
788 xev.xclient.data.l[2] = 0;
789 xev.xclient.data.l[3] = 0;
790 xev.xclient.data.l[4] = 0;
792 RootWindow(display_, visual_info_->screen),
794 SubstructureRedirectMask | SubstructureNotifyMask,
798bool GHOST_WindowX11::netwmIsFullScreen()
const
801 ulong bytes_after, num_ret, i;
808 ret = XGetWindowProperty(display_,
810 system_->atom_._NET_WM_STATE,
819 (
uchar **)&prop_ret);
820 if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
821 for (i = 0; i < num_ret; i++) {
822 if (prop_ret[i] == system_->atom_._NET_WM_STATE_FULLSCREEN) {
835void GHOST_WindowX11::motifShowWindowFrame(
bool set)
845 "Only allowed when the window frame is shown.");
849 XChangeProperty(display_,
851 system_->atom_._MOTIF_WM_HINTS,
852 system_->atom_._MOTIF_WM_HINTS,
859bool GHOST_WindowX11::motifIsShowWindowFrame()
const
861 MotifWmHints *prop_ret;
862 ulong bytes_after, num_ret;
869 st = XGetWindowProperty(display_,
871 system_->atom_._MOTIF_WM_HINTS,
875 system_->atom_._MOTIF_WM_HINTS,
880 (
uchar **)&prop_ret);
881 if ((st == Success) && prop_ret) {
895void GHOST_WindowX11::motifFullScreen(
bool set)
898 motifShowWindowFrame(
false);
901 motifShowWindowFrame(
true);
905bool GHOST_WindowX11::motifIsFullScreen()
const
911 return motifIsShowWindowFrame();
920 state = icccmGetState();
925 if (
ELEM(
state, IconicState, WithdrawnState)) {
928 else if (netwmIsFullScreen() == True) {
931 else if (motifIsFullScreen() == True) {
934 else if (netwmIsMaximized() == True) {
943 bool is_max, is_full, is_motif_full;
946 if (
state ==
int(cur_state)) {
955 is_max = netwmIsMaximized();
956 is_full = netwmIsFullScreen();
963 is_motif_full = motifIsFullScreen();
966 state = normal_state_;
970 if (is_max == True) {
971 netwmMaximized(False);
973 if (is_full == True) {
974 netwmFullScreen(False);
976 if (is_motif_full == True) {
977 motifFullScreen(False);
979 icccmSetState(NormalState);
992 normal_state_ = cur_state;
994 if (is_max == True) {
995 netwmMaximized(False);
997 if (is_full == False) {
998 netwmFullScreen(True);
1000 if (is_motif_full == False) {
1001 motifFullScreen(True);
1015 if (is_full == True) {
1016 netwmFullScreen(False);
1018 if (is_motif_full == True) {
1019 motifFullScreen(False);
1021 if (is_max == False) {
1022 netwmMaximized(True);
1032 icccmSetState(IconicState);
1042 XWindowAttributes attr;
1049 XRaiseWindow(display_, window_);
1051 atom = XInternAtom(display_,
"_NET_ACTIVE_WINDOW", True);
1058 xev.xclient.type = ClientMessage;
1059 xev.xclient.serial = 0;
1060 xev.xclient.send_event = True;
1061 xev.xclient.window = window_;
1062 xev.xclient.message_type = atom;
1064 xev.xclient.format = 32;
1065 xev.xclient.data.l[0] = 1;
1066 xev.xclient.data.l[1] = CurrentTime;
1067 xev.xclient.data.l[2] = window_;
1068 xev.xclient.data.l[3] = 0;
1069 xev.xclient.data.l[4] = 0;
1071 root = RootWindow(display_, visual_info_->screen);
1072 eventmask = SubstructureRedirectMask | SubstructureNotifyMask;
1074 XSendEvent(display_, root, False, eventmask, &xev);
1077 XGetWindowAttributes(display_, window_, &attr);
1080 if (attr.map_state == IsViewable) {
1081 XSetInputFocus(display_, window_, RevertToPointerRoot, CurrentTime);
1086 XLowerWindow(display_, window_);
1098 Atom atom_window_type = XInternAtom(display_,
"_NET_WM_WINDOW_TYPE", False);
1099 Atom atom_dialog = XInternAtom(display_,
"_NET_WM_WINDOW_TYPE_DIALOG", False);
1102 ulong bytes_after, num_ret;
1105 int format_ret, ret;
1109 ret = XGetWindowProperty(display_,
1120 (
uchar **)&prop_ret);
1121 if ((ret == Success) && (prop_ret) && (format_ret == 32)) {
1122 if (prop_ret[0] == atom_dialog) {
1149 if (invalid_window_ ==
false) {
1150 system_->addDirtyWindow(
this);
1151 invalid_window_ =
true;
1164 invalid_window_ =
false;
1169 std::map<uint, Cursor>::iterator it = standard_cursors_.begin();
1170 for (; it != standard_cursors_.end(); ++it) {
1171 XFreeCursor(display_, it->second);
1174 if (empty_cursor_) {
1175 XFreeCursor(display_, empty_cursor_);
1177 if (custom_cursor_) {
1178 XFreeCursor(display_, custom_cursor_);
1182 static Atom Primary_atom, Clipboard_atom;
1185 Primary_atom = XInternAtom(display_,
"PRIMARY", False);
1186 Clipboard_atom = XInternAtom(display_,
"CLIPBOARD", False);
1188 p_owner = XGetSelectionOwner(display_, Primary_atom);
1189 c_owner = XGetSelectionOwner(display_, Clipboard_atom);
1191 if (p_owner == window_) {
1192 XSetSelectionOwner(display_, Primary_atom, None, CurrentTime);
1194 if (c_owner == window_) {
1195 XSetSelectionOwner(display_, Clipboard_atom, None, CurrentTime);
1200 XFree(visual_info_);
1203#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
1210 delete drop_target_;
1216 XDestroyWindow(display_, window_);
1223#ifdef WITH_VULKAN_BACKEND
1224 case GHOST_kDrawingContextTypeVulkan: {
1226 GHOST_kVulkanPlatformX11,
1236 if (context->initializeDrawingContext()) {
1244#ifdef WITH_OPENGL_BACKEND
1245 case GHOST_kDrawingContextTypeOpenGL: {
1248 for (
int minor = 6; minor >= 3; --minor) {
1252 EGLNativeWindowType(window_),
1253 EGLNativeDisplayType(display_),
1254 EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
1261 if (context->initializeDrawingContext()) {
1269 for (
int minor = 6; minor >= 3; --minor) {
1274 (GLXFBConfig)fbconfig_,
1275 GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
1281 if (context->initializeDrawingContext()) {
1302 xcursor_id = XC_question_arrow;
1305 xcursor_id = XC_watch;
1308 xcursor_id = XC_xterm;
1311 xcursor_id = XC_crosshair;
1314 xcursor_id = XC_sb_v_double_arrow;
1317 xcursor_id = XC_sb_h_double_arrow;
1320 xcursor_id = XC_top_side;
1323 xcursor_id = XC_bottom_side;
1326 xcursor_id = XC_left_side;
1329 xcursor_id = XC_right_side;
1332 xcursor_id = XC_top_left_corner;
1335 xcursor_id = XC_top_right_corner;
1338 xcursor_id = XC_bottom_right_corner;
1341 xcursor_id = XC_bottom_left_corner;
1351 xcursor = standard_cursors_[xcursor_id];
1354 xcursor = XCreateFontCursor(display_, xcursor_id);
1356 standard_cursors_[xcursor_id] = xcursor;
1362Cursor GHOST_WindowX11::getEmptyCursor()
1364 if (!empty_cursor_) {
1370 blank = XCreateBitmapFromData(
1371 display_, RootWindow(display_, visual_info_->screen), data, 1, 1);
1373 empty_cursor_ = XCreatePixmapCursor(display_, blank, blank, &dummy, &dummy, 0, 0);
1374 XFreePixmap(display_, blank);
1377 return empty_cursor_;
1385 if (visible_cursor_) {
1386 xcursor = visible_cursor_;
1393 xcursor = getEmptyCursor();
1396 XDefineCursor(display_, window_, xcursor);
1413#ifdef GHOST_X11_GRAB
1414 XGrabPointer(display_,
1417 ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
1435#if defined(WITH_X11_XINPUT) && defined(USE_X11_XINPUT_WARP)
1436 if ((system_->xinput_version_.present) && (system_->xinput_version_.major_version >= 2)) {
1438 if (XIGetClientPointer(display_, None, &device_id) != False) {
1439 XIWarpPointer(display_, device_id, None, None, 0, 0, 0, 0, 0, 0);
1445 XWarpPointer(display_, None, None, 0, 0, 0, 0, 0, 0);
1458#ifdef GHOST_X11_GRAB
1459 XUngrabPointer(display_, CurrentTime);
1475 visible_cursor_ = xcursor;
1477 XDefineCursor(display_, window_, xcursor);
1486 return getStandardCursor(shape, xcursor);
1490 const uint8_t *
mask,
1492 const int hot_spot[2],
1495 Colormap colormap = DefaultColormap(display_, visual_info_->screen);
1496 Pixmap bitmap_pix, mask_pix;
1499 if (XAllocNamedColor(display_, colormap,
"White", &fg, &fg) == 0) {
1502 if (XAllocNamedColor(display_, colormap,
"Black", &bg, &bg) == 0) {
1506 if (custom_cursor_) {
1507 XFreeCursor(display_, custom_cursor_);
1510 bitmap_pix = XCreateBitmapFromData(display_, window_, (
char *)bitmap, size[0], size[1]);
1511 mask_pix = XCreateBitmapFromData(display_, window_, (
char *)
mask, size[0], size[1]);
1513 custom_cursor_ = XCreatePixmapCursor(
1514 display_, bitmap_pix, mask_pix, &fg, &bg, hot_spot[0], hot_spot[1]);
1515 XDefineCursor(display_, window_, custom_cursor_);
1518 visible_cursor_ = custom_cursor_;
1520 XFreePixmap(display_, bitmap_pix);
1521 XFreePixmap(display_, mask_pix);
1523 XFreeColors(display_, colormap, &fg.pixel, 1, 0
L);
1524 XFreeColors(display_, colormap, &bg.pixel, 1, 0
L);
1532 if (!system_->native_pixel_) {
1537 char *resMan = XResourceManagerString(display_);
1539 XrmDatabase xrdb = XrmGetStringDatabase(resMan);
1542 char *type =
nullptr;
1545 int success = XrmGetResource(xrdb,
"Xft.dpi",
"Xft.Dpi", &type, &val);
1546 if (success && type) {
1547 if (
STREQ(type,
"String")) {
1548 dpi = atoi((
const char *)val.addr);
1551 XrmDestroyDatabase(xrdb);
1560 XWindowAttributes attr;
1561 if (!XGetWindowAttributes(display_, window_, &attr)) {
1566 Screen *screen = attr.screen;
1567 int pixelWidth = WidthOfScreen(screen);
1568 int pixelHeight = HeightOfScreen(screen);
1569 int mmWidth = WidthMMOfScreen(screen);
1570 int mmHeight = HeightMMOfScreen(screen);
1572 double pixelDiagonal =
sqrt((pixelWidth * pixelWidth) + (pixelHeight * pixelHeight));
1573 double mmDiagonal =
sqrt((mmWidth * mmWidth) + (mmHeight * mmHeight));
1574 float inchDiagonal = mmDiagonal * 0.039f;
1575 int dpi = pixelDiagonal / inchDiagonal;
#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
#define GHOST_ASSERT(x, info)
@ 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
GHOST_TDrawingContextType
@ GHOST_kWindowOrderBottom
#define _NET_WM_STATE_REMOVE
#define _NET_WM_STATE_ADD
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
GHOST_ContextEGL(const GHOST_System *const system, const GHOST_ContextParams &context_params, EGLNativeWindowType nativeWindow, EGLNativeDisplayType nativeDisplay, EGLint contextProfileMask, EGLint contextMajorVersion, EGLint contextMinorVersion, EGLint contextFlags, EGLint contextResetNotificationStrategy, EGLenum api)
GHOST_ContextGLX(const GHOST_ContextParams &context_params, Window window, Display *display, GLXFBConfig fbconfig, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_ContextVK(const GHOST_ContextParams &context_params, GHOST_TVulkanPlatformType platform, Window window, Display *display, wl_surface *wayland_surface, wl_display *wayland_display, const GHOST_ContextVK_WindowInfo *wayland_window_info, int contextMajorVersion, int contextMinorVersion, const GHOST_GPUDevice &preferred_device, const GHOST_WindowHDRInfo *hdr_info_=nullptr)
GHOST_DropTargetX11(GHOST_WindowX11 *window, GHOST_SystemX11 *system)
static bool getUseWindowFrame()
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_Context * newDrawingContext(GHOST_TDrawingContextType type) 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 *parent_window, GHOST_TDrawingContextType type, const bool is_dialog, const GHOST_ContextParams &context_params, const bool exclusive, const GHOST_GPUDevice &preferred_device)
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_TSuccess setState(GHOST_TWindowState state) override
GHOST_TSuccess endProgressBar() override
void getClientBounds(GHOST_Rect &bounds) const override
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 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
GHOST_TSuccess setWindowCustomCursorShape(const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override
bool isDialog() const override
uint16_t getDPIHint() override
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override
GHOST_TSuccess invalidate() override
GHOST_TWindowState post_state_
GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parent_window)
GHOST_TWindowState getState() const override
GHOST_ContextParams want_context_params_
void setCursorGrabAccum(int32_t x, int32_t y)
GHOST_TStandardCursor getCursorShape() const override
GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type) override
int32_t cursor_grab_init_pos_[2]
GHOST_TSuccess releaseNativeHandles()
bool getValid() const override
GHOST_Window(uint32_t width, uint32_t height, GHOST_TWindowState state, const GHOST_ContextParams &context_params, const bool exclusive=false)
GHOST_Rect cursor_grab_bounds_
GHOST_WindowHDRInfo hdr_info_
GHOST_TGrabCursorMode cursor_grab_
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
BMesh const char void * data