// 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/pango/pango-attributes.go:1:1
/*
 * Copyright (c) 2015- terrak <terrak1975@gmail.com>
 *
 * This file originated from: http://www.terrak.net/
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

package pango

// #include <pango/pango.h>
// #include "pango.go.h"
import _ "unsafe"
import (
	"unsafe"

	"github.com/gotk3/gotk3/glib"
)

func init() {
	tm := []glib.TypeMarshaler{
		// Enums
		{glib.Type(( /*line :33:14*/_Cfunc_pango_attr_type_get_type /*line :33:39*/)()), marshalAttrType},
		{glib.Type(( /*line :34:14*/_Cfunc_pango_underline_get_type /*line :34:39*/)()), marshalUnderline},
	}
	glib.RegisterGValueMarshalers(tm)
}

/* PangoColor */

// Color is a representation of PangoColor.
type Color struct {
	pangoColor * /*line :43:14*/_Ctype_PangoColor /*line :43:26*/
}

// Native returns a pointer to the underlying PangoColor.
func (v *Color) Native() uintptr {
	return uintptr(unsafe.Pointer(v.native()))
}

func (v *Color) native() * /*line :51:27*/_Ctype_PangoColor /*line :51:39*/ {
	return (* /*line :52:11*/_Ctype_PangoColor /*line :52:23*/)(unsafe.Pointer(v.pangoColor))
}

// Set sets the new values for the red, green, and blue color properties.
func (v *Color) Set(red, green, blue uint16) {
	v.native().red =  /*line :57:19*/_Ctype_guint16 /*line :57:28*/(red)
	v.native().green =  /*line :58:21*/_Ctype_guint16 /*line :58:30*/(green)
	v.native().blue =  /*line :59:20*/_Ctype_guint16 /*line :59:29*/(blue)
}

// Get returns the red, green, and blue color values.
func (v *Color) Get() (red, green, blue uint16) {
	return uint16(v.native().red), uint16(v.native().green), uint16(v.native().blue)
}

// Copy is a wrapper around "pango_color_copy".
func (v *Color) Copy(c *Color) *Color {
	w := new(Color)
	w.pangoColor = ( /*line :70:17*/_Cfunc_pango_color_copy /*line :70:34*/)(v.native())
	return w
}

// Free is a wrapper around "pango_color_free".
func (v *Color) Free() {
	( /*line :76:2*/_Cfunc_pango_color_free /*line :76:19*/)(v.native())
}

// Parse is a wrapper around "pango_color_parse".
func (v *Color) Parse(spec string) bool {
	cstr := ( /*line :81:10*/_Cfunc_CString /*line :81:18*/)(spec)
	defer func() func() { _cgo0 := /*line :82:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); /*line :82:36*/_Cfunc_free(_cgo0); }}()()
	c := ( /*line :83:7*/_Cfunc_pango_color_parse /*line :83:25*/)(v.native(), (* /*line :83:41*/_Ctype_char /*line :83:47*/)(cstr))
	return gobool(c)
}

// ToString is a wrapper around "pango_color_to_string".
func (v *Color) ToString() string {
	c := ( /*line :89:7*/_Cfunc_pango_color_to_string /*line :89:29*/)(v.native())
	return ( /*line :90:9*/_Cfunc_GoString /*line :90:18*/)((* /*line :90:22*/_Ctype_char /*line :90:28*/)(c))
}

/* ---  ---  --- Attributes ---  ---  ---  */

// AttrList is a representation of PangoAttrList.
type AttrList struct {
	internal * /*line :97:12*/_Ctype_PangoAttrList /*line :97:27*/
}

// Native returns a pointer to the underlying PangoLayout.
func (v *AttrList) Native() uintptr {
	return uintptr(unsafe.Pointer(v.native()))
}

func (v *AttrList) native() * /*line :105:30*/_Ctype_PangoAttrList /*line :105:45*/ {
	return func() *_Ctype_struct__PangoAttrList{ _cgo0 := /*line :106:27*/unsafe.Pointer(v.internal); _cgoCheckPointer(_cgo0, nil); return /*line :106:54*/_Cfunc_toPangoAttrList(_cgo0); }()
}

func wrapAttrList(c * /*line :109:22*/_Ctype_PangoAttrList /*line :109:37*/) *AttrList {
	if c == nil {
		return nil
	}

	return &AttrList{c}
}

