// SendWindowSize mocks base method
182715
func (m *MockConnectionFlowController) SendWindowSize() protocol.ByteCount {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "SendWindowSize")
	ret0, _ := ret[0].(protocol.ByteCount)
	return ret0
}
309823
func (c *connectionFlowController) EnsureMinimumWindowSize(inc protocol.ByteCount) {
	c.mutex.Lock()
	if inc > c.receiveWindowSize {
		c.logger.Debugf("Increasing receive flow control window for the connection to %d kB, in response to stream flow control window increase", c.receiveWindowSize/(1<<10))
		c.receiveWindowSize = utils.MinByteCount(inc, c.maxReceiveWindowSize)
		c.startNewAutoTuningEpoch()
	}
	c.mutex.Unlock()
}
38321
func (r *Render) UpdateWinSize(ws *WinSize) {
	r.row = ws.Row
	r.col = ws.Col
	return
}
508859
func GetTerminalWindowSize(file *os.File) (*Size, error) {
	var info consoleScreenBufferInfo
	_, _, e := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, file.Fd(), uintptr(unsafe.Pointer(&info)), 0)
	if e != 0 {
		return nil, error(e)
	}
	return &Size{
		Lines:   int(info.size.y),
		Columns: int(info.size.x),
	}, nil
}
1205859
func terminalSize(out *os.File) (int, int, error) {
	ws := new(winsize)

	_, _, err := unix.Syscall(unix.SYS_IOCTL, out.Fd(),
		uintptr(unix.TIOCGWINSZ), uintptr(unsafe.Pointer(ws)))
	if err != 0 {
		return 0, 0, err
	}

	return int(ws.cols), int(ws.rows), nil
}
1257293
func MoveresizeWindow(xu *xgbutil.XUtil, win xproto.Window,
	x, y, w, h int) error {

	return MoveresizeWindowExtra(xu, win, x, y, w, h, xproto.GravityBitForget,
		2, true, true)
}
725279
func GetWinSize(fd int) *Winsize {
	ws := &Winsize{}
	retCode, _, errno := syscall.Syscall(
		syscall.SYS_IOCTL,
		uintptr(fd),
		uintptr(syscall.TIOCGWINSZ),
		uintptr(unsafe.Pointer(ws)))

	if int(retCode) == -1 {
		panic(errno)
	}
	return ws
}
467303
func WithWindowsIgnoreFlushesDuringBoot() SpecOpts {
	return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
		if s.Windows == nil {
			s.Windows = &specs.Windows{}
		}
		s.Windows.IgnoreFlushesDuringBoot = true
		return nil
	}
}
845462
func (c *baseFlowController) UpdateSendWindow(offset protocol.ByteCount) {
	if offset > c.sendWindow {
		c.sendWindow = offset
	}
}
1190244
func (w *Window) GetSize() (width, height int) {
	var wi, h C.int
	C.glfwGetWindowSize(w.data, &wi, &h)
	return int(wi), int(h)
}
150621
func (s *GetFileOutput) SetFileSize(v int64) *GetFileOutput {
	s.FileSize = &v
	return s
}
1
func (p *MediaPlaylist) SetWinSize(winsize uint) error {
	if winsize > p.capacity {
		return errors.New("capacity must be greater than winsize or equal")
	}
	p.winsize = winsize
	return nil
}
600145
func (h *Client) ViewportSize(viewportSize string) *Client {
	h.viewportSize = viewportSize
	h.viewportSizeSet = true
	return h
}
851069
func (e *endpoint) zeroReceiveWindow(scale uint8) bool {
	if e.rcvBufUsed >= e.rcvBufSize {
		return true
	}

	return ((e.rcvBufSize - e.rcvBufUsed) >> scale) == 0
}
1110058
func DetectWinSize() *WinSize {
	w := &WinSize{
		make(chan bool),
		make(chan bool),
		make(chan bool),
	}

	changeSig := make(chan os.Signal)
	signal.Notify(changeSig, unix.SIGWINCH)

	go func() {
		for {
			select {
			case <-changeSig:
				// Add a pause because it is sent two signals at maximizing a window.
				time.Sleep(7 * time.Millisecond)
				w.Change <- true
			case <-w.quit:
				w.wait <- true
				return
			}
		}
	}()
	return w
}
632533
func (s *Stream) sendWindowUpdate() error {
	s.controlHdrLock.Lock()
	defer s.controlHdrLock.Unlock()

	// Determine the delta update
	max := s.session.config.MaxStreamWindowSize
	var bufLen uint32
	s.recvLock.Lock()
	if s.recvBuf != nil {
		bufLen = uint32(s.recvBuf.Len())
	}
	delta := (max - bufLen) - s.recvWindow

	// Determine the flags if any
	flags := s.sendFlags()

	// Check if we can omit the update
	if delta < (max/2) && flags == 0 {
		s.recvLock.Unlock()
		return nil
	}

	// Update our window
	s.recvWindow += delta
	s.recvLock.Unlock()

	// Send the header
	s.controlHdr.encode(typeWindowUpdate, flags, s.id, delta)
	if err := s.session.waitForSendErr(s.controlHdr, nil, s.controlErr); err != nil {
		return err
	}
	return nil
}
332837
func (m *MockBytes) Resize(arg0 int) {
	m.ctrl.Call(m, "Resize", arg0)
}