// See cairo_image_surface_get_height().
//
// C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-height
486517
func (surface *ImageSurface) GetHeight() int {
	ret := int(C.cairo_image_surface_get_height(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
625807
func (fl *FileLedger) Height() uint64 {
	info, err := fl.blockStore.GetBlockchainInfo()
	if err != nil {
		logger.Panic(err)
	}
	return info.Height
}
334601
func (apic *APICache) GetBlockHash(height int64) string {
	if !apic.IsEnabled() {
		return ""
	}
	hash, ok := apic.blockHash(height)
	if !ok {
		return ""
	}
	return hash.String()
}
1129219
func (t Text) Height() float32 {
	atlas, ok := atlasCache[*t.Font]
	if !ok {
		// Generate texture first
		atlas = t.Font.generateFontAtlas(200)
		atlasCache[*t.Font] = atlas
	}

	var currentY float32
	var totalY float32
	var tallest float32

	for _, char := range t.Text {
		// TODO: this might not work for all characters
		switch {
		case char == '\n':
			totalY += tallest
			tallest = float32(0)
			continue
		case char < 32: // all system stuff should be ignored
			continue
		}
		currentY = atlas.Height[char] + t.LineSpacing*atlas.Height[char]
		if currentY > tallest {
			tallest = currentY
		}
	}
	return totalY + tallest
}
502643
func ImageSurfaceCreate(format Format, width, height int) *ImageSurface {
	ret := &ImageSurface{wrapSurface(C.cairo_image_surface_create(C.cairo_format_t(format), C.int(width), C.int(height)))}
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
785768
func GetXY(x int, y int) (int, int) {
	if y == -1 {
		y = CurrentHeight() + 1
	}

	if x&PCT != 0 {
		x = int((x & 0xFF) * Width() / 100)
	}

	if y&PCT != 0 {
		y = int((y & 0xFF) * Height() / 100)
	}

	return x, y
}
690830
func (surface *XlibSurface) GetDisplay() unsafe.Pointer {
	ret := unsafe.Pointer(C.cairo_xlib_surface_get_display(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
799464
func GetSize(fd int) (width, height int, err error) {
	return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
}
1317242
func (cr *Context) GetFontFace() *FontFace {
	ret := wrapFontFace(C.cairo_get_font_face(cr.Ptr))
	if err := cr.status(); err != nil {
		panic(err)
	}
	return ret
}
118144
func (f *File) GetRowHeight(sheet string, row int) (float64, error) {
	if row < 1 {
		return defaultRowHeightPixels, newInvalidRowNumberError(row)
	}

	xlsx, err := f.workSheetReader(sheet)
	if err != nil {
		return defaultRowHeightPixels, err
	}
	if row > len(xlsx.SheetData.Row) {
		return defaultRowHeightPixels, nil // it will be better to use 0, but we take care with BC
	}
	for _, v := range xlsx.SheetData.Row {
		if v.R == row && v.Ht != 0 {
			return v.Ht, nil
		}
	}
	// Optimisation for when the row heights haven't changed.
	return defaultRowHeightPixels, nil
}
1307954
func GetSize(fd int) (width, height int, err error) {
	var info consoleScreenBufferInfo
	_, _, e := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&info)), 0)
	if e != 0 {
		return 0, 0, error(e)
	}
	return int(info.size.x), int(info.size.y), nil
}
736498
func (apic *APICache) GetBlockSize(height int64) int32 {
	if !apic.IsEnabled() {
		return -1
	}
	cachedBlock := apic.GetCachedBlockByHeight(height)
	if cachedBlock != nil && cachedBlock.summary != nil {
		return int32(cachedBlock.summary.Size)
	}
	return -1
}
273230
func (v *Widget) GetSizeRequest() (width int, height int) {
	var w, h C.gint
	C.gtk_widget_get_size_request(v.GWidget, &w, &h)
	return int(w), int(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
}
700481
func (v *Window) GetSize() (width int, height int) {
	var cwidth, cheight C.gint
	C.gtk_window_get_size(WINDOW(v), &cwidth, &cheight)
	return int(cwidth), int(cheight)
}
430259
func (i *ImageSurface) Data() []byte {
	buf := C.cairo_image_surface_get_data(i.Ptr)
	return C.GoBytes(unsafe.Pointer(buf), C.int(i.GetStride()*i.GetHeight()))
}
757595
func (b Box) Height() int {
	return util.Math.AbsInt(b.Bottom - b.Top)
}