1// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package pango
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/glib"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15// Type of a function that can duplicate user data for an attribute.
16type AttrDataCopyFunc func(uintptr) uintptr
17
18// Type of a function filtering a list of attributes.
19type AttrFilterFunc func(*Attribute, uintptr) bool
20
21// The `PangoAttrClass` structure stores the type and operations for
22// a particular type of attribute.
23//
24// The functions in this structure should not be called directly. Instead,
25// one should use the wrapper functions provided for `PangoAttribute`.
26type AttrClass struct {
27 _ structs.HostLayout
28
29 Type AttrType
30
31 xCopy uintptr
32
33 xDestroy uintptr
34
35 xEqual uintptr
36}
37
38func (x *AttrClass) GoPointer() uintptr {
39 return uintptr(unsafe.Pointer(x))
40}
41
42// OverrideCopy sets the "copy" callback function.
43// function to duplicate an attribute of this type
44//
45// (see [method@Pango.Attribute.copy])
46func (x *AttrClass) OverrideCopy(cb func(*Attribute) *Attribute) {
47 if cb == nil {
48 x.xCopy = 0
49 } else {
50 x.xCopy = purego.NewCallback(func(AttrVarp *Attribute) *Attribute {
51 return cb(AttrVarp)
52 })
53 }
54}
55
56// GetCopy gets the "copy" callback function.
57// function to duplicate an attribute of this type
58//
59// (see [method@Pango.Attribute.copy])
60func (x *AttrClass) GetCopy() func(*Attribute) *Attribute {
61 if x.xCopy == 0 {
62 return nil
63 }
64 var rawCallback func(AttrVarp *Attribute) *Attribute
65 purego.RegisterFunc(&rawCallback, x.xCopy)
66 return func(AttrVar *Attribute) *Attribute {
67 return rawCallback(AttrVar)
68 }
69}
70
71// OverrideDestroy sets the "destroy" callback function.
72// function to free an attribute of this type
73//
74// (see [method@Pango.Attribute.destroy])
75func (x *AttrClass) OverrideDestroy(cb func(*Attribute)) {
76 if cb == nil {
77 x.xDestroy = 0
78 } else {
79 x.xDestroy = purego.NewCallback(func(AttrVarp *Attribute) {
80 cb(AttrVarp)
81 })
82 }
83}
84
85// GetDestroy gets the "destroy" callback function.
86// function to free an attribute of this type
87//
88// (see [method@Pango.Attribute.destroy])
89func (x *AttrClass) GetDestroy() func(*Attribute) {
90 if x.xDestroy == 0 {
91 return nil
92 }
93 var rawCallback func(AttrVarp *Attribute)
94 purego.RegisterFunc(&rawCallback, x.xDestroy)
95 return func(AttrVar *Attribute) {
96 rawCallback(AttrVar)
97 }
98}
99
100// OverrideEqual sets the "equal" callback function.
101// function to check two attributes of this type for equality
102//
103// (see [method@Pango.Attribute.equal])
104func (x *AttrClass) OverrideEqual(cb func(*Attribute, *Attribute) bool) {
105 if cb == nil {
106 x.xEqual = 0
107 } else {
108 x.xEqual = purego.NewCallback(func(Attr1Varp *Attribute, Attr2Varp *Attribute) bool {
109 return cb(Attr1Varp, Attr2Varp)
110 })
111 }
112}
113
114// GetEqual gets the "equal" callback function.
115// function to check two attributes of this type for equality
116//
117// (see [method@Pango.Attribute.equal])
118func (x *AttrClass) GetEqual() func(*Attribute, *Attribute) bool {
119 if x.xEqual == 0 {
120 return nil
121 }
122 var rawCallback func(Attr1Varp *Attribute, Attr2Varp *Attribute) bool
123 purego.RegisterFunc(&rawCallback, x.xEqual)
124 return func(Attr1Var *Attribute, Attr2Var *Attribute) bool {
125 return rawCallback(Attr1Var, Attr2Var)
126 }
127}
128
129// The `PangoAttrColor` structure is used to represent attributes that
130// are colors.
131type AttrColor struct {
132 _ structs.HostLayout
133
134 Attr uintptr
135
136 Color uintptr
137}
138
139func (x *AttrColor) GoPointer() uintptr {
140 return uintptr(unsafe.Pointer(x))
141}
142
143// The `PangoAttrFloat` structure is used to represent attributes with
144// a float or double value.
145type AttrFloat struct {
146 _ structs.HostLayout
147
148 Attr uintptr
149
150 Value float64
151}
152
153func (x *AttrFloat) GoPointer() uintptr {
154 return uintptr(unsafe.Pointer(x))
155}
156
157// The `PangoAttrFontDesc` structure is used to store an attribute that
158// sets all aspects of the font description at once.
159type AttrFontDesc struct {
160 _ structs.HostLayout
161
162 Attr uintptr
163
164 Desc *FontDescription
165}
166
167func (x *AttrFontDesc) GoPointer() uintptr {
168 return uintptr(unsafe.Pointer(x))
169}
170
171// The `PangoAttrFontFeatures` structure is used to represent OpenType
172// font features as an attribute.
173type AttrFontFeatures struct {
174 _ structs.HostLayout
175
176 Attr uintptr
177
178 Features uintptr
179}
180
181func (x *AttrFontFeatures) GoPointer() uintptr {
182 return uintptr(unsafe.Pointer(x))
183}
184
185// The `PangoAttrInt` structure is used to represent attributes with
186// an integer or enumeration value.
187type AttrInt struct {
188 _ structs.HostLayout
189
190 Attr uintptr
191
192 Value int
193}
194
195func (x *AttrInt) GoPointer() uintptr {
196 return uintptr(unsafe.Pointer(x))
197}
198
199// A `PangoAttrIterator` is used to iterate through a `PangoAttrList`.
200//
201// A new iterator is created with [method@Pango.AttrList.get_iterator].
202// Once the iterator is created, it can be advanced through the style
203// changes in the text using [method@Pango.AttrIterator.next]. At each
204// style change, the range of the current style segment and the attributes
205// currently in effect can be queried.
206type AttrIterator struct {
207 _ structs.HostLayout
208}
209
210var xAttrIteratorGLibType func() types.GType
211
212func AttrIteratorGLibType() types.GType {
213 return xAttrIteratorGLibType()
214}
215
216func (x *AttrIterator) GoPointer() uintptr {
217 return uintptr(unsafe.Pointer(x))
218}
219
220var xAttrIteratorCopy func(uintptr) *AttrIterator
221
222// Copy a `PangoAttrIterator`.
223func (x *AttrIterator) Copy() *AttrIterator {
224
225 cret := xAttrIteratorCopy(x.GoPointer())
226 return cret
227}
228
229var xAttrIteratorDestroy func(uintptr)
230
231// Destroy a `PangoAttrIterator` and free all associated memory.
232func (x *AttrIterator) Destroy() {
233
234 xAttrIteratorDestroy(x.GoPointer())
235
236}
237
238var xAttrIteratorGet func(uintptr, AttrType) *Attribute
239
240// Find the current attribute of a particular type
241// at the iterator location.
242//
243// When multiple attributes of the same type overlap,
244// the attribute whose range starts closest to the
245// current location is used.
246func (x *AttrIterator) Get(TypeVar AttrType) *Attribute {
247
248 cret := xAttrIteratorGet(x.GoPointer(), TypeVar)
249 return cret
250}
251
252var xAttrIteratorGetAttrs func(uintptr) *glib.SList
253
254// Gets a list of all attributes at the current position of the
255// iterator.
256func (x *AttrIterator) GetAttrs() *glib.SList {
257
258 cret := xAttrIteratorGetAttrs(x.GoPointer())
259 return cret
260}
261
262var xAttrIteratorGetFont func(uintptr, *FontDescription, **Language, **glib.SList)
263
264// Get the font and other attributes at the current
265// iterator position.
266func (x *AttrIterator) GetFont(DescVar *FontDescription, LanguageVar **Language, ExtraAttrsVar **glib.SList) {
267
268 xAttrIteratorGetFont(x.GoPointer(), DescVar, LanguageVar, ExtraAttrsVar)
269
270}
271
272var xAttrIteratorNext func(uintptr) bool
273
274// Advance the iterator until the next change of style.
275func (x *AttrIterator) Next() bool {
276
277 cret := xAttrIteratorNext(x.GoPointer())
278 return cret
279}
280
281var xAttrIteratorRange func(uintptr, *int, *int)
282
283// Get the range of the current segment.
284//
285// Note that the stored return values are signed, not unsigned
286// like the values in `PangoAttribute`. To deal with this API
287// oversight, stored return values that wouldn't fit into
288// a signed integer are clamped to %G_MAXINT.
289func (x *AttrIterator) Range(StartVar *int, EndVar *int) {
290
291 xAttrIteratorRange(x.GoPointer(), StartVar, EndVar)
292
293}
294
295// The `PangoAttrLanguage` structure is used to represent attributes that
296// are languages.
297type AttrLanguage struct {
298 _ structs.HostLayout
299
300 Attr uintptr
301
302 Value *Language
303}
304
305func (x *AttrLanguage) GoPointer() uintptr {
306 return uintptr(unsafe.Pointer(x))
307}
308
309// A `PangoAttrList` represents a list of attributes that apply to a section
310// of text.
311//
312// The attributes in a `PangoAttrList` are, in general, allowed to overlap in
313// an arbitrary fashion. However, if the attributes are manipulated only through
314// [method@Pango.AttrList.change], the overlap between properties will meet
315// stricter criteria.
316//
317// Since the `PangoAttrList` structure is stored as a linear list, it is not
318// suitable for storing attributes for large amounts of text. In general, you
319// should not use a single `PangoAttrList` for more than one paragraph of text.
320type AttrList struct {
321 _ structs.HostLayout
322}
323
324var xAttrListGLibType func() types.GType
325
326func AttrListGLibType() types.GType {
327 return xAttrListGLibType()
328}
329
330func (x *AttrList) GoPointer() uintptr {
331 return uintptr(unsafe.Pointer(x))
332}
333
334var xNewAttrList func() *AttrList
335
336// Create a new empty attribute list with a reference
337// count of one.
338func NewAttrList() *AttrList {
339
340 cret := xNewAttrList()
341 return cret
342}
343
344var xAttrListChange func(uintptr, *Attribute)
345
346// Insert the given attribute into the `PangoAttrList`.
347//
348// It will replace any attributes of the same type
349// on that segment and be merged with any adjoining
350// attributes that are identical.
351//
352// This function is slower than [method@Pango.AttrList.insert]
353// for creating an attribute list in order (potentially
354// much slower for large lists). However,
355// [method@Pango.AttrList.insert] is not suitable for
356// continually changing a set of attributes since it
357// never removes or combines existing attributes.
358func (x *AttrList) Change(AttrVar *Attribute) {
359
360 xAttrListChange(x.GoPointer(), AttrVar)
361
362}
363
364var xAttrListCopy func(uintptr) *AttrList
365
366// Copy @list and return an identical new list.
367func (x *AttrList) Copy() *AttrList {
368
369 cret := xAttrListCopy(x.GoPointer())
370 return cret
371}
372
373var xAttrListEqual func(uintptr, *AttrList) bool
374
375// Checks whether @list and @other_list contain the same
376// attributes and whether those attributes apply to the
377// same ranges.
378//
379// Beware that this will return wrong values if any list
380// contains duplicates.
381func (x *AttrList) Equal(OtherListVar *AttrList) bool {
382
383 cret := xAttrListEqual(x.GoPointer(), OtherListVar)
384 return cret
385}
386
387var xAttrListFilter func(uintptr, uintptr, uintptr) *AttrList
388
389// Given a `PangoAttrList` and callback function, removes
390// any elements of @list for which @func returns %TRUE and
391// inserts them into a new list.
392func (x *AttrList) Filter(FuncVar *AttrFilterFunc, DataVar uintptr) *AttrList {
393
394 var FuncVarRef uintptr
395 if FuncVar != nil {
396 FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
397 if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
398 FuncVarRef = cbRefPtr
399 } else {
400 fcb := func(arg0 *Attribute, arg1 uintptr) bool {
401 cbFn := *FuncVar
402 return cbFn(arg0, arg1)
403 }
404 FuncVarRef = purego.NewCallback(fcb)
405 glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
406 }
407 }
408
409 cret := xAttrListFilter(x.GoPointer(), FuncVarRef, DataVar)
410 return cret
411}
412
413var xAttrListGetAttributes func(uintptr) *glib.SList
414
415// Gets a list of all attributes in @list.
416func (x *AttrList) GetAttributes() *glib.SList {
417
418 cret := xAttrListGetAttributes(x.GoPointer())
419 return cret
420}
421
422var xAttrListGetIterator func(uintptr) *AttrIterator
423
424// Create a iterator initialized to the beginning of the list.
425//
426// @list must not be modified until this iterator is freed.
427func (x *AttrList) GetIterator() *AttrIterator {
428
429 cret := xAttrListGetIterator(x.GoPointer())
430 return cret
431}
432
433var xAttrListInsert func(uintptr, *Attribute)
434
435// Insert the given attribute into the `PangoAttrList`.
436//
437// It will be inserted after all other attributes with a
438// matching @start_index.
439func (x *AttrList) Insert(AttrVar *Attribute) {
440
441 xAttrListInsert(x.GoPointer(), AttrVar)
442
443}
444
445var xAttrListInsertBefore func(uintptr, *Attribute)
446
447// Insert the given attribute into the `PangoAttrList`.
448//
449// It will be inserted before all other attributes with a
450// matching @start_index.
451func (x *AttrList) InsertBefore(AttrVar *Attribute) {
452
453 xAttrListInsertBefore(x.GoPointer(), AttrVar)
454
455}
456
457var xAttrListRef func(uintptr) *AttrList
458
459// Increase the reference count of the given attribute
460// list by one.
461func (x *AttrList) Ref() *AttrList {
462
463 cret := xAttrListRef(x.GoPointer())
464 return cret
465}
466
467var xAttrListSplice func(uintptr, *AttrList, int, int)
468
469// This function opens up a hole in @list, fills it
470// in with attributes from the left, and then merges
471// @other on top of the hole.
472//
473// This operation is equivalent to stretching every attribute
474// that applies at position @pos in @list by an amount @len,
475// and then calling [method@Pango.AttrList.change] with a copy
476// of each attribute in @other in sequence (offset in position
477// by @pos, and limited in length to @len).
478//
479// This operation proves useful for, for instance, inserting
480// a pre-edit string in the middle of an edit buffer.
481//
482// For backwards compatibility, the function behaves differently
483// when @len is 0. In this case, the attributes from @other are
484// not imited to @len, and are just overlayed on top of @list.
485//
486// This mode is useful for merging two lists of attributes together.
487func (x *AttrList) Splice(OtherVar *AttrList, PosVar int, LenVar int) {
488
489 xAttrListSplice(x.GoPointer(), OtherVar, PosVar, LenVar)
490
491}
492
493var xAttrListToString func(uintptr) string
494
495// Serializes a `PangoAttrList` to a string.
496//
497// In the resulting string, serialized attributes are separated by newlines or commas.
498// Individual attributes are serialized to a string of the form
499//
500// [START END] TYPE VALUE
501//
502// Where START and END are the indices (with -1 being accepted in place
503// of MAXUINT), TYPE is the nickname of the attribute value type, e.g.
504// _weight_ or _stretch_, and the value is serialized according to its type:
505//
506// Optionally, START and END can be omitted to indicate unlimited extent.
507//
508// - enum values as nick or numeric value
509// - boolean values as _true_ or _false_
510// - integers and floats as numbers
511// - strings as string, optionally quoted
512// - font features as quoted string
513// - PangoLanguage as string
514// - PangoFontDescription as serialized by [method@Pango.FontDescription.to_string], quoted
515// - PangoColor as serialized by [method@Pango.Color.to_string]
516//
517// Examples:
518//
519// 0 10 foreground red, 5 15 weight bold, 0 200 font-desc "Sans 10"
520//
521// 0 -1 weight 700
522// 0 100 family Times
523//
524// weight bold
525//
526// To parse the returned value, use [func@Pango.AttrList.from_string].
527//
528// Note that shape attributes can not be serialized.
529func (x *AttrList) ToString() string {
530
531 cret := xAttrListToString(x.GoPointer())
532 return cret
533}
534
535var xAttrListUnref func(uintptr)
536
537// Decrease the reference count of the given attribute
538// list by one.
539//
540// If the result is zero, free the attribute list
541// and the attributes it contains.
542func (x *AttrList) Unref() {
543
544 xAttrListUnref(x.GoPointer())
545
546}
547
548var xAttrListUpdate func(uintptr, int, int, int)
549
550// Update indices of attributes in @list for a change in the
551// text they refer to.
552//
553// The change that this function applies is removing @remove
554// bytes at position @pos and inserting @add bytes instead.
555//
556// Attributes that fall entirely in the (@pos, @pos + @remove)
557// range are removed.
558//
559// Attributes that start or end inside the (@pos, @pos + @remove)
560// range are shortened to reflect the removal.
561//
562// Attributes start and end positions are updated if they are
563// behind @pos + @remove.
564func (x *AttrList) Update(PosVar int, RemoveVar int, AddVar int) {
565
566 xAttrListUpdate(x.GoPointer(), PosVar, RemoveVar, AddVar)
567
568}
569
570// The `PangoAttrShape` structure is used to represent attributes which
571// impose shape restrictions.
572type AttrShape struct {
573 _ structs.HostLayout
574
575 Attr uintptr
576
577 InkRect uintptr
578
579 LogicalRect uintptr
580
581 Data uintptr
582
583 CopyFunc AttrDataCopyFunc
584
585 DestroyFunc glib.DestroyNotify
586}
587
588func (x *AttrShape) GoPointer() uintptr {
589 return uintptr(unsafe.Pointer(x))
590}
591
592// The `PangoAttrSize` structure is used to represent attributes which
593// set font size.
594type AttrSize struct {
595 _ structs.HostLayout
596
597 Attr uintptr
598
599 Size int
600
601 Absolute uint
602}
603
604func (x *AttrSize) GoPointer() uintptr {
605 return uintptr(unsafe.Pointer(x))
606}
607
608// The `PangoAttrString` structure is used to represent attributes with
609// a string value.
610type AttrString struct {
611 _ structs.HostLayout
612
613 Attr uintptr
614
615 Value uintptr
616}
617
618func (x *AttrString) GoPointer() uintptr {
619 return uintptr(unsafe.Pointer(x))
620}
621
622// The `PangoAttribute` structure represents the common portions of all
623// attributes.
624//
625// Particular types of attributes include this structure as their initial
626// portion. The common portion of the attribute holds the range to which
627// the value in the type-specific part of the attribute applies and should
628// be initialized using [method@Pango.Attribute.init]. By default, an attribute
629// will have an all-inclusive range of [0,%G_MAXUINT].
630type Attribute struct {
631 _ structs.HostLayout
632
633 Klass *AttrClass
634
635 StartIndex uint
636
637 EndIndex uint
638}
639
640var xAttributeGLibType func() types.GType
641
642func AttributeGLibType() types.GType {
643 return xAttributeGLibType()
644}
645
646func (x *Attribute) GoPointer() uintptr {
647 return uintptr(unsafe.Pointer(x))
648}
649
650var xAttributeAsColor func(uintptr) *AttrColor
651
652// Returns the attribute cast to `PangoAttrColor`.
653//
654// This is mainly useful for language bindings.
655func (x *Attribute) AsColor() *AttrColor {
656
657 cret := xAttributeAsColor(x.GoPointer())
658 return cret
659}
660
661var xAttributeAsFloat func(uintptr) *AttrFloat
662
663// Returns the attribute cast to `PangoAttrFloat`.
664//
665// This is mainly useful for language bindings.
666func (x *Attribute) AsFloat() *AttrFloat {
667
668 cret := xAttributeAsFloat(x.GoPointer())
669 return cret
670}
671
672var xAttributeAsFontDesc func(uintptr) *AttrFontDesc
673
674// Returns the attribute cast to `PangoAttrFontDesc`.
675//
676// This is mainly useful for language bindings.
677func (x *Attribute) AsFontDesc() *AttrFontDesc {
678
679 cret := xAttributeAsFontDesc(x.GoPointer())
680 return cret
681}
682
683var xAttributeAsFontFeatures func(uintptr) *AttrFontFeatures
684
685// Returns the attribute cast to `PangoAttrFontFeatures`.
686//
687// This is mainly useful for language bindings.
688func (x *Attribute) AsFontFeatures() *AttrFontFeatures {
689
690 cret := xAttributeAsFontFeatures(x.GoPointer())
691 return cret
692}
693
694var xAttributeAsInt func(uintptr) *AttrInt
695
696// Returns the attribute cast to `PangoAttrInt`.
697//
698// This is mainly useful for language bindings.
699func (x *Attribute) AsInt() *AttrInt {
700
701 cret := xAttributeAsInt(x.GoPointer())
702 return cret
703}
704
705var xAttributeAsLanguage func(uintptr) *AttrLanguage
706
707// Returns the attribute cast to `PangoAttrLanguage`.
708//
709// This is mainly useful for language bindings.
710func (x *Attribute) AsLanguage() *AttrLanguage {
711
712 cret := xAttributeAsLanguage(x.GoPointer())
713 return cret
714}
715
716var xAttributeAsShape func(uintptr) *AttrShape
717
718// Returns the attribute cast to `PangoAttrShape`.
719//
720// This is mainly useful for language bindings.
721func (x *Attribute) AsShape() *AttrShape {
722
723 cret := xAttributeAsShape(x.GoPointer())
724 return cret
725}
726
727var xAttributeAsSize func(uintptr) *AttrSize
728
729// Returns the attribute cast to `PangoAttrSize`.
730//
731// This is mainly useful for language bindings.
732func (x *Attribute) AsSize() *AttrSize {
733
734 cret := xAttributeAsSize(x.GoPointer())
735 return cret
736}
737
738var xAttributeAsString func(uintptr) *AttrString
739
740// Returns the attribute cast to `PangoAttrString`.
741//
742// This is mainly useful for language bindings.
743func (x *Attribute) AsString() *AttrString {
744
745 cret := xAttributeAsString(x.GoPointer())
746 return cret
747}
748
749var xAttributeCopy func(uintptr) *Attribute
750
751// Make a copy of an attribute.
752func (x *Attribute) Copy() *Attribute {
753
754 cret := xAttributeCopy(x.GoPointer())
755 return cret
756}
757
758var xAttributeDestroy func(uintptr)
759
760// Destroy a `PangoAttribute` and free all associated memory.
761func (x *Attribute) Destroy() {
762
763 xAttributeDestroy(x.GoPointer())
764
765}
766
767var xAttributeEqual func(uintptr, *Attribute) bool
768
769// Compare two attributes for equality.
770//
771// This compares only the actual value of the two
772// attributes and not the ranges that the attributes
773// apply to.
774func (x *Attribute) Equal(Attr2Var *Attribute) bool {
775
776 cret := xAttributeEqual(x.GoPointer(), Attr2Var)
777 return cret
778}
779
780var xAttributeInit func(uintptr, *AttrClass)
781
782// Initializes @attr's klass to @klass, it's start_index to
783// %PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING and end_index to
784// %PANGO_ATTR_INDEX_TO_TEXT_END such that the attribute applies
785// to the entire text by default.
786func (x *Attribute) Init(KlassVar *AttrClass) {
787
788 xAttributeInit(x.GoPointer(), KlassVar)
789
790}
791
792const (
793 // Value for @start_index in `PangoAttribute` that indicates
794 // the beginning of the text.
795 ATTR_INDEX_FROM_TEXT_BEGINNING uint = 0
796 // Value for @end_index in `PangoAttribute` that indicates
797 // the end of the text.
798 ATTR_INDEX_TO_TEXT_END uint = 4294967295
799)
800
801// These flags affect how Pango treats characters that are normally
802// not visible in the output.
803type ShowFlags int
804
805var xShowFlagsGLibType func() types.GType
806
807func ShowFlagsGLibType() types.GType {
808 return xShowFlagsGLibType()
809}
810
811const (
812
813 // No special treatment for invisible characters
814 ShowNoneValue ShowFlags = 0
815 // Render spaces, tabs and newlines visibly
816 ShowSpacesValue ShowFlags = 1
817 // Render line breaks visibly
818 ShowLineBreaksValue ShowFlags = 2
819 // Render default-ignorable Unicode
820 // characters visibly
821 ShowIgnorablesValue ShowFlags = 4
822)
823
824// The `PangoAttrType` distinguishes between different types of attributes.
825//
826// Along with the predefined values, it is possible to allocate additional
827// values for custom attributes using [func@AttrType.register]. The predefined
828// values are given below. The type of structure used to store the attribute is
829// listed in parentheses after the description.
830type AttrType int
831
832var xAttrTypeGLibType func() types.GType
833
834func AttrTypeGLibType() types.GType {
835 return xAttrTypeGLibType()
836}
837
838const (
839
840 // does not happen
841 AttrInvalidValue AttrType = 0
842 // language ([struct@Pango.AttrLanguage])
843 AttrLanguageValue AttrType = 1
844 // font family name list ([struct@Pango.AttrString])
845 AttrFamilyValue AttrType = 2
846 // font slant style ([struct@Pango.AttrInt])
847 AttrStyleValue AttrType = 3
848 // font weight ([struct@Pango.AttrInt])
849 AttrWeightValue AttrType = 4
850 // font variant (normal or small caps) ([struct@Pango.AttrInt])
851 AttrVariantValue AttrType = 5
852 // font stretch ([struct@Pango.AttrInt])
853 AttrStretchValue AttrType = 6
854 // font size in points scaled by %PANGO_SCALE ([struct@Pango.AttrInt])
855 AttrSizeValue AttrType = 7
856 // font description ([struct@Pango.AttrFontDesc])
857 AttrFontDescValue AttrType = 8
858 // foreground color ([struct@Pango.AttrColor])
859 AttrForegroundValue AttrType = 9
860 // background color ([struct@Pango.AttrColor])
861 AttrBackgroundValue AttrType = 10
862 // whether the text has an underline ([struct@Pango.AttrInt])
863 AttrUnderlineValue AttrType = 11
864 // whether the text is struck-through ([struct@Pango.AttrInt])
865 AttrStrikethroughValue AttrType = 12
866 // baseline displacement ([struct@Pango.AttrInt])
867 AttrRiseValue AttrType = 13
868 // shape ([struct@Pango.AttrShape])
869 AttrShapeValue AttrType = 14
870 // font size scale factor ([struct@Pango.AttrFloat])
871 AttrScaleValue AttrType = 15
872 // whether fallback is enabled ([struct@Pango.AttrInt])
873 AttrFallbackValue AttrType = 16
874 // letter spacing ([struct@PangoAttrInt])
875 AttrLetterSpacingValue AttrType = 17
876 // underline color ([struct@Pango.AttrColor])
877 AttrUnderlineColorValue AttrType = 18
878 // strikethrough color ([struct@Pango.AttrColor])
879 AttrStrikethroughColorValue AttrType = 19
880 // font size in pixels scaled by %PANGO_SCALE ([struct@Pango.AttrInt])
881 AttrAbsoluteSizeValue AttrType = 20
882 // base text gravity ([struct@Pango.AttrInt])
883 AttrGravityValue AttrType = 21
884 // gravity hint ([struct@Pango.AttrInt])
885 AttrGravityHintValue AttrType = 22
886 // OpenType font features ([struct@Pango.AttrFontFeatures]). Since 1.38
887 AttrFontFeaturesValue AttrType = 23
888 // foreground alpha ([struct@Pango.AttrInt]). Since 1.38
889 AttrForegroundAlphaValue AttrType = 24
890 // background alpha ([struct@Pango.AttrInt]). Since 1.38
891 AttrBackgroundAlphaValue AttrType = 25
892 // whether breaks are allowed ([struct@Pango.AttrInt]). Since 1.44
893 AttrAllowBreaksValue AttrType = 26
894 // how to render invisible characters ([struct@Pango.AttrInt]). Since 1.44
895 AttrShowValue AttrType = 27
896 // whether to insert hyphens at intra-word line breaks ([struct@Pango.AttrInt]). Since 1.44
897 AttrInsertHyphensValue AttrType = 28
898 // whether the text has an overline ([struct@Pango.AttrInt]). Since 1.46
899 AttrOverlineValue AttrType = 29
900 // overline color ([struct@Pango.AttrColor]). Since 1.46
901 AttrOverlineColorValue AttrType = 30
902 // line height factor ([struct@Pango.AttrFloat]). Since: 1.50
903 AttrLineHeightValue AttrType = 31
904 // line height ([struct@Pango.AttrInt]). Since: 1.50
905 AttrAbsoluteLineHeightValue AttrType = 32
906
907 AttrTextTransformValue AttrType = 33
908 // override segmentation to classify the range of the attribute as a single word ([struct@Pango.AttrInt]). Since 1.50
909 AttrWordValue AttrType = 34
910 // override segmentation to classify the range of the attribute as a single sentence ([struct@Pango.AttrInt]). Since 1.50
911 AttrSentenceValue AttrType = 35
912 // baseline displacement ([struct@Pango.AttrInt]). Since 1.50
913 AttrBaselineShiftValue AttrType = 36
914 // font-relative size change ([struct@Pango.AttrInt]). Since 1.50
915 AttrFontScaleValue AttrType = 37
916)
917
918// An enumeration that affects baseline shifts between runs.
919type BaselineShift int
920
921var xBaselineShiftGLibType func() types.GType
922
923func BaselineShiftGLibType() types.GType {
924 return xBaselineShiftGLibType()
925}
926
927const (
928
929 // Leave the baseline unchanged
930 BaselineShiftNoneValue BaselineShift = 0
931 // Shift the baseline to the superscript position,
932 // relative to the previous run
933 BaselineShiftSuperscriptValue BaselineShift = 1
934 // Shift the baseline to the subscript position,
935 // relative to the previous run
936 BaselineShiftSubscriptValue BaselineShift = 2
937)
938
939// An enumeration that affects font sizes for superscript
940// and subscript positioning and for (emulated) Small Caps.
941type FontScale int
942
943var xFontScaleGLibType func() types.GType
944
945func FontScaleGLibType() types.GType {
946 return xFontScaleGLibType()
947}
948
949const (
950
951 // Leave the font size unchanged
952 FontScaleNoneValue FontScale = 0
953 // Change the font to a size suitable for superscripts
954 FontScaleSuperscriptValue FontScale = 1
955 // Change the font to a size suitable for subscripts
956 FontScaleSubscriptValue FontScale = 2
957 // Change the font to a size suitable for Small Caps
958 FontScaleSmallCapsValue FontScale = 3
959)
960
961// The `PangoOverline` enumeration is used to specify whether text
962// should be overlined, and if so, the type of line.
963type Overline int
964
965var xOverlineGLibType func() types.GType
966
967func OverlineGLibType() types.GType {
968 return xOverlineGLibType()
969}
970
971const (
972
973 // no overline should be drawn
974 OverlineNoneValue Overline = 0
975 // Draw a single line above the ink
976 // extents of the text being underlined.
977 OverlineSingleValue Overline = 1
978)
979
980// An enumeration that affects how Pango treats characters during shaping.
981type TextTransform int
982
983var xTextTransformGLibType func() types.GType
984
985func TextTransformGLibType() types.GType {
986 return xTextTransformGLibType()
987}
988
989const (
990
991 // Leave text unchanged
992 TextTransformNoneValue TextTransform = 0
993 // Display letters and numbers as lowercase
994 TextTransformLowercaseValue TextTransform = 1
995 // Display letters and numbers as uppercase
996 TextTransformUppercaseValue TextTransform = 2
997 // Display the first character of a word
998 // in titlecase
999 TextTransformCapitalizeValue TextTransform = 3
1000)
1001
1002// The `PangoUnderline` enumeration is used to specify whether text
1003// should be underlined, and if so, the type of underlining.
1004type Underline int
1005
1006var xUnderlineGLibType func() types.GType
1007
1008func UnderlineGLibType() types.GType {
1009 return xUnderlineGLibType()
1010}
1011
1012const (
1013
1014 // no underline should be drawn
1015 UnderlineNoneValue Underline = 0
1016 // a single underline should be drawn
1017 UnderlineSingleValue Underline = 1
1018 // a double underline should be drawn
1019 UnderlineDoubleValue Underline = 2
1020 // a single underline should be drawn at a
1021 // position beneath the ink extents of the text being
1022 // underlined. This should be used only for underlining
1023 // single characters, such as for keyboard accelerators.
1024 // %PANGO_UNDERLINE_SINGLE should be used for extended
1025 // portions of text.
1026 UnderlineLowValue Underline = 3
1027 // an underline indicating an error should
1028 // be drawn below. The exact style of rendering is up to the
1029 // `PangoRenderer` in use, but typical styles include wavy
1030 // or dotted lines.
1031 // This underline is typically used to indicate an error such
1032 // as a possible mispelling; in some cases a contrasting color
1033 // may automatically be used. This type of underlining is
1034 // available since Pango 1.4.
1035 UnderlineErrorValue Underline = 4
1036 // Like @PANGO_UNDERLINE_SINGLE, but
1037 // drawn continuously across multiple runs. This type
1038 // of underlining is available since Pango 1.46.
1039 UnderlineSingleLineValue Underline = 5
1040 // Like @PANGO_UNDERLINE_DOUBLE, but
1041 // drawn continuously across multiple runs. This type
1042 // of underlining is available since Pango 1.46.
1043 UnderlineDoubleLineValue Underline = 6
1044 // Like @PANGO_UNDERLINE_ERROR, but
1045 // drawn continuously across multiple runs. This type
1046 // of underlining is available since Pango 1.46.
1047 UnderlineErrorLineValue Underline = 7
1048)
1049
1050var xAttrAllowBreaksNew func(bool) *Attribute
1051
1052// Create a new allow-breaks attribute.
1053//
1054// If breaks are disabled, the range will be kept in a
1055// single run, as far as possible.
1056func AttrAllowBreaksNew(AllowBreaksVar bool) *Attribute {
1057
1058 cret := xAttrAllowBreaksNew(AllowBreaksVar)
1059 return cret
1060}
1061
1062var xAttrBackgroundAlphaNew func(uint16) *Attribute
1063
1064// Create a new background alpha attribute.
1065func AttrBackgroundAlphaNew(AlphaVar uint16) *Attribute {
1066
1067 cret := xAttrBackgroundAlphaNew(AlphaVar)
1068 return cret
1069}
1070
1071var xAttrBackgroundNew func(uint16, uint16, uint16) *Attribute
1072
1073// Create a new background color attribute.
1074func AttrBackgroundNew(RedVar uint16, GreenVar uint16, BlueVar uint16) *Attribute {
1075
1076 cret := xAttrBackgroundNew(RedVar, GreenVar, BlueVar)
1077 return cret
1078}
1079
1080var xAttrBaselineShiftNew func(int) *Attribute
1081
1082// Create a new baseline displacement attribute.
1083//
1084// The effect of this attribute is to shift the baseline of a run,
1085// relative to the run of preceding run.
1086//
1087// <picture>
1088//
1089// <source srcset="baseline-shift-dark.png" media="(prefers-color-scheme: dark)">
1090// <img alt="Baseline Shift" src="baseline-shift-light.png">
1091//
1092// </picture>
1093func AttrBaselineShiftNew(ShiftVar int) *Attribute {
1094
1095 cret := xAttrBaselineShiftNew(ShiftVar)
1096 return cret
1097}
1098
1099var xAttrFallbackNew func(bool) *Attribute
1100
1101// Create a new font fallback attribute.
1102//
1103// If fallback is disabled, characters will only be
1104// used from the closest matching font on the system.
1105// No fallback will be done to other fonts on the system
1106// that might contain the characters in the text.
1107func AttrFallbackNew(EnableFallbackVar bool) *Attribute {
1108
1109 cret := xAttrFallbackNew(EnableFallbackVar)
1110 return cret
1111}
1112
1113var xAttrFamilyNew func(string) *Attribute
1114
1115// Create a new font family attribute.
1116func AttrFamilyNew(FamilyVar string) *Attribute {
1117
1118 cret := xAttrFamilyNew(FamilyVar)
1119 return cret
1120}
1121
1122var xAttrFontDescNew func(*FontDescription) *Attribute
1123
1124// Create a new font description attribute.
1125//
1126// This attribute allows setting family, style, weight, variant,
1127// stretch, and size simultaneously.
1128func AttrFontDescNew(DescVar *FontDescription) *Attribute {
1129
1130 cret := xAttrFontDescNew(DescVar)
1131 return cret
1132}
1133
1134var xAttrFontFeaturesNew func(string) *Attribute
1135
1136// Create a new font features tag attribute.
1137//
1138// You can use this attribute to select OpenType font features like small-caps,
1139// alternative glyphs, ligatures, etc. for fonts that support them.
1140func AttrFontFeaturesNew(FeaturesVar string) *Attribute {
1141
1142 cret := xAttrFontFeaturesNew(FeaturesVar)
1143 return cret
1144}
1145
1146var xAttrFontScaleNew func(FontScale) *Attribute
1147
1148// Create a new font scale attribute.
1149//
1150// The effect of this attribute is to change the font size of a run,
1151// relative to the size of preceding run.
1152func AttrFontScaleNew(ScaleVar FontScale) *Attribute {
1153
1154 cret := xAttrFontScaleNew(ScaleVar)
1155 return cret
1156}
1157
1158var xAttrForegroundAlphaNew func(uint16) *Attribute
1159
1160// Create a new foreground alpha attribute.
1161func AttrForegroundAlphaNew(AlphaVar uint16) *Attribute {
1162
1163 cret := xAttrForegroundAlphaNew(AlphaVar)
1164 return cret
1165}
1166
1167var xAttrForegroundNew func(uint16, uint16, uint16) *Attribute
1168
1169// Create a new foreground color attribute.
1170func AttrForegroundNew(RedVar uint16, GreenVar uint16, BlueVar uint16) *Attribute {
1171
1172 cret := xAttrForegroundNew(RedVar, GreenVar, BlueVar)
1173 return cret
1174}
1175
1176var xAttrGravityHintNew func(GravityHint) *Attribute
1177
1178// Create a new gravity hint attribute.
1179func AttrGravityHintNew(HintVar GravityHint) *Attribute {
1180
1181 cret := xAttrGravityHintNew(HintVar)
1182 return cret
1183}
1184
1185var xAttrGravityNew func(Gravity) *Attribute
1186
1187// Create a new gravity attribute.
1188func AttrGravityNew(GravityVar Gravity) *Attribute {
1189
1190 cret := xAttrGravityNew(GravityVar)
1191 return cret
1192}
1193
1194var xAttrInsertHyphensNew func(bool) *Attribute
1195
1196// Create a new insert-hyphens attribute.
1197//
1198// Pango will insert hyphens when breaking lines in
1199// the middle of a word. This attribute can be used
1200// to suppress the hyphen.
1201func AttrInsertHyphensNew(InsertHyphensVar bool) *Attribute {
1202
1203 cret := xAttrInsertHyphensNew(InsertHyphensVar)
1204 return cret
1205}
1206
1207var xAttrLanguageNew func(*Language) *Attribute
1208
1209// Create a new language tag attribute.
1210func AttrLanguageNew(LanguageVar *Language) *Attribute {
1211
1212 cret := xAttrLanguageNew(LanguageVar)
1213 return cret
1214}
1215
1216var xAttrLetterSpacingNew func(int) *Attribute
1217
1218// Create a new letter-spacing attribute.
1219func AttrLetterSpacingNew(LetterSpacingVar int) *Attribute {
1220
1221 cret := xAttrLetterSpacingNew(LetterSpacingVar)
1222 return cret
1223}
1224
1225var xAttrLineHeightNew func(float64) *Attribute
1226
1227// Modify the height of logical line extents by a factor.
1228//
1229// This affects the values returned by
1230// [method@Pango.LayoutLine.get_extents],
1231// [method@Pango.LayoutLine.get_pixel_extents] and
1232// [method@Pango.LayoutIter.get_line_extents].
1233func AttrLineHeightNew(FactorVar float64) *Attribute {
1234
1235 cret := xAttrLineHeightNew(FactorVar)
1236 return cret
1237}
1238
1239var xAttrLineHeightNewAbsolute func(int) *Attribute
1240
1241// Override the height of logical line extents to be @height.
1242//
1243// This affects the values returned by
1244// [method@Pango.LayoutLine.get_extents],
1245// [method@Pango.LayoutLine.get_pixel_extents] and
1246// [method@Pango.LayoutIter.get_line_extents].
1247func AttrLineHeightNewAbsolute(HeightVar int) *Attribute {
1248
1249 cret := xAttrLineHeightNewAbsolute(HeightVar)
1250 return cret
1251}
1252
1253var xAttrListFromString func(string) *AttrList
1254
1255// Deserializes a `PangoAttrList` from a string.
1256//
1257// This is the counterpart to [method@Pango.AttrList.to_string].
1258// See that functions for details about the format.
1259func AttrListFromString(TextVar string) *AttrList {
1260
1261 cret := xAttrListFromString(TextVar)
1262 return cret
1263}
1264
1265var xAttrOverlineColorNew func(uint16, uint16, uint16) *Attribute
1266
1267// Create a new overline color attribute.
1268//
1269// This attribute modifies the color of overlines.
1270// If not set, overlines will use the foreground color.
1271func AttrOverlineColorNew(RedVar uint16, GreenVar uint16, BlueVar uint16) *Attribute {
1272
1273 cret := xAttrOverlineColorNew(RedVar, GreenVar, BlueVar)
1274 return cret
1275}
1276
1277var xAttrOverlineNew func(Overline) *Attribute
1278
1279// Create a new overline-style attribute.
1280func AttrOverlineNew(OverlineVar Overline) *Attribute {
1281
1282 cret := xAttrOverlineNew(OverlineVar)
1283 return cret
1284}
1285
1286var xAttrRiseNew func(int) *Attribute
1287
1288// Create a new baseline displacement attribute.
1289func AttrRiseNew(RiseVar int) *Attribute {
1290
1291 cret := xAttrRiseNew(RiseVar)
1292 return cret
1293}
1294
1295var xAttrScaleNew func(float64) *Attribute
1296
1297// Create a new font size scale attribute.
1298//
1299// The base font for the affected text will have
1300// its size multiplied by @scale_factor.
1301func AttrScaleNew(ScaleFactorVar float64) *Attribute {
1302
1303 cret := xAttrScaleNew(ScaleFactorVar)
1304 return cret
1305}
1306
1307var xAttrSentenceNew func() *Attribute
1308
1309// Marks the range of the attribute as a single sentence.
1310//
1311// Note that this may require adjustments to word and
1312// sentence classification around the range.
1313func AttrSentenceNew() *Attribute {
1314
1315 cret := xAttrSentenceNew()
1316 return cret
1317}
1318
1319var xAttrShapeNew func(*Rectangle, *Rectangle) *Attribute
1320
1321// Create a new shape attribute.
1322//
1323// A shape is used to impose a particular ink and logical
1324// rectangle on the result of shaping a particular glyph.
1325// This might be used, for instance, for embedding a picture
1326// or a widget inside a `PangoLayout`.
1327func AttrShapeNew(InkRectVar *Rectangle, LogicalRectVar *Rectangle) *Attribute {
1328
1329 cret := xAttrShapeNew(InkRectVar, LogicalRectVar)
1330 return cret
1331}
1332
1333var xAttrShapeNewWithData func(*Rectangle, *Rectangle, uintptr, uintptr, uintptr) *Attribute
1334
1335// Creates a new shape attribute.
1336//
1337// Like [func@Pango.AttrShape.new], but a user data pointer
1338// is also provided; this pointer can be accessed when later
1339// rendering the glyph.
1340func AttrShapeNewWithData(InkRectVar *Rectangle, LogicalRectVar *Rectangle, DataVar uintptr, CopyFuncVar *AttrDataCopyFunc, DestroyFuncVar *glib.DestroyNotify) *Attribute {
1341
1342 var CopyFuncVarRef uintptr
1343 if CopyFuncVar != nil {
1344 CopyFuncVarPtr := uintptr(unsafe.Pointer(CopyFuncVar))
1345 if cbRefPtr, ok := glib.GetCallback(CopyFuncVarPtr); ok {
1346 CopyFuncVarRef = cbRefPtr
1347 } else {
1348 fcb := func(arg0 uintptr) uintptr {
1349 cbFn := *CopyFuncVar
1350 return cbFn(arg0)
1351 }
1352 CopyFuncVarRef = purego.NewCallback(fcb)
1353 glib.SaveCallbackWithClosure(CopyFuncVarPtr, CopyFuncVarRef, CopyFuncVar)
1354 }
1355 }
1356
1357 var DestroyFuncVarRef uintptr
1358 if DestroyFuncVar != nil {
1359 DestroyFuncVarPtr := uintptr(unsafe.Pointer(DestroyFuncVar))
1360 if cbRefPtr, ok := glib.GetCallback(DestroyFuncVarPtr); ok {
1361 DestroyFuncVarRef = cbRefPtr
1362 } else {
1363 fcb := func(arg0 uintptr) {
1364 cbFn := *DestroyFuncVar
1365 cbFn(arg0)
1366 }
1367 DestroyFuncVarRef = purego.NewCallback(fcb)
1368 glib.SaveCallbackWithClosure(DestroyFuncVarPtr, DestroyFuncVarRef, DestroyFuncVar)
1369 }
1370 }
1371
1372 cret := xAttrShapeNewWithData(InkRectVar, LogicalRectVar, DataVar, CopyFuncVarRef, DestroyFuncVarRef)
1373 return cret
1374}
1375
1376var xAttrShowNew func(ShowFlags) *Attribute
1377
1378// Create a new attribute that influences how invisible
1379// characters are rendered.
1380func AttrShowNew(FlagsVar ShowFlags) *Attribute {
1381
1382 cret := xAttrShowNew(FlagsVar)
1383 return cret
1384}
1385
1386var xAttrSizeNew func(int) *Attribute
1387
1388// Create a new font-size attribute in fractional points.
1389func AttrSizeNew(SizeVar int) *Attribute {
1390
1391 cret := xAttrSizeNew(SizeVar)
1392 return cret
1393}
1394
1395var xAttrSizeNewAbsolute func(int) *Attribute
1396
1397// Create a new font-size attribute in device units.
1398func AttrSizeNewAbsolute(SizeVar int) *Attribute {
1399
1400 cret := xAttrSizeNewAbsolute(SizeVar)
1401 return cret
1402}
1403
1404var xAttrStretchNew func(Stretch) *Attribute
1405
1406// Create a new font stretch attribute.
1407func AttrStretchNew(StretchVar Stretch) *Attribute {
1408
1409 cret := xAttrStretchNew(StretchVar)
1410 return cret
1411}
1412
1413var xAttrStrikethroughColorNew func(uint16, uint16, uint16) *Attribute
1414
1415// Create a new strikethrough color attribute.
1416//
1417// This attribute modifies the color of strikethrough lines.
1418// If not set, strikethrough lines will use the foreground color.
1419func AttrStrikethroughColorNew(RedVar uint16, GreenVar uint16, BlueVar uint16) *Attribute {
1420
1421 cret := xAttrStrikethroughColorNew(RedVar, GreenVar, BlueVar)
1422 return cret
1423}
1424
1425var xAttrStrikethroughNew func(bool) *Attribute
1426
1427// Create a new strike-through attribute.
1428func AttrStrikethroughNew(StrikethroughVar bool) *Attribute {
1429
1430 cret := xAttrStrikethroughNew(StrikethroughVar)
1431 return cret
1432}
1433
1434var xAttrStyleNew func(Style) *Attribute
1435
1436// Create a new font slant style attribute.
1437func AttrStyleNew(StyleVar Style) *Attribute {
1438
1439 cret := xAttrStyleNew(StyleVar)
1440 return cret
1441}
1442
1443var xAttrTextTransformNew func(TextTransform) *Attribute
1444
1445// Create a new attribute that influences how characters
1446// are transformed during shaping.
1447func AttrTextTransformNew(TransformVar TextTransform) *Attribute {
1448
1449 cret := xAttrTextTransformNew(TransformVar)
1450 return cret
1451}
1452
1453var xAttrTypeGetName func(AttrType) string
1454
1455// Fetches the attribute type name.
1456//
1457// The attribute type name is the string passed in
1458// when registering the type using
1459// [func@Pango.AttrType.register].
1460//
1461// The returned value is an interned string (see
1462// g_intern_string() for what that means) that should
1463// not be modified or freed.
1464func AttrTypeGetName(TypeVar AttrType) string {
1465
1466 cret := xAttrTypeGetName(TypeVar)
1467 return cret
1468}
1469
1470var xAttrTypeRegister func(string) AttrType
1471
1472// Allocate a new attribute type ID.
1473//
1474// The attribute type name can be accessed later
1475// by using [func@Pango.AttrType.get_name].
1476func AttrTypeRegister(NameVar string) AttrType {
1477
1478 cret := xAttrTypeRegister(NameVar)
1479 return cret
1480}
1481
1482var xAttrUnderlineColorNew func(uint16, uint16, uint16) *Attribute
1483
1484// Create a new underline color attribute.
1485//
1486// This attribute modifies the color of underlines.
1487// If not set, underlines will use the foreground color.
1488func AttrUnderlineColorNew(RedVar uint16, GreenVar uint16, BlueVar uint16) *Attribute {
1489
1490 cret := xAttrUnderlineColorNew(RedVar, GreenVar, BlueVar)
1491 return cret
1492}
1493
1494var xAttrUnderlineNew func(Underline) *Attribute
1495
1496// Create a new underline-style attribute.
1497func AttrUnderlineNew(UnderlineVar Underline) *Attribute {
1498
1499 cret := xAttrUnderlineNew(UnderlineVar)
1500 return cret
1501}
1502
1503var xAttrVariantNew func(Variant) *Attribute
1504
1505// Create a new font variant attribute (normal or small caps).
1506func AttrVariantNew(VariantVar Variant) *Attribute {
1507
1508 cret := xAttrVariantNew(VariantVar)
1509 return cret
1510}
1511
1512var xAttrWeightNew func(Weight) *Attribute
1513
1514// Create a new font weight attribute.
1515func AttrWeightNew(WeightVar Weight) *Attribute {
1516
1517 cret := xAttrWeightNew(WeightVar)
1518 return cret
1519}
1520
1521var xAttrWordNew func() *Attribute
1522
1523// Marks the range of the attribute as a single word.
1524//
1525// Note that this may require adjustments to word and
1526// sentence classification around the range.
1527func AttrWordNew() *Attribute {
1528
1529 cret := xAttrWordNew()
1530 return cret
1531}
1532
1533func init() {
1534 core.SetPackageName("PANGO", "pango")
1535 core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
1536 var libs []uintptr
1537 for _, libPath := range core.GetPaths("PANGO") {
1538 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1539 if err != nil {
1540 panic(err)
1541 }
1542 libs = append(libs, lib)
1543 }
1544
1545 core.PuregoSafeRegister(&xShowFlagsGLibType, libs, "pango_show_flags_get_type")
1546
1547 core.PuregoSafeRegister(&xAttrTypeGLibType, libs, "pango_attr_type_get_type")
1548
1549 core.PuregoSafeRegister(&xBaselineShiftGLibType, libs, "pango_baseline_shift_get_type")
1550
1551 core.PuregoSafeRegister(&xFontScaleGLibType, libs, "pango_font_scale_get_type")
1552
1553 core.PuregoSafeRegister(&xOverlineGLibType, libs, "pango_overline_get_type")
1554
1555 core.PuregoSafeRegister(&xTextTransformGLibType, libs, "pango_text_transform_get_type")
1556
1557 core.PuregoSafeRegister(&xUnderlineGLibType, libs, "pango_underline_get_type")
1558
1559 core.PuregoSafeRegister(&xAttrAllowBreaksNew, libs, "pango_attr_allow_breaks_new")
1560 core.PuregoSafeRegister(&xAttrBackgroundAlphaNew, libs, "pango_attr_background_alpha_new")
1561 core.PuregoSafeRegister(&xAttrBackgroundNew, libs, "pango_attr_background_new")
1562 core.PuregoSafeRegister(&xAttrBaselineShiftNew, libs, "pango_attr_baseline_shift_new")
1563 core.PuregoSafeRegister(&xAttrFallbackNew, libs, "pango_attr_fallback_new")
1564 core.PuregoSafeRegister(&xAttrFamilyNew, libs, "pango_attr_family_new")
1565 core.PuregoSafeRegister(&xAttrFontDescNew, libs, "pango_attr_font_desc_new")
1566 core.PuregoSafeRegister(&xAttrFontFeaturesNew, libs, "pango_attr_font_features_new")
1567 core.PuregoSafeRegister(&xAttrFontScaleNew, libs, "pango_attr_font_scale_new")
1568 core.PuregoSafeRegister(&xAttrForegroundAlphaNew, libs, "pango_attr_foreground_alpha_new")
1569 core.PuregoSafeRegister(&xAttrForegroundNew, libs, "pango_attr_foreground_new")
1570 core.PuregoSafeRegister(&xAttrGravityHintNew, libs, "pango_attr_gravity_hint_new")
1571 core.PuregoSafeRegister(&xAttrGravityNew, libs, "pango_attr_gravity_new")
1572 core.PuregoSafeRegister(&xAttrInsertHyphensNew, libs, "pango_attr_insert_hyphens_new")
1573 core.PuregoSafeRegister(&xAttrLanguageNew, libs, "pango_attr_language_new")
1574 core.PuregoSafeRegister(&xAttrLetterSpacingNew, libs, "pango_attr_letter_spacing_new")
1575 core.PuregoSafeRegister(&xAttrLineHeightNew, libs, "pango_attr_line_height_new")
1576 core.PuregoSafeRegister(&xAttrLineHeightNewAbsolute, libs, "pango_attr_line_height_new_absolute")
1577 core.PuregoSafeRegister(&xAttrListFromString, libs, "pango_attr_list_from_string")
1578 core.PuregoSafeRegister(&xAttrOverlineColorNew, libs, "pango_attr_overline_color_new")
1579 core.PuregoSafeRegister(&xAttrOverlineNew, libs, "pango_attr_overline_new")
1580 core.PuregoSafeRegister(&xAttrRiseNew, libs, "pango_attr_rise_new")
1581 core.PuregoSafeRegister(&xAttrScaleNew, libs, "pango_attr_scale_new")
1582 core.PuregoSafeRegister(&xAttrSentenceNew, libs, "pango_attr_sentence_new")
1583 core.PuregoSafeRegister(&xAttrShapeNew, libs, "pango_attr_shape_new")
1584 core.PuregoSafeRegister(&xAttrShapeNewWithData, libs, "pango_attr_shape_new_with_data")
1585 core.PuregoSafeRegister(&xAttrShowNew, libs, "pango_attr_show_new")
1586 core.PuregoSafeRegister(&xAttrSizeNew, libs, "pango_attr_size_new")
1587 core.PuregoSafeRegister(&xAttrSizeNewAbsolute, libs, "pango_attr_size_new_absolute")
1588 core.PuregoSafeRegister(&xAttrStretchNew, libs, "pango_attr_stretch_new")
1589 core.PuregoSafeRegister(&xAttrStrikethroughColorNew, libs, "pango_attr_strikethrough_color_new")
1590 core.PuregoSafeRegister(&xAttrStrikethroughNew, libs, "pango_attr_strikethrough_new")
1591 core.PuregoSafeRegister(&xAttrStyleNew, libs, "pango_attr_style_new")
1592 core.PuregoSafeRegister(&xAttrTextTransformNew, libs, "pango_attr_text_transform_new")
1593 core.PuregoSafeRegister(&xAttrTypeGetName, libs, "pango_attr_type_get_name")
1594 core.PuregoSafeRegister(&xAttrTypeRegister, libs, "pango_attr_type_register")
1595 core.PuregoSafeRegister(&xAttrUnderlineColorNew, libs, "pango_attr_underline_color_new")
1596 core.PuregoSafeRegister(&xAttrUnderlineNew, libs, "pango_attr_underline_new")
1597 core.PuregoSafeRegister(&xAttrVariantNew, libs, "pango_attr_variant_new")
1598 core.PuregoSafeRegister(&xAttrWeightNew, libs, "pango_attr_weight_new")
1599 core.PuregoSafeRegister(&xAttrWordNew, libs, "pango_attr_word_new")
1600
1601 core.PuregoSafeRegister(&xAttrIteratorGLibType, libs, "pango_attr_iterator_get_type")
1602
1603 core.PuregoSafeRegister(&xAttrIteratorCopy, libs, "pango_attr_iterator_copy")
1604 core.PuregoSafeRegister(&xAttrIteratorDestroy, libs, "pango_attr_iterator_destroy")
1605 core.PuregoSafeRegister(&xAttrIteratorGet, libs, "pango_attr_iterator_get")
1606 core.PuregoSafeRegister(&xAttrIteratorGetAttrs, libs, "pango_attr_iterator_get_attrs")
1607 core.PuregoSafeRegister(&xAttrIteratorGetFont, libs, "pango_attr_iterator_get_font")
1608 core.PuregoSafeRegister(&xAttrIteratorNext, libs, "pango_attr_iterator_next")
1609 core.PuregoSafeRegister(&xAttrIteratorRange, libs, "pango_attr_iterator_range")
1610
1611 core.PuregoSafeRegister(&xAttrListGLibType, libs, "pango_attr_list_get_type")
1612
1613 core.PuregoSafeRegister(&xNewAttrList, libs, "pango_attr_list_new")
1614
1615 core.PuregoSafeRegister(&xAttrListChange, libs, "pango_attr_list_change")
1616 core.PuregoSafeRegister(&xAttrListCopy, libs, "pango_attr_list_copy")
1617 core.PuregoSafeRegister(&xAttrListEqual, libs, "pango_attr_list_equal")
1618 core.PuregoSafeRegister(&xAttrListFilter, libs, "pango_attr_list_filter")
1619 core.PuregoSafeRegister(&xAttrListGetAttributes, libs, "pango_attr_list_get_attributes")
1620 core.PuregoSafeRegister(&xAttrListGetIterator, libs, "pango_attr_list_get_iterator")
1621 core.PuregoSafeRegister(&xAttrListInsert, libs, "pango_attr_list_insert")
1622 core.PuregoSafeRegister(&xAttrListInsertBefore, libs, "pango_attr_list_insert_before")
1623 core.PuregoSafeRegister(&xAttrListRef, libs, "pango_attr_list_ref")
1624 core.PuregoSafeRegister(&xAttrListSplice, libs, "pango_attr_list_splice")
1625 core.PuregoSafeRegister(&xAttrListToString, libs, "pango_attr_list_to_string")
1626 core.PuregoSafeRegister(&xAttrListUnref, libs, "pango_attr_list_unref")
1627 core.PuregoSafeRegister(&xAttrListUpdate, libs, "pango_attr_list_update")
1628
1629 core.PuregoSafeRegister(&xAttributeGLibType, libs, "pango_attribute_get_type")
1630
1631 core.PuregoSafeRegister(&xAttributeAsColor, libs, "pango_attribute_as_color")
1632 core.PuregoSafeRegister(&xAttributeAsFloat, libs, "pango_attribute_as_float")
1633 core.PuregoSafeRegister(&xAttributeAsFontDesc, libs, "pango_attribute_as_font_desc")
1634 core.PuregoSafeRegister(&xAttributeAsFontFeatures, libs, "pango_attribute_as_font_features")
1635 core.PuregoSafeRegister(&xAttributeAsInt, libs, "pango_attribute_as_int")
1636 core.PuregoSafeRegister(&xAttributeAsLanguage, libs, "pango_attribute_as_language")
1637 core.PuregoSafeRegister(&xAttributeAsShape, libs, "pango_attribute_as_shape")
1638 core.PuregoSafeRegister(&xAttributeAsSize, libs, "pango_attribute_as_size")
1639 core.PuregoSafeRegister(&xAttributeAsString, libs, "pango_attribute_as_string")
1640 core.PuregoSafeRegister(&xAttributeCopy, libs, "pango_attribute_copy")
1641 core.PuregoSafeRegister(&xAttributeDestroy, libs, "pango_attribute_destroy")
1642 core.PuregoSafeRegister(&xAttributeEqual, libs, "pango_attribute_equal")
1643 core.PuregoSafeRegister(&xAttributeInit, libs, "pango_attribute_init")
1644
1645}