// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT package pango import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject/types" ) // A `PangoTabArray` contains an array of tab stops. // // `PangoTabArray` can be used to set tab stops in a `PangoLayout`. // Each tab stop has an alignment, a position, and optionally // a character to use as decimal point. type TabArray struct { _ structs.HostLayout } var xTabArrayGLibType func() types.GType func TabArrayGLibType() types.GType { return xTabArrayGLibType() } func (x *TabArray) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewTabArray func(int, bool) *TabArray // Creates an array of @initial_size tab stops. // // Tab stops are specified in pixel units if @positions_in_pixels is %TRUE, // otherwise in Pango units. All stops are initially at position 0. func NewTabArray(InitialSizeVar int, PositionsInPixelsVar bool) *TabArray { cret := xNewTabArray(InitialSizeVar, PositionsInPixelsVar) return cret } var xNewTabArrayWithPositions func(int, bool, TabAlign, int, ...interface{}) *TabArray // Creates a `PangoTabArray` and allows you to specify the alignment // and position of each tab stop. // // You **must** provide an alignment and position for @size tab stops. func NewTabArrayWithPositions(SizeVar int, PositionsInPixelsVar bool, FirstAlignmentVar TabAlign, FirstPositionVar int, varArgs ...interface{}) *TabArray { cret := xNewTabArrayWithPositions(SizeVar, PositionsInPixelsVar, FirstAlignmentVar, FirstPositionVar, varArgs...) return cret } var xTabArrayCopy func(uintptr) *TabArray // Copies a `PangoTabArray`. func (x *TabArray) Copy() *TabArray { cret := xTabArrayCopy(x.GoPointer()) return cret } var xTabArrayFree func(uintptr) // Frees a tab array and associated resources. func (x *TabArray) Free() { xTabArrayFree(x.GoPointer()) } var xTabArrayGetDecimalPoint func(uintptr, int) uint32 // Gets the Unicode character to use as decimal point. // // This is only relevant for tabs with %PANGO_TAB_DECIMAL alignment, // which align content at the first occurrence of the decimal point // character. // // The default value of 0 means that Pango will use the // decimal point according to the current locale. func (x *TabArray) GetDecimalPoint(TabIndexVar int) uint32 { cret := xTabArrayGetDecimalPoint(x.GoPointer(), TabIndexVar) return cret } var xTabArrayGetPositionsInPixels func(uintptr) bool // Returns %TRUE if the tab positions are in pixels, // %FALSE if they are in Pango units. func (x *TabArray) GetPositionsInPixels() bool { cret := xTabArrayGetPositionsInPixels(x.GoPointer()) return cret } var xTabArrayGetSize func(uintptr) int // Gets the number of tab stops in @tab_array. func (x *TabArray) GetSize() int { cret := xTabArrayGetSize(x.GoPointer()) return cret } var xTabArrayGetTab func(uintptr, int, *TabAlign, *int) // Gets the alignment and position of a tab stop. func (x *TabArray) GetTab(TabIndexVar int, AlignmentVar *TabAlign, LocationVar *int) { xTabArrayGetTab(x.GoPointer(), TabIndexVar, AlignmentVar, LocationVar) } var xTabArrayGetTabs func(uintptr, **TabAlign, *[]int) // If non-%NULL, @alignments and @locations are filled with allocated // arrays. // // The arrays are of length [method@Pango.TabArray.get_size]. // You must free the returned array. func (x *TabArray) GetTabs(AlignmentsVar **TabAlign, LocationsVar *[]int) { xTabArrayGetTabs(x.GoPointer(), AlignmentsVar, LocationsVar) } var xTabArrayResize func(uintptr, int) // Resizes a tab array. // // You must subsequently initialize any tabs // that were added as a result of growing the array. func (x *TabArray) Resize(NewSizeVar int) { xTabArrayResize(x.GoPointer(), NewSizeVar) } var xTabArraySetDecimalPoint func(uintptr, int, uint32) // Sets the Unicode character to use as decimal point. // // This is only relevant for tabs with %PANGO_TAB_DECIMAL alignment, // which align content at the first occurrence of the decimal point // character. // // By default, Pango uses the decimal point according // to the current locale. func (x *TabArray) SetDecimalPoint(TabIndexVar int, DecimalPointVar uint32) { xTabArraySetDecimalPoint(x.GoPointer(), TabIndexVar, DecimalPointVar) } var xTabArraySetPositionsInPixels func(uintptr, bool) // Sets whether positions in this array are specified in // pixels. func (x *TabArray) SetPositionsInPixels(PositionsInPixelsVar bool) { xTabArraySetPositionsInPixels(x.GoPointer(), PositionsInPixelsVar) } var xTabArraySetTab func(uintptr, int, TabAlign, int) // Sets the alignment and location of a tab stop. func (x *TabArray) SetTab(TabIndexVar int, AlignmentVar TabAlign, LocationVar int) { xTabArraySetTab(x.GoPointer(), TabIndexVar, AlignmentVar, LocationVar) } var xTabArraySort func(uintptr) // Utility function to ensure that the tab stops are in increasing order. func (x *TabArray) Sort() { xTabArraySort(x.GoPointer()) } var xTabArrayToString func(uintptr) string // Serializes a `PangoTabArray` to a string. // // In the resulting string, serialized tabs are separated by newlines or commas. // // Individual tabs are serialized to a string of the form // // [ALIGNMENT:]POSITION[:DECIMAL_POINT] // // Where ALIGNMENT is one of _left_, _right_, _center_ or _decimal_, and // POSITION is the position of the tab, optionally followed by the unit _px_. // If ALIGNMENT is omitted, it defaults to _left_. If ALIGNMENT is _decimal_, // the DECIMAL_POINT character may be specified as a Unicode codepoint. // // Note that all tabs in the array must use the same unit. // // A typical example: // // 100px 200px center:300px right:400px func (x *TabArray) ToString() string { cret := xTabArrayToString(x.GoPointer()) return cret } // `PangoTabAlign` specifies where the text appears relative to the tab stop // position. type TabAlign int var xTabAlignGLibType func() types.GType func TabAlignGLibType() types.GType { return xTabAlignGLibType() } const ( // the text appears to the right of the tab stop position TabLeftValue TabAlign = 0 // the text appears to the left of the tab stop position // until the available space is filled. Since: 1.50 TabRightValue TabAlign = 1 // the text is centered at the tab stop position // until the available space is filled. Since: 1.50 TabCenterValue TabAlign = 2 // text before the first occurrence of the decimal point // character appears to the left of the tab stop position (until the available // space is filled), the rest to the right. Since: 1.50 TabDecimalValue TabAlign = 3 ) var xTabArrayFromString func(string) *TabArray // Deserializes a `PangoTabArray` from a string. // // This is the counterpart to [method@Pango.TabArray.to_string]. // See that functions for details about the format. func TabArrayFromString(TextVar string) *TabArray { cret := xTabArrayFromString(TextVar) return cret } func init() { core.SetPackageName("PANGO", "pango") core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("PANGO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xTabAlignGLibType, libs, "pango_tab_align_get_type") core.PuregoSafeRegister(&xTabArrayFromString, libs, "pango_tab_array_from_string") core.PuregoSafeRegister(&xTabArrayGLibType, libs, "pango_tab_array_get_type") core.PuregoSafeRegister(&xNewTabArray, libs, "pango_tab_array_new") core.PuregoSafeRegister(&xNewTabArrayWithPositions, libs, "pango_tab_array_new_with_positions") core.PuregoSafeRegister(&xTabArrayCopy, libs, "pango_tab_array_copy") core.PuregoSafeRegister(&xTabArrayFree, libs, "pango_tab_array_free") core.PuregoSafeRegister(&xTabArrayGetDecimalPoint, libs, "pango_tab_array_get_decimal_point") core.PuregoSafeRegister(&xTabArrayGetPositionsInPixels, libs, "pango_tab_array_get_positions_in_pixels") core.PuregoSafeRegister(&xTabArrayGetSize, libs, "pango_tab_array_get_size") core.PuregoSafeRegister(&xTabArrayGetTab, libs, "pango_tab_array_get_tab") core.PuregoSafeRegister(&xTabArrayGetTabs, libs, "pango_tab_array_get_tabs") core.PuregoSafeRegister(&xTabArrayResize, libs, "pango_tab_array_resize") core.PuregoSafeRegister(&xTabArraySetDecimalPoint, libs, "pango_tab_array_set_decimal_point") core.PuregoSafeRegister(&xTabArraySetPositionsInPixels, libs, "pango_tab_array_set_positions_in_pixels") core.PuregoSafeRegister(&xTabArraySetTab, libs, "pango_tab_array_set_tab") core.PuregoSafeRegister(&xTabArraySort, libs, "pango_tab_array_sort") core.PuregoSafeRegister(&xTabArrayToString, libs, "pango_tab_array_to_string") }