v0.2.1 c0399be

gtktextmark.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
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/gobject"
12	"github.com/bnema/puregotk/v4/gobject/types"
13)
14
15type TextMarkClass struct {
16	_ structs.HostLayout
17
18	ParentClass gobject.ObjectClass
19
20	Padding [8]uintptr
21}
22
23func (x *TextMarkClass) GoPointer() uintptr {
24	return uintptr(unsafe.Pointer(x))
25}
26
27// Marks a position in a `GtkTextbuffer` that is preserved
28// across modifications.
29//
30// You may wish to begin by reading the
31// [text widget conceptual overview](section-text-widget.html),
32// which gives an overview of all the objects and data types
33// related to the text widget and how they work together.
34//
35// A `GtkTextMark` is like a bookmark in a text buffer; it preserves
36// a position in the text. You can convert the mark to an iterator using
37// [method@Gtk.TextBuffer.get_iter_at_mark]. Unlike iterators, marks remain
38// valid across buffer mutations, because their behavior is defined when
39// text is inserted or deleted. When text containing a mark is deleted,
40// the mark remains in the position originally occupied by the deleted
41// text. When text is inserted at a mark, a mark with “left gravity” will
42// be moved to the beginning of the newly-inserted text, and a mark with
43// “right gravity” will be moved to the end.
44//
45// Note that “left” and “right” here refer to logical direction (left
46// is the toward the start of the buffer); in some languages such as
47// Hebrew the logically-leftmost text is not actually on the left when
48// displayed.
49//
50// Marks are reference counted, but the reference count only controls
51// the validity of the memory; marks can be deleted from the buffer at
52// any time with [method@Gtk.TextBuffer.delete_mark]. Once deleted from
53// the buffer, a mark is essentially useless.
54//
55// Marks optionally have names; these can be convenient to avoid passing
56// the `GtkTextMark` object around.
57//
58// Marks are typically created using the [method@Gtk.TextBuffer.create_mark]
59// function.
60type TextMark struct {
61	gobject.Object
62}
63
64var xTextMarkGLibType func() types.GType
65
66func TextMarkGLibType() types.GType {
67	return xTextMarkGLibType()
68}
69
70func TextMarkNewFromInternalPtr(ptr uintptr) *TextMark {
71	cls := &TextMark{}
72	cls.Ptr = ptr
73	return cls
74}
75
76var xNewTextMark func(uintptr, bool) uintptr
77
78// Creates a text mark.
79//
80// Add it to a buffer using [method@Gtk.TextBuffer.add_mark].
81// If @name is %NULL, the mark is anonymous; otherwise, the mark can be
82// retrieved by name using [method@Gtk.TextBuffer.get_mark]. If a mark
83// has left gravity, and text is inserted at the mark’s current location,
84// the mark will be moved to the left of the newly-inserted text. If the
85// mark has right gravity (@left_gravity = %FALSE), the mark will end up
86// on the right of newly-inserted text. The standard left-to-right cursor
87// is a mark with right gravity (when you type, the cursor stays on the
88// right side of the text you’re typing).
89func NewTextMark(NameVar *string, LeftGravityVar bool) *TextMark {
90	var cls *TextMark
91
92	NameVarPtr := core.GStrdupNullable(NameVar)
93	defer core.GFreeNullable(NameVarPtr)
94
95	cret := xNewTextMark(NameVarPtr, LeftGravityVar)
96
97	if cret == 0 {
98		return nil
99	}
100	cls = &TextMark{}
101	cls.Ptr = cret
102	return cls
103}
104
105var xTextMarkGetBuffer func(uintptr) uintptr
106
107// Gets the buffer this mark is located inside.
108//
109// Returns %NULL if the mark is deleted.
110func (x *TextMark) GetBuffer() *TextBuffer {
111	var cls *TextBuffer
112
113	cret := xTextMarkGetBuffer(x.GoPointer())
114
115	if cret == 0 {
116		return nil
117	}
118	gobject.IncreaseRef(cret)
119	cls = &TextBuffer{}
120	cls.Ptr = cret
121	return cls
122}
123
124var xTextMarkGetDeleted func(uintptr) bool
125
126// Returns %TRUE if the mark has been removed from its buffer.
127//
128// See [method@Gtk.TextBuffer.add_mark] for a way to add it
129// to a buffer again.
130func (x *TextMark) GetDeleted() bool {
131
132	cret := xTextMarkGetDeleted(x.GoPointer())
133	return cret
134}
135
136var xTextMarkGetLeftGravity func(uintptr) bool
137
138// Determines whether the mark has left gravity.
139func (x *TextMark) GetLeftGravity() bool {
140
141	cret := xTextMarkGetLeftGravity(x.GoPointer())
142	return cret
143}
144
145var xTextMarkGetName func(uintptr) string
146
147// Returns the mark name.
148//
149// Returns %NULL for anonymous marks.
150func (x *TextMark) GetName() string {
151
152	cret := xTextMarkGetName(x.GoPointer())
153	return cret
154}
155
156var xTextMarkGetVisible func(uintptr) bool
157
158// Returns %TRUE if the mark is visible.
159//
160// A cursor is displayed for visible marks.
161func (x *TextMark) GetVisible() bool {
162
163	cret := xTextMarkGetVisible(x.GoPointer())
164	return cret
165}
166
167var xTextMarkSetVisible func(uintptr, bool)
168
169// Sets the visibility of @mark.
170//
171// The insertion point is normally visible, i.e. you can see it as
172// a vertical bar. Also, the text widget uses a visible mark to
173// indicate where a drop will occur when dragging-and-dropping text.
174// Most other marks are not visible.
175//
176// Marks are not visible by default.
177func (x *TextMark) SetVisible(SettingVar bool) {
178
179	xTextMarkSetVisible(x.GoPointer(), SettingVar)
180
181}
182
183func (c *TextMark) GoPointer() uintptr {
184	if c == nil {
185		return 0
186	}
187	return c.Ptr
188}
189
190func (c *TextMark) SetGoPointer(ptr uintptr) {
191	c.Ptr = ptr
192}
193
194// SetPropertyLeftGravity sets the "left-gravity" property.
195// Whether the mark has left gravity.
196//
197// When text is inserted at the mark’s current location, if the mark
198// has left gravity it will be moved to the left of the newly-inserted
199// text, otherwise to the right.
200func (x *TextMark) SetPropertyLeftGravity(value bool) {
201	var v gobject.Value
202	v.Init(gobject.TypeBooleanVal)
203	v.SetBoolean(value)
204	x.SetProperty("left-gravity", &v)
205}
206
207// GetPropertyLeftGravity gets the "left-gravity" property.
208// Whether the mark has left gravity.
209//
210// When text is inserted at the mark’s current location, if the mark
211// has left gravity it will be moved to the left of the newly-inserted
212// text, otherwise to the right.
213func (x *TextMark) GetPropertyLeftGravity() bool {
214	var v gobject.Value
215	x.GetProperty("left-gravity", &v)
216	return v.GetBoolean()
217}
218
219// SetPropertyName sets the "name" property.
220// The name of the mark or %NULL if the mark is anonymous.
221func (x *TextMark) SetPropertyName(value string) {
222	var v gobject.Value
223	v.Init(gobject.TypeStringVal)
224	v.SetString(&value)
225	x.SetProperty("name", &v)
226}
227
228// GetPropertyName gets the "name" property.
229// The name of the mark or %NULL if the mark is anonymous.
230func (x *TextMark) GetPropertyName() string {
231	var v gobject.Value
232	x.GetProperty("name", &v)
233	return v.GetString()
234}
235
236func init() {
237	core.SetPackageName("GTK", "gtk4")
238	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
239	var libs []uintptr
240	for _, libPath := range core.GetPaths("GTK") {
241		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
242		if err != nil {
243			panic(err)
244		}
245		libs = append(libs, lib)
246	}
247
248	core.PuregoSafeRegister(&xTextMarkGLibType, libs, "gtk_text_mark_get_type")
249
250	core.PuregoSafeRegister(&xNewTextMark, libs, "gtk_text_mark_new")
251
252	core.PuregoSafeRegister(&xTextMarkGetBuffer, libs, "gtk_text_mark_get_buffer")
253	core.PuregoSafeRegister(&xTextMarkGetDeleted, libs, "gtk_text_mark_get_deleted")
254	core.PuregoSafeRegister(&xTextMarkGetLeftGravity, libs, "gtk_text_mark_get_left_gravity")
255	core.PuregoSafeRegister(&xTextMarkGetName, libs, "gtk_text_mark_get_name")
256	core.PuregoSafeRegister(&xTextMarkGetVisible, libs, "gtk_text_mark_get_visible")
257	core.PuregoSafeRegister(&xTextMarkSetVisible, libs, "gtk_text_mark_set_visible")
258
259}

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