Lines Matching refs:window
272 void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods)
274 assert(window != NULL);
284 if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE)
287 if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS)
290 if (action == GLFW_RELEASE && window->stickyKeys)
291 window->keys[key] = _GLFW_STICK;
293 window->keys[key] = (char) action;
299 if (!window->lockKeyMods)
302 if (window->callbacks.key)
303 window->callbacks.key((GLFWwindow*) window, key, scancode, action, mods);
309 void _glfwInputChar(_GLFWwindow* window, uint32_t codepoint, int mods, GLFWbool plain)
311 assert(window != NULL);
318 if (!window->lockKeyMods)
321 if (window->callbacks.charmods)
322 window->callbacks.charmods((GLFWwindow*) window, codepoint, mods);
326 if (window->callbacks.character)
327 window->callbacks.character((GLFWwindow*) window, codepoint);
333 void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset)
335 assert(window != NULL);
341 if (window->callbacks.scroll)
342 window->callbacks.scroll((GLFWwindow*) window, xoffset, yoffset);
347 void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods)
349 assert(window != NULL);
354 if (button < 0 || (!window->disableMouseButtonLimit && button > GLFW_MOUSE_BUTTON_LAST))
357 if (!window->lockKeyMods)
362 if (action == GLFW_RELEASE && window->stickyMouseButtons)
363 window->mouseButtons[button] = _GLFW_STICK;
365 window->mouseButtons[button] = (char) action;
368 if (window->callbacks.mouseButton)
369 window->callbacks.mouseButton((GLFWwindow*) window, button, action, mods);
375 void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos)
377 assert(window != NULL);
383 if (window->virtualCursorPosX == xpos && window->virtualCursorPosY == ypos)
386 window->virtualCursorPosX = xpos;
387 window->virtualCursorPosY = ypos;
389 if (window->callbacks.cursorPos)
390 window->callbacks.cursorPos((GLFWwindow*) window, xpos, ypos);
395 void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered)
397 assert(window != NULL);
400 if (window->callbacks.cursorEnter)
401 window->callbacks.cursorEnter((GLFWwindow*) window, entered);
404 // Notifies shared code of files or directories dropped on a window
406 void _glfwInputDrop(_GLFWwindow* window, int count, const char** paths)
408 assert(window != NULL);
412 if (window->callbacks.drop)
413 window->callbacks.drop((GLFWwindow*) window, count, paths);
547 // Center the cursor in the content area of the specified window
549 void _glfwCenterCursorInContentArea(_GLFWwindow* window)
553 _glfw.platform.getWindowSize(window, &width, &height);
554 _glfw.platform.setCursorPos(window, width / 2.0, height / 2.0);
566 _GLFWwindow* window = (_GLFWwindow*) handle;
567 assert(window != NULL);
572 return window->cursorMode;
574 return window->stickyKeys;
576 return window->stickyMouseButtons;
578 return window->lockKeyMods;
580 return window->rawMouseMotion;
582 return window->disableMouseButtonLimit;
593 _GLFWwindow* window = (_GLFWwindow*) handle;
594 assert(window != NULL);
611 if (window->cursorMode == value)
614 window->cursorMode = value;
616 _glfw.platform.getCursorPos(window,
617 &window->virtualCursorPosX,
618 &window->virtualCursorPosY);
619 _glfw.platform.setCursorMode(window, value);
626 if (window->stickyKeys == value)
636 if (window->keys[i] == _GLFW_STICK)
637 window->keys[i] = GLFW_RELEASE;
641 window->stickyKeys = value;
648 if (window->stickyMouseButtons == value)
658 if (window->mouseButtons[i] == _GLFW_STICK)
659 window->mouseButtons[i] = GLFW_RELEASE;
663 window->stickyMouseButtons = value;
669 window->lockKeyMods = value ? GLFW_TRUE : GLFW_FALSE;
683 if (window->rawMouseMotion == value)
686 window->rawMouseMotion = value;
687 _glfw.platform.setRawMouseMotion(window, value);
693 window->disableMouseButtonLimit = value ? GLFW_TRUE : GLFW_FALSE;
749 _GLFWwindow* window = (_GLFWwindow*) handle;
750 assert(window != NULL);
758 if (window->keys[key] == _GLFW_STICK)
761 window->keys[key] = GLFW_RELEASE;
765 return (int) window->keys[key];
772 _GLFWwindow* window = (_GLFWwindow*) handle;
773 assert(window != NULL);
781 if (window->mouseButtons[button] == _GLFW_STICK)
784 window->mouseButtons[button] = GLFW_RELEASE;
788 return (int) window->mouseButtons[button];
800 _GLFWwindow* window = (_GLFWwindow*) handle;
801 assert(window != NULL);
803 if (window->cursorMode == GLFW_CURSOR_DISABLED)
806 *xpos = window->virtualCursorPosX;
808 *ypos = window->virtualCursorPosY;
811 _glfw.platform.getCursorPos(window, xpos, ypos);
818 _GLFWwindow* window = (_GLFWwindow*) handle;
819 assert(window != NULL);
830 if (!_glfw.platform.windowFocused(window))
833 if (window->cursorMode == GLFW_CURSOR_DISABLED)
836 window->virtualCursorPosX = xpos;
837 window->virtualCursorPosY = ypos;
842 _glfw.platform.setCursorPos(window, xpos, ypos);
917 // Make sure the cursor is not being used by any window
919 _GLFWwindow* window;
921 for (window = _glfw.windowListHead; window; window = window->next)
923 if (window->cursor == cursor)
924 glfwSetCursor((GLFWwindow*) window, NULL);
947 _GLFWwindow* window = (_GLFWwindow*) windowHandle;
949 assert(window != NULL);
951 window->cursor = cursor;
953 _glfw.platform.setCursor(window, cursor);
960 _GLFWwindow* window = (_GLFWwindow*) handle;
961 assert(window != NULL);
963 _GLFW_SWAP(GLFWkeyfun, window->callbacks.key, cbfun);
971 _GLFWwindow* window = (_GLFWwindow*) handle;
972 assert(window != NULL);
974 _GLFW_SWAP(GLFWcharfun, window->callbacks.character, cbfun);
982 _GLFWwindow* window = (_GLFWwindow*) handle;
983 assert(window != NULL);
985 _GLFW_SWAP(GLFWcharmodsfun, window->callbacks.charmods, cbfun);
994 _GLFWwindow* window = (_GLFWwindow*) handle;
995 assert(window != NULL);
997 _GLFW_SWAP(GLFWmousebuttonfun, window->callbacks.mouseButton, cbfun);
1006 _GLFWwindow* window = (_GLFWwindow*) handle;
1007 assert(window != NULL);
1009 _GLFW_SWAP(GLFWcursorposfun, window->callbacks.cursorPos, cbfun);
1018 _GLFWwindow* window = (_GLFWwindow*) handle;
1019 assert(window != NULL);
1021 _GLFW_SWAP(GLFWcursorenterfun, window->callbacks.cursorEnter, cbfun);
1030 _GLFWwindow* window = (_GLFWwindow*) handle;
1031 assert(window != NULL);
1033 _GLFW_SWAP(GLFWscrollfun, window->callbacks.scroll, cbfun);
1041 _GLFWwindow* window = (_GLFWwindow*) handle;
1042 assert(window != NULL);
1044 _GLFW_SWAP(GLFWdropfun, window->callbacks.drop, cbfun);