// WrapAttrList wraps a unsafe.Pointer as a AttrList.
// This function is exported for visibility in other gotk3 packages and
// is not meant to be used by applications.
func WrapAttrList(ptr unsafe.Pointer) *AttrList {
	internal := func() *_Ctype_struct__PangoAttrList{ _cgo0 := /*line :121:32*/ptr; _cgoCheckPointer(_cgo0, nil); return /*line :121:36*/_Cfunc_toPangoAttrList(_cgo0); }()
	if internal == nil {
		return nil
	}

	return &AttrList{internal}
}

// Insert is a wrapper around "pango_attr_list_insert".
func (v *AttrList) Insert(attribute *Attribute) {
	func() { _cgo0 := /*line :131:27*/v.internal; _cgo1 := /*line :131:39*/attribute.native(); _cgoCheckPointer(_cgo0, nil); _cgoCheckPointer(_cgo1, nil); /*line :131:58*/_Cfunc_pango_attr_list_insert(_cgo0, _cgo1); }()
}

// GetAttributes is a wrapper around "pango_attr_list_get_attributes".
func (v *AttrList) GetAttributes() (*glib.SList, error) {
	orig := func() *_Ctype_struct__PangoAttrIterator{ _cgo0 := /*line :136:41*/v.internal; _cgoCheckPointer(_cgo0, nil); return /*line :136:52*/_Cfunc_pango_attr_list_get_iterator(_cgo0); }()
	iter := func() *_Ctype_struct__PangoAttrIterator{ _cgo0 := /*line :137:37*/orig; _cgoCheckPointer(_cgo0, nil); return /*line :137:42*/_Cfunc_pango_attr_iterator_copy(_cgo0); }()

	gslist := (* /*line :139:14*/_Ctype_struct__GSList /*line :139:30*/)(func() *_Ctype_struct__GSList{ _cgo0 := /*line :139:64*/iter; _cgoCheckPointer(_cgo0, nil); return /*line :139:69*/_Cfunc_pango_attr_iterator_get_attrs(_cgo0); }())
	list := glib.WrapSList(uintptr(unsafe.Pointer(gslist)))
	if list == nil {
		return nil, nilPtrErr
	}

	list.DataWrapper(func(ptr unsafe.Pointer) interface{} {
		return &Attribute{(* /*line :146:23*/_Ctype_PangoAttribute /*line :146:39*/)(ptr)}
	})

	return list, nil
}

// AttrListNew is a wrapper around "pango_attr_list_new".
func AttrListNew() *AttrList {
	c := ( /*line :154:7*/_Cfunc_pango_attr_list_new /*line :154:27*/)()
	return wrapAttrList(c)
}

// AttrType is a representation of Pango's PangoAttrType.
type AttrType int

