v0.2.2 9100209

pango-layout.go RawHistoryFolder

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"
13	"github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type LayoutClass struct {
17	_ structs.HostLayout
18}
19
20func (x *LayoutClass) GoPointer() uintptr {
21	return uintptr(unsafe.Pointer(x))
22}
23
24// A `PangoLayoutIter` can be used to iterate over the visual
25// extents of a `PangoLayout`.
26//
27// To obtain a `PangoLayoutIter`, use [method@Pango.Layout.get_iter].
28//
29// The `PangoLayoutIter` structure is opaque, and has no user-visible fields.
30type LayoutIter struct {
31	_ structs.HostLayout
32}
33
34var xLayoutIterGLibType func() types.GType
35
36func LayoutIterGLibType() types.GType {
37	return xLayoutIterGLibType()
38}
39
40func (x *LayoutIter) GoPointer() uintptr {
41	return uintptr(unsafe.Pointer(x))
42}
43
44var xLayoutIterAtLastLine func(uintptr) bool
45
46// Determines whether @iter is on the last line of the layout.
47func (x *LayoutIter) AtLastLine() bool {
48
49	cret := xLayoutIterAtLastLine(x.GoPointer())
50	return cret
51}
52
53var xLayoutIterCopy func(uintptr) *LayoutIter
54
55// Copies a `PangoLayoutIter`.
56func (x *LayoutIter) Copy() *LayoutIter {
57
58	cret := xLayoutIterCopy(x.GoPointer())
59	return cret
60}
61
62var xLayoutIterFree func(uintptr)
63
64// Frees an iterator that's no longer in use.
65func (x *LayoutIter) Free() {
66
67	xLayoutIterFree(x.GoPointer())
68
69}
70
71var xLayoutIterGetBaseline func(uintptr) int
72
73// Gets the Y position of the current line's baseline, in layout
74// coordinates.
75//
76// Layout coordinates have the origin at the top left of the entire layout.
77func (x *LayoutIter) GetBaseline() int {
78
79	cret := xLayoutIterGetBaseline(x.GoPointer())
80	return cret
81}
82
83var xLayoutIterGetCharExtents func(uintptr, *Rectangle)
84
85// Gets the extents of the current character, in layout coordinates.
86//
87// Layout coordinates have the origin at the top left of the entire layout.
88//
89// Only logical extents can sensibly be obtained for characters;
90// ink extents make sense only down to the level of clusters.
91func (x *LayoutIter) GetCharExtents(LogicalRectVar *Rectangle) {
92
93	xLayoutIterGetCharExtents(x.GoPointer(), LogicalRectVar)
94
95}
96
97var xLayoutIterGetClusterExtents func(uintptr, *Rectangle, *Rectangle)
98
99// Gets the extents of the current cluster, in layout coordinates.
100//
101// Layout coordinates have the origin at the top left of the entire layout.
102func (x *LayoutIter) GetClusterExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
103
104	xLayoutIterGetClusterExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
105
106}
107
108var xLayoutIterGetIndex func(uintptr) int
109
110// Gets the current byte index.
111//
112// Note that iterating forward by char moves in visual order,
113// not logical order, so indexes may not be sequential. Also,
114// the index may be equal to the length of the text in the
115// layout, if on the %NULL run (see [method@Pango.LayoutIter.get_run]).
116func (x *LayoutIter) GetIndex() int {
117
118	cret := xLayoutIterGetIndex(x.GoPointer())
119	return cret
120}
121
122var xLayoutIterGetLayout func(uintptr) uintptr
123
124// Gets the layout associated with a `PangoLayoutIter`.
125func (x *LayoutIter) GetLayout() *Layout {
126	var cls *Layout
127
128	cret := xLayoutIterGetLayout(x.GoPointer())
129
130	if cret == 0 {
131		return nil
132	}
133	gobject.IncreaseRef(cret)
134	cls = &Layout{}
135	cls.Ptr = cret
136	return cls
137}
138
139var xLayoutIterGetLayoutExtents func(uintptr, *Rectangle, *Rectangle)
140
141// Obtains the extents of the `PangoLayout` being iterated over.
142func (x *LayoutIter) GetLayoutExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
143
144	xLayoutIterGetLayoutExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
145
146}
147
148var xLayoutIterGetLine func(uintptr) *LayoutLine
149
150// Gets the current line.
151//
152// Use the faster [method@Pango.LayoutIter.get_line_readonly] if
153// you do not plan to modify the contents of the line (glyphs,
154// glyph widths, etc.).
155func (x *LayoutIter) GetLine() *LayoutLine {
156
157	cret := xLayoutIterGetLine(x.GoPointer())
158	return cret
159}
160
161var xLayoutIterGetLineExtents func(uintptr, *Rectangle, *Rectangle)
162
163// Obtains the extents of the current line.
164//
165// Extents are in layout coordinates (origin is the top-left corner
166// of the entire `PangoLayout`). Thus the extents returned by this
167// function will be the same width/height but not at the same x/y
168// as the extents returned from [method@Pango.LayoutLine.get_extents].
169func (x *LayoutIter) GetLineExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
170
171	xLayoutIterGetLineExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
172
173}
174
175var xLayoutIterGetLineReadonly func(uintptr) *LayoutLine
176
177// Gets the current line for read-only access.
178//
179// This is a faster alternative to [method@Pango.LayoutIter.get_line],
180// but the user is not expected to modify the contents of the line
181// (glyphs, glyph widths, etc.).
182func (x *LayoutIter) GetLineReadonly() *LayoutLine {
183
184	cret := xLayoutIterGetLineReadonly(x.GoPointer())
185	return cret
186}
187
188var xLayoutIterGetLineYrange func(uintptr, *int, *int)
189
190// Divides the vertical space in the `PangoLayout` being iterated over
191// between the lines in the layout, and returns the space belonging to
192// the current line.
193//
194// A line's range includes the line's logical extents. plus half of the
195// spacing above and below the line, if [method@Pango.Layout.set_spacing]
196// has been called to set layout spacing. The Y positions are in layout
197// coordinates (origin at top left of the entire layout).
198//
199// Note: Since 1.44, Pango uses line heights for placing lines, and there
200// may be gaps between the ranges returned by this function.
201func (x *LayoutIter) GetLineYrange(Y0Var *int, Y1Var *int) {
202
203	xLayoutIterGetLineYrange(x.GoPointer(), Y0Var, Y1Var)
204
205}
206
207var xLayoutIterGetRun func(uintptr) *LayoutRun
208
209// Gets the current run.
210//
211// When iterating by run, at the end of each line, there's a position
212// with a %NULL run, so this function can return %NULL. The %NULL run
213// at the end of each line ensures that all lines have at least one run,
214// even lines consisting of only a newline.
215//
216// Use the faster [method@Pango.LayoutIter.get_run_readonly] if you do not
217// plan to modify the contents of the run (glyphs, glyph widths, etc.).
218func (x *LayoutIter) GetRun() *LayoutRun {
219
220	cret := xLayoutIterGetRun(x.GoPointer())
221	return cret
222}
223
224var xLayoutIterGetRunBaseline func(uintptr) int
225
226// Gets the Y position of the current run's baseline, in layout
227// coordinates.
228//
229// Layout coordinates have the origin at the top left of the entire layout.
230//
231// The run baseline can be different from the line baseline, for
232// example due to superscript or subscript positioning.
233func (x *LayoutIter) GetRunBaseline() int {
234
235	cret := xLayoutIterGetRunBaseline(x.GoPointer())
236	return cret
237}
238
239var xLayoutIterGetRunExtents func(uintptr, *Rectangle, *Rectangle)
240
241// Gets the extents of the current run in layout coordinates.
242//
243// Layout coordinates have the origin at the top left of the entire layout.
244func (x *LayoutIter) GetRunExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
245
246	xLayoutIterGetRunExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
247
248}
249
250var xLayoutIterGetRunReadonly func(uintptr) *LayoutRun
251
252// Gets the current run for read-only access.
253//
254// When iterating by run, at the end of each line, there's a position
255// with a %NULL run, so this function can return %NULL. The %NULL run
256// at the end of each line ensures that all lines have at least one run,
257// even lines consisting of only a newline.
258//
259// This is a faster alternative to [method@Pango.LayoutIter.get_run],
260// but the user is not expected to modify the contents of the run (glyphs,
261// glyph widths, etc.).
262func (x *LayoutIter) GetRunReadonly() *LayoutRun {
263
264	cret := xLayoutIterGetRunReadonly(x.GoPointer())
265	return cret
266}
267
268var xLayoutIterNextChar func(uintptr) bool
269
270// Moves @iter forward to the next character in visual order.
271//
272// If @iter was already at the end of the layout, returns %FALSE.
273func (x *LayoutIter) NextChar() bool {
274
275	cret := xLayoutIterNextChar(x.GoPointer())
276	return cret
277}
278
279var xLayoutIterNextCluster func(uintptr) bool
280
281// Moves @iter forward to the next cluster in visual order.
282//
283// If @iter was already at the end of the layout, returns %FALSE.
284func (x *LayoutIter) NextCluster() bool {
285
286	cret := xLayoutIterNextCluster(x.GoPointer())
287	return cret
288}
289
290var xLayoutIterNextLine func(uintptr) bool
291
292// Moves @iter forward to the start of the next line.
293//
294// If @iter is already on the last line, returns %FALSE.
295func (x *LayoutIter) NextLine() bool {
296
297	cret := xLayoutIterNextLine(x.GoPointer())
298	return cret
299}
300
301var xLayoutIterNextRun func(uintptr) bool
302
303// Moves @iter forward to the next run in visual order.
304//
305// If @iter was already at the end of the layout, returns %FALSE.
306func (x *LayoutIter) NextRun() bool {
307
308	cret := xLayoutIterNextRun(x.GoPointer())
309	return cret
310}
311
312// A `PangoLayoutLine` represents one of the lines resulting from laying
313// out a paragraph via `PangoLayout`.
314//
315// `PangoLayoutLine` structures are obtained by calling
316// [method@Pango.Layout.get_line] and are only valid until the text,
317// attributes, or settings of the parent `PangoLayout` are modified.
318type LayoutLine struct {
319	_ structs.HostLayout
320
321	Layout *Layout
322
323	StartIndex int32
324
325	Length int32
326
327	Runs *glib.SList
328
329	IsParagraphStart uint
330
331	ResolvedDir uint
332}
333
334var xLayoutLineGLibType func() types.GType
335
336func LayoutLineGLibType() types.GType {
337	return xLayoutLineGLibType()
338}
339
340func (x *LayoutLine) GoPointer() uintptr {
341	return uintptr(unsafe.Pointer(x))
342}
343
344var xLayoutLineGetExtents func(uintptr, *Rectangle, *Rectangle)
345
346// Computes the logical and ink extents of a layout line.
347//
348// See [method@Pango.Font.get_glyph_extents] for details
349// about the interpretation of the rectangles.
350func (x *LayoutLine) GetExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
351
352	xLayoutLineGetExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
353
354}
355
356var xLayoutLineGetHeight func(uintptr, *int)
357
358// Computes the height of the line, as the maximum of the heights
359// of fonts used in this line.
360//
361// Note that the actual baseline-to-baseline distance between lines
362// of text is influenced by other factors, such as
363// [method@Pango.Layout.set_spacing] and
364// [method@Pango.Layout.set_line_spacing].
365func (x *LayoutLine) GetHeight(HeightVar *int) {
366
367	xLayoutLineGetHeight(x.GoPointer(), HeightVar)
368
369}
370
371var xLayoutLineGetLength func(uintptr) int
372
373// Returns the length of the line, in bytes.
374func (x *LayoutLine) GetLength() int {
375
376	cret := xLayoutLineGetLength(x.GoPointer())
377	return cret
378}
379
380var xLayoutLineGetPixelExtents func(uintptr, *Rectangle, *Rectangle)
381
382// Computes the logical and ink extents of @layout_line in device units.
383//
384// This function just calls [method@Pango.LayoutLine.get_extents] followed by
385// two [func@extents_to_pixels] calls, rounding @ink_rect and @logical_rect
386// such that the rounded rectangles fully contain the unrounded one (that is,
387// passes them as first argument to [func@extents_to_pixels]).
388func (x *LayoutLine) GetPixelExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
389
390	xLayoutLineGetPixelExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
391
392}
393
394var xLayoutLineGetResolvedDirection func(uintptr) Direction
395
396// Returns the resolved direction of the line.
397func (x *LayoutLine) GetResolvedDirection() Direction {
398
399	cret := xLayoutLineGetResolvedDirection(x.GoPointer())
400	return cret
401}
402
403var xLayoutLineGetStartIndex func(uintptr) int
404
405// Returns the start index of the line, as byte index
406// into the text of the layout.
407func (x *LayoutLine) GetStartIndex() int {
408
409	cret := xLayoutLineGetStartIndex(x.GoPointer())
410	return cret
411}
412
413var xLayoutLineGetXRanges func(uintptr, int, int, *[]int, *int)
414
415// Gets a list of visual ranges corresponding to a given logical range.
416//
417// This list is not necessarily minimal - there may be consecutive
418// ranges which are adjacent. The ranges will be sorted from left to
419// right. The ranges are with respect to the left edge of the entire
420// layout, not with respect to the line.
421func (x *LayoutLine) GetXRanges(StartIndexVar int, EndIndexVar int, RangesVar *[]int, NRangesVar *int) {
422
423	xLayoutLineGetXRanges(x.GoPointer(), StartIndexVar, EndIndexVar, RangesVar, NRangesVar)
424
425}
426
427var xLayoutLineIndexToX func(uintptr, int, bool, *int)
428
429// Converts an index within a line to a X position.
430func (x *LayoutLine) IndexToX(IndexVar int, TrailingVar bool, XPosVar *int) {
431
432	xLayoutLineIndexToX(x.GoPointer(), IndexVar, TrailingVar, XPosVar)
433
434}
435
436var xLayoutLineIsParagraphStartFn func(uintptr) bool
437
438// Returns whether this is the first line of the paragraph.
439func (x *LayoutLine) IsParagraphStartFn() bool {
440
441	cret := xLayoutLineIsParagraphStartFn(x.GoPointer())
442	return cret
443}
444
445var xLayoutLineRef func(uintptr) *LayoutLine
446
447// Increase the reference count of a `PangoLayoutLine` by one.
448func (x *LayoutLine) Ref() *LayoutLine {
449
450	cret := xLayoutLineRef(x.GoPointer())
451	return cret
452}
453
454var xLayoutLineUnref func(uintptr)
455
456// Decrease the reference count of a `PangoLayoutLine` by one.
457//
458// If the result is zero, the line and all associated memory
459// will be freed.
460func (x *LayoutLine) Unref() {
461
462	xLayoutLineUnref(x.GoPointer())
463
464}
465
466var xLayoutLineXToIndex func(uintptr, int, *int, *int) bool
467
468// Converts from x offset to the byte index of the corresponding character
469// within the text of the layout.
470//
471// If @x_pos is outside the line, @index_ and @trailing will point to the very
472// first or very last position in the line. This determination is based on the
473// resolved direction of the paragraph; for example, if the resolved direction
474// is right-to-left, then an X position to the right of the line (after it)
475// results in 0 being stored in @index_ and @trailing. An X position to the
476// left of the line results in @index_ pointing to the (logical) last grapheme
477// in the line and @trailing being set to the number of characters in that
478// grapheme. The reverse is true for a left-to-right line.
479func (x *LayoutLine) XToIndex(XPosVar int, IndexVar *int, TrailingVar *int) bool {
480
481	cret := xLayoutLineXToIndex(x.GoPointer(), XPosVar, IndexVar, TrailingVar)
482	return cret
483}
484
485// A `PangoLayoutRun` represents a single run within a `PangoLayoutLine`.
486//
487// It is simply an alternate name for [struct@Pango.GlyphItem].
488// See the [struct@Pango.GlyphItem] docs for details on the fields.
489type LayoutRun = uintptr
490
491// Flags that influence the behavior of [func@Pango.Layout.deserialize].
492//
493// New members may be added to this enumeration over time.
494type LayoutDeserializeFlags int
495
496var xLayoutDeserializeFlagsGLibType func() types.GType
497
498func LayoutDeserializeFlagsGLibType() types.GType {
499	return xLayoutDeserializeFlagsGLibType()
500}
501
502const (
503
504	// Default behavior
505	LayoutDeserializeDefaultValue LayoutDeserializeFlags = 0
506	// Apply context information
507	//   from the serialization to the `PangoContext`
508	LayoutDeserializeContextValue LayoutDeserializeFlags = 1
509)
510
511// Flags that influence the behavior of [method@Pango.Layout.serialize].
512//
513// New members may be added to this enumeration over time.
514type LayoutSerializeFlags int
515
516var xLayoutSerializeFlagsGLibType func() types.GType
517
518func LayoutSerializeFlagsGLibType() types.GType {
519	return xLayoutSerializeFlagsGLibType()
520}
521
522const (
523
524	// Default behavior
525	LayoutSerializeDefaultValue LayoutSerializeFlags = 0
526	// Include context information
527	LayoutSerializeContextValue LayoutSerializeFlags = 1
528	// Include information about the formatted output
529	LayoutSerializeOutputValue LayoutSerializeFlags = 2
530)
531
532// `PangoAlignment` describes how to align the lines of a `PangoLayout`
533// within the available space.
534//
535// If the `PangoLayout` is set to justify using [method@Pango.Layout.set_justify],
536// this only affects partial lines.
537//
538// See [method@Pango.Layout.set_auto_dir] for how text direction affects
539// the interpretation of `PangoAlignment` values.
540type Alignment int
541
542var xAlignmentGLibType func() types.GType
543
544func AlignmentGLibType() types.GType {
545	return xAlignmentGLibType()
546}
547
548const (
549
550	// Put all available space on the right
551	AlignLeftValue Alignment = 0
552	// Center the line within the available space
553	AlignCenterValue Alignment = 1
554	// Put all available space on the left
555	AlignRightValue Alignment = 2
556)
557
558// `PangoEllipsizeMode` describes what sort of ellipsization
559// should be applied to text.
560//
561// In the ellipsization process characters are removed from the
562// text in order to make it fit to a given width and replaced
563// with an ellipsis.
564type EllipsizeMode int
565
566var xEllipsizeModeGLibType func() types.GType
567
568func EllipsizeModeGLibType() types.GType {
569	return xEllipsizeModeGLibType()
570}
571
572const (
573
574	// No ellipsization
575	EllipsizeNoneValue EllipsizeMode = 0
576	// Omit characters at the start of the text
577	EllipsizeStartValue EllipsizeMode = 1
578	// Omit characters in the middle of the text
579	EllipsizeMiddleValue EllipsizeMode = 2
580	// Omit characters at the end of the text
581	EllipsizeEndValue EllipsizeMode = 3
582)
583
584// Errors that can be returned by [func@Pango.Layout.deserialize].
585type LayoutDeserializeError int
586
587var xLayoutDeserializeErrorGLibType func() types.GType
588
589func LayoutDeserializeErrorGLibType() types.GType {
590	return xLayoutDeserializeErrorGLibType()
591}
592
593const (
594
595	// Unspecified error
596	LayoutDeserializeInvalidValue LayoutDeserializeError = 0
597	// A JSon value could not be
598	//   interpreted
599	LayoutDeserializeInvalidValueValue LayoutDeserializeError = 1
600	// A required JSon member was
601	//   not found
602	LayoutDeserializeMissingValueValue LayoutDeserializeError = 2
603)
604
605// `PangoWrapMode` describes how to wrap the lines of a `PangoLayout`
606// to the desired width.
607//
608// For @PANGO_WRAP_WORD, Pango uses break opportunities that are determined
609// by the Unicode line breaking algorithm. For @PANGO_WRAP_CHAR, Pango allows
610// breaking at grapheme boundaries that are determined by the Unicode text
611// segmentation algorithm.
612type WrapMode int
613
614var xWrapModeGLibType func() types.GType
615
616func WrapModeGLibType() types.GType {
617	return xWrapModeGLibType()
618}
619
620const (
621
622	// wrap lines at word boundaries.
623	WrapWordValue WrapMode = 0
624	// wrap lines at character boundaries.
625	WrapCharValue WrapMode = 1
626	// wrap lines at word boundaries, but fall back to
627	//   character boundaries if there is not enough space for a full word.
628	WrapWordCharValue WrapMode = 2
629	// do not wrap.
630	WrapNoneValue WrapMode = 3
631)
632
633// A `PangoLayout` structure represents an entire paragraph of text.
634//
635// While complete access to the layout capabilities of Pango is provided
636// using the detailed interfaces for itemization and shaping, using
637// that functionality directly involves writing a fairly large amount
638// of code. `PangoLayout` provides a high-level driver for formatting
639// entire paragraphs of text at once. This includes paragraph-level
640// functionality such as line breaking, justification, alignment and
641// ellipsization.
642//
643// A `PangoLayout` is initialized with a `PangoContext`, UTF-8 string
644// and set of attributes for that string. Once that is done, the set of
645// formatted lines can be extracted from the object, the layout can be
646// rendered, and conversion between logical character positions within
647// the layout's text, and the physical position of the resulting glyphs
648// can be made.
649//
650// There are a number of parameters to adjust the formatting of a
651// `PangoLayout`. The following image shows adjustable parameters
652// (on the left) and font metrics (on the right):
653//
654// <picture>
655//
656//	<source srcset="layout-dark.png" media="(prefers-color-scheme: dark)">
657//	<img alt="Pango Layout Parameters" src="layout-light.png">
658//
659// </picture>
660//
661// The following images demonstrate the effect of alignment and
662// justification on the layout of text:
663//
664// | | |
665// | --- | --- |
666// | ![align=left](align-left.png) | ![align=left, justify](align-left-justify.png) |
667// | ![align=center](align-center.png) | ![align=center, justify](align-center-justify.png) |
668// | ![align=right](align-right.png) | ![align=right, justify](align-right-justify.png) |
669//
670// It is possible, as well, to ignore the 2-D setup,
671// and simply treat the results of a `PangoLayout` as a list of lines.
672type Layout struct {
673	gobject.Object
674}
675
676var xLayoutGLibType func() types.GType
677
678func LayoutGLibType() types.GType {
679	return xLayoutGLibType()
680}
681
682func LayoutNewFromInternalPtr(ptr uintptr) *Layout {
683	cls := &Layout{}
684	cls.Ptr = ptr
685	return cls
686}
687
688var xNewLayout func(uintptr) uintptr
689
690// Create a new `PangoLayout` object with attributes initialized to
691// default values for a particular `PangoContext`.
692func NewLayout(ContextVar *Context) *Layout {
693	var cls *Layout
694
695	cret := xNewLayout(ContextVar.GoPointer())
696
697	if cret == 0 {
698		return nil
699	}
700	cls = &Layout{}
701	cls.Ptr = cret
702	return cls
703}
704
705var xLayoutContextChanged func(uintptr)
706
707// Forces recomputation of any state in the `PangoLayout` that
708// might depend on the layout's context.
709//
710// This function should be called if you make changes to the context
711// subsequent to creating the layout.
712func (x *Layout) ContextChanged() {
713
714	xLayoutContextChanged(x.GoPointer())
715
716}
717
718var xLayoutCopy func(uintptr) uintptr
719
720// Creates a deep copy-by-value of the layout.
721//
722// The attribute list, tab array, and text from the original layout
723// are all copied by value.
724func (x *Layout) Copy() *Layout {
725	var cls *Layout
726
727	cret := xLayoutCopy(x.GoPointer())
728
729	if cret == 0 {
730		return nil
731	}
732	cls = &Layout{}
733	cls.Ptr = cret
734	return cls
735}
736
737var xLayoutGetAlignment func(uintptr) Alignment
738
739// Gets the alignment for the layout: how partial lines are
740// positioned within the horizontal space available.
741func (x *Layout) GetAlignment() Alignment {
742
743	cret := xLayoutGetAlignment(x.GoPointer())
744	return cret
745}
746
747var xLayoutGetAttributes func(uintptr) *AttrList
748
749// Gets the attribute list for the layout, if any.
750func (x *Layout) GetAttributes() *AttrList {
751
752	cret := xLayoutGetAttributes(x.GoPointer())
753	return cret
754}
755
756var xLayoutGetAutoDir func(uintptr) bool
757
758// Gets whether to calculate the base direction for the layout
759// according to its contents.
760//
761// See [method@Pango.Layout.set_auto_dir].
762func (x *Layout) GetAutoDir() bool {
763
764	cret := xLayoutGetAutoDir(x.GoPointer())
765	return cret
766}
767
768var xLayoutGetBaseline func(uintptr) int
769
770// Gets the Y position of baseline of the first line in @layout.
771func (x *Layout) GetBaseline() int {
772
773	cret := xLayoutGetBaseline(x.GoPointer())
774	return cret
775}
776
777var xLayoutGetCaretPos func(uintptr, int, *Rectangle, *Rectangle)
778
779// Given an index within a layout, determines the positions that of the
780// strong and weak cursors if the insertion point is at that index.
781//
782// This is a variant of [method@Pango.Layout.get_cursor_pos] that applies
783// font metric information about caret slope and offset to the positions
784// it returns.
785//
786// <picture>
787//
788//	<source srcset="caret-metrics-dark.png" media="(prefers-color-scheme: dark)">
789//	<img alt="Caret metrics" src="caret-metrics-light.png">
790//
791// </picture>
792func (x *Layout) GetCaretPos(IndexVar int, StrongPosVar *Rectangle, WeakPosVar *Rectangle) {
793
794	xLayoutGetCaretPos(x.GoPointer(), IndexVar, StrongPosVar, WeakPosVar)
795
796}
797
798var xLayoutGetCharacterCount func(uintptr) int
799
800// Returns the number of Unicode characters in the
801// the text of @layout.
802func (x *Layout) GetCharacterCount() int {
803
804	cret := xLayoutGetCharacterCount(x.GoPointer())
805	return cret
806}
807
808var xLayoutGetContext func(uintptr) uintptr
809
810// Retrieves the `PangoContext` used for this layout.
811func (x *Layout) GetContext() *Context {
812	var cls *Context
813
814	cret := xLayoutGetContext(x.GoPointer())
815
816	if cret == 0 {
817		return nil
818	}
819	gobject.IncreaseRef(cret)
820	cls = &Context{}
821	cls.Ptr = cret
822	return cls
823}
824
825var xLayoutGetCursorPos func(uintptr, int, *Rectangle, *Rectangle)
826
827// Given an index within a layout, determines the positions that of the
828// strong and weak cursors if the insertion point is at that index.
829//
830// The position of each cursor is stored as a zero-width rectangle
831// with the height of the run extents.
832//
833// <picture>
834//
835//	<source srcset="cursor-positions-dark.png" media="(prefers-color-scheme: dark)">
836//	<img alt="Cursor positions" src="cursor-positions-light.png">
837//
838// </picture>
839//
840// The strong cursor location is the location where characters of the
841// directionality equal to the base direction of the layout are inserted.
842// The weak cursor location is the location where characters of the
843// directionality opposite to the base direction of the layout are inserted.
844//
845// The following example shows text with both a strong and a weak cursor.
846//
847// <picture>
848//
849//	<source srcset="split-cursor-dark.png" media="(prefers-color-scheme: dark)">
850//	<img alt="Strong and weak cursors" src="split-cursor-light.png">
851//
852// </picture>
853//
854// The strong cursor has a little arrow pointing to the right, the weak
855// cursor to the left. Typing a 'c' in this situation will insert the
856// character after the 'b', and typing another Hebrew character, like 'ג',
857// will insert it at the end.
858func (x *Layout) GetCursorPos(IndexVar int, StrongPosVar *Rectangle, WeakPosVar *Rectangle) {
859
860	xLayoutGetCursorPos(x.GoPointer(), IndexVar, StrongPosVar, WeakPosVar)
861
862}
863
864var xLayoutGetDirection func(uintptr, int) Direction
865
866// Gets the text direction at the given character position in @layout.
867func (x *Layout) GetDirection(IndexVar int) Direction {
868
869	cret := xLayoutGetDirection(x.GoPointer(), IndexVar)
870	return cret
871}
872
873var xLayoutGetEllipsize func(uintptr) EllipsizeMode
874
875// Gets the type of ellipsization being performed for @layout.
876//
877// See [method@Pango.Layout.set_ellipsize].
878//
879// Use [method@Pango.Layout.is_ellipsized] to query whether any
880// paragraphs were actually ellipsized.
881func (x *Layout) GetEllipsize() EllipsizeMode {
882
883	cret := xLayoutGetEllipsize(x.GoPointer())
884	return cret
885}
886
887var xLayoutGetExtents func(uintptr, *Rectangle, *Rectangle)
888
889// Computes the logical and ink extents of @layout.
890//
891// Logical extents are usually what you want for positioning things. Note
892// that both extents may have non-zero x and y. You may want to use those
893// to offset where you render the layout. Not doing that is a very typical
894// bug that shows up as right-to-left layouts not being correctly positioned
895// in a layout with a set width.
896//
897// The extents are given in layout coordinates and in Pango units; layout
898// coordinates begin at the top left corner of the layout.
899func (x *Layout) GetExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
900
901	xLayoutGetExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
902
903}
904
905var xLayoutGetFontDescription func(uintptr) *FontDescription
906
907// Gets the font description for the layout, if any.
908func (x *Layout) GetFontDescription() *FontDescription {
909
910	cret := xLayoutGetFontDescription(x.GoPointer())
911	return cret
912}
913
914var xLayoutGetHeight func(uintptr) int
915
916// Gets the height of layout used for ellipsization.
917//
918// See [method@Pango.Layout.set_height] for details.
919func (x *Layout) GetHeight() int {
920
921	cret := xLayoutGetHeight(x.GoPointer())
922	return cret
923}
924
925var xLayoutGetIndent func(uintptr) int
926
927// Gets the paragraph indent width in Pango units.
928//
929// A negative value indicates a hanging indentation.
930func (x *Layout) GetIndent() int {
931
932	cret := xLayoutGetIndent(x.GoPointer())
933	return cret
934}
935
936var xLayoutGetIter func(uintptr) *LayoutIter
937
938// Returns an iterator to iterate over the visual extents of the layout.
939func (x *Layout) GetIter() *LayoutIter {
940
941	cret := xLayoutGetIter(x.GoPointer())
942	return cret
943}
944
945var xLayoutGetJustify func(uintptr) bool
946
947// Gets whether each complete line should be stretched to fill the entire
948// width of the layout.
949func (x *Layout) GetJustify() bool {
950
951	cret := xLayoutGetJustify(x.GoPointer())
952	return cret
953}
954
955var xLayoutGetJustifyLastLine func(uintptr) bool
956
957// Gets whether the last line should be stretched
958// to fill the entire width of the layout.
959func (x *Layout) GetJustifyLastLine() bool {
960
961	cret := xLayoutGetJustifyLastLine(x.GoPointer())
962	return cret
963}
964
965var xLayoutGetLine func(uintptr, int) *LayoutLine
966
967// Retrieves a particular line from a `PangoLayout`.
968//
969// Use the faster [method@Pango.Layout.get_line_readonly] if you do not
970// plan to modify the contents of the line (glyphs, glyph widths, etc.).
971func (x *Layout) GetLine(LineVar int) *LayoutLine {
972
973	cret := xLayoutGetLine(x.GoPointer(), LineVar)
974	return cret
975}
976
977var xLayoutGetLineCount func(uintptr) int
978
979// Retrieves the count of lines for the @layout.
980func (x *Layout) GetLineCount() int {
981
982	cret := xLayoutGetLineCount(x.GoPointer())
983	return cret
984}
985
986var xLayoutGetLineReadonly func(uintptr, int) *LayoutLine
987
988// Retrieves a particular line from a `PangoLayout`.
989//
990// This is a faster alternative to [method@Pango.Layout.get_line],
991// but the user is not expected to modify the contents of the line
992// (glyphs, glyph widths, etc.).
993func (x *Layout) GetLineReadonly(LineVar int) *LayoutLine {
994
995	cret := xLayoutGetLineReadonly(x.GoPointer(), LineVar)
996	return cret
997}
998
999var xLayoutGetLineSpacing func(uintptr) float32
1000
1001// Gets the line spacing factor of @layout.
1002//
1003// See [method@Pango.Layout.set_line_spacing].
1004func (x *Layout) GetLineSpacing() float32 {
1005
1006	cret := xLayoutGetLineSpacing(x.GoPointer())
1007	return cret
1008}
1009
1010var xLayoutGetLines func(uintptr) *glib.SList
1011
1012// Returns the lines of the @layout as a list.
1013//
1014// Use the faster [method@Pango.Layout.get_lines_readonly] if you do not
1015// plan to modify the contents of the lines (glyphs, glyph widths, etc.).
1016func (x *Layout) GetLines() *glib.SList {
1017
1018	cret := xLayoutGetLines(x.GoPointer())
1019	return cret
1020}
1021
1022var xLayoutGetLinesReadonly func(uintptr) *glib.SList
1023
1024// Returns the lines of the @layout as a list.
1025//
1026// This is a faster alternative to [method@Pango.Layout.get_lines],
1027// but the user is not expected to modify the contents of the lines
1028// (glyphs, glyph widths, etc.).
1029func (x *Layout) GetLinesReadonly() *glib.SList {
1030
1031	cret := xLayoutGetLinesReadonly(x.GoPointer())
1032	return cret
1033}
1034
1035var xLayoutGetLogAttrs func(uintptr, *uintptr, *int)
1036
1037// Retrieves an array of logical attributes for each character in
1038// the @layout.
1039func (x *Layout) GetLogAttrs(AttrsVar *uintptr, NAttrsVar *int) {
1040
1041	xLayoutGetLogAttrs(x.GoPointer(), AttrsVar, NAttrsVar)
1042
1043}
1044
1045var xLayoutGetLogAttrsReadonly func(uintptr, *int) uintptr
1046
1047// Retrieves an array of logical attributes for each character in
1048// the @layout.
1049//
1050// This is a faster alternative to [method@Pango.Layout.get_log_attrs].
1051// The returned array is part of @layout and must not be modified.
1052// Modifying the layout will invalidate the returned array.
1053//
1054// The number of attributes returned in @n_attrs will be one more
1055// than the total number of characters in the layout, since there
1056// need to be attributes corresponding to both the position before
1057// the first character and the position after the last character.
1058func (x *Layout) GetLogAttrsReadonly(NAttrsVar *int) uintptr {
1059
1060	cret := xLayoutGetLogAttrsReadonly(x.GoPointer(), NAttrsVar)
1061	return cret
1062}
1063
1064var xLayoutGetPixelExtents func(uintptr, *Rectangle, *Rectangle)
1065
1066// Computes the logical and ink extents of @layout in device units.
1067//
1068// This function just calls [method@Pango.Layout.get_extents] followed by
1069// two [func@extents_to_pixels] calls, rounding @ink_rect and @logical_rect
1070// such that the rounded rectangles fully contain the unrounded one (that is,
1071// passes them as first argument to [func@Pango.extents_to_pixels]).
1072func (x *Layout) GetPixelExtents(InkRectVar *Rectangle, LogicalRectVar *Rectangle) {
1073
1074	xLayoutGetPixelExtents(x.GoPointer(), InkRectVar, LogicalRectVar)
1075
1076}
1077
1078var xLayoutGetPixelSize func(uintptr, *int, *int)
1079
1080// Determines the logical width and height of a `PangoLayout` in device
1081// units.
1082//
1083// [method@Pango.Layout.get_size] returns the width and height
1084// scaled by %PANGO_SCALE. This is simply a convenience function
1085// around [method@Pango.Layout.get_pixel_extents].
1086func (x *Layout) GetPixelSize(WidthVar *int, HeightVar *int) {
1087
1088	xLayoutGetPixelSize(x.GoPointer(), WidthVar, HeightVar)
1089
1090}
1091
1092var xLayoutGetSerial func(uintptr) uint
1093
1094// Returns the current serial number of @layout.
1095//
1096// The serial number is initialized to an small number larger than zero
1097// when a new layout is created and is increased whenever the layout is
1098// changed using any of the setter functions, or the `PangoContext` it
1099// uses has changed. The serial may wrap, but will never have the value 0.
1100// Since it can wrap, never compare it with "less than", always use "not equals".
1101//
1102// This can be used to automatically detect changes to a `PangoLayout`,
1103// and is useful for example to decide whether a layout needs redrawing.
1104// To force the serial to be increased, use
1105// [method@Pango.Layout.context_changed].
1106func (x *Layout) GetSerial() uint {
1107
1108	cret := xLayoutGetSerial(x.GoPointer())
1109	return cret
1110}
1111
1112var xLayoutGetSingleParagraphMode func(uintptr) bool
1113
1114// Obtains whether @layout is in single paragraph mode.
1115//
1116// See [method@Pango.Layout.set_single_paragraph_mode].
1117func (x *Layout) GetSingleParagraphMode() bool {
1118
1119	cret := xLayoutGetSingleParagraphMode(x.GoPointer())
1120	return cret
1121}
1122
1123var xLayoutGetSize func(uintptr, *int, *int)
1124
1125// Determines the logical width and height of a `PangoLayout` in Pango
1126// units.
1127//
1128// This is simply a convenience function around [method@Pango.Layout.get_extents].
1129func (x *Layout) GetSize(WidthVar *int, HeightVar *int) {
1130
1131	xLayoutGetSize(x.GoPointer(), WidthVar, HeightVar)
1132
1133}
1134
1135var xLayoutGetSpacing func(uintptr) int
1136
1137// Gets the amount of spacing between the lines of the layout.
1138func (x *Layout) GetSpacing() int {
1139
1140	cret := xLayoutGetSpacing(x.GoPointer())
1141	return cret
1142}
1143
1144var xLayoutGetTabs func(uintptr) *TabArray
1145
1146// Gets the current `PangoTabArray` used by this layout.
1147//
1148// If no `PangoTabArray` has been set, then the default tabs are
1149// in use and %NULL is returned. Default tabs are every 8 spaces.
1150//
1151// The return value should be freed with [method@Pango.TabArray.free].
1152func (x *Layout) GetTabs() *TabArray {
1153
1154	cret := xLayoutGetTabs(x.GoPointer())
1155	return cret
1156}
1157
1158var xLayoutGetText func(uintptr) string
1159
1160// Gets the text in the layout.
1161//
1162// The returned text should not be freed or modified.
1163func (x *Layout) GetText() string {
1164
1165	cret := xLayoutGetText(x.GoPointer())
1166	return cret
1167}
1168
1169var xLayoutGetUnknownGlyphsCount func(uintptr) int
1170
1171// Counts the number of unknown glyphs in @layout.
1172//
1173// This function can be used to determine if there are any fonts
1174// available to render all characters in a certain string, or when
1175// used in combination with %PANGO_ATTR_FALLBACK, to check if a
1176// certain font supports all the characters in the string.
1177func (x *Layout) GetUnknownGlyphsCount() int {
1178
1179	cret := xLayoutGetUnknownGlyphsCount(x.GoPointer())
1180	return cret
1181}
1182
1183var xLayoutGetWidth func(uintptr) int
1184
1185// Gets the width to which the lines of the `PangoLayout` should wrap.
1186func (x *Layout) GetWidth() int {
1187
1188	cret := xLayoutGetWidth(x.GoPointer())
1189	return cret
1190}
1191
1192var xLayoutGetWrap func(uintptr) WrapMode
1193
1194// Gets the wrap mode for the layout.
1195//
1196// Use [method@Pango.Layout.is_wrapped] to query whether
1197// any paragraphs were actually wrapped.
1198func (x *Layout) GetWrap() WrapMode {
1199
1200	cret := xLayoutGetWrap(x.GoPointer())
1201	return cret
1202}
1203
1204var xLayoutIndexToLineX func(uintptr, int, bool, *int, *int)
1205
1206// Converts from byte @index_ within the @layout to line and X position.
1207//
1208// The X position is measured from the left edge of the line.
1209func (x *Layout) IndexToLineX(IndexVar int, TrailingVar bool, LineVar *int, XPosVar *int) {
1210
1211	xLayoutIndexToLineX(x.GoPointer(), IndexVar, TrailingVar, LineVar, XPosVar)
1212
1213}
1214
1215var xLayoutIndexToPos func(uintptr, int, *Rectangle)
1216
1217// Converts from an index within a `PangoLayout` to the onscreen position
1218// corresponding to the grapheme at that index.
1219//
1220// The returns is represented as rectangle. Note that `pos->x` is
1221// always the leading edge of the grapheme and `pos->x + pos->width` the
1222// trailing edge of the grapheme. If the directionality of the grapheme
1223// is right-to-left, then `pos->width` will be negative.
1224func (x *Layout) IndexToPos(IndexVar int, PosVar *Rectangle) {
1225
1226	xLayoutIndexToPos(x.GoPointer(), IndexVar, PosVar)
1227
1228}
1229
1230var xLayoutIsEllipsized func(uintptr) bool
1231
1232// Queries whether the layout had to ellipsize any paragraphs.
1233//
1234// This returns %TRUE if the ellipsization mode for @layout
1235// is not %PANGO_ELLIPSIZE_NONE, a positive width is set on @layout,
1236// and there are paragraphs exceeding that width that have to be
1237// ellipsized.
1238func (x *Layout) IsEllipsized() bool {
1239
1240	cret := xLayoutIsEllipsized(x.GoPointer())
1241	return cret
1242}
1243
1244var xLayoutIsWrapped func(uintptr) bool
1245
1246// Queries whether the layout had to wrap any paragraphs.
1247//
1248// This returns %TRUE if a positive width is set on @layout,
1249// and there are paragraphs exceeding the layout width that have
1250// to be wrapped.
1251func (x *Layout) IsWrapped() bool {
1252
1253	cret := xLayoutIsWrapped(x.GoPointer())
1254	return cret
1255}
1256
1257var xLayoutMoveCursorVisually func(uintptr, bool, int, int, int, *int, *int)
1258
1259// Computes a new cursor position from an old position and a direction.
1260//
1261// If @direction is positive, then the new position will cause the strong
1262// or weak cursor to be displayed one position to right of where it was
1263// with the old cursor position. If @direction is negative, it will be
1264// moved to the left.
1265//
1266// In the presence of bidirectional text, the correspondence between
1267// logical and visual order will depend on the direction of the current
1268// run, and there may be jumps when the cursor is moved off of the end
1269// of a run.
1270//
1271// Motion here is in cursor positions, not in characters, so a single
1272// call to this function may move the cursor over multiple characters
1273// when multiple characters combine to form a single grapheme.
1274func (x *Layout) MoveCursorVisually(StrongVar bool, OldIndexVar int, OldTrailingVar int, DirectionVar int, NewIndexVar *int, NewTrailingVar *int) {
1275
1276	xLayoutMoveCursorVisually(x.GoPointer(), StrongVar, OldIndexVar, OldTrailingVar, DirectionVar, NewIndexVar, NewTrailingVar)
1277
1278}
1279
1280var xLayoutSerialize func(uintptr, LayoutSerializeFlags) *glib.Bytes
1281
1282// Serializes the @layout for later deserialization via [func@Pango.Layout.deserialize].
1283//
1284// There are no guarantees about the format of the output across different
1285// versions of Pango and [func@Pango.Layout.deserialize] will reject data
1286// that it cannot parse.
1287//
1288// The intended use of this function is testing, benchmarking and debugging.
1289// The format is not meant as a permanent storage format.
1290func (x *Layout) Serialize(FlagsVar LayoutSerializeFlags) *glib.Bytes {
1291
1292	cret := xLayoutSerialize(x.GoPointer(), FlagsVar)
1293	return cret
1294}
1295
1296var xLayoutSetAlignment func(uintptr, Alignment)
1297
1298// Sets the alignment for the layout: how partial lines are
1299// positioned within the horizontal space available.
1300//
1301// The default alignment is %PANGO_ALIGN_LEFT.
1302func (x *Layout) SetAlignment(AlignmentVar Alignment) {
1303
1304	xLayoutSetAlignment(x.GoPointer(), AlignmentVar)
1305
1306}
1307
1308var xLayoutSetAttributes func(uintptr, *AttrList)
1309
1310// Sets the text attributes for a layout object.
1311//
1312// References @attrs, so the caller can unref its reference.
1313func (x *Layout) SetAttributes(AttrsVar *AttrList) {
1314
1315	xLayoutSetAttributes(x.GoPointer(), AttrsVar)
1316
1317}
1318
1319var xLayoutSetAutoDir func(uintptr, bool)
1320
1321// Sets whether to calculate the base direction
1322// for the layout according to its contents.
1323//
1324// When this flag is on (the default), then paragraphs in @layout that
1325// begin with strong right-to-left characters (Arabic and Hebrew principally),
1326// will have right-to-left layout, paragraphs with letters from other scripts
1327// will have left-to-right layout. Paragraphs with only neutral characters
1328// get their direction from the surrounding paragraphs.
1329//
1330// When %FALSE, the choice between left-to-right and right-to-left
1331// layout is done according to the base direction of the layout's
1332// `PangoContext`. (See [method@Pango.Context.set_base_dir]).
1333//
1334// When the auto-computed direction of a paragraph differs from the
1335// base direction of the context, the interpretation of
1336// %PANGO_ALIGN_LEFT and %PANGO_ALIGN_RIGHT are swapped.
1337func (x *Layout) SetAutoDir(AutoDirVar bool) {
1338
1339	xLayoutSetAutoDir(x.GoPointer(), AutoDirVar)
1340
1341}
1342
1343var xLayoutSetEllipsize func(uintptr, EllipsizeMode)
1344
1345// Sets the type of ellipsization being performed for @layout.
1346//
1347// Depending on the ellipsization mode @ellipsize text is
1348// removed from the start, middle, or end of text so they
1349// fit within the width and height of layout set with
1350// [method@Pango.Layout.set_width] and [method@Pango.Layout.set_height].
1351//
1352// If the layout contains characters such as newlines that
1353// force it to be layed out in multiple paragraphs, then whether
1354// each paragraph is ellipsized separately or the entire layout
1355// is ellipsized as a whole depends on the set height of the layout.
1356//
1357// The default value is %PANGO_ELLIPSIZE_NONE.
1358//
1359// See [method@Pango.Layout.set_height] for details.
1360func (x *Layout) SetEllipsize(EllipsizeVar EllipsizeMode) {
1361
1362	xLayoutSetEllipsize(x.GoPointer(), EllipsizeVar)
1363
1364}
1365
1366var xLayoutSetFontDescription func(uintptr, *FontDescription)
1367
1368// Sets the default font description for the layout.
1369//
1370// If no font description is set on the layout, the
1371// font description from the layout's context is used.
1372func (x *Layout) SetFontDescription(DescVar *FontDescription) {
1373
1374	xLayoutSetFontDescription(x.GoPointer(), DescVar)
1375
1376}
1377
1378var xLayoutSetHeight func(uintptr, int)
1379
1380// Sets the height to which the `PangoLayout` should be ellipsized at.
1381//
1382// There are two different behaviors, based on whether @height is positive
1383// or negative.
1384//
1385// If @height is positive, it will be the maximum height of the layout. Only
1386// lines would be shown that would fit, and if there is any text omitted,
1387// an ellipsis added. At least one line is included in each paragraph regardless
1388// of how small the height value is. A value of zero will render exactly one
1389// line for the entire layout.
1390//
1391// If @height is negative, it will be the (negative of) maximum number of lines
1392// per paragraph. That is, the total number of lines shown may well be more than
1393// this value if the layout contains multiple paragraphs of text.
1394// The default value of -1 means that the first line of each paragraph is ellipsized.
1395// This behavior may be changed in the future to act per layout instead of per
1396// paragraph. File a bug against pango at
1397// [https://gitlab.gnome.org/gnome/pango](https://gitlab.gnome.org/gnome/pango)
1398// if your code relies on this behavior.
1399//
1400// Height setting only has effect if a positive width is set on
1401// @layout and ellipsization mode of @layout is not %PANGO_ELLIPSIZE_NONE.
1402// The behavior is undefined if a height other than -1 is set and
1403// ellipsization mode is set to %PANGO_ELLIPSIZE_NONE, and may change in the
1404// future.
1405func (x *Layout) SetHeight(HeightVar int) {
1406
1407	xLayoutSetHeight(x.GoPointer(), HeightVar)
1408
1409}
1410
1411var xLayoutSetIndent func(uintptr, int)
1412
1413// Sets the width in Pango units to indent each paragraph.
1414//
1415// A negative value of @indent will produce a hanging indentation.
1416// That is, the first line will have the full width, and subsequent
1417// lines will be indented by the absolute value of @indent.
1418//
1419// The indent setting is ignored if layout alignment is set to
1420// %PANGO_ALIGN_CENTER.
1421//
1422// The default value is 0.
1423func (x *Layout) SetIndent(IndentVar int) {
1424
1425	xLayoutSetIndent(x.GoPointer(), IndentVar)
1426
1427}
1428
1429var xLayoutSetJustify func(uintptr, bool)
1430
1431// Sets whether each complete line should be stretched to fill the
1432// entire width of the layout.
1433//
1434// Stretching is typically done by adding whitespace, but for some scripts
1435// (such as Arabic), the justification may be done in more complex ways,
1436// like extending the characters.
1437//
1438// Note that this setting is not implemented and so is ignored in
1439// Pango older than 1.18.
1440//
1441// Note that tabs and justification conflict with each other:
1442// Justification will move content away from its tab-aligned
1443// positions.
1444//
1445// The default value is %FALSE.
1446//
1447// Also see [method@Pango.Layout.set_justify_last_line].
1448func (x *Layout) SetJustify(JustifyVar bool) {
1449
1450	xLayoutSetJustify(x.GoPointer(), JustifyVar)
1451
1452}
1453
1454var xLayoutSetJustifyLastLine func(uintptr, bool)
1455
1456// Sets whether the last line should be stretched to fill the
1457// entire width of the layout.
1458//
1459// This only has an effect if [method@Pango.Layout.set_justify] has
1460// been called as well.
1461//
1462// The default value is %FALSE.
1463func (x *Layout) SetJustifyLastLine(JustifyVar bool) {
1464
1465	xLayoutSetJustifyLastLine(x.GoPointer(), JustifyVar)
1466
1467}
1468
1469var xLayoutSetLineSpacing func(uintptr, float32)
1470
1471// Sets a factor for line spacing.
1472//
1473// Typical values are: 0, 1, 1.5, 2. The default values is 0.
1474//
1475// If @factor is non-zero, lines are placed so that
1476//
1477//	baseline2 = baseline1 + factor * height2
1478//
1479// where height2 is the line height of the second line
1480// (as determined by the font(s)). In this case, the spacing
1481// set with [method@Pango.Layout.set_spacing] is ignored.
1482//
1483// If @factor is zero (the default), spacing is applied as before.
1484//
1485// Note: for semantics that are closer to the CSS line-height
1486// property, see [func@Pango.attr_line_height_new].
1487func (x *Layout) SetLineSpacing(FactorVar float32) {
1488
1489	xLayoutSetLineSpacing(x.GoPointer(), FactorVar)
1490
1491}
1492
1493var xLayoutSetMarkup func(uintptr, string, int)
1494
1495// Sets the layout text and attribute list from marked-up text.
1496//
1497// See [Pango Markup](pango_markup.html)).
1498//
1499// Replaces the current text and attribute list.
1500//
1501// This is the same as [method@Pango.Layout.set_markup_with_accel],
1502// but the markup text isn't scanned for accelerators.
1503func (x *Layout) SetMarkup(MarkupVar string, LengthVar int) {
1504
1505	xLayoutSetMarkup(x.GoPointer(), MarkupVar, LengthVar)
1506
1507}
1508
1509var xLayoutSetMarkupWithAccel func(uintptr, string, int, uint32, *uint32)
1510
1511// Sets the layout text and attribute list from marked-up text.
1512//
1513// See [Pango Markup](pango_markup.html)).
1514//
1515// Replaces the current text and attribute list.
1516//
1517// If @accel_marker is nonzero, the given character will mark the
1518// character following it as an accelerator. For example, @accel_marker
1519// might be an ampersand or underscore. All characters marked
1520// as an accelerator will receive a %PANGO_UNDERLINE_LOW attribute,
1521// and the first character so marked will be returned in @accel_char.
1522// Two @accel_marker characters following each other produce a single
1523// literal @accel_marker character.
1524func (x *Layout) SetMarkupWithAccel(MarkupVar string, LengthVar int, AccelMarkerVar uint32, AccelCharVar *uint32) {
1525
1526	xLayoutSetMarkupWithAccel(x.GoPointer(), MarkupVar, LengthVar, AccelMarkerVar, AccelCharVar)
1527
1528}
1529
1530var xLayoutSetSingleParagraphMode func(uintptr, bool)
1531
1532// Sets the single paragraph mode of @layout.
1533//
1534// If @setting is %TRUE, do not treat newlines and similar characters
1535// as paragraph separators; instead, keep all text in a single paragraph,
1536// and display a glyph for paragraph separator characters. Used when
1537// you want to allow editing of newlines on a single text line.
1538//
1539// The default value is %FALSE.
1540func (x *Layout) SetSingleParagraphMode(SettingVar bool) {
1541
1542	xLayoutSetSingleParagraphMode(x.GoPointer(), SettingVar)
1543
1544}
1545
1546var xLayoutSetSpacing func(uintptr, int)
1547
1548// Sets the amount of spacing in Pango units between
1549// the lines of the layout.
1550//
1551// When placing lines with spacing, Pango arranges things so that
1552//
1553//	line2.top = line1.bottom + spacing
1554//
1555// The default value is 0.
1556//
1557// Note: Since 1.44, Pango is using the line height (as determined
1558// by the font) for placing lines when the line spacing factor is set
1559// to a non-zero value with [method@Pango.Layout.set_line_spacing].
1560// In that case, the @spacing set with this function is ignored.
1561//
1562// Note: for semantics that are closer to the CSS line-height
1563// property, see [func@Pango.attr_line_height_new].
1564func (x *Layout) SetSpacing(SpacingVar int) {
1565
1566	xLayoutSetSpacing(x.GoPointer(), SpacingVar)
1567
1568}
1569
1570var xLayoutSetTabs func(uintptr, *TabArray)
1571
1572// Sets the tabs to use for @layout, overriding the default tabs.
1573//
1574// `PangoLayout` will place content at the next tab position
1575// whenever it meets a Tab character (U+0009).
1576//
1577// By default, tabs are every 8 spaces. If @tabs is %NULL, the
1578// default tabs are reinstated. @tabs is copied into the layout;
1579// you must free your copy of @tabs yourself.
1580//
1581// Note that tabs and justification conflict with each other:
1582// Justification will move content away from its tab-aligned
1583// positions. The same is true for alignments other than
1584// %PANGO_ALIGN_LEFT.
1585func (x *Layout) SetTabs(TabsVar *TabArray) {
1586
1587	xLayoutSetTabs(x.GoPointer(), TabsVar)
1588
1589}
1590
1591var xLayoutSetText func(uintptr, string, int)
1592
1593// Sets the text of the layout.
1594//
1595// This function validates @text and renders invalid UTF-8
1596// with a placeholder glyph.
1597//
1598// Note that if you have used [method@Pango.Layout.set_markup] or
1599// [method@Pango.Layout.set_markup_with_accel] on @layout before, you
1600// may want to call [method@Pango.Layout.set_attributes] to clear the
1601// attributes set on the layout from the markup as this function does
1602// not clear attributes.
1603func (x *Layout) SetText(TextVar string, LengthVar int) {
1604
1605	xLayoutSetText(x.GoPointer(), TextVar, LengthVar)
1606
1607}
1608
1609var xLayoutSetWidth func(uintptr, int)
1610
1611// Sets the width to which the lines of the `PangoLayout` should wrap or
1612// get ellipsized.
1613//
1614// The default value is -1: no width set.
1615func (x *Layout) SetWidth(WidthVar int) {
1616
1617	xLayoutSetWidth(x.GoPointer(), WidthVar)
1618
1619}
1620
1621var xLayoutSetWrap func(uintptr, WrapMode)
1622
1623// Sets the wrap mode.
1624//
1625// The wrap mode only has effect if a width is set on the layout
1626// with [method@Pango.Layout.set_width]. To turn off wrapping,
1627// set the width to -1.
1628//
1629// The default value is %PANGO_WRAP_WORD.
1630func (x *Layout) SetWrap(WrapVar WrapMode) {
1631
1632	xLayoutSetWrap(x.GoPointer(), WrapVar)
1633
1634}
1635
1636var xLayoutWriteToFile func(uintptr, LayoutSerializeFlags, string, **glib.Error) bool
1637
1638// A convenience method to serialize a layout to a file.
1639//
1640// It is equivalent to calling [method@Pango.Layout.serialize]
1641// followed by [func@GLib.file_set_contents].
1642//
1643// See those two functions for details on the arguments.
1644//
1645// It is mostly intended for use inside a debugger to quickly dump
1646// a layout to a file for later inspection.
1647func (x *Layout) WriteToFile(FlagsVar LayoutSerializeFlags, FilenameVar string) (bool, error) {
1648	var cerr *glib.Error
1649
1650	cret := xLayoutWriteToFile(x.GoPointer(), FlagsVar, FilenameVar, &cerr)
1651	if cerr == nil {
1652		return cret, nil
1653	}
1654	return cret, cerr
1655
1656}
1657
1658var xLayoutXyToIndex func(uintptr, int, int, *int, *int) bool
1659
1660// Converts from X and Y position within a layout to the byte index to the
1661// character at that logical position.
1662//
1663// If the Y position is not inside the layout, the closest position is
1664// chosen (the position will be clamped inside the layout). If the X position
1665// is not within the layout, then the start or the end of the line is
1666// chosen as described for [method@Pango.LayoutLine.x_to_index]. If either
1667// the X or Y positions were not inside the layout, then the function returns
1668// %FALSE; on an exact hit, it returns %TRUE.
1669func (x *Layout) XyToIndex(XVar int, YVar int, IndexVar *int, TrailingVar *int) bool {
1670
1671	cret := xLayoutXyToIndex(x.GoPointer(), XVar, YVar, IndexVar, TrailingVar)
1672	return cret
1673}
1674
1675func (c *Layout) GoPointer() uintptr {
1676	if c == nil {
1677		return 0
1678	}
1679	return c.Ptr
1680}
1681
1682func (c *Layout) SetGoPointer(ptr uintptr) {
1683	c.Ptr = ptr
1684}
1685
1686var xLayoutDeserialize func(uintptr, *glib.Bytes, LayoutDeserializeFlags, **glib.Error) uintptr
1687
1688// Loads data previously created via [method@Pango.Layout.serialize].
1689//
1690// For a discussion of the supported format, see that function.
1691//
1692// Note: to verify that the returned layout is identical to
1693// the one that was serialized, you can compare @bytes to the
1694// result of serializing the layout again.
1695func LayoutDeserialize(ContextVar *Context, BytesVar *glib.Bytes, FlagsVar LayoutDeserializeFlags) (*Layout, error) {
1696	var cls *Layout
1697	var cerr *glib.Error
1698
1699	cret := xLayoutDeserialize(ContextVar.GoPointer(), BytesVar, FlagsVar, &cerr)
1700
1701	if cret == 0 {
1702		return nil, cerr
1703	}
1704	cls = &Layout{}
1705	cls.Ptr = cret
1706	if cerr == nil {
1707		return cls, nil
1708	}
1709	return cls, cerr
1710
1711}
1712
1713func init() {
1714	core.SetPackageName("PANGO", "pango")
1715	core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
1716	var libs []uintptr
1717	for _, libPath := range core.GetPaths("PANGO") {
1718		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1719		if err != nil {
1720			panic(err)
1721		}
1722		libs = append(libs, lib)
1723	}
1724
1725	core.PuregoSafeRegister(&xLayoutDeserializeFlagsGLibType, libs, "pango_layout_deserialize_flags_get_type")
1726
1727	core.PuregoSafeRegister(&xLayoutSerializeFlagsGLibType, libs, "pango_layout_serialize_flags_get_type")
1728
1729	core.PuregoSafeRegister(&xAlignmentGLibType, libs, "pango_alignment_get_type")
1730
1731	core.PuregoSafeRegister(&xEllipsizeModeGLibType, libs, "pango_ellipsize_mode_get_type")
1732
1733	core.PuregoSafeRegister(&xLayoutDeserializeErrorGLibType, libs, "pango_layout_deserialize_error_get_type")
1734
1735	core.PuregoSafeRegister(&xWrapModeGLibType, libs, "pango_wrap_mode_get_type")
1736
1737	core.PuregoSafeRegister(&xLayoutIterGLibType, libs, "pango_layout_iter_get_type")
1738
1739	core.PuregoSafeRegister(&xLayoutIterAtLastLine, libs, "pango_layout_iter_at_last_line")
1740	core.PuregoSafeRegister(&xLayoutIterCopy, libs, "pango_layout_iter_copy")
1741	core.PuregoSafeRegister(&xLayoutIterFree, libs, "pango_layout_iter_free")
1742	core.PuregoSafeRegister(&xLayoutIterGetBaseline, libs, "pango_layout_iter_get_baseline")
1743	core.PuregoSafeRegister(&xLayoutIterGetCharExtents, libs, "pango_layout_iter_get_char_extents")
1744	core.PuregoSafeRegister(&xLayoutIterGetClusterExtents, libs, "pango_layout_iter_get_cluster_extents")
1745	core.PuregoSafeRegister(&xLayoutIterGetIndex, libs, "pango_layout_iter_get_index")
1746	core.PuregoSafeRegister(&xLayoutIterGetLayout, libs, "pango_layout_iter_get_layout")
1747	core.PuregoSafeRegister(&xLayoutIterGetLayoutExtents, libs, "pango_layout_iter_get_layout_extents")
1748	core.PuregoSafeRegister(&xLayoutIterGetLine, libs, "pango_layout_iter_get_line")
1749	core.PuregoSafeRegister(&xLayoutIterGetLineExtents, libs, "pango_layout_iter_get_line_extents")
1750	core.PuregoSafeRegister(&xLayoutIterGetLineReadonly, libs, "pango_layout_iter_get_line_readonly")
1751	core.PuregoSafeRegister(&xLayoutIterGetLineYrange, libs, "pango_layout_iter_get_line_yrange")
1752	core.PuregoSafeRegister(&xLayoutIterGetRun, libs, "pango_layout_iter_get_run")
1753	core.PuregoSafeRegister(&xLayoutIterGetRunBaseline, libs, "pango_layout_iter_get_run_baseline")
1754	core.PuregoSafeRegister(&xLayoutIterGetRunExtents, libs, "pango_layout_iter_get_run_extents")
1755	core.PuregoSafeRegister(&xLayoutIterGetRunReadonly, libs, "pango_layout_iter_get_run_readonly")
1756	core.PuregoSafeRegister(&xLayoutIterNextChar, libs, "pango_layout_iter_next_char")
1757	core.PuregoSafeRegister(&xLayoutIterNextCluster, libs, "pango_layout_iter_next_cluster")
1758	core.PuregoSafeRegister(&xLayoutIterNextLine, libs, "pango_layout_iter_next_line")
1759	core.PuregoSafeRegister(&xLayoutIterNextRun, libs, "pango_layout_iter_next_run")
1760
1761	core.PuregoSafeRegister(&xLayoutLineGLibType, libs, "pango_layout_line_get_type")
1762
1763	core.PuregoSafeRegister(&xLayoutLineGetExtents, libs, "pango_layout_line_get_extents")
1764	core.PuregoSafeRegister(&xLayoutLineGetHeight, libs, "pango_layout_line_get_height")
1765	core.PuregoSafeRegister(&xLayoutLineGetLength, libs, "pango_layout_line_get_length")
1766	core.PuregoSafeRegister(&xLayoutLineGetPixelExtents, libs, "pango_layout_line_get_pixel_extents")
1767	core.PuregoSafeRegister(&xLayoutLineGetResolvedDirection, libs, "pango_layout_line_get_resolved_direction")
1768	core.PuregoSafeRegister(&xLayoutLineGetStartIndex, libs, "pango_layout_line_get_start_index")
1769	core.PuregoSafeRegister(&xLayoutLineGetXRanges, libs, "pango_layout_line_get_x_ranges")
1770	core.PuregoSafeRegister(&xLayoutLineIndexToX, libs, "pango_layout_line_index_to_x")
1771	core.PuregoSafeRegister(&xLayoutLineIsParagraphStartFn, libs, "pango_layout_line_is_paragraph_start")
1772	core.PuregoSafeRegister(&xLayoutLineRef, libs, "pango_layout_line_ref")
1773	core.PuregoSafeRegister(&xLayoutLineUnref, libs, "pango_layout_line_unref")
1774	core.PuregoSafeRegister(&xLayoutLineXToIndex, libs, "pango_layout_line_x_to_index")
1775
1776	core.PuregoSafeRegister(&xLayoutGLibType, libs, "pango_layout_get_type")
1777
1778	core.PuregoSafeRegister(&xNewLayout, libs, "pango_layout_new")
1779
1780	core.PuregoSafeRegister(&xLayoutContextChanged, libs, "pango_layout_context_changed")
1781	core.PuregoSafeRegister(&xLayoutCopy, libs, "pango_layout_copy")
1782	core.PuregoSafeRegister(&xLayoutGetAlignment, libs, "pango_layout_get_alignment")
1783	core.PuregoSafeRegister(&xLayoutGetAttributes, libs, "pango_layout_get_attributes")
1784	core.PuregoSafeRegister(&xLayoutGetAutoDir, libs, "pango_layout_get_auto_dir")
1785	core.PuregoSafeRegister(&xLayoutGetBaseline, libs, "pango_layout_get_baseline")
1786	core.PuregoSafeRegister(&xLayoutGetCaretPos, libs, "pango_layout_get_caret_pos")
1787	core.PuregoSafeRegister(&xLayoutGetCharacterCount, libs, "pango_layout_get_character_count")
1788	core.PuregoSafeRegister(&xLayoutGetContext, libs, "pango_layout_get_context")
1789	core.PuregoSafeRegister(&xLayoutGetCursorPos, libs, "pango_layout_get_cursor_pos")
1790	core.PuregoSafeRegister(&xLayoutGetDirection, libs, "pango_layout_get_direction")
1791	core.PuregoSafeRegister(&xLayoutGetEllipsize, libs, "pango_layout_get_ellipsize")
1792	core.PuregoSafeRegister(&xLayoutGetExtents, libs, "pango_layout_get_extents")
1793	core.PuregoSafeRegister(&xLayoutGetFontDescription, libs, "pango_layout_get_font_description")
1794	core.PuregoSafeRegister(&xLayoutGetHeight, libs, "pango_layout_get_height")
1795	core.PuregoSafeRegister(&xLayoutGetIndent, libs, "pango_layout_get_indent")
1796	core.PuregoSafeRegister(&xLayoutGetIter, libs, "pango_layout_get_iter")
1797	core.PuregoSafeRegister(&xLayoutGetJustify, libs, "pango_layout_get_justify")
1798	core.PuregoSafeRegister(&xLayoutGetJustifyLastLine, libs, "pango_layout_get_justify_last_line")
1799	core.PuregoSafeRegister(&xLayoutGetLine, libs, "pango_layout_get_line")
1800	core.PuregoSafeRegister(&xLayoutGetLineCount, libs, "pango_layout_get_line_count")
1801	core.PuregoSafeRegister(&xLayoutGetLineReadonly, libs, "pango_layout_get_line_readonly")
1802	core.PuregoSafeRegister(&xLayoutGetLineSpacing, libs, "pango_layout_get_line_spacing")
1803	core.PuregoSafeRegister(&xLayoutGetLines, libs, "pango_layout_get_lines")
1804	core.PuregoSafeRegister(&xLayoutGetLinesReadonly, libs, "pango_layout_get_lines_readonly")
1805	core.PuregoSafeRegister(&xLayoutGetLogAttrs, libs, "pango_layout_get_log_attrs")
1806	core.PuregoSafeRegister(&xLayoutGetLogAttrsReadonly, libs, "pango_layout_get_log_attrs_readonly")
1807	core.PuregoSafeRegister(&xLayoutGetPixelExtents, libs, "pango_layout_get_pixel_extents")
1808	core.PuregoSafeRegister(&xLayoutGetPixelSize, libs, "pango_layout_get_pixel_size")
1809	core.PuregoSafeRegister(&xLayoutGetSerial, libs, "pango_layout_get_serial")
1810	core.PuregoSafeRegister(&xLayoutGetSingleParagraphMode, libs, "pango_layout_get_single_paragraph_mode")
1811	core.PuregoSafeRegister(&xLayoutGetSize, libs, "pango_layout_get_size")
1812	core.PuregoSafeRegister(&xLayoutGetSpacing, libs, "pango_layout_get_spacing")
1813	core.PuregoSafeRegister(&xLayoutGetTabs, libs, "pango_layout_get_tabs")
1814	core.PuregoSafeRegister(&xLayoutGetText, libs, "pango_layout_get_text")
1815	core.PuregoSafeRegister(&xLayoutGetUnknownGlyphsCount, libs, "pango_layout_get_unknown_glyphs_count")
1816	core.PuregoSafeRegister(&xLayoutGetWidth, libs, "pango_layout_get_width")
1817	core.PuregoSafeRegister(&xLayoutGetWrap, libs, "pango_layout_get_wrap")
1818	core.PuregoSafeRegister(&xLayoutIndexToLineX, libs, "pango_layout_index_to_line_x")
1819	core.PuregoSafeRegister(&xLayoutIndexToPos, libs, "pango_layout_index_to_pos")
1820	core.PuregoSafeRegister(&xLayoutIsEllipsized, libs, "pango_layout_is_ellipsized")
1821	core.PuregoSafeRegister(&xLayoutIsWrapped, libs, "pango_layout_is_wrapped")
1822	core.PuregoSafeRegister(&xLayoutMoveCursorVisually, libs, "pango_layout_move_cursor_visually")
1823	core.PuregoSafeRegister(&xLayoutSerialize, libs, "pango_layout_serialize")
1824	core.PuregoSafeRegister(&xLayoutSetAlignment, libs, "pango_layout_set_alignment")
1825	core.PuregoSafeRegister(&xLayoutSetAttributes, libs, "pango_layout_set_attributes")
1826	core.PuregoSafeRegister(&xLayoutSetAutoDir, libs, "pango_layout_set_auto_dir")
1827	core.PuregoSafeRegister(&xLayoutSetEllipsize, libs, "pango_layout_set_ellipsize")
1828	core.PuregoSafeRegister(&xLayoutSetFontDescription, libs, "pango_layout_set_font_description")
1829	core.PuregoSafeRegister(&xLayoutSetHeight, libs, "pango_layout_set_height")
1830	core.PuregoSafeRegister(&xLayoutSetIndent, libs, "pango_layout_set_indent")
1831	core.PuregoSafeRegister(&xLayoutSetJustify, libs, "pango_layout_set_justify")
1832	core.PuregoSafeRegister(&xLayoutSetJustifyLastLine, libs, "pango_layout_set_justify_last_line")
1833	core.PuregoSafeRegister(&xLayoutSetLineSpacing, libs, "pango_layout_set_line_spacing")
1834	core.PuregoSafeRegister(&xLayoutSetMarkup, libs, "pango_layout_set_markup")
1835	core.PuregoSafeRegister(&xLayoutSetMarkupWithAccel, libs, "pango_layout_set_markup_with_accel")
1836	core.PuregoSafeRegister(&xLayoutSetSingleParagraphMode, libs, "pango_layout_set_single_paragraph_mode")
1837	core.PuregoSafeRegister(&xLayoutSetSpacing, libs, "pango_layout_set_spacing")
1838	core.PuregoSafeRegister(&xLayoutSetTabs, libs, "pango_layout_set_tabs")
1839	core.PuregoSafeRegister(&xLayoutSetText, libs, "pango_layout_set_text")
1840	core.PuregoSafeRegister(&xLayoutSetWidth, libs, "pango_layout_set_width")
1841	core.PuregoSafeRegister(&xLayoutSetWrap, libs, "pango_layout_set_wrap")
1842	core.PuregoSafeRegister(&xLayoutWriteToFile, libs, "pango_layout_write_to_file")
1843	core.PuregoSafeRegister(&xLayoutXyToIndex, libs, "pango_layout_xy_to_index")
1844
1845	core.PuregoSafeRegister(&xLayoutDeserialize, libs, "pango_layout_deserialize")
1846
1847}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close