Lines Matching refs:window

95 void (*__glutStartMenu)(GLUTmenu * menu, GLUTwindow * window, int x, int y, int x_win, int y_win);
189 __glutPutOnWorkList(GLUTwindow * window, int workMask)
191 if (window->workMask) {
193 window->workMask |= workMask;
195 /* Update work mask and add to window work list. */
196 window->workMask = workMask;
197 /* Assert that if the window does not have a
198 workMask already, the window should definitely
200 assert(window != __glutWindowWorkList);
201 window->prevWorkWin = __glutWindowWorkList;
202 __glutWindowWorkList = window;
207 __glutPostRedisplay(GLUTwindow * window, int layerMask)
210 window->shownState : window->overlay->shownState;
212 /* Post a redisplay if the window is visible (or the
213 visibility of the window is unknown, ie. window->visState
215 if (window->visState != GLUT_HIDDEN
216 && window->visState != GLUT_FULLY_COVERED && shown) {
217 __glutPutOnWorkList(window, layerMask);
255 markWindowHidden(GLUTwindow * window)
257 if (GLUT_HIDDEN != window->visState) {
260 if (window->windowStatus) {
261 window->visState = GLUT_HIDDEN;
262 __glutSetWindow(window);
263 window->windowStatus(GLUT_HIDDEN);
265 /* An unmap is only reported on a single window; its
267 child = window->children;
283 /* Tranverse singly-linked stale window list look for the
284 window ID. */
354 DispatchMessage(&event); /* call the window proc */
360 GLUTwindow *window;
372 window = __glutGetWindow(event.xconfigure.window);
373 if (window) {
374 if (window->win != event.xconfigure.window) {
383 if (width != window->width || height != window->height) {
384 if (window->overlay) {
385 XResizeWindow(__glutDisplay, window->overlay->win, width, height);
387 window->width = width;
388 window->height = height;
389 __glutSetWindow(window);
393 window->reshape(width, height);
394 window->forceReshape = False;
400 damage happens to the window. */
401 __glutPostRedisplay(window, GLUT_REPAIR_WORK);
411 ahead.xexpose.window != event.xexpose.window) {
420 (menu = __glutGetMenu(event.xexpose.window))) {
423 window = __glutGetWindow(event.xexpose.window);
424 if (window) {
425 if (window->win == event.xexpose.window) {
426 __glutPostRedisplay(window, GLUT_REPAIR_WORK);
427 } else if (window->overlay && window->overlay->win == event.xexpose.window) {
428 __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK);
442 __glutFinishMenu(event.xbutton.window, event.xbutton.x, event.xbutton.y);
444 window = __glutGetWindow(event.xbutton.window);
446 if (window) {
451 menuNum = window->menu[event.xbutton.button - 1];
459 __glutStartMenu(menu, window,
469 } else if (window->mouse) {
470 __glutSetWindow(window);
472 window->mouse(event.xbutton.button - 1,
482 events for the window may not yet be received. */
488 window = __glutGetWindow(event.xmotion.window);
489 if (window) {
492 if (window->motion && event.xmotion.state &
494 __glutSetWindow(window);
495 window->motion(event.xmotion.x, event.xmotion.y);
500 else if (window->passive &&
504 __glutSetWindow(window);
505 window->passive(event.xmotion.x,
516 window = __glutGetWindow(event.xkey.window);
517 if (!window) {
521 keyboard = window->keyboard;
524 /* If we are ignoring auto repeated keys for this window,
530 if (window->ignoreKeyRepeat) {
534 && ahead.xkey.window == event.xkey.window
544 keyboard = window->keyboardUp;
553 __glutSetWindow(window);
562 special = window->special;
564 special = window->specialUp;
666 __glutSetWindow(window);
674 __glutSetWindow(window);
691 the window hierarchy without actually entering or
692 leaving the actual real estate of a window. */
701 event.xcrossing.window, &num);
707 window = __glutGetWindow(event.xcrossing.window);
708 if (window) {
709 if (window->entry) {
714 plane window. Do not generate a second enter
718 if (window->entryState != EnterNotify) {
719 int num = window->num;
720 Window xid = window->win;
722 window->entryState = EnterNotify;
723 __glutSetWindow(window);
724 window->entry(GLUT_ENTERED);
737 the window could have been destroyed in the
740 window = __glutWindowList[num];
741 if (window && window->passive && window->win == xid) {
742 __glutSetWindow(window);
743 window->passive(event.xcrossing.x, event.xcrossing.y);
748 if (window->entryState != LeaveNotify) {
750 /* When an overlay is established for a window
754 moving) from the normal plane X window to
755 the newly mapped overlay X window (or vice
760 GLUT window. */
765 __glutGetWindow(ahead.xcrossing.window) == window) {
770 window->entryState = LeaveNotify;
771 __glutSetWindow(window);
772 window->entry(GLUT_LEFT);
775 } else if (window->passive) {
776 __glutSetWindow(window);
777 window->passive(event.xcrossing.x, event.xcrossing.y);
784 be delivered when a window becomes visible from
786 delivered when a window is unmapped (for the window
788 window = __glutGetWindow(event.xunmap.window);
789 if (window) {
790 if (window->win != event.xconfigure.window) {
797 markWindowHidden(window);
801 window = __glutGetWindow(event.xvisibility.window);
802 if (window) {
809 if (visState != window->visState) {
810 if (window->windowStatus) {
811 window->visState = visState;
812 __glutSetWindow(window);
813 window->windowStatus(visState);
823 purgeStaleWindow(event.xdestroywindow.window);
979 processWindowWorkList(GLUTwindow * window)
983 if (window->prevWorkWin) {
984 window->prevWorkWin = processWindowWorkList(window->prevWorkWin);
986 beforeEnd = &window->prevWorkWin;
990 window, then clear the window's work mask (excepting the
993 captured work mask to set the window's work mask for
996 workMask = window->workMask;
1000 indicate that the window is currently on the window work
1001 list _and_ that the window's work mask is currently being
1003 window is on the work list still. */
1004 window->workMask = GLUT_DUMMY_WORK;
1014 /* Be sure to set event mask BEFORE map window is done. */
1019 window is selecting for. Be sure to do this before
1021 if (window->children) {
1022 GLUTwindow *child = window->children;
1026 wa.do_not_propagate_mask = window->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK;
1027 if (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) {
1028 wa.event_mask = child->eventMask | (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK);
1037 eventMask = window->eventMask;
1038 if (window->parent && window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK)
1039 eventMask |= (window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK);
1040 XSelectInput(__glutDisplay, window->win, eventMask);
1041 if (window->overlay)
1042 XSelectInput(__glutDisplay, window->overlay->win,
1043 window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK);
1046 /* Be sure to set device mask BEFORE map window is done. */
1048 __glutUpdateInputDeviceMaskFunc(window);
1050 /* Be sure to configure window BEFORE map window is done. */
1058 GetClientRect(window->win, &changes);
1060 /* If this window is a toplevel window, translate the 0,0 client
1062 if (!window->parent) {
1065 ClientToScreen(window->win, &point);
1069 if (window->desiredConfMask & (CWX | CWY)) {
1070 changes.left = window->desiredX;
1071 changes.top = window->desiredY;
1074 if (window->desiredConfMask & (CWWidth | CWHeight)) {
1075 changes.right = changes.left + window->desiredWidth;
1076 changes.bottom = changes.top + window->desiredHeight;
1079 if (window->overlay) ... */
1081 if (window->desiredConfMask & CWStackMode) {
1086 /* Adjust the window rectangle because Win32 thinks that the x, y,
1087 width & height are the WHOLE window (including decorations),
1089 area of the window. Only do this to top level windows
1092 if (!window->parent && window != __glutGameModeWindow) {
1099 SetWindowPos(window->win,
1100 window->desiredStack == Above ? HWND_TOP : HWND_NOTOPMOST,
1106 window->desiredConfMask = 0;
1108 /* This hack causes the window to go back to the right position
1111 window->desiredConfMask |= CWX | CWY;
1112 window->desiredX = point.x;
1113 window->desiredY = point.y;
1118 changes.x = window->desiredX;
1119 changes.y = window->desiredY;
1120 if (window->desiredConfMask & (CWWidth | CWHeight)) {
1121 changes.width = window->desiredWidth;
1122 changes.height = window->desiredHeight;
1123 if (window->overlay)
1124 XResizeWindow(__glutDisplay, window->overlay->win,
1125 window->desiredWidth, window->desiredHeight);
1133 XChangeProperty(__glutDisplay, window->win,
1138 before the first time that the window is
1139 mapped. Some window managers will randomly or
1140 interactively position the window the first
1141 time it is mapped if the window's
1144 window manager interaction when going
1148 requesting a fullscreen window. */
1154 hints.width = window->desiredWidth;
1155 hints.height = window->desiredHeight;
1156 XSetWMNormalHints(__glutDisplay, window->win, &hints);
1159 XDeleteProperty(__glutDisplay, window->win, __glutMotifHints);
1163 if (window->desiredConfMask & CWStackMode) {
1164 changes.stack_mode = window->desiredStack;
1165 /* Do not let glutPushWindow push window beneath the
1167 if (window->parent && window->parent->overlay
1168 && window->desiredStack == Below) {
1170 changes.sibling = window->parent->overlay->win;
1171 window->desiredConfMask |= CWSibling;
1174 XConfigureWindow(__glutDisplay, window->win,
1175 window->desiredConfMask, &changes);
1176 window->desiredConfMask = 0;
1180 /* Be sure to establish the colormaps BEFORE map window is
1183 __glutEstablishColormapsProperty(window);
1187 switch (window->desiredMapState) {
1189 if (window->parent) {
1190 XUnmapWindow(__glutDisplay, window->win);
1192 XWithdrawWindow(__glutDisplay, window->win,
1195 window->shownState = 0;
1198 XMapWindow(__glutDisplay, window->win);
1199 window->shownState = 1;
1203 ShowWindow(window->win, SW_SHOW);
1204 window->shownState = 1;
1208 XIconifyWindow(__glutDisplay, window->win, __glutScreen);
1209 window->shownState = 0;
1215 if (window->forceReshape) {
1217 for a window, a reshape callback must be generated. */
1218 __glutSetWindow(window);
1219 window->reshape(window->width, window->height);
1220 window->forceReshape = False;
1227 happens to the window. */
1231 because it is paranoid about the overlay or entire window
1237 window (or overlay) may be destroyed (or removed) when the
1240 if (window->overlay && window->overlay->display) {
1241 int num = window->num;
1242 Window xid = window->overlay ? window->overlay->win : None;
1252 if (window->usedSwapBuffers) {
1254 SWAP_BUFFERS_WINDOW(window);
1261 window->renderDc = window->hdc;
1263 window->renderWin = window->win;
1264 window->renderCtx = window->ctx;
1266 __glutSetWindow(window);
1267 window->usedSwapBuffers = 0;
1268 window->display();
1274 window = __glutWindowList[num];
1275 if (window && window->overlay &&
1276 window->overlay->win == xid && window->overlay->display) {
1280 window->renderDc = window->overlay->hdc;
1282 window->renderWin = window->overlay->win;
1283 window->renderCtx = window->overlay->ctx;
1285 __glutSetWindow(window);
1286 window->overlay->display();
1296 if (!window->overlay && window->usedSwapBuffers) {
1298 SWAP_BUFFERS_WINDOW(window);
1305 __glutSetWindow(window);
1306 window->usedSwapBuffers = 0;
1307 window->display();
1313 /* Combine workMask with window->workMask to determine what
1315 assert(window);
1316 workMask |= window->workMask;
1325 __glutSetWindow(window);
1327 if (!window->isDirect)
1334 __glutSetWindow(window);
1338 window->workMask &= ~(GLUT_DUMMY_WORK | GLUT_FINISH_WORK | GLUT_DEBUG_WORK);
1339 if (window->workMask) {
1341 return window;
1343 /* Remove current window from work list. */
1344 return window->prevWorkWin;