Returns the user pointer of the specified window.

    Wrapper for:
        void* glfwGetWindowUserPointer(GLFWwindow* window);
8173
def get_window_user_pointer(window):
    

    window_addr = ctypes.cast(ctypes.pointer(window),
                              ctypes.POINTER(ctypes.c_long)).contents.value

    if window_addr in _window_user_data_repository:
        data = _window_user_data_repository[window_addr]
        is_wrapped_py_object = data[0]
        if is_wrapped_py_object:
            return data[1]
    return _glfw.glfwGetWindowUserPointer(window)
150183
def set_window_focus_callback(window, cbfun):
    
    window_addr = ctypes.cast(ctypes.pointer(window),
                              ctypes.POINTER(ctypes.c_long)).contents.value
    if window_addr in _window_focus_callback_repository:
        previous_callback = _window_focus_callback_repository[window_addr]
    else:
        previous_callback = None
    if cbfun is None:
        cbfun = 0
    c_cbfun = _GLFWwindowfocusfun(cbfun)
    _window_focus_callback_repository[window_addr] = (cbfun, c_cbfun)
    cbfun = c_cbfun
    _glfw.glfwSetWindowFocusCallback(window, cbfun)
    if previous_callback is not None and previous_callback[0] != 0:
        return previous_callback[0]
192368
def user(self):
        
        return self.users.get(self.contexts[self.current_context].get("user", ""), {})
243440
private Point restoreWindowLocation() {
		Point result = null;
		final String sizestr = preferences.get(prefnzPrefix+PREF_WINDOW_POSITION, null);
		if (sizestr != null) {
			int x = 0;
			int y = 0;
			final String[] sizes = sizestr.split("[,]");
			try {
				x = Integer.parseInt(sizes[0].trim());
				y = Integer.parseInt(sizes[1].trim());
			} catch (final Exception e) {
				// ignoring, cause is prevented by default values;
			}
			if (x > 0 && y > 0) {
				result = new Point(x, y);
				if (logger.isDebugEnabled()) logger.debug("Restoring preference " + PREF_WINDOW_POSITION + "=" + result.x + "," + result.y);
				this.setLocation(result);
			}
		}
		return result;
	}
669679
protected User getUser() {
        User visitor = ThreadContext.getSessionVisitor();
        if (visitor != null) {
            return visitor;
        }
        return null;
    }
526355
def get_final_window_monitor(cls, settings, window):
        

        screen = window.get_screen()

        # fetch settings
        use_mouse = settings.general.get_boolean('mouse-display')
        dest_screen = settings.general.get_int('display-n')

        if use_mouse:

            # TODO PORT get_pointer is deprecated
            # https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-get-pointer
            win, x, y, _ = screen.get_root_window().get_pointer()
            dest_screen = screen.get_monitor_at_point(x, y)

        # If Guake is configured to use a screen that is not currently attached,
        # default to 'primary display' option.
        n_screens = screen.get_n_monitors()
        if dest_screen > n_screens - 1:
            settings.general.set_boolean('mouse-display', False)
            settings.general.set_int('display-n', dest_screen)
            dest_screen = screen.get_primary_monitor()

        # Use primary display if configured
        if dest_screen == ALWAYS_ON_PRIMARY:
            dest_screen = screen.get_primary_monitor()

        return dest_screen
387636
def prj_view_user(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        i = self.prj_user_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            self.view_user(user)
964104
private void saveWindowLocation(Point point) {
		if (point != null) {
			if (getExtendedState() == Frame.NORMAL) {
				if (logger.isDebugEnabled()) logger.debug("Saving preference " + PREF_WINDOW_POSITION + "=" + point.x + "," + point.y);
				this.preferences.put(prefnzPrefix+PREF_WINDOW_POSITION, point.x + ","	+ point.y);
			} else {
				if (logger.isDebugEnabled()) logger.debug("Preference " + PREF_WINDOW_POSITION + " not saved, cause window state is not 'normal'.");
			}
		}
	}
54923
def getWindowPID(self, hwnd):
        
        pid = ctypes.c_ulong()
        ctypes.windll.user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))
        return int(pid.value)
686319
def set_key_callback(window, cbfun):
    
    window_addr = ctypes.cast(ctypes.pointer(window),
                              ctypes.POINTER(ctypes.c_long)).contents.value
    if window_addr in _key_callback_repository:
        previous_callback = _key_callback_repository[window_addr]
    else:
        previous_callback = None
    if cbfun is None:
        cbfun = 0
    c_cbfun = _GLFWkeyfun(cbfun)
    _key_callback_repository[window_addr] = (cbfun, c_cbfun)
    cbfun = c_cbfun
    _glfw.glfwSetKeyCallback(window, cbfun)
    if previous_callback is not None and previous_callback[0] != 0:
        return previous_callback[0]
1360593
def can_view(self, user):
        """"""
        return user in self.group.users or self.project.can_view(user)
1284099
def focusWindow(self, hwnd):
        
        Debug.log(3, "Focusing window: " + str(hwnd))
        SW_RESTORE = 9
        if ctypes.windll.user32.IsIconic(hwnd):
            ctypes.windll.user32.ShowWindow(hwnd, SW_RESTORE)
        ctypes.windll.user32.SetForegroundWindow(hwnd)
444660
private int getCurrentWindowIndex()
    {
        long currentTime = System.currentTimeMillis();
        long currentWindow =((currentTime - startTime) / windowDurationInMs);
        return (int) currentWindow%(numKeys/windowSize);
    }
1190576
def set_scroll_callback(window, cbfun):
    
    window_addr = ctypes.cast(ctypes.pointer(window),
                              ctypes.POINTER(ctypes.c_long)).contents.value
    if window_addr in _scroll_callback_repository:
        previous_callback = _scroll_callback_repository[window_addr]
    else:
        previous_callback = None
    if cbfun is None:
        cbfun = 0
    c_cbfun = _GLFWscrollfun(cbfun)
    _scroll_callback_repository[window_addr] = (cbfun, c_cbfun)
    cbfun = c_cbfun
    _glfw.glfwSetScrollCallback(window, cbfun)
    if previous_callback is not None and previous_callback[0] != 0:
        return previous_callback[0]
940170
def get_cursor_pos(window):
    
    xpos_value = ctypes.c_double(0.0)
    xpos = ctypes.pointer(xpos_value)
    ypos_value = ctypes.c_double(0.0)
    ypos = ctypes.pointer(ypos_value)
    _glfw.glfwGetCursorPos(window, xpos, ypos)
    return xpos_value.value, ypos_value.value
442268
def window_handles(self):
        
        if self.w3c:
            return self.execute(Command.W3C_GET_WINDOW_HANDLES)['value']
        else:
            return self.execute(Command.GET_WINDOW_HANDLES)['value']
52935
def get_window_size(window):
    
    width_value = ctypes.c_int(0)
    width = ctypes.pointer(width_value)
    height_value = ctypes.c_int(0)
    height = ctypes.pointer(height_value)
    _glfw.glfwGetWindowSize(window, width, height)
    return width_value.value, height_value.value