Change browser window size.
- small: 640x480
- medium: 1024x768
- large: 2560x1600

@param string $windowsize size of window.
@param bool $viewport If true, changes viewport rather than window size
@throws ExpectationException
514240
protected function resize_window($windowsize, $viewport = false) {
        // Non JS don't support resize window.
        if (!$this->running_javascript()) {
            return;
        }

        switch ($windowsize) {
            case "small":
                $width = 640;
                $height = 480;
                break;
            case "medium":
                $width = 1024;
                $height = 768;
                break;
            case "large":
                $width = 2560;
                $height = 1600;
                break;
            default:
                preg_match('/^(\d+x\d+)$/', $windowsize, $matches);
                if (empty($matches) || (count($matches) != 2)) {
                    throw new ExpectationException("Invalid screen size, can't resize", $this->getSession());
                }
                $size = explode('x', $windowsize);
                $width = (int) $size[0];
                $height = (int) $size[1];
        }
        if ($viewport) {
            // When setting viewport size, we set it so that the document width will be exactly
            // as specified, assuming that there is a vertical scrollbar. (In cases where there is
            // no scrollbar it will be slightly wider. We presume this is rare and predictable.)
            // The window inner height will be as specified, which means the available viewport will
            // actually be smaller if there is a horizontal scrollbar. We assume that horizontal
            // scrollbars are rare so this doesn't matter.
            $offset = $this->getSession()->getDriver()->evaluateScript(
                    'return (function() { var before = document.body.style.overflowY;' .
                    'document.body.style.overflowY = "scroll";' .
                    'var result = {};' .
                    'result.x = window.outerWidth - document.body.offsetWidth;' .
                    'result.y = window.outerHeight - window.innerHeight;' .
                    'document.body.style.overflowY = before;' .
                    'return result; })();');
            $width += $offset['x'];
            $height += $offset['y'];
        }

        $this->getSession()->getDriver()->resizeWindow($width, $height);
    }
1269045
func WindowSize(width, height int) ExecAllocatorOption {
	return Flag("window-size", fmt.Sprintf("%d,%d", width, height))
}
360854
public function setSize(WebDriverDimension $size)
    {
        $params = [
            'width' => $size->getWidth(),
            'height' => $size->getHeight(),
            ':windowHandle' => 'current',
        ];
        $this->executor->execute(DriverCommand::SET_WINDOW_SIZE, $params);

        return $this;
    }
208421
function set_pagesize($size)
    {
        $this->page_size = (int)$size;
        $this->ldap->set_vlv_page($this->list_page, $this->page_size);
    }
1331032
function (width) {
            var so = this._width;
            ariaTemplatesLayout.setSOViewport(so, width);
            if (this._tpl.$width != so.value) {
                this._tpl.$width = so.value;
                return true;
            }
            return false;
        }
650504
public function assertDeviceScreenResize($device) {
    $resolution = $this->getDeviceResolution($device);
    $this->getSession()->resizeWindow((int) $resolution->getWidth(), (int) $resolution->getHeight(), 'current');
  }
1063027
def on_resize(self, event):
        """"""
        self.context.set_viewport(0, 0, event.size[0], event.size[1])
        for visual in self.visuals:
            visual.on_resize(event.size)
        self.update()
13352
public function setSize($size)
    {
        if (null === $size) {
            return $this;
        }

        $this->size = $size;
        $this->pixelRatio = (int) round($size / 5);

        return $this;
    }
235433
public function resize( $width, $height, $maintainAspect = false, $scaleUp = true )
	{
		$oldFrameWidth = $this->frameWidth;
		$aspectRatio = $this->frameWidth / $this->frameHeight;

		if ( $maintainAspect )
		{
			// Try width first
			$newHeight = round( $width / $aspectRatio );

			if ( $newHeight > $height )
			{
				$newWidth = round( $height * $aspectRatio );
				$newHeight = $height;
			}
			else
			{
				$newWidth = $width;
			}

			if ( !$scaleUp && ( ( $newWidth > $this->frameWidth ) || ( $newHeight > $this->frameHeight ) ) )
			{
				// Make no changes as we don't want to scale up.
				return;
			}

			// This is effectively changing the width of our frame.
			$this->frameWidth = $newWidth;
			$this->frameHeight = $newHeight;

			// Use the change in width as a ratio to scale the offsets etc.
			$scale = $oldFrameWidth / $this->frameWidth;

			$this->scaleWidth = ceil( $this->scaleWidth / $scale );
			$this->scaleHeight = ceil( $this->scaleHeight / $scale );

			$this->offsetX = ceil( $this->offsetX / $scale );
			$this->offsetY = ceil( $this->offsetY / $scale );
		}
		else
		{
			if ( !$scaleUp && ( ( $width > $this->scaleWidth ) || ( $height > $this->scaleHeight ) ) )
			{
				// Make no changes as we don't want to scale up
				return;
			}

			$this->scaleWidth = $width;
			$this->scaleHeight = $height;
			$this->frameWidth = $width;
			$this->frameHeight = $height;
		}

		$this->aspectRatio = $this->scaleWidth / $this->scaleHeight;
	}
1182328
protected void ensureBufferSpace(int expectedAdditions) {
    final int bufferLen = (buffer == null ? 0 : buffer.length);
    if (elementsCount + expectedAdditions > bufferLen) {
      final int newSize = resizer.grow(bufferLen, elementsCount, expectedAdditions);
      assert newSize >= elementsCount + expectedAdditions : "Resizer failed to" + " return sensible new size: "
          + newSize + " <= " + (elementsCount + expectedAdditions);

      this.buffer = Arrays.copyOf(buffer, newSize);
    }
  }
587175
public function getSize()
    {
        $size = $this->executor->execute(
            DriverCommand::GET_WINDOW_SIZE,
            [':windowHandle' => 'current']
        );

        return new WebDriverDimension(
            $size['width'],
            $size['height']
        );
    }
518385
protected final void checkMaxSize(final Dimension screenSize,
            final Dimension frameSize) {
        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }
    }
1238133
public function setPageSize($pagesize)
    {
        if($pagesize>0)
           $this->pagesize = $pagesize;
        else 
           $this->pagesize = 20;
        
        $this->currentpage = 1;
        // $this->Reload();
    }
119929
public function resizeWindow($width, $height)
    {
        $this->webDriver->manage()->window()->setSize(new WebDriverDimension($width, $height));
    }
574461
public function resizeWindow($width, $height, $name = null)
    {
        $this->driver->resizeWindow($width, $height, $name);
    }
264897
def resize(widthWindow, heightWindow):
	""""""
	glViewport(0, 0, widthWindow, heightWindow)
	glMatrixMode(GL_PROJECTION)
	glLoadIdentity()
	gluPerspective(70, 1.0*widthWindow/heightWindow, 0.001, 10000.0)
	glMatrixMode(GL_MODELVIEW)
	glLoadIdentity()
775634
private function get_page_size(?int $pagesize) : int {
        if (null === $pagesize || $pagesize <= 0) {
            $pagesize = discussion_list_vault::PAGESIZE_DEFAULT;
        }

        return $pagesize;
    }