// Code generated by cmd/cgo; DO NOT EDIT.

//line /home/josie/.cache/paru/clone/wiiudownloader/src/pkg/mod/github.com/gotk3/gotk3@v0.6.5-0.20240618185848-ff349ae13f56/cairo/text.go:1:1
package cairo

// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import _ "unsafe"

import (
	"unsafe"
)

// FontSlant is a representation of Cairo's cairo_font_slant_t
type FontSlant int

const (
	FONT_SLANT_NORMAL  FontSlant = ( /*line :16:33*/_Ciconst_CAIRO_FONT_SLANT_NORMAL /*line :16:57*/)
	FONT_SLANT_ITALIC  FontSlant = ( /*line :17:33*/_Ciconst_CAIRO_FONT_SLANT_ITALIC /*line :17:57*/)
	FONT_SLANT_OBLIQUE FontSlant = ( /*line :18:33*/_Ciconst_CAIRO_FONT_SLANT_OBLIQUE /*line :18:58*/)
)

// FontWeight is a representation of Cairo's cairo_font_weight_t
type FontWeight int

const (
	FONT_WEIGHT_NORMAL FontWeight = ( /*line :25:34*/_Ciconst_CAIRO_FONT_WEIGHT_NORMAL /*line :25:59*/)
	FONT_WEIGHT_BOLD   FontWeight = ( /*line :26:34*/_Ciconst_CAIRO_FONT_WEIGHT_BOLD /*line :26:57*/)
)

func (v *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight) {
	cstr := ( /*line :30:10*/_Cfunc_CString /*line :30:18*/)(family)
	defer func() func() { _cgo0 := /*line :31:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); /*line :31:36*/_Cfunc_free(_cgo0); }}()()
	func() { _cgo0 := /*line :32:27*/v.native(); var _cgo1 *_Ctype_char = /*line :32:39*/(*_Ctype_char /*line :32:47*/)(cstr); var _cgo2 _Ctype_cairo_font_slant_t = _Ctype_cairo_font_slant_t /*line :32:76*/(slant); var _cgo3 _Ctype_cairo_font_weight_t = _Ctype_cairo_font_weight_t /*line :32:106*/(weight); _cgoCheckPointer(_cgo0, nil); /*line :32:115*/_Cfunc_cairo_select_font_face(_cgo0, _cgo1, _cgo2, _cgo3); }()
}

func (v *Context) SetFontSize(size float64) {
	func() { _cgo0 := /*line :36:24*/v.native(); var _cgo1 _Ctype_double = _Ctype_double /*line :36:44*/(size); _cgoCheckPointer(_cgo0, nil); /*line :36:51*/_Cfunc_cairo_set_font_size(_cgo0, _cgo1); }()
}

// TODO: cairo_set_font_matrix

// TODO: cairo_get_font_matrix

// TODO: cairo_set_font_options

// TODO: cairo_get_font_options

// TODO: cairo_set_font_face

// TODO: cairo_get_font_face

// TODO: cairo_set_scaled_font

// TODO: cairo_get_scaled_font

func (v *Context) ShowText(utf8 string) {
	cstr := ( /*line :56:10*/_Cfunc_CString /*line :56:18*/)(utf8)
	defer func() func() { _cgo0 := /*line :57:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); /*line :57:36*/_Cfunc_free(_cgo0); }}()()
	func() { _cgo0 := /*line :58:20*/v.native(); var _cgo1 *_Ctype_char = /*line :58:32*/(*_Ctype_char /*line :58:40*/)(cstr); _cgoCheckPointer(_cgo0, nil); /*line :58:48*/_Cfunc_cairo_show_text(_cgo0, _cgo1); }()
}

// TODO: cairo_show_glyphs

// TODO: cairo_show_text_glyphs

type FontExtents struct {
	Ascent      float64
	Descent     float64
	Height      float64
	MaxXAdvance float64
	MaxYAdvance float64
}

func (v *Context) FontExtents() FontExtents {
	var extents  /*line :74:14*/_Ctype_cairo_font_extents_t /*line :74:36*/
	func() { _cgo0 := /*line :75:23*/v.native(); var _cgo1 *_Ctype_struct___14 = /*line :75:35*/&extents; _cgoCheckPointer(_cgo0, nil); /*line :75:44*/_Cfunc_cairo_font_extents(_cgo0, _cgo1); }()
	return FontExtents{
		Ascent:      float64(extents.ascent),
		Descent:     float64(extents.descent),
		Height:      float64(extents.height),
		MaxXAdvance: float64(extents.max_x_advance),
		MaxYAdvance: float64(extents.max_y_advance),
	}
}

type TextExtents struct {
	XBearing float64
	YBearing float64
	Width    float64
	Height   float64
	XAdvance float64
	YAdvance float64
}

func (v *Context) TextExtents(utf8 string) TextExtents {
	cstr := ( /*line :95:10*/_Cfunc_CString /*line :95:18*/)(utf8)
	defer func() func() { _cgo0 := /*line :96:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); /*line :96:36*/_Cfunc_free(_cgo0); }}()()
	var extents  /*line :97:14*/_Ctype_cairo_text_extents_t /*line :97:36*/
	func() { _cgo0 := /*line :98:23*/v.native(); var _cgo1 *_Ctype_char = /*line :98:35*/(*_Ctype_char /*line :98:43*/)(cstr); var _cgo2 *_Ctype_struct___15 = /*line :98:52*/&extents; _cgoCheckPointer(_cgo0, nil); /*line :98:61*/_Cfunc_cairo_text_extents(_cgo0, _cgo1, _cgo2); }()
	return TextExtents{
		XBearing: float64(extents.x_bearing),
		YBearing: float64(extents.y_bearing),
		Width:    float64(extents.width),
		Height:   float64(extents.height),
		XAdvance: float64(extents.x_advance),
		YAdvance: float64(extents.y_advance),
	}
}

// TODO: cairo_glyph_extents

// TODO: cairo_toy_font_face_create

// TODO: cairo_toy_font_face_get_family

// TODO: cairo_toy_font_face_get_slant

// TODO: cairo_toy_font_face_get_weight

// TODO: cairo_glyph_allocate

// TODO: cairo_glyph_free

// TODO: cairo_text_cluster_allocate

// TODO: cairo_text_cluster_free