const (
	ATTR_INVALID             AttrType = ( /*line :162:38*/_Ciconst_PANGO_ATTR_INVALID /*line :162:57*/)             /* 0 is an invalid attribute type */
	ATTR_LANGUAGE            AttrType = ( /*line :163:38*/_Ciconst_PANGO_ATTR_LANGUAGE /*line :163:58*/)            /* PangoAttrLanguage */
	ATTR_FAMILY              AttrType = ( /*line :164:38*/_Ciconst_PANGO_ATTR_FAMILY /*line :164:56*/)              /* PangoAttrString */
	ATTR_STYLE               AttrType = ( /*line :165:38*/_Ciconst_PANGO_ATTR_STYLE /*line :165:55*/)               /* PangoAttrInt */
	ATTR_WEIGHT              AttrType = ( /*line :166:38*/_Ciconst_PANGO_ATTR_WEIGHT /*line :166:56*/)              /* PangoAttrInt */
	ATTR_VARIANT             AttrType = ( /*line :167:38*/_Ciconst_PANGO_ATTR_VARIANT /*line :167:57*/)             /* PangoAttrInt */
	ATTR_STRETCH             AttrType = ( /*line :168:38*/_Ciconst_PANGO_ATTR_STRETCH /*line :168:57*/)             /* PangoAttrInt */
	ATTR_SIZE                AttrType = ( /*line :169:38*/_Ciconst_PANGO_ATTR_SIZE /*line :169:54*/)                /* PangoAttrSize */
	ATTR_FONT_DESC           AttrType = ( /*line :170:38*/_Ciconst_PANGO_ATTR_FONT_DESC /*line :170:59*/)           /* PangoAttrFontDesc */
	ATTR_FOREGROUND          AttrType = ( /*line :171:38*/_Ciconst_PANGO_ATTR_FOREGROUND /*line :171:60*/)          /* PangoAttrColor */
	ATTR_BACKGROUND          AttrType = ( /*line :172:38*/_Ciconst_PANGO_ATTR_BACKGROUND /*line :172:60*/)          /* PangoAttrColor */
	ATTR_UNDERLINE           AttrType = ( /*line :173:38*/_Ciconst_PANGO_ATTR_UNDERLINE /*line :173:59*/)           /* PangoAttrInt */
	ATTR_STRIKETHROUGH       AttrType = ( /*line :174:38*/_Ciconst_PANGO_ATTR_STRIKETHROUGH /*line :174:63*/)       /* PangoAttrInt */
	ATTR_RISE                AttrType = ( /*line :175:38*/_Ciconst_PANGO_ATTR_RISE /*line :175:54*/)                /* PangoAttrInt */
	ATTR_SHAPE               AttrType = ( /*line :176:38*/_Ciconst_PANGO_ATTR_SHAPE /*line :176:55*/)               /* PangoAttrShape */
	ATTR_SCALE               AttrType = ( /*line :177:38*/_Ciconst_PANGO_ATTR_SCALE /*line :177:55*/)               /* PangoAttrFloat */
	ATTR_FALLBACK            AttrType = ( /*line :178:38*/_Ciconst_PANGO_ATTR_FALLBACK /*line :178:58*/)            /* PangoAttrInt */
	ATTR_LETTER_SPACING      AttrType = ( /*line :179:38*/_Ciconst_PANGO_ATTR_LETTER_SPACING /*line :179:64*/)      /* PangoAttrInt */
	ATTR_UNDERLINE_COLOR     AttrType = ( /*line :180:38*/_Ciconst_PANGO_ATTR_UNDERLINE_COLOR /*line :180:65*/)     /* PangoAttrColor */
	ATTR_STRIKETHROUGH_COLOR AttrType = ( /*line :181:38*/_Ciconst_PANGO_ATTR_STRIKETHROUGH_COLOR /*line :181:69*/) /* PangoAttrColor */
	ATTR_ABSOLUTE_SIZE       AttrType = ( /*line :182:38*/_Ciconst_PANGO_ATTR_ABSOLUTE_SIZE /*line :182:63*/)       /* PangoAttrSize */
	ATTR_GRAVITY             AttrType = ( /*line :183:38*/_Ciconst_PANGO_ATTR_GRAVITY /*line :183:57*/)             /* PangoAttrInt */
	ATTR_GRAVITY_HINT        AttrType = ( /*line :184:38*/_Ciconst_PANGO_ATTR_GRAVITY_HINT /*line :184:62*/)        /* PangoAttrInt */

)

func marshalAttrType(p uintptr) (interface{}, error) {
	c := ( /*line :189:7*/_Cfunc_g_value_get_enum /*line :189:24*/)((* /*line :189:28*/_Ctype_GValue /*line :189:36*/)(unsafe.Pointer(p)))
	return AttrType(c), nil
}

// Underline is a representation of Pango's PangoUnderline.
type Underline int

const (
	UNDERLINE_NONE   Underline = ( /*line :197:31*/_Ciconst_PANGO_UNDERLINE_NONE /*line :197:52*/)
	UNDERLINE_SINGLE Underline = ( /*line :198:31*/_Ciconst_PANGO_UNDERLINE_SINGLE /*line :198:54*/)
	UNDERLINE_DOUBLE Underline = ( /*line :199:31*/_Ciconst_PANGO_UNDERLINE_DOUBLE /*line :199:54*/)
	UNDERLINE_LOW    Underline = ( /*line :200:31*/_Ciconst_PANGO_UNDERLINE_LOW /*line :200:51*/)
	UNDERLINE_ERROR  Underline = ( /*line :201:31*/_Ciconst_PANGO_UNDERLINE_ERROR /*line :201:53*/)
)

func marshalUnderline(p uintptr) (interface{}, error) {
	c := ( /*line :205:7*/_Cfunc_g_value_get_enum /*line :205:24*/)((* /*line :205:28*/_Ctype_GValue /*line :205:36*/)(unsafe.Pointer(p)))
	return Underline(c), nil
}

