Lines Matching refs:window

44 cleanWindowWorkList(GLUTwindow * window)
49 /* Tranverse singly-linked window work list look for the
50 window. */
52 if (entry == window) {
66 cleanStaleWindowList(GLUTwindow * window)
71 /* Tranverse singly-linked stale window list look for the
72 window ID. */
74 if (entry->window == window) {
95 /* Does win belong to the last window ID looked up? */
102 /* Otherwise scan the window list looking for the window ID. */
121 /* Scan through destroyed overlay window IDs for which no
125 return entry->window;
145 __glutSetWindow(GLUTwindow * window)
149 to a window we are already current to. In fact, this
155 __glutCurrentWindow = window;
170 /* If debugging is enabled, we'll want to check this window
173 GLUT_DEBUG_WORK to be done on this window. */
183 GLUTwindow *window;
186 __glutWarning("glutSetWindow attempted on bogus window.");
189 window = __glutWindowList[win - 1];
190 if (!window) {
191 __glutWarning("glutSetWindow attempted on bogus window.");
194 __glutSetWindow(window);
435 "redisplay needed for window %d, but no display callback.",
444 /* Adjust the viewport of the window (and overlay if one
492 GLUTwindow *window;
515 window = (GLUTwindow *) malloc(sizeof(GLUTwindow));
516 if (!window) {
519 window->num = winnum;
522 window->vis = __glutDetermineWindowVisual(&window->treatAsSingle,
523 &window->visAlloced, &fbc);
524 if (!window->vis) {
528 __glutSetupColormap(window->vis, &window->colormap, &window->cmap);
530 window->eventMask = StructureNotifyMask | ExposureMask;
535 wa.colormap = window->cmap;
536 wa.event_mask = window->eventMask;
548 window->width = width;
549 window->height = height;
550 window->forceReshape = True;
551 window->ignoreKeyRepeat = False;
560 /* Game mode window should be a WS_POPUP window to
565 /* A standard toplevel window with borders and such. */
569 window->win = CreateWindow("GLUT", "GLUT",
573 window->hdc = GetDC(window->win);
576 XHDC = window->hdc;
577 window->vis = __glutDetermineWindowVisual(&window->treatAsSingle,
578 &window->visAlloced, &fbc);
579 if (!window->vis) {
583 if (!SetPixelFormat(window->hdc,
584 ChoosePixelFormat(window->hdc, window->vis),
585 window->vis)) {
586 __glutFatalError("SetPixelFormat failed during window create.");
588 __glutSetupColormap(window->vis, &window->colormap, &window->cmap);
593 window->renderDc = window->hdc;
595 window->win = XCreateWindow(__glutDisplay,
598 window->vis->depth, InputOutput, window->vis->visual,
601 window->renderWin = window->win;
604 window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
609 window->ctx = glXCreateContext(__glutDisplay, window->vis,
612 if (!window->ctx) {
616 window->renderCtx = window->ctx;
618 window->isDirect = glXIsDirect(__glutDisplay, window->ctx);
620 if (!window->isDirect)
625 window->parent = parent;
627 window->siblings = parent->children;
628 parent->children = window;
630 window->siblings = NULL;
632 window->overlay = NULL;
633 window->children = NULL;
634 window->display = __glutDefaultDisplay;
635 window->reshape = __glutDefaultReshape;
636 window->mouse = NULL;
637 window->motion = NULL;
638 window->passive = NULL;
639 window->entry = NULL;
640 window->keyboard = NULL;
641 window->keyboardUp = NULL;
642 window->windowStatus = NULL;
643 window->visibility = NULL;
644 window->special = NULL;
645 window->specialUp = NULL;
646 window->buttonBox = NULL;
647 window->dials = NULL;
648 window->spaceMotion = NULL;
649 window->spaceRotate = NULL;
650 window->spaceButton = NULL;
651 window->tabletMotion = NULL;
652 window->tabletButton = NULL;
654 window->joystick = NULL;
655 window->joyPollInterval = 0;
657 window->tabletPos[0] = -1;
658 window->tabletPos[1] = -1;
659 window->shownState = 0;
660 window->visState = -1; /* not VisibilityUnobscured,
663 window->entryState = -1; /* not EnterNotify or LeaveNotify */
665 window->desiredConfMask = 0;
666 window->buttonUses = 0;
667 window->cursor = GLUT_CURSOR_INHERIT;
669 /* Setup window to be mapped when glutMainLoop starts. */
670 window->workMask = GLUT_MAP_WORK;
673 /* When mapping a game mode window, just show
674 the window. We have already created the game
675 mode window with a maximize flag at creation
676 time. Doing a ShowWindow(window->win, SW_SHOWNORMAL)
677 would be wrong for a game mode window since it
678 would unmaximize the window. */
679 window->desiredMapState = GameModeState;
681 window->desiredMapState = NormalState;
684 window->desiredMapState = NormalState;
686 window->prevWorkWin = __glutWindowWorkList;
687 __glutWindowWorkList = window;
691 window->menu[i] = 0;
694 /* Add this new window to the window list. */
695 __glutWindowList[winnum] = window;
697 /* Make the new window the current window. */
698 __glutSetWindow(window);
702 if (window->treatAsSingle) {
703 /* We do this because either the window really is single
706 state); or we are treating a double buffered window as a
707 single-buffered window because the system does not appear
713 return window;
721 GLUTwindow *window;
731 window = __glutCreateWindow(NULL,
735 win = window->win;
744 window->desiredMapState = IconicState;
752 /* Only put WM_COMMAND property on first window. */
760 return window->num + 1;
775 GLUTwindow *window;
777 window = __glutCreateWindow(__glutWindowList[win - 1],
783 toplevel = __glutToplevelOf(window);
784 if (toplevel->cmap != window->cmap) {
789 return window->num + 1;
794 __glutDestroyWindow(GLUTwindow * window,
800 cur = window->children;
808 parent = window->parent;
813 if (cur == window) {
821 /* Unbind if bound to this window. */
822 if (window == __glutCurrentWindow) {
826 /* Begin tearing down window itself. */
827 if (window->overlay) {
828 __glutFreeOverlayFunc(window->overlay);
830 XDestroyWindow(__glutDisplay, window->win);
831 glXDestroyContext(__glutDisplay, window->ctx);
832 if (window->colormap) {
834 __glutFreeColormap(window->colormap);
836 /* NULLing the __glutWindowList helps detect is a window
837 instance has been destroyed, given a window number. */
838 __glutWindowList[window->num] = NULL;
840 /* Cleanup data structures that might contain window. */
841 cleanWindowWorkList(window);
843 cleanStaleWindowList(window);
845 /* Remove window from the "get window cache" if it is there. */
846 if (__glutWindowCache == window)
849 if (window->visAlloced) {
851 XFree(window->vis);
854 if (window == __glutGameModeWindow) {
855 /* Destroying the game mode window should implicitly
860 free(window);
867 GLUTwindow *window = __glutWindowList[win - 1];
869 if (__glutMappedMenu && __glutMenuWindow == window) {
870 __glutFatalUsage("destroying menu window not allowed while menus in use");
873 /* If not a toplevel window... */
874 if (window->parent) {
876 recalculate toplevel window's WM_COLORMAP_WINDOWS
878 __glutPutOnWorkList(__glutToplevelOf(window->parent),
882 __glutDestroyWindow(window, window);
891 /* Add eventMask to window's event mask. */
899 /* Remove eventMask from window's event mask. */
942 /* Hack. Some window managers (4Dwm by default) will mask