Gets the width and height of the current window.

        :Usage:
            ::

                driver.get_window_size()
353749
def get_window_size(self, windowHandle='current'):
        
        command = Command.GET_WINDOW_SIZE
        if self.w3c:
            if windowHandle != 'current':
                warnings.warn("Only 'current' window is supported for W3C compatibile browsers.")
            size = self.get_window_rect()
        else:
            size = self.execute(command, {'windowHandle': windowHandle})

        if size.get('value', None) is not None:
            size = size['value']

        return {k: size[k] for k in ('width', 'height')}
505356
def display(self):
        
        w, h = self.session.window_size()
        return Display(w*self.scale, h*self.scale)
57644
def get_config_window_bounds(self):
        
        bounds_x = int(self.config.get_optional('Driver', 'bounds_x') or 0)
        bounds_y = int(self.config.get_optional('Driver', 'bounds_y') or 0)

        monitor_index = int(self.config.get_optional('Driver', 'monitor') or -1)
        if monitor_index > -1:
            try:
                monitor = screeninfo.get_monitors()[monitor_index]
                bounds_x += monitor.x
                bounds_y += monitor.y
            except NotImplementedError:
                self.logger.warn('Current environment doesn\'t support get_monitors')

        return bounds_x, bounds_y
1236392
def get_window_dim():
    
    version = sys.version_info

    if version >= (3, 3):
        return _size_36()
    if platform.system() == 'Windows':
        return _size_windows()
    return _size_27()
433349
def _height_and_width(self):
        

        try:
            return self._cache['height_and_width']
        except KeyError:
            handw = self._cache['height_and_width'] = super(Terminal, self)._height_and_width()
            return handw
1278393
def size(self):
        """"""
        size = ffi.new('int[]', 2)
        lib.SDL_GetWindowSize(self._ptr, size + 0, size + 1)
        return (size[0], size[1])
366709
def getWindowBounds(self):
        """"""

        fn = self.function_table.getWindowBounds
        pnX = c_int32()
        pnY = c_int32()
        pnWidth = c_uint32()
        pnHeight = c_uint32()
        fn(byref(pnX), byref(pnY), byref(pnWidth), byref(pnHeight))
        return pnX.value, pnY.value, pnWidth.value, pnHeight.value
1353602
def term_width():
    
    if fcntl and termios:
        try:
            winsize = fcntl.ioctl(0, termios.TIOCGWINSZ, '    ')
            _, width = struct.unpack('hh', winsize)
            return width
        except IOError:
            pass
    elif windll and create_string_buffer:  # pragma: no cover (windows)
        stderr_handle, struct_size = -12, 22
        handle = windll.kernel32.GetStdHandle(stderr_handle)
        csbi = create_string_buffer(struct_size)
        res = windll.kernel32.GetConsoleScreenBufferInfo(handle, csbi)
        if res:
            (_, _, _, _, _, left, _, right, _,
             _, _) = struct.unpack('hhhhHhhhhhh', csbi.raw)
            return right - left + 1
        else:
            return 0
492572
def window_size(self, window_size):
        
        BasePlotter.window_size.fset(self, window_size)
        self.app_window.setBaseSize(*window_size)
1076455
def size(self, width=None, height=None):
        '''
        info = CONSOLE_SCREEN_BUFFER_INFO()
        status = self.GetConsoleScreenBufferInfo(self.hout, byref(info))
        if not status:
            return None
        if width is not None and height is not None:
            wmin = info.srWindow.Right - info.srWindow.Left + 1
            hmin = info.srWindow.Bottom - info.srWindow.Top + 1
            #print wmin, hmin
            width = max(width, wmin)
            height = max(height, hmin)
            #print width, height
            self.SetConsoleScreenBufferSize(self.hout, 
                                            self.fixcoord(width, height))
        else:
            return (info.dwSize.X, info.dwSize.Y)
913656
def GetSizeHint(self, context=None, **unused_kwargs):
    
    context_state = getattr(context, 'state', {})

    subcontext = context_state.get('context', None)
    if not subcontext:
      mapped_values = context_state.get('mapped_values', None)
      subcontext = DataTypeMapContext(values={
          type(mapped_values).__name__: mapped_values})

    size_hint = 0
    for data_type_map in self._data_type_maps:
      data_type_size = data_type_map.GetSizeHint(context=subcontext)
      if data_type_size is None:
        break

      size_hint += data_type_size

    return size_hint
131263
def get_framebuffer_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.glfwGetFramebufferSize(window, width, height)
    return width_value.value, height_value.value
875360
def get_monitor_physical_size(monitor):
    
    width_value = ctypes.c_int(0)
    width = ctypes.pointer(width_value)
    height_value = ctypes.c_int(0)
    height = ctypes.pointer(height_value)
    _glfw.glfwGetMonitorPhysicalSize(monitor, width, height)
    return width_value.value, height_value.value
310826
def retrieve_width(self, signum=None, frame=None):
        
        for method_name, args in self.strategies:
            method = getattr(self, "from_" + method_name)
            width = method(*args)
            if width and width > 0:
                self.width = width
                break # Found!
        os.environ["COLUMNS"] = str(self.width)
73583
def _height_and_width(self):
        

        # In Python 3.3+ we can let the standard library handle this
        if GTS_SUPPORTED:
            return os.get_terminal_size(self.stream_fd)

        window = get_csbi(self.stream_fh).srWindow
        return TerminalSize(window.Right - window.Left + 1, window.Bottom - window.Top + 1)
629966
def get_term_size():
        ''''''
        rows, columns = os.popen('stty size', 'r').read().split()
        return int(rows), int(columns)
837474
def get_window_size(self):
        
        def active_window_for_app(app):
            with set_app(app):
                return self.arrangement.get_active_window()

        active_window = self.arrangement.get_active_window()

        # Get sizes for connections watching the same window.
        apps = [client_state.app for client_state in self._client_states.values()
                if active_window_for_app(client_state.app) == active_window]
        sizes = [app.output.get_size() for app in apps]

        rows = [s.rows for s in sizes]
        columns = [s.columns for s in sizes]

        if rows and columns:
            return Size(rows=min(rows) - (1 if self.enable_status else 0),
                        columns=min(columns))
        else:
            return Size(rows=20, columns=80)