Lines Matching refs:window

41 // Notifies shared code that a window has lost or received input focus
43 void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused)
45 assert(window != NULL);
48 if (window->callbacks.focus)
49 window->callbacks.focus((GLFWwindow*) window, focused);
57 if (window->keys[key] == GLFW_PRESS)
60 _glfwInputKey(window, key, scancode, GLFW_RELEASE, 0);
66 if (window->mouseButtons[button] == GLFW_PRESS)
67 _glfwInputMouseClick(window, button, GLFW_RELEASE, 0);
72 // Notifies shared code that a window has moved
75 void _glfwInputWindowPos(_GLFWwindow* window, int x, int y)
77 assert(window != NULL);
79 if (window->callbacks.pos)
80 window->callbacks.pos((GLFWwindow*) window, x, y);
83 // Notifies shared code that a window has been resized
86 void _glfwInputWindowSize(_GLFWwindow* window, int width, int height)
88 assert(window != NULL);
92 if (window->callbacks.size)
93 window->callbacks.size((GLFWwindow*) window, width, height);
96 // Notifies shared code that a window has been iconified or restored
98 void _glfwInputWindowIconify(_GLFWwindow* window, GLFWbool iconified)
100 assert(window != NULL);
103 if (window->callbacks.iconify)
104 window->callbacks.iconify((GLFWwindow*) window, iconified);
107 // Notifies shared code that a window has been maximized or restored
109 void _glfwInputWindowMaximize(_GLFWwindow* window, GLFWbool maximized)
111 assert(window != NULL);
114 if (window->callbacks.maximize)
115 window->callbacks.maximize((GLFWwindow*) window, maximized);
118 // Notifies shared code that a window framebuffer has been resized
121 void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height)
123 assert(window != NULL);
127 if (window->callbacks.fbsize)
128 window->callbacks.fbsize((GLFWwindow*) window, width, height);
131 // Notifies shared code that a window content scale has changed
134 void _glfwInputWindowContentScale(_GLFWwindow* window, float xscale, float yscale)
136 assert(window != NULL);
142 if (window->callbacks.scale)
143 window->callbacks.scale((GLFWwindow*) window, xscale, yscale);
146 // Notifies shared code that the window contents needs updating
148 void _glfwInputWindowDamage(_GLFWwindow* window)
150 assert(window != NULL);
152 if (window->callbacks.refresh)
153 window->callbacks.refresh((GLFWwindow*) window);
156 // Notifies shared code that the user wishes to close a window
158 void _glfwInputWindowCloseRequest(_GLFWwindow* window)
160 assert(window != NULL);
162 window->shouldClose = GLFW_TRUE;
164 if (window->callbacks.close)
165 window->callbacks.close((GLFWwindow*) window);
168 // Notifies shared code that a window has changed its desired monitor
170 void _glfwInputWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor)
172 assert(window != NULL);
173 window->monitor = monitor;
188 _GLFWwindow* window;
199 "Invalid window size %ix%i",
207 wndconfig = _glfw.hints.window;
217 window = _glfw_calloc(1, sizeof(_GLFWwindow));
218 window->next = _glfw.windowListHead;
219 _glfw.windowListHead = window;
221 window->videoMode.width = width;
222 window->videoMode.height = height;
223 window->videoMode.redBits = fbconfig.redBits;
224 window->videoMode.greenBits = fbconfig.greenBits;
225 window->videoMode.blueBits = fbconfig.blueBits;
226 window->videoMode.refreshRate = _glfw.hints.refreshRate;
228 window->monitor = (_GLFWmonitor*) monitor;
229 window->resizable = wndconfig.resizable;
230 window->decorated = wndconfig.decorated;
231 window->autoIconify = wndconfig.autoIconify;
232 window->floating = wndconfig.floating;
233 window->focusOnShow = wndconfig.focusOnShow;
234 window->mousePassthrough = wndconfig.mousePassthrough;
235 window->cursorMode = GLFW_CURSOR_NORMAL;
237 window->doublebuffer = fbconfig.doublebuffer;
239 window->minwidth = GLFW_DONT_CARE;
240 window->minheight = GLFW_DONT_CARE;
241 window->maxwidth = GLFW_DONT_CARE;
242 window->maxheight = GLFW_DONT_CARE;
243 window->numer = GLFW_DONT_CARE;
244 window->denom = GLFW_DONT_CARE;
245 window->title = _glfw_strdup(title);
247 if (!_glfw.platform.createWindow(window, &wndconfig, &ctxconfig, &fbconfig))
249 glfwDestroyWindow((GLFWwindow*) window);
253 return (GLFWwindow*) window;
267 // The default is a focused, visible, resizable window with decorations
268 memset(&_glfw.hints.window, 0, sizeof(_glfw.hints.window));
269 _glfw.hints.window.resizable = GLFW_TRUE;
270 _glfw.hints.window.visible = GLFW_TRUE;
271 _glfw.hints.window.decorated = GLFW_TRUE;
272 _glfw.hints.window.focused = GLFW_TRUE;
273 _glfw.hints.window.autoIconify = GLFW_TRUE;
274 _glfw.hints.window.centerCursor = GLFW_TRUE;
275 _glfw.hints.window.focusOnShow = GLFW_TRUE;
276 _glfw.hints.window.xpos = GLFW_ANY_POSITION;
277 _glfw.hints.window.ypos = GLFW_ANY_POSITION;
278 _glfw.hints.window.scaleFramebuffer = GLFW_TRUE;
350 _glfw.hints.window.resizable = value ? GLFW_TRUE : GLFW_FALSE;
353 _glfw.hints.window.decorated = value ? GLFW_TRUE : GLFW_FALSE;
356 _glfw.hints.window.focused = value ? GLFW_TRUE : GLFW_FALSE;
359 _glfw.hints.window.autoIconify = value ? GLFW_TRUE : GLFW_FALSE;
362 _glfw.hints.window.floating = value ? GLFW_TRUE : GLFW_FALSE;
365 _glfw.hints.window.maximized = value ? GLFW_TRUE : GLFW_FALSE;
368 _glfw.hints.window.visible = value ? GLFW_TRUE : GLFW_FALSE;
371 _glfw.hints.window.xpos = value;
374 _glfw.hints.window.ypos = value;
377 _glfw.hints.window.win32.keymenu = value ? GLFW_TRUE : GLFW_FALSE;
380 _glfw.hints.window.win32.showDefault = value ? GLFW_TRUE : GLFW_FALSE;
386 _glfw.hints.window.scaleToMonitor = value ? GLFW_TRUE : GLFW_FALSE;
390 _glfw.hints.window.scaleFramebuffer = value ? GLFW_TRUE : GLFW_FALSE;
393 _glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE;
396 _glfw.hints.window.focusOnShow = value ? GLFW_TRUE : GLFW_FALSE;
399 _glfw.hints.window.mousePassthrough = value ? GLFW_TRUE : GLFW_FALSE;
436 _glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint 0x%08X", hint);
448 strncpy(_glfw.hints.window.ns.frameName, value,
449 sizeof(_glfw.hints.window.ns.frameName) - 1);
452 strncpy(_glfw.hints.window.x11.className, value,
453 sizeof(_glfw.hints.window.x11.className) - 1);
456 strncpy(_glfw.hints.window.x11.instanceName, value,
457 sizeof(_glfw.hints.window.x11.instanceName) - 1);
460 strncpy(_glfw.hints.window.wl.appId, value,
461 sizeof(_glfw.hints.window.wl.appId) - 1);
465 _glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint string 0x%08X", hint);
472 _GLFWwindow* window = (_GLFWwindow*) handle;
475 if (window == NULL)
478 // Clear all callbacks to avoid exposing a half torn-down window object
479 memset(&window->callbacks, 0, sizeof(window->callbacks));
481 // The window's context must not be current on another thread when the
482 // window is destroyed
483 if (window == _glfwPlatformGetTls(&_glfw.contextSlot))
486 _glfw.platform.destroyWindow(window);
488 // Unlink window from global linked list
492 while (*prev != window)
495 *prev = window->next;
498 _glfw_free(window->title);
499 _glfw_free(window);
506 _GLFWwindow* window = (_GLFWwindow*) handle;
507 assert(window != NULL);
509 return window->shouldClose;
516 _GLFWwindow* window = (_GLFWwindow*) handle;
517 assert(window != NULL);
519 window->shouldClose = value;
526 _GLFWwindow* window = (_GLFWwindow*) handle;
527 assert(window != NULL);
529 return window->title;
538 _GLFWwindow* window = (_GLFWwindow*) handle;
539 assert(window != NULL);
541 char* prev = window->title;
542 window->title = _glfw_strdup(title);
544 _glfw.platform.setWindowTitle(window, title);
558 _GLFWwindow* window = (_GLFWwindow*) handle;
559 assert(window != NULL);
563 _glfwInputError(GLFW_INVALID_VALUE, "Invalid image count for window icon");
574 "Invalid image dimensions for window icon");
579 _glfw.platform.setWindowIcon(window, count, images);
591 _GLFWwindow* window = (_GLFWwindow*) handle;
592 assert(window != NULL);
594 _glfw.platform.getWindowPos(window, xpos, ypos);
601 _GLFWwindow* window = (_GLFWwindow*) handle;
602 assert(window != NULL);
604 if (window->monitor)
607 _glfw.platform.setWindowPos(window, xpos, ypos);
619 _GLFWwindow* window = (_GLFWwindow*) handle;
620 assert(window != NULL);
622 _glfw.platform.getWindowSize(window, width, height);
632 _GLFWwindow* window = (_GLFWwindow*) handle;
633 assert(window != NULL);
635 window->videoMode.width = width;
636 window->videoMode.height = height;
638 _glfw.platform.setWindowSize(window, width, height);
647 _GLFWwindow* window = (_GLFWwindow*) handle;
648 assert(window != NULL);
655 "Invalid window minimum size %ix%i",
667 "Invalid window maximum size %ix%i",
673 window->minwidth = minwidth;
674 window->minheight = minheight;
675 window->maxwidth = maxwidth;
676 window->maxheight = maxheight;
678 if (window->monitor || !window->resizable)
681 _glfw.platform.setWindowSizeLimits(window,
693 _GLFWwindow* window = (_GLFWwindow*) handle;
694 assert(window != NULL);
701 "Invalid window aspect ratio %i:%i",
707 window->numer = numer;
708 window->denom = denom;
710 if (window->monitor || !window->resizable)
713 _glfw.platform.setWindowAspectRatio(window, numer, denom);
725 _GLFWwindow* window = (_GLFWwindow*) handle;
726 assert(window != NULL);
728 _glfw.platform.getFramebufferSize(window, width, height);
746 _GLFWwindow* window = (_GLFWwindow*) handle;
747 assert(window != NULL);
749 _glfw.platform.getWindowFrameSize(window, left, top, right, bottom);
762 _GLFWwindow* window = (_GLFWwindow*) handle;
763 assert(window != NULL);
765 _glfw.platform.getWindowContentScale(window, xscale, yscale);
772 _GLFWwindow* window = (_GLFWwindow*) handle;
773 assert(window != NULL);
775 return _glfw.platform.getWindowOpacity(window);
786 _GLFWwindow* window = (_GLFWwindow*) handle;
787 assert(window != NULL);
791 _glfwInputError(GLFW_INVALID_VALUE, "Invalid window opacity %f", opacity);
795 _glfw.platform.setWindowOpacity(window, opacity);
802 _GLFWwindow* window = (_GLFWwindow*) handle;
803 assert(window != NULL);
805 _glfw.platform.iconifyWindow(window);
812 _GLFWwindow* window = (_GLFWwindow*) handle;
813 assert(window != NULL);
815 _glfw.platform.restoreWindow(window);
822 _GLFWwindow* window = (_GLFWwindow*) handle;
823 assert(window != NULL);
825 if (window->monitor)
828 _glfw.platform.maximizeWindow(window);
835 _GLFWwindow* window = (_GLFWwindow*) handle;
836 assert(window != NULL);
838 if (window->monitor)
841 _glfw.platform.showWindow(window);
843 if (window->focusOnShow)
844 _glfw.platform.focusWindow(window);
851 _GLFWwindow* window = (_GLFWwindow*) handle;
852 assert(window != NULL);
854 _glfw.platform.requestWindowAttention(window);
861 _GLFWwindow* window = (_GLFWwindow*) handle;
862 assert(window != NULL);
864 if (window->monitor)
867 _glfw.platform.hideWindow(window);
874 _GLFWwindow* window = (_GLFWwindow*) handle;
875 assert(window != NULL);
877 _glfw.platform.focusWindow(window);
884 _GLFWwindow* window = (_GLFWwindow*) handle;
885 assert(window != NULL);
890 return _glfw.platform.windowFocused(window);
892 return _glfw.platform.windowIconified(window);
894 return _glfw.platform.windowVisible(window);
896 return _glfw.platform.windowMaximized(window);
898 return _glfw.platform.windowHovered(window);
900 return window->focusOnShow;
902 return window->mousePassthrough;
904 return _glfw.platform.framebufferTransparent(window);
906 return window->resizable;
908 return window->decorated;
910 return window->floating;
912 return window->autoIconify;
914 return window->doublebuffer;
916 return window->context.client;
918 return window->context.source;
920 return window->context.major;
922 return window->context.minor;
924 return window->context.revision;
926 return window->context.robustness;
928 return window->context.forward;
930 return window->context.debug;
932 return window->context.profile;
934 return window->context.release;
936 return window->context.noerror;
939 _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
947 _GLFWwindow* window = (_GLFWwindow*) handle;
948 assert(window != NULL);
955 window->autoIconify = value;
959 window->resizable = value;
960 if (!window->monitor)
961 _glfw.platform.setWindowResizable(window, value);
965 window->decorated = value;
966 if (!window->monitor)
967 _glfw.platform.setWindowDecorated(window, value);
971 window->floating = value;
972 if (!window->monitor)
973 _glfw.platform.setWindowFloating(window, value);
977 window->focusOnShow = value;
981 window->mousePassthrough = value;
982 _glfw.platform.setWindowMousePassthrough(window, value);
986 _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
993 _GLFWwindow* window = (_GLFWwindow*) handle;
994 assert(window != NULL);
996 return (GLFWmonitor*) window->monitor;
1010 _GLFWwindow* window = (_GLFWwindow*) wh;
1012 assert(window != NULL);
1017 "Invalid window size %ix%i",
1030 window->videoMode.width = width;
1031 window->videoMode.height = height;
1032 window->videoMode.refreshRate = refreshRate;
1034 _glfw.platform.setWindowMonitor(window, monitor,
1043 _GLFWwindow* window = (_GLFWwindow*) handle;
1044 assert(window != NULL);
1046 window->userPointer = pointer;
1053 _GLFWwindow* window = (_GLFWwindow*) handle;
1054 assert(window != NULL);
1056 return window->userPointer;
1064 _GLFWwindow* window = (_GLFWwindow*) handle;
1065 assert(window != NULL);
1067 _GLFW_SWAP(GLFWwindowposfun, window->callbacks.pos, cbfun);
1076 _GLFWwindow* window = (_GLFWwindow*) handle;
1077 assert(window != NULL);
1079 _GLFW_SWAP(GLFWwindowsizefun, window->callbacks.size, cbfun);
1088 _GLFWwindow* window = (_GLFWwindow*) handle;
1089 assert(window != NULL);
1091 _GLFW_SWAP(GLFWwindowclosefun, window->callbacks.close, cbfun);
1100 _GLFWwindow* window = (_GLFWwindow*) handle;
1101 assert(window != NULL);
1103 _GLFW_SWAP(GLFWwindowrefreshfun, window->callbacks.refresh, cbfun);
1112 _GLFWwindow* window = (_GLFWwindow*) handle;
1113 assert(window != NULL);
1115 _GLFW_SWAP(GLFWwindowfocusfun, window->callbacks.focus, cbfun);
1124 _GLFWwindow* window = (_GLFWwindow*) handle;
1125 assert(window != NULL);
1127 _GLFW_SWAP(GLFWwindowiconifyfun, window->callbacks.iconify, cbfun);
1136 _GLFWwindow* window = (_GLFWwindow*) handle;
1137 assert(window != NULL);
1139 _GLFW_SWAP(GLFWwindowmaximizefun, window->callbacks.maximize, cbfun);
1148 _GLFWwindow* window = (_GLFWwindow*) handle;
1149 assert(window != NULL);
1151 _GLFW_SWAP(GLFWframebuffersizefun, window->callbacks.fbsize, cbfun);
1160 _GLFWwindow* window = (_GLFWwindow*) handle;
1161 assert(window != NULL);
1163 _GLFW_SWAP(GLFWwindowcontentscalefun, window->callbacks.scale, cbfun);