21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_X11
26 #include "../SDL_sysvideo.h"
27 #include "../SDL_pixels_c.h"
28 #include "../../events/SDL_keyboard_c.h"
29 #include "../../events/SDL_mouse_c.h"
36 #if SDL_VIDEO_OPENGL_EGL
43 #define _NET_WM_STATE_REMOVE 0l
44 #define _NET_WM_STATE_ADD 1l
46 static Bool isMapNotify(Display *
dpy, XEvent *ev, XPointer win)
48 return ev->type == MapNotify && ev->xmap.window == *((Window*)win);
50 static Bool isUnmapNotify(Display *
dpy, XEvent *ev, XPointer win)
52 return ev->type == UnmapNotify && ev->xunmap.window == *((Window*)win);
78 return (
data->fswindow != 0);
86 XWindowAttributes attr;
88 X11_XGetWindowAttributes(videodata->display,
data->xwindow, &attr);
89 if (attr.map_state != IsUnmapped) {
103 Display *display =
data->videodata->display;
105 unsigned long remain;
106 unsigned long len,
i;
110 if (X11_XGetWindowProperty(display,
data->xwindow, _NET_WM_ALLOWED_ACTIONS, 0, 1024, False, XA_ATOM, &
type, &form, &
len, &remain, (
unsigned char **)&list) == Success)
129 Display *display = videodata->
display;
153 atoms[
count++] = _NET_WM_STATE_ABOVE;
156 atoms[
count++] = _NET_WM_STATE_SKIP_TASKBAR;
157 atoms[
count++] = _NET_WM_STATE_SKIP_PAGER;
160 atoms[
count++] = _NET_WM_STATE_FOCUSED;
163 atoms[
count++] = _NET_WM_STATE_MAXIMIZED_VERT;
164 atoms[
count++] = _NET_WM_STATE_MAXIMIZED_HORZ;
167 atoms[
count++] = _NET_WM_STATE_FULLSCREEN;
173 X11_XChangeProperty(display, xwindow, _NET_WM_STATE, XA_ATOM, 32,
174 PropModeReplace, (
unsigned char *)atoms,
count);
176 X11_XDeleteProperty(display, xwindow, _NET_WM_STATE);
184 Display *display = videodata->
display;
193 unsigned long i, numItems, bytesAfter;
194 unsigned char *propertyValue =
NULL;
198 if (X11_XGetWindowProperty(display, xwindow, _NET_WM_STATE,
200 &actualFormat, &numItems, &bytesAfter,
201 &propertyValue) == Success) {
202 Atom *atoms = (Atom *) propertyValue;
206 for (
i = 0;
i < numItems; ++
i) {
207 if (atoms[
i] == _NET_WM_STATE_HIDDEN) {
209 }
else if (atoms[
i] == _NET_WM_STATE_FOCUSED) {
211 }
else if (atoms[
i] == _NET_WM_STATE_MAXIMIZED_VERT) {
213 }
else if (atoms[
i] == _NET_WM_STATE_MAXIMIZED_HORZ) {
215 }
else if ( atoms[
i] == _NET_WM_STATE_FULLSCREEN) {
219 if (maximized == 3) {
223 if (fullscreen == 1) {
232 XWindowAttributes attr;
234 X11_XGetWindowAttributes(videodata->
display, xwindow, &attr);
235 if (attr.map_state == IsUnmapped) {
239 X11_XFree(propertyValue);
264 #ifdef X_HAVE_UTF8_STRING
265 if (SDL_X11_HAVE_UTF8 && videodata->
im) {
267 X11_XCreateIC(videodata->
im, XNClientWindow,
w, XNFocusWindow,
w,
268 XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
272 data->created = created;
273 data->videodata = videodata;
277 if (numwindows < windowlistlength) {
278 windowlist[numwindows] =
data;
284 1) *
sizeof(*windowlist));
289 windowlist[numwindows] =
data;
297 XWindowAttributes attrib;
299 X11_XGetWindowAttributes(
data->videodata->display,
w, &attrib);
303 window->h = attrib.height;
304 if (attrib.map_state != IsUnmapped) {
309 data->visual = attrib.visual;
310 data->colormap = attrib.colormap;
318 X11_XGetInputFocus(
data->videodata->display, &FocalWindow, &RevertTo);
347 Atom WM_HINTS = X11_XInternAtom(display,
"_MOTIF_WM_HINTS", True);
348 if (WM_HINTS != None) {
353 unsigned long functions;
354 unsigned long decorations;
356 unsigned long status;
358 (1L << 1), 0,
border ? 1 : 0, 0, 0
361 X11_XChangeProperty(display,
window, WM_HINTS, WM_HINTS, 32,
362 PropModeReplace, (
unsigned char *) &MWMHints,
363 sizeof(MWMHints) /
sizeof(
long));
365 X11_XSetTransientForHint(display,
window, RootWindow(display,
screen));
376 Display *display =
data->display;
377 int screen = displaydata->screen;
380 XSetWindowAttributes xattr;
382 XSizeHints *sizehints;
384 XClassHint *classhints;
385 Atom _NET_WM_BYPASS_COMPOSITOR;
386 Atom _NET_WM_WINDOW_TYPE;
388 const char *wintype_name =
NULL;
393 #if SDL_VIDEO_OPENGL_GLX || SDL_VIDEO_OPENGL_EGL
396 if (forced_visual_id !=
NULL && forced_visual_id[0] !=
'\0')
398 XVisualInfo *vi,
template;
403 vi = X11_XGetVisualInfo(display, VisualIDMask, &
template, &nvis);
416 XVisualInfo *vinfo =
NULL;
418 #if SDL_VIDEO_OPENGL_EGL
425 vinfo = X11_GLES_GetVisual(
_this, display,
screen);
429 #if SDL_VIDEO_OPENGL_GLX
437 visual = vinfo->visual;
438 depth = vinfo->depth;
443 visual = displaydata->visual;
444 depth = displaydata->depth;
448 xattr.background_pixmap = None;
449 xattr.border_pixel = 0;
451 if (visual->class == DirectColor) {
455 int rmax, gmax, bmax;
456 int rmask, gmask, bmask;
457 int rshift, gshift, bshift;
460 X11_XCreateColormap(display, RootWindow(display,
screen),
464 if (!xattr.colormap) {
465 return SDL_SetError(
"Could not create writable colormap");
469 colorcells =
SDL_malloc(visual->map_entries *
sizeof(XColor));
473 ncolors = visual->map_entries;
479 rmask = visual->red_mask;
480 while (0 == (rmask & 1)) {
486 gmask = visual->green_mask;
487 while (0 == (gmask & 1)) {
493 bmask = visual->blue_mask;
494 while (0 == (bmask & 1)) {
500 for (
i = 0;
i < ncolors;
i++) {
505 Uint32 rbits = (rmask *
i) / (ncolors - 1);
506 Uint32 gbits = (gmask *
i) / (ncolors - 1);
507 Uint32 bbits = (bmask *
i) / (ncolors - 1);
510 (rbits << rshift) | (gbits << gshift) | (bbits << bshift);
512 colorcells[
i].pixel = pix;
514 colorcells[
i].red =
red;
515 colorcells[
i].green =
green;
516 colorcells[
i].blue =
blue;
518 colorcells[
i].flags = DoRed | DoGreen | DoBlue;
521 X11_XStoreColors(display, xattr.colormap, colorcells, ncolors);
526 X11_XCreateColormap(display, RootWindow(display,
screen),
530 w = X11_XCreateWindow(display, RootWindow(display,
screen),
532 0,
depth, InputOutput, visual,
533 (CWOverrideRedirect | CWBackPixmap | CWBorderPixel |
534 CWColormap), &xattr);
539 SetWindowBordered(display,
screen,
w,
542 sizehints = X11_XAllocSizeHints();
544 sizehints->flags = 0;
546 sizehints->min_width = sizehints->max_width =
window->w;
547 sizehints->min_height = sizehints->max_height =
window->h;
548 sizehints->flags |= (PMaxSize | PMinSize);
552 sizehints->flags |= USPosition;
555 wmhints = X11_XAllocWMHints();
556 wmhints->input = True;
557 wmhints->window_group =
data->window_group;
558 wmhints->flags = InputHint | WindowGroupHint;
561 classhints = X11_XAllocClassHint();
562 classhints->res_name =
data->classname;
563 classhints->res_class =
data->classname;
566 X11_XSetWMProperties(display,
w,
NULL,
NULL,
NULL, 0, sizehints, wmhints, classhints);
568 X11_XFree(sizehints);
570 X11_XFree(classhints);
573 long pid = (long)
data->pid;
574 _NET_WM_PID = X11_XInternAtom(display,
"_NET_WM_PID", False);
575 X11_XChangeProperty(display,
w, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace,
576 (
unsigned char *) &pid, 1);
585 wintype_name =
"_NET_WM_WINDOW_TYPE_UTILITY";
587 wintype_name =
"_NET_WM_WINDOW_TYPE_TOOLTIP";
589 wintype_name =
"_NET_WM_WINDOW_TYPE_POPUP_MENU";
591 wintype_name =
"_NET_WM_WINDOW_TYPE_NORMAL";
596 _NET_WM_WINDOW_TYPE = X11_XInternAtom(display,
"_NET_WM_WINDOW_TYPE", False);
597 wintype = X11_XInternAtom(display, wintype_name, False);
598 X11_XChangeProperty(display,
w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
599 PropModeReplace, (
unsigned char *)&wintype, 1);
601 _NET_WM_BYPASS_COMPOSITOR = X11_XInternAtom(display,
"_NET_WM_BYPASS_COMPOSITOR", False);
602 X11_XChangeProperty(display,
w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
604 (
unsigned char *)&compositor, 1);
611 protocols[proto_count++] =
data->WM_DELETE_WINDOW;
612 protocols[proto_count++] =
data->WM_TAKE_FOCUS;
616 protocols[proto_count++] =
data->_NET_WM_PING;
619 SDL_assert(proto_count <=
sizeof(protocols) /
sizeof(protocols[0]));
621 X11_XSetWMProtocols(display,
w, protocols, proto_count);
625 X11_XDestroyWindow(display,
w);
638 #if SDL_VIDEO_OPENGL_EGL
639 if (!
_this->egl_data) {
647 return SDL_SetError(
"Could not create GLES window surface");
650 return SDL_SetError(
"Could not create GLES window surface (EGL support not configured)");
656 #ifdef X_HAVE_UTF8_STRING
657 if (SDL_X11_HAVE_UTF8 && windowdata->
ic) {
658 X11_XGetICValues(windowdata->
ic, XNFilterEvents, &fevent,
NULL);
664 X11_XSelectInput(display,
w,
665 (FocusChangeMask | EnterWindowMask | LeaveWindowMask |
666 ExposureMask | ButtonPressMask | ButtonReleaseMask |
667 PointerMotionMask | KeyPressMask | KeyReleaseMask |
668 PropertyChangeMask | StructureNotifyMask |
669 KeymapStateMask | fevent));
679 Window
w = (Window)
data;
693 Display *display =
data->display;
694 int status, real_format;
696 unsigned long items_read, items_left;
697 unsigned char *propdata;
700 status = X11_XGetWindowProperty(display, xwindow,
data->_NET_WM_NAME,
701 0L, 8192L, False,
data->UTF8_STRING, &real_type, &real_format,
702 &items_read, &items_left, &propdata);
703 if (status == Success && propdata) {
707 status = X11_XGetWindowProperty(display, xwindow, XA_WM_NAME,
708 0L, 8192L, False, XA_STRING, &real_type, &real_format,
709 &items_read, &items_left, &propdata);
710 if (status == Success && propdata) {
725 XTextProperty titleprop;
728 char *title_locale =
NULL;
730 #ifdef X_HAVE_UTF8_STRING
731 Atom _NET_WM_NAME =
data->videodata->_NET_WM_NAME;
740 status = X11_XStringListToTextProperty(&title_locale, 1, &titleprop);
743 X11_XSetTextProperty(display,
data->xwindow, &titleprop, XA_WM_NAME);
744 X11_XFree(titleprop.value);
746 #ifdef X_HAVE_UTF8_STRING
747 if (SDL_X11_HAVE_UTF8) {
748 status = X11_Xutf8TextListToTextProperty(display, (
char **) &title, 1,
749 XUTF8StringStyle, &titleprop);
750 if (status == Success) {
751 X11_XSetTextProperty(display,
data->xwindow, &titleprop,
753 X11_XFree(titleprop.value);
766 Atom _NET_WM_ICON =
data->videodata->_NET_WM_ICON;
774 propsize = 2 + (icon->
w * icon->
h);
775 propdata =
SDL_malloc(propsize *
sizeof(
long));
781 propdata[0] = icon->
w;
782 propdata[1] = icon->
h;
784 for (
y = 0;
y < icon->
h; ++
y) {
786 for (
x = 0;
x < icon->
w; ++
x) {
790 X11_XChangeProperty(display,
data->xwindow, _NET_WM_ICON, XA_CARDINAL,
791 32, PropModeReplace, (
unsigned char *) propdata,
796 X11_XDeleteProperty(display,
data->xwindow, _NET_WM_ICON);
806 unsigned int childCount;
807 Window childReturn, root, parent;
809 XWindowAttributes attrs;
813 X11_XSync(display, False);
814 X11_XQueryTree(display,
data->xwindow, &root, &parent, &children, &childCount);
815 X11_XGetWindowAttributes(display,
data->xwindow, &attrs);
816 X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display),
817 attrs.x, attrs.y, &orig_x, &orig_y, &childReturn);
827 X11_XSync(display, False);
828 X11_XGetWindowAttributes(display,
data->xwindow, &attrs);
829 X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display),
830 attrs.x, attrs.y, &
x, &
y, &childReturn);
832 if ((
x != orig_x) || (
y != orig_y)) {
855 XSizeHints *sizehints = X11_XAllocSizeHints();
858 X11_XGetWMNormalHints(display,
data->xwindow, sizehints, &userhints);
860 sizehints->min_width =
window->min_w;
861 sizehints->min_height =
window->min_h;
862 sizehints->flags |= PMinSize;
864 X11_XSetWMNormalHints(display,
data->xwindow, sizehints);
866 X11_XFree(sizehints);
871 X11_XRaiseWindow(display,
data->xwindow);
884 XSizeHints *sizehints = X11_XAllocSizeHints();
887 X11_XGetWMNormalHints(display,
data->xwindow, sizehints, &userhints);
889 sizehints->max_width =
window->max_w;
890 sizehints->max_height =
window->max_h;
891 sizehints->flags |= PMaxSize;
893 X11_XSetWMNormalHints(display,
data->xwindow, sizehints);
895 X11_XFree(sizehints);
900 X11_XRaiseWindow(display,
data->xwindow);
911 XWindowAttributes attrs;
915 X11_XSync(display, False);
916 X11_XGetWindowAttributes(display,
data->xwindow, &attrs);
917 orig_w = attrs.width;
918 orig_h = attrs.height;
926 XSizeHints *sizehints = X11_XAllocSizeHints();
929 X11_XGetWMNormalHints(display,
data->xwindow, sizehints, &userhints);
931 sizehints->min_width = sizehints->max_width =
window->w;
932 sizehints->min_height = sizehints->max_height =
window->h;
933 sizehints->flags |= PMinSize | PMaxSize;
935 X11_XSetWMNormalHints(display,
data->xwindow, sizehints);
937 X11_XFree(sizehints);
957 X11_XRaiseWindow(display,
data->xwindow);
966 X11_XSync(display, False);
967 X11_XGetWindowAttributes(display,
data->xwindow, &attrs);
969 if ((attrs.width != orig_w) || (attrs.height != orig_h)) {
973 }
else if ((attrs.width ==
window->w) && (attrs.height ==
window->h)) {
1003 Atom _NET_WM_WINDOW_OPACITY =
data->videodata->_NET_WM_WINDOW_OPACITY;
1005 if (opacity == 1.0f) {
1006 X11_XDeleteProperty(display,
data->xwindow, _NET_WM_WINDOW_OPACITY);
1008 const Uint32 FullyOpaque = 0xFFFFFFFF;
1009 const long alpha = (long) ((
double)opacity * (double)FullyOpaque);
1010 X11_XChangeProperty(display,
data->xwindow, _NET_WM_WINDOW_OPACITY, XA_CARDINAL, 32,
1011 PropModeReplace, (
unsigned char *)&
alpha, 1);
1021 Display *display =
data->videodata->display;
1023 X11_XSetTransientForHint(display,
data->xwindow, parent_data->xwindow);
1033 X11_XSetInputFocus(display,
data->xwindow, RevertToNone, CurrentTime);
1034 X11_XFlush(display);
1048 Display *display =
data->videodata->display;
1051 SetWindowBordered(display, displaydata->screen,
data->xwindow, bordered);
1052 X11_XFlush(display);
1055 XWindowAttributes attr;
1057 X11_XSync(display, False);
1058 X11_XGetWindowAttributes(display,
data->xwindow, &attr);
1059 }
while (attr.map_state != IsViewable);
1062 X11_XSetInputFocus(display,
data->xwindow, RevertToParent, CurrentTime);
1067 X11_XSync(display, False);
1068 X11_XCheckIfEvent(display, &
event, &isUnmapNotify, (XPointer)&
data->xwindow);
1069 X11_XCheckIfEvent(display, &
event, &isMapNotify, (XPointer)&
data->xwindow);
1078 XSizeHints *sizehints = X11_XAllocSizeHints();
1081 X11_XGetWMNormalHints(display,
data->xwindow, sizehints, &userhints);
1085 const int maxsize = 0x7FFFFFFF;
1086 sizehints->min_width =
window->min_w;
1087 sizehints->min_height =
window->min_h;
1088 sizehints->max_width = (
window->max_w == 0) ? maxsize :
window->max_w;
1089 sizehints->max_height = (
window->max_h == 0) ? maxsize :
window->max_h;
1091 sizehints->min_width =
window->w;
1092 sizehints->min_height =
window->h;
1093 sizehints->max_width =
window->w;
1094 sizehints->max_height =
window->h;
1096 sizehints->flags |= PMinSize | PMaxSize;
1098 X11_XSetWMNormalHints(display,
data->xwindow, sizehints);
1100 X11_XFree(sizehints);
1105 X11_XRaiseWindow(display,
data->xwindow);
1107 X11_XFlush(display);
1118 X11_XMapRaised(display,
data->xwindow);
1123 X11_XIfEvent(display, &
event, &isMapNotify, (XPointer)&
data->xwindow);
1124 X11_XFlush(display);
1127 if (!
data->videodata->net_wm) {
1129 X11_XSetInputFocus(display,
data->xwindow, RevertToNone, CurrentTime);
1130 X11_XFlush(display);
1139 Display *display =
data->videodata->display;
1143 X11_XWithdrawWindow(display,
data->xwindow, displaydata->screen);
1146 X11_XIfEvent(display, &
event, &isUnmapNotify, (XPointer)&
data->xwindow);
1147 X11_XFlush(display);
1157 Display *display =
data->videodata->display;
1158 Atom _NET_ACTIVE_WINDOW =
data->videodata->_NET_ACTIVE_WINDOW;
1166 e.xany.type = ClientMessage;
1167 e.xclient.message_type = _NET_ACTIVE_WINDOW;
1168 e.xclient.format = 32;
1169 e.xclient.window =
data->xwindow;
1170 e.xclient.data.l[0] = 1;
1171 e.xclient.data.l[1] =
data->user_time;
1172 e.xclient.data.l[2] = 0;
1174 X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
1175 SubstructureNotifyMask | SubstructureRedirectMask, &
e);
1177 X11_XFlush(display);
1187 X11_XRaiseWindow(display,
data->xwindow);
1189 X11_XFlush(display);
1198 Display *display =
data->videodata->display;
1199 Atom _NET_WM_STATE =
data->videodata->_NET_WM_STATE;
1200 Atom _NET_WM_STATE_MAXIMIZED_VERT =
data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
1201 Atom _NET_WM_STATE_MAXIMIZED_HORZ =
data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
1213 e.xany.type = ClientMessage;
1214 e.xclient.message_type = _NET_WM_STATE;
1215 e.xclient.format = 32;
1216 e.xclient.window =
data->xwindow;
1217 e.xclient.data.l[0] =
1218 maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
1219 e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT;
1220 e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ;
1221 e.xclient.data.l[3] = 0
l;
1223 X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
1224 SubstructureNotifyMask | SubstructureRedirectMask, &
e);
1228 X11_XFlush(display);
1243 Display *display =
data->videodata->display;
1245 X11_XIconifyWindow(display,
data->xwindow, displaydata->screen);
1246 X11_XFlush(display);
1263 Display *display =
data->videodata->display;
1264 Atom _NET_WM_STATE =
data->videodata->_NET_WM_STATE;
1265 Atom _NET_WM_STATE_FULLSCREEN =
data->videodata->_NET_WM_STATE_FULLSCREEN;
1273 XSizeHints *sizehints = X11_XAllocSizeHints();
1275 X11_XGetWMNormalHints(display,
data->xwindow, sizehints, &
flags);
1279 sizehints->flags &= ~(PMinSize | PMaxSize);
1282 sizehints->flags |= PMinSize | PMaxSize;
1283 sizehints->min_width = sizehints->max_width =
window->windowed.w;
1284 sizehints->min_height = sizehints->max_height =
window->windowed.h;
1286 X11_XSetWMNormalHints(display,
data->xwindow, sizehints);
1287 X11_XFree(sizehints);
1291 e.xany.type = ClientMessage;
1292 e.xclient.message_type = _NET_WM_STATE;
1293 e.xclient.format = 32;
1294 e.xclient.window =
data->xwindow;
1295 e.xclient.data.l[0] =
1296 fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
1297 e.xclient.data.l[1] = _NET_WM_STATE_FULLSCREEN;
1298 e.xclient.data.l[3] = 0
l;
1300 X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
1301 SubstructureNotifyMask | SubstructureRedirectMask, &
e);
1307 e.xany.type = ClientMessage;
1308 e.xclient.message_type = _NET_WM_STATE;
1309 e.xclient.format = 32;
1310 e.xclient.window =
data->xwindow;
1311 e.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
1312 e.xclient.data.l[1] =
data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
1313 e.xclient.data.l[2] =
data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
1314 e.xclient.data.l[3] = 0
l;
1315 X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
1316 SubstructureNotifyMask | SubstructureRedirectMask, &
e);
1330 if (
data->visual->class == DirectColor) {
1332 X11_XInstallColormap(display,
data->colormap);
1334 X11_XUninstallColormap(display,
data->colormap);
1338 X11_XFlush(display);
1347 Visual *visual =
data->visual;
1348 Display *display =
data->videodata->display;
1349 const int screen = displaydata->screen;
1350 Window root = RootWindow(display,
screen);
1351 const int def_vis = (visual == DefaultVisual(display,
screen));
1352 unsigned long xattrmask = 0;
1353 XSetWindowAttributes xattr;
1357 if (
data->fswindow ) {
1364 xattr.override_redirect = True;
1365 xattrmask |= CWOverrideRedirect;
1366 xattr.background_pixel = def_vis ? BlackPixel(display,
screen) : 0;
1367 xattrmask |= CWBackPixel;
1368 xattr.border_pixel = 0;
1369 xattrmask |= CWBorderPixel;
1370 xattr.colormap =
data->colormap;
1371 xattrmask |= CWColormap;
1373 data->fswindow = X11_XCreateWindow(display, root,
1375 displaydata->depth, InputOutput,
1376 visual, xattrmask, &xattr);
1378 X11_XSelectInput(display,
data->fswindow, StructureNotifyMask);
1379 X11_XSetWindowBackground(display,
data->fswindow, 0);
1380 X11_XInstallColormap(display,
data->colormap);
1381 X11_XClearWindow(display,
data->fswindow);
1382 X11_XMapRaised(display,
data->fswindow);
1385 X11_XUngrabPointer(display, CurrentTime);
1386 X11_XWarpPointer(display, None, root, 0, 0, 0, 0,
rect.
x,
rect.
y);
1389 X11_XIfEvent(display, &ev, &isMapNotify, (XPointer)&
data->fswindow);
1390 X11_XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&
data->fswindow);
1392 #if SDL_VIDEO_DRIVER_X11_XVIDMODE
1393 if ( displaydata->use_vidmode ) {
1394 X11_XF86VidModeLockModeSwitch(display,
screen, True);
1398 SetWindowBordered(display, displaydata->screen,
data->xwindow,
SDL_FALSE);
1401 X11_XReparentWindow(display,
data->xwindow,
data->fswindow,
1405 X11_XWarpPointer(display, None, root, 0, 0, 0, 0,
rect.
x,
rect.
y);
1410 X11_XWarpPointer(display, None, root, 0, 0, 0, 0,
rect.
x,
rect.
y);
1413 X11_XIfEvent(display, &ev, &isMapNotify, (XPointer)&
data->xwindow);
1414 X11_XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&
data->xwindow);
1424 Display *display =
data->videodata->display;
1425 const int screen = displaydata->screen;
1426 Window root = RootWindow(display,
screen);
1427 Window fswindow =
data->fswindow;
1430 if (!
data->fswindow) {
1434 data->fswindow = None;
1436 #if SDL_VIDEO_DRIVER_X11_VIDMODE
1437 if ( displaydata->use_vidmode ) {
1438 X11_XF86VidModeLockModeSwitch(display,
screen, False);
1447 X11_XSync(display, False);
1448 X11_XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&
data->xwindow);
1449 X11_XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&
data->xwindow);
1451 SetWindowBordered(display,
screen,
data->xwindow,
1454 X11_XWithdrawWindow(display, fswindow,
screen);
1457 X11_XIfEvent(display, &ev, &isUnmapNotify, (XPointer)&fswindow);
1458 X11_XDestroyWindow(display, fswindow);
1467 const char *env =
SDL_getenv(
"SDL_VIDEO_X11_LEGACY_FULLSCREEN");
1473 if ( displaydata->use_vidmode ) {
1475 }
else if ( !videodata->
net_wm ) {
1486 X11_BeginWindowFullscreenLegacy(
_this,
window, _display);
1488 X11_EndWindowFullscreenLegacy(
_this,
window, _display);
1491 X11_SetWindowFullscreenViaWM(
_this,
window, _display, fullscreen);
1501 Visual *visual =
data->visual;
1502 Colormap colormap =
data->colormap;
1505 int rmask, gmask, bmask;
1506 int rshift, gshift, bshift;
1509 if (visual->class != DirectColor) {
1510 return SDL_SetError(
"Window doesn't have DirectColor visual");
1513 ncolors = visual->map_entries;
1514 colorcells =
SDL_malloc(ncolors *
sizeof(XColor));
1520 rmask = visual->red_mask;
1521 while (0 == (rmask & 1)) {
1527 gmask = visual->green_mask;
1528 while (0 == (gmask & 1)) {
1534 bmask = visual->blue_mask;
1535 while (0 == (bmask & 1)) {
1541 for (
i = 0;
i < ncolors;
i++) {
1542 Uint32 rbits = (rmask *
i) / (ncolors - 1);
1543 Uint32 gbits = (gmask *
i) / (ncolors - 1);
1544 Uint32 bbits = (bmask *
i) / (ncolors - 1);
1545 Uint32 pix = (rbits << rshift) | (gbits << gshift) | (bbits << bshift);
1547 colorcells[
i].pixel = pix;
1549 colorcells[
i].red = ramp[(0 * 256) +
i];
1550 colorcells[
i].green = ramp[(1 * 256) +
i];
1551 colorcells[
i].blue = ramp[(2 * 256) +
i];
1553 colorcells[
i].flags = DoRed | DoGreen | DoBlue;
1556 X11_XStoreColors(display, colormap, colorcells, ncolors);
1557 X11_XFlush(display);
1575 oldstyle_fullscreen = X11_IsWindowLegacyFullscreen(
_this,
window);
1577 if (oldstyle_fullscreen || grabbed) {
1586 if (!
data->videodata->broken_pointer_grab) {
1587 const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask;
1592 for (attempts = 0; attempts < 100; attempts++) {
1593 result = X11_XGrabPointer(display,
data->xwindow, True,
mask, GrabModeAsync,
1594 GrabModeAsync,
data->xwindow, None, CurrentTime);
1595 if (
result == GrabSuccess) {
1601 if (
result != GrabSuccess) {
1608 X11_XRaiseWindow(display,
data->xwindow);
1617 grab_keyboard = oldstyle_fullscreen;
1619 if (grab_keyboard) {
1620 X11_XGrabKeyboard(display,
data->xwindow, True, GrabModeAsync,
1621 GrabModeAsync, CurrentTime);
1624 X11_XUngrabPointer(display, CurrentTime);
1625 X11_XUngrabKeyboard(display, CurrentTime);
1627 X11_XSync(display, False);
1637 Display *display = videodata->
display;
1643 for (
i = 0;
i < numwindows; ++
i) {
1645 windowlist[
i] = windowlist[numwindows - 1];
1646 windowlist[numwindows - 1] =
NULL;
1652 #ifdef X_HAVE_UTF8_STRING
1654 X11_XDestroyIC(
data->ic);
1657 if (
data->created) {
1658 X11_XDestroyWindow(display,
data->xwindow);
1659 X11_XFlush(display);
1678 display =
data->videodata->display;
1683 info->
info.
x11.display = display;
1687 SDL_SetError(
"Application not compiled with SDL %d.%d",
1704 Atom XdndAware = X11_XInternAtom(display,
"XdndAware", False);
1707 Atom xdnd_version = 5;
1708 X11_XChangeProperty(display,
data->xwindow, XdndAware, XA_ATOM, 32,
1709 PropModeReplace, (
unsigned char*)&xdnd_version, 1);
1711 X11_XDeleteProperty(display,
data->xwindow, XdndAware);
#define SDL_assert(condition)
#define SDL_VIDEO_OPENGL_ES
#define SDL_GetHintBoolean
#define SDL_IsShapedWindow
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
#define SDL_OutOfMemory()
#define SDL_HINT_GRAB_KEYBOARD
A variable controlling whether grabbing input grabs the keyboard.
#define SDL_HINT_VIDEO_X11_NET_WM_PING
A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID
A variable forcing the visual ID chosen for new X11 windows.
#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR
A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
#define SDL_HINT_VIDEO_X11_FORCE_EGL
A variable controlling whether X11 should use GLX or EGL by default.
void SDL_SetKeyboardFocus(SDL_Window *window)
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei GLsizei GLint border
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLdouble GLdouble GLdouble GLdouble top
GLbitfield GLuint64 timeout
GLfloat GLfloat GLfloat alpha
GLubyte GLubyte GLubyte GLubyte w
@ SDL_PIXELFORMAT_ARGB8888
#define SDL_arraysize(array)
#define SDL_iconv_utf8_locale(S)
#define SDL_static_cast(type, expression)
void SDL_UpdateWindowGrab(SDL_Window *window)
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
#define SDL_MINOR_VERSION
#define SDL_MAJOR_VERSION
static SDL_VideoDevice * _this
@ SDL_WINDOW_ALWAYS_ON_TOP
@ SDL_WINDOW_SKIP_TASKBAR
@ SDL_WINDOW_INPUT_GRABBED
@ SDL_GL_CONTEXT_PROFILE_ES
int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
int X11_ResizeWindowShape(SDL_Window *window)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display int int int return Display long XVisualInfo int return Display Window Atom long long Bool Atom Atom int unsigned long unsigned long unsigned char * l)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display dpy)
char * X11_GetWindowTitle(_THIS, Window xwindow)
void X11_RaiseWindow(_THIS, SDL_Window *window)
void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window)
int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
void X11_MinimizeWindow(_THIS, SDL_Window *window)
int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
void X11_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
void X11_SetWindowTitle(_THIS, SDL_Window *window)
void X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags)
void X11_SetWindowMinimumSize(_THIS, SDL_Window *window)
void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept)
void X11_SetWindowPosition(_THIS, SDL_Window *window)
int X11_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
void X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
void X11_MaximizeWindow(_THIS, SDL_Window *window)
void X11_HideWindow(_THIS, SDL_Window *window)
void X11_DestroyWindow(_THIS, SDL_Window *window)
int X11_SetWindowInputFocus(_THIS, SDL_Window *window)
void X11_SetWindowSize(_THIS, SDL_Window *window)
void X11_ShowWindow(_THIS, SDL_Window *window)
int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity)
int X11_CreateWindow(_THIS, SDL_Window *window)
void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right)
Uint32 X11_GetNetWMState(_THIS, Window xwindow)
void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable)
SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void X11_SetWindowMaximumSize(_THIS, SDL_Window *window)
void X11_RestoreWindow(_THIS, SDL_Window *window)
EGLSurface EGLNativeWindowType * window
#define SDL_VIDEO_OPENGL_EGL
#define SDL_VIDEO_OPENGL_GLX
#define SDL_VIDEO_OPENGL_ES2
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF lsl PF lsl PF endif SIZE macro preload_middle scratch_holds_offset if bpp if else PF PF endif endif endif endm macro preload_trailing base if bpp if bpp *pix_per_block PF PF lsl PF PF PF PF PF else PF lsl PF lsl PF PF PF PF PF base if bpp if narrow_case &&bpp<=dst_w_bpp) PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, LSL #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 90f PF pld,[WK1]90:.else PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, lsl #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 92f91:PF add, WK0, WK0, #32 PF cmp, WK0, WK1 PF pld,[WK0] PF bne, 91b92:.endif .endif.endm.macro conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond X, X, #8 *numbytes/dst_w_bpp .endif process_tail cond, numbytes, firstreg .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst cond, numbytes, firstreg, DST .endif.endm.macro conditional_process1 cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_BRANCH_OVER .ifc cond, mi bpl 100f .endif .ifc cond, cs bcc 100f .endif .ifc cond, ne beq 100f .endif conditional_process1_helper, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx100:.else conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .endif.endm.macro conditional_process2 test, cond1, cond2, process_head, process_tail, numbytes1, numbytes2, firstreg1, firstreg2, unaligned_src, unaligned_mask, decrementx .if(flags) &(FLAG_DST_READWRITE|FLAG_BRANCH_OVER|FLAG_PROCESS_CORRUPTS_PSR|FLAG_PROCESS_DOES_STORE) test conditional_process1 cond1, process_head, process_tail, numbytes1, firstreg1, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_PROCESS_CORRUPTS_PSR test .endif conditional_process1 cond2, process_head, process_tail, numbytes2, firstreg2, unaligned_src, unaligned_mask, decrementx .else test process_head cond1, numbytes1, firstreg1, unaligned_src, unaligned_mask, 0 process_head cond2, numbytes2, firstreg2, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond1 X, X, #8 *numbytes1/dst_w_bpp sub &cond2 X, X, #8 *numbytes2/dst_w_bpp .endif process_tail cond1, numbytes1, firstreg1 process_tail cond2, numbytes2, firstreg2 pixst cond1, numbytes1, firstreg1, DST pixst cond2, numbytes2, firstreg2, DST .endif.endm.macro test_bits_1_0_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-1 .else movs SCRATCH, WK0, lsl #32-1 .endif.endm.macro test_bits_3_2_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-3 .else movs SCRATCH, WK0, lsl #32-3 .endif.endm.macro leading_15bytes process_head, process_tail .set DECREMENT_X, 1 .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 .set DECREMENT_X, 0 sub X, X, WK0, lsr #dst_bpp_shift str X,[sp, #LINE_SAVED_REG_COUNT *4] mov X, WK0 .endif .if dst_w_bpp==8 conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X .elseif dst_w_bpp==16 test_bits_1_0_ptr conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X .endif conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 ldr X,[sp, #LINE_SAVED_REG_COUNT *4] .endif.endm.macro test_bits_3_2_pix movs SCRATCH, X, lsl #dst_bpp_shift+32-3.endm.macro test_bits_1_0_pix .if dst_w_bpp==8 movs SCRATCH, X, lsl #dst_bpp_shift+32-1 .else movs SCRATCH, X, lsr #1 .endif.endm.macro trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask conditional_process2 test_bits_3_2_pix, cs, mi, process_head, process_tail, 8, 4, 0, 2, unaligned_src, unaligned_mask, 0 .if dst_w_bpp==16 test_bits_1_0_pix conditional_process1 cs, process_head, process_tail, 2, 0, unaligned_src, unaligned_mask, 0 .elseif dst_w_bpp==8 conditional_process2 test_bits_1_0_pix, cs, mi, process_head, process_tail, 2, 1, 0, 1, unaligned_src, unaligned_mask, 0 .endif.endm.macro wide_case_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, dst_alignment110:.set SUBBLOCK, 0 .rept pix_per_block *dst_w_bpp/128 process_head, 16, 0, unaligned_src, unaligned_mask, 1 .if(src_bpp > 0) &&(mask_bpp==0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle src_bpp, SRC, 1 .elseif(src_bpp==0) &&(mask_bpp > 0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle mask_bpp, MASK, 1 .else preload_middle src_bpp, SRC, 0 preload_middle mask_bpp, MASK, 0 .endif .if(dst_r_bpp > 0) &&((SUBBLOCK % 2)==0) &&(((flags) &FLAG_NO_PRELOAD_DST)==0) PF pld,[DST, #32 *prefetch_distance - dst_alignment] .endif process_tail, 16, 0 .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst, 16, 0, DST .endif .set SUBBLOCK, SUBBLOCK+1 .endr subs X, X, #pix_per_block bhs 110b.endm.macro wide_case_inner_loop_and_trailing_pixels process_head, process_tail, process_inner_loop, exit_label, unaligned_src, unaligned_mask .if dst_r_bpp > tst bne process_inner_loop DST_PRELOAD_BIAS endif preload_trailing SRC preload_trailing MASK DST endif add medium_case_inner_loop_and_trailing_pixels unaligned_mask endm macro medium_case_inner_loop_and_trailing_pixels DST endif subs bhs tst beq exit_label trailing_15bytes unaligned_mask endm macro narrow_case_inner_loop_and_trailing_pixels unaligned_mask tst conditional_process1 trailing_15bytes unaligned_mask endm macro switch_on_alignment action
A rectangle, with the origin at the upper left (integer).
A collection of pixels used in software blitting.
union SDL_SysWMinfo::@10 info
struct SDL_SysWMinfo::@10::@11 x11
Atom _NET_WM_STATE_HIDDEN
Atom _NET_WM_STATE_SKIP_PAGER
SDL_WindowData ** windowlist
Atom _NET_WM_STATE_MAXIMIZED_HORZ
Atom _NET_WM_STATE_FOCUSED
Atom _NET_WM_STATE_MAXIMIZED_VERT
Atom _NET_WM_STATE_FULLSCREEN
Atom _NET_WM_STATE_SKIP_TASKBAR
Atom _NET_WM_ALLOWED_ACTIONS
struct wl_display * display
struct SDL_VideoDevice::@440 gl_config
struct SDL_GLDriverData * gl_data
struct SDL_VideoData * videodata
The type used to identify a window.