const (
	ATTR_INDEX_FROM_TEXT_BEGINNING uint = 0
	ATTR_INDEX_TO_TEXT_END         uint = ( /*line :211:40*/_Ciconst_G_MAXUINT /*line :211:50*/)
)

// Attribute is a representation of Pango's PangoAttribute.
type Attribute struct {
	internal * /*line :216:12*/_Ctype_PangoAttribute /*line :216:28*/
}

// Native returns a pointer to the underlying PangoColor.
func (v *Attribute) Native() uintptr {
	return uintptr(unsafe.Pointer(v.native()))
}

func (v *Attribute) native() * /*line :224:31*/_Ctype_PangoAttribute /*line :224:47*/ {
	return (* /*line :225:11*/_Ctype_PangoAttribute /*line :225:27*/)(unsafe.Pointer(v.internal))
}

// GetStartIndex returns the index of the start of the attribute application in the text.
func (v *Attribute) GetStartIndex() uint {
	return uint(v.internal.start_index)
}

// SetStartIndex sets the index of the start of the attribute application in the text.
func (v *Attribute) SetStartIndex(setting uint) {
	v.internal.start_index =  /*line :235:27*/_Ctype_guint /*line :235:34*/(setting)
}

// GetEndIndex returns the index of the end of the attribute application in the text.
func (v *Attribute) GetEndIndex() uint {
	return uint(v.internal.end_index)
}

// SetEndIndex the index of the end of the attribute application in the text.
func (v *Attribute) SetEndIndex(setting uint) {
	v.internal.end_index =  /*line :245:25*/_Ctype_guint /*line :245:32*/(setting)
}

/*
//typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute,
//					 gpointer        user_data);
func (v *Attribute) AttrFilterFunc(user_data uintptr) bool {
	c := C.PangoAttrFilterFunc(Attribute.native(), C.gpointer(user_data))
	return gobool(c)
}

//typedef gpointer (*PangoAttrDataCopyFunc) (gconstpointer user_data);
func AttrDataCopyFunc(user_data uintptr) uintptr {
	c := C.PangoAttrDataCopyFunc(C.gpointer(user_data))
	return uintptr(c)
}
*/

// AttrClass is a representation of Pango's PangoAttrClass.
type AttrClass struct {
	//PangoAttrType type;
}

// AttrString is a representation of Pango's PangoAttrString.
type AttrString struct {
	Attribute
	//char *value;
}

// AttrLanguage is a representation of Pango's PangoAttrLanguage.
type AttrLanguage struct {
	Attribute
	//PangoLanguage *value;
}

// AttrInt is a representation of Pango's PangoAttrInt.
type AttrInt struct {
	Attribute
	//int value;
}

// AttrFloat is a representation of Pango's PangoAttrFloat.
type AttrFloat struct {
	Attribute
	//double value;
}

// AttrColor is a representation of Pango's AttrColor.
type AttrColor struct {
	Attribute
	Color
}

// AttrSize is a representation of Pango's PangoAttrSize.
type AttrSize struct {
	Attribute
	//int size;
	//guint absolute : 1;
}

// AttrShape is a representation of Pango's PangoAttrShape.
type AttrShape struct {
	Attribute
	//PangoRectangle ink_rect;
	//PangoRectangle logical_rect;

	//gpointer              data;
	//PangoAttrDataCopyFunc copy_func;
	//GDestroyNotify        destroy_func;
}

// AttrFontDesc is a representation of Pango's PangoAttrFontDesc.
type AttrFontDesc struct {
	Attribute
	//PangoFontDescription *desc;
}

