// GetScreenSize get the screen size
777152
func GetScreenSize() (int, int) {
	size := C.get_screen_size()
	// fmt.Println("...", size, size.width)
	return int(size.width), int(size.height)
}
577806
func (v *Window) GetDefaultSize() (width int, height int) {
	var cwidth, cheight C.gint
	C.gtk_window_get_default_size(WINDOW(v), &cwidth, &cheight)
	return int(cwidth), int(cheight)
}
1100536
func (r *Repository) GetSize() int {
	if r == nil || r.Size == nil {
		return 0
	}
	return *r.Size
}
1269261
func GetBackedSize(ds Read, key Key) (int, error) {
	value, err := ds.Get(key)
	if err == nil {
		return len(value), nil
	}
	return -1, err
}
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
}
201257
func GetTerminalSize() TerminalWindowSize {
	res, err := GetTerminalSizeErr()
	if err != nil {
		res = DefaultTerminalWindowSize
		warnTerminalSizeOnce.Do(func() {
			Log.Warnf("Failed to get terminal size: %v. Using default: %+v", err, DefaultTerminalWindowSize)
		})
	}
	return res
}
747628
func getDeviceSize(dev string) (uint64, error) {
	cmd := exec.Command("lsblk", "-dbno", "SIZE", dev)
	out, err := cmd.Output()
	if err != nil {
		return 0, err
	}
	var size uint64
	if size, err = strconv.ParseUint(strings.TrimSpace(string(out)), 10, 64); err != nil {
		return 0, err
	}
	return size, nil
}
1167299
func (renderer *Renderer) GetOutputSize() (w, h int32, err error) {
	ret := C.SDL_GetRendererOutputSize(
		renderer.cptr(),
		(*C.int)(unsafe.Pointer(&w)),
		(*C.int)(unsafe.Pointer(&h)))
	err = errorFromInt(int(ret))
	return
}
709776
func (renderer *Renderer) GetScale() (scaleX, scaleY float32) {
	C.SDL_RenderGetScale(
		renderer.cptr(),
		(*C.float)(unsafe.Pointer(&scaleX)),
		(*C.float)(unsafe.Pointer(&scaleY)))
	return
}
315260
func (w *Writer) GetTermDimensions() (int, int) {
	f, ok := io.Writer(w.Out).(*os.File)
	if !ok {
		return 80, 25
	}
	fd := f.Fd()
	var csbi consoleScreenBufferInfo
	procGetConsoleScreenBufferInfo.Call(fd, uintptr(unsafe.Pointer(&csbi)))
	return int(csbi.maximumWindowSize.x), int(csbi.maximumWindowSize.y)
}
39962
func (_class HostPatchClass) GetSize(sessionID SessionRef, self HostPatchRef) (_retval int, _err error) {
	_method := "host_patch.get_size"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostPatchRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
	return
}
708330
func (window *Window) GetSize() (w, h int32) {
	var _w, _h C.int
	C.SDL_GetWindowSize(window.cptr(), &_w, &_h)
	return int32(_w), int32(_h)
}
1301913
func (image *Image) GetSize() (size uint64, err error) {
	if image.image == nil {
		return 0, RbdErrorImageNotOpen
	}

	if ret := C.rbd_get_size(image.image, (*C.uint64_t)(&size)); ret < 0 {
		return 0, RBDError(ret)
	}

	return size, nil
}
535494
func (f *Filestore) GetSize(c cid.Cid) (int, error) {
	size, err := f.bs.GetSize(c)
	switch err {
	case nil:
		return size, nil
	case blockstore.ErrNotFound:
		return f.fm.GetSize(c)
	default:
		return -1, err
	}
}
72919
func (document *Document) GetSize() (int, int) {
	width := C.long(0)
	heigth := C.long(0)
	C.get_document_size(document.handle, &width, &heigth)
	return int(width), int(heigth)
}
1275915
func (o ObjectInfo) GetActualSize() int64 {
	metadata := o.UserDefined
	sizeStr, ok := metadata[ReservedMetadataPrefix+"actual-size"]
	if ok {
		size, err := strconv.ParseInt(sizeStr, 10, 64)
		if err == nil {
			return size
		}
	}
	return -1
}
1172900
func GetSize() (ws Size, err error) {
	var wsz *unix.Winsize
	wsz, err = unix.IoctlGetWinsize(syscall.Stdout, TIOCGWINSZ)

	if err != nil {
		ws = Size{80, 25, 0, 0}
	} else {
		ws = Size{wsz.Row, wsz.Col, wsz.Xpixel, wsz.Ypixel}
	}
	return ws, err
}