/*
PangoAttrType         pango_attr_type_register (const gchar        *name);
const char *          pango_attr_type_get_name (PangoAttrType       type) G_GNUC_CONST;

void             pango_attribute_init        (PangoAttribute       *attr,
					      const PangoAttrClass *klass);
PangoAttribute * pango_attribute_copy        (const PangoAttribute *attr);
void             pango_attribute_destroy     (PangoAttribute       *attr);
gboolean         pango_attribute_equal       (const PangoAttribute *attr1,
					      const PangoAttribute *attr2) G_GNUC_PURE;

PangoAttribute *pango_attr_language_new      (PangoLanguage              *language);
PangoAttribute *pango_attr_family_new        (const char                 *family);
PangoAttribute *pango_attr_foreground_new    (guint16                     red,
					      guint16                     green,
					      guint16                     blue);
PangoAttribute *pango_attr_background_new    (guint16                     red,
					      guint16                     green,
					      guint16                     blue);
PangoAttribute *pango_attr_size_new          (int                         size);
PangoAttribute *pango_attr_size_new_absolute (int                         size);
PangoAttribute *pango_attr_style_new         (PangoStyle                  style);
PangoAttribute *pango_attr_weight_new        (PangoWeight                 weight);
PangoAttribute *pango_attr_variant_new       (PangoVariant                variant);
PangoAttribute *pango_attr_stretch_new       (PangoStretch                stretch);
PangoAttribute *pango_attr_font_desc_new     (const PangoFontDescription *desc);

PangoAttribute *pango_attr_underline_new           (PangoUnderline underline);
PangoAttribute *pango_attr_underline_color_new     (guint16        red,
						    guint16        green,
						    guint16        blue);
PangoAttribute *pango_attr_strikethrough_new       (gboolean       strikethrough);
PangoAttribute *pango_attr_strikethrough_color_new (guint16        red,
						    guint16        green,
						    guint16        blue);

PangoAttribute *pango_attr_rise_new          (int                         rise);
PangoAttribute *pango_attr_scale_new         (double                      scale_factor);
PangoAttribute *pango_attr_fallback_new      (gboolean                    enable_fallback);
PangoAttribute *pango_attr_letter_spacing_new (int                        letter_spacing);

PangoAttribute *pango_attr_shape_new           (const PangoRectangle       *ink_rect,
						const PangoRectangle       *logical_rect);
PangoAttribute *pango_attr_shape_new_with_data (const PangoRectangle       *ink_rect,
						const PangoRectangle       *logical_rect,
						gpointer                    data,
						PangoAttrDataCopyFunc       copy_func,
						GDestroyNotify              destroy_func);

PangoAttribute *pango_attr_gravity_new      (PangoGravity     gravity);
PangoAttribute *pango_attr_gravity_hint_new (PangoGravityHint hint);

GType              pango_attr_list_get_type      (void) G_GNUC_CONST;
PangoAttrList *    pango_attr_list_new           (void);
PangoAttrList *    pango_attr_list_ref           (PangoAttrList  *list);
void               pango_attr_list_unref         (PangoAttrList  *list);
PangoAttrList *    pango_attr_list_copy          (PangoAttrList  *list);
void               pango_attr_list_insert        (PangoAttrList  *list,
						  PangoAttribute *attr);
void               pango_attr_list_insert_before (PangoAttrList  *list,
						  PangoAttribute *attr);
void               pango_attr_list_change        (PangoAttrList  *list,
						  PangoAttribute *attr);
void               pango_attr_list_splice        (PangoAttrList  *list,
						  PangoAttrList  *other,
						  gint            pos,
						  gint            len);

PangoAttrList *pango_attr_list_filter (PangoAttrList       *list,
				       PangoAttrFilterFunc  func,
				       gpointer             data);

PangoAttrIterator *pango_attr_list_get_iterator  (PangoAttrList  *list);

void               pango_attr_iterator_range    (PangoAttrIterator     *iterator,
						 gint                  *start,
						 gint                  *end);
gboolean           pango_attr_iterator_next     (PangoAttrIterator     *iterator);
PangoAttrIterator *pango_attr_iterator_copy     (PangoAttrIterator     *iterator);
void               pango_attr_iterator_destroy  (PangoAttrIterator     *iterator);
PangoAttribute *   pango_attr_iterator_get      (PangoAttrIterator     *iterator,
						 PangoAttrType          type);
void               pango_attr_iterator_get_font (PangoAttrIterator     *iterator,
						 PangoFontDescription  *desc,
						 PangoLanguage        **language,
						 GSList               **extra_attrs);
GSList *          pango_attr_iterator_get_attrs (PangoAttrIterator     *iterator);


gboolean pango_parse_markup (const char                 *markup_text,
			     int                         length,
			     gunichar                    accel_marker,
			     PangoAttrList             **attr_list,
			     char                      **text,
			     gunichar                   *accel_char,
			     GError                    **error);

GMarkupParseContext * pango_markup_parser_new (gunichar               accel_marker);
gboolean              pango_markup_parser_finish (GMarkupParseContext   *context,
                                                  PangoAttrList        **attr_list,
                                                  char                 **text,
                                                  gunichar              *accel_char,
                                                  GError               **error);
*/
