v0.2.2 9100209

gtktreemodelfilter.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/gdk"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17// A function which calculates display values from raw values in the model.
18// It must fill @value with the display value for the column @column in the
19// row indicated by @iter.
20//
21// Since this function is called for each data access, it’s not a
22// particularly efficient operation.
23type TreeModelFilterModifyFunc func(uintptr, *TreeIter, *gobject.Value, int, uintptr)
24
25// A function which decides whether the row indicated by @iter is visible.
26type TreeModelFilterVisibleFunc func(uintptr, *TreeIter, uintptr) bool
27
28type TreeModelFilterClass struct {
29	_ structs.HostLayout
30
31	ParentClass gobject.ObjectClass
32
33	xVisible uintptr
34
35	xModify uintptr
36
37	Padding [8]uintptr
38}
39
40func (x *TreeModelFilterClass) GoPointer() uintptr {
41	return uintptr(unsafe.Pointer(x))
42}
43
44// OverrideVisible sets the "visible" callback function.
45// A function which decides whether the row indicated by @iter is visible.
46func (x *TreeModelFilterClass) OverrideVisible(cb func(*TreeModelFilter, TreeModel, *TreeIter) bool) {
47	if cb == nil {
48		x.xVisible = 0
49	} else {
50		x.xVisible = purego.NewCallback(func(SelfVarp uintptr, ChildModelVarp uintptr, IterVarp *TreeIter) bool {
51			return cb(TreeModelFilterNewFromInternalPtr(SelfVarp), &TreeModelBase{Ptr: ChildModelVarp}, IterVarp)
52		})
53	}
54}
55
56// GetVisible gets the "visible" callback function.
57// A function which decides whether the row indicated by @iter is visible.
58func (x *TreeModelFilterClass) GetVisible() func(*TreeModelFilter, TreeModel, *TreeIter) bool {
59	if x.xVisible == 0 {
60		return nil
61	}
62	var rawCallback func(SelfVarp uintptr, ChildModelVarp uintptr, IterVarp *TreeIter) bool
63	purego.RegisterFunc(&rawCallback, x.xVisible)
64	return func(SelfVar *TreeModelFilter, ChildModelVar TreeModel, IterVar *TreeIter) bool {
65		return rawCallback(SelfVar.GoPointer(), ChildModelVar.GoPointer(), IterVar)
66	}
67}
68
69// OverrideModify sets the "modify" callback function.
70// A function which calculates display values from raw values in the model.
71// It must fill @value with the display value for the column @column in the
72// row indicated by @iter.
73//
74// Since this function is called for each data access, it’s not a
75// particularly efficient operation.
76func (x *TreeModelFilterClass) OverrideModify(cb func(*TreeModelFilter, TreeModel, *TreeIter, *gobject.Value, int)) {
77	if cb == nil {
78		x.xModify = 0
79	} else {
80		x.xModify = purego.NewCallback(func(SelfVarp uintptr, ChildModelVarp uintptr, IterVarp *TreeIter, ValueVarp *gobject.Value, ColumnVarp int) {
81			cb(TreeModelFilterNewFromInternalPtr(SelfVarp), &TreeModelBase{Ptr: ChildModelVarp}, IterVarp, ValueVarp, ColumnVarp)
82		})
83	}
84}
85
86// GetModify gets the "modify" callback function.
87// A function which calculates display values from raw values in the model.
88// It must fill @value with the display value for the column @column in the
89// row indicated by @iter.
90//
91// Since this function is called for each data access, it’s not a
92// particularly efficient operation.
93func (x *TreeModelFilterClass) GetModify() func(*TreeModelFilter, TreeModel, *TreeIter, *gobject.Value, int) {
94	if x.xModify == 0 {
95		return nil
96	}
97	var rawCallback func(SelfVarp uintptr, ChildModelVarp uintptr, IterVarp *TreeIter, ValueVarp *gobject.Value, ColumnVarp int)
98	purego.RegisterFunc(&rawCallback, x.xModify)
99	return func(SelfVar *TreeModelFilter, ChildModelVar TreeModel, IterVar *TreeIter, ValueVar *gobject.Value, ColumnVar int) {
100		rawCallback(SelfVar.GoPointer(), ChildModelVar.GoPointer(), IterVar, ValueVar, ColumnVar)
101	}
102}
103
104type TreeModelFilterPrivate struct {
105	_ structs.HostLayout
106}
107
108func (x *TreeModelFilterPrivate) GoPointer() uintptr {
109	return uintptr(unsafe.Pointer(x))
110}
111
112// A `GtkTreeModel` which hides parts of an underlying tree model
113//
114// A `GtkTreeModelFilter` is a tree model which wraps another tree model,
115// and can do the following things:
116//
117//   - Filter specific rows, based on data from a “visible column”, a column
118//     storing booleans indicating whether the row should be filtered or not,
119//     or based on the return value of a “visible function”, which gets a
120//     model, iter and user_data and returns a boolean indicating whether the
121//     row should be filtered or not.
122//
123//   - Modify the “appearance” of the model, using a modify function.
124//     This is extremely powerful and allows for just changing some
125//     values and also for creating a completely different model based
126//     on the given child model.
127//
128//   - Set a different root node, also known as a “virtual root”. You can pass
129//     in a `GtkTreePath` indicating the root node for the filter at construction
130//     time.
131//
132// The basic API is similar to `GtkTreeModelSort`. For an example on its usage,
133// see the section on `GtkTreeModelSort`.
134//
135// When using `GtkTreeModelFilter`, it is important to realize that
136// `GtkTreeModelFilter` maintains an internal cache of all nodes which are
137// visible in its clients. The cache is likely to be a subtree of the tree
138// exposed by the child model. `GtkTreeModelFilter` will not cache the entire
139// child model when unnecessary to not compromise the caching mechanism
140// that is exposed by the reference counting scheme. If the child model
141// implements reference counting, unnecessary signals may not be emitted
142// because of reference counting rule 3, see the `GtkTreeModel`
143// documentation. (Note that e.g. `GtkTreeStore` does not implement
144// reference counting and will always emit all signals, even when
145// the receiving node is not visible).
146//
147// Because of this, limitations for possible visible functions do apply.
148// In general, visible functions should only use data or properties from
149// the node for which the visibility state must be determined, its siblings
150// or its parents. Usually, having a dependency on the state of any child
151// node is not possible, unless references are taken on these explicitly.
152// When no such reference exists, no signals may be received for these child
153// nodes (see reference counting rule number 3 in the `GtkTreeModel` section).
154//
155// Determining the visibility state of a given node based on the state
156// of its child nodes is a frequently occurring use case. Therefore,
157// `GtkTreeModelFilter` explicitly supports this. For example, when a node
158// does not have any children, you might not want the node to be visible.
159// As soon as the first row is added to the node’s child level (or the
160// last row removed), the node’s visibility should be updated.
161//
162// This introduces a dependency from the node on its child nodes. In order
163// to accommodate this, `GtkTreeModelFilter` must make sure the necessary
164// signals are received from the child model. This is achieved by building,
165// for all nodes which are exposed as visible nodes to `GtkTreeModelFilter`'s
166// clients, the child level (if any) and take a reference on the first node
167// in this level. Furthermore, for every row-inserted, row-changed or
168// row-deleted signal (also these which were not handled because the node
169// was not cached), `GtkTreeModelFilter` will check if the visibility state
170// of any parent node has changed.
171//
172// Beware, however, that this explicit support is limited to these two
173// cases. For example, if you want a node to be visible only if two nodes
174// in a child’s child level (2 levels deeper) are visible, you are on your
175// own. In this case, either rely on `GtkTreeStore` to emit all signals
176// because it does not implement reference counting, or for models that
177// do implement reference counting, obtain references on these child levels
178// yourself.
179type TreeModelFilter struct {
180	gobject.Object
181}
182
183var xTreeModelFilterGLibType func() types.GType
184
185func TreeModelFilterGLibType() types.GType {
186	return xTreeModelFilterGLibType()
187}
188
189func TreeModelFilterNewFromInternalPtr(ptr uintptr) *TreeModelFilter {
190	cls := &TreeModelFilter{}
191	cls.Ptr = ptr
192	return cls
193}
194
195var xTreeModelFilterClearCache func(uintptr)
196
197// This function should almost never be called. It clears the @filter
198// of any cached iterators that haven’t been reffed with
199// gtk_tree_model_ref_node(). This might be useful if the child model
200// being filtered is static (and doesn’t change often) and there has been
201// a lot of unreffed access to nodes. As a side effect of this function,
202// all unreffed iters will be invalid.
203func (x *TreeModelFilter) ClearCache() {
204
205	xTreeModelFilterClearCache(x.GoPointer())
206
207}
208
209var xTreeModelFilterConvertChildIterToIter func(uintptr, *TreeIter, *TreeIter) bool
210
211// Sets @filter_iter to point to the row in @filter that corresponds to the
212// row pointed at by @child_iter.  If @filter_iter was not set, %FALSE is
213// returned.
214func (x *TreeModelFilter) ConvertChildIterToIter(FilterIterVar *TreeIter, ChildIterVar *TreeIter) bool {
215
216	cret := xTreeModelFilterConvertChildIterToIter(x.GoPointer(), FilterIterVar, ChildIterVar)
217	return cret
218}
219
220var xTreeModelFilterConvertChildPathToPath func(uintptr, *TreePath) *TreePath
221
222// Converts @child_path to a path relative to @filter. That is, @child_path
223// points to a path in the child model. The rerturned path will point to the
224// same row in the filtered model. If @child_path isn’t a valid path on the
225// child model or points to a row which is not visible in @filter, then %NULL
226// is returned.
227func (x *TreeModelFilter) ConvertChildPathToPath(ChildPathVar *TreePath) *TreePath {
228
229	cret := xTreeModelFilterConvertChildPathToPath(x.GoPointer(), ChildPathVar)
230	return cret
231}
232
233var xTreeModelFilterConvertIterToChildIter func(uintptr, *TreeIter, *TreeIter)
234
235// Sets @child_iter to point to the row pointed to by @filter_iter.
236func (x *TreeModelFilter) ConvertIterToChildIter(ChildIterVar *TreeIter, FilterIterVar *TreeIter) {
237
238	xTreeModelFilterConvertIterToChildIter(x.GoPointer(), ChildIterVar, FilterIterVar)
239
240}
241
242var xTreeModelFilterConvertPathToChildPath func(uintptr, *TreePath) *TreePath
243
244// Converts @filter_path to a path on the child model of @filter. That is,
245// @filter_path points to a location in @filter. The returned path will
246// point to the same location in the model not being filtered. If @filter_path
247// does not point to a location in the child model, %NULL is returned.
248func (x *TreeModelFilter) ConvertPathToChildPath(FilterPathVar *TreePath) *TreePath {
249
250	cret := xTreeModelFilterConvertPathToChildPath(x.GoPointer(), FilterPathVar)
251	return cret
252}
253
254var xTreeModelFilterGetModel func(uintptr) uintptr
255
256// Returns a pointer to the child model of @filter.
257func (x *TreeModelFilter) GetModel() *TreeModelBase {
258	var cls *TreeModelBase
259
260	cret := xTreeModelFilterGetModel(x.GoPointer())
261
262	if cret == 0 {
263		return nil
264	}
265	gobject.IncreaseRef(cret)
266	cls = &TreeModelBase{}
267	cls.Ptr = cret
268	return cls
269}
270
271var xTreeModelFilterRefilter func(uintptr)
272
273// Emits ::row_changed for each row in the child model, which causes
274// the filter to re-evaluate whether a row is visible or not.
275func (x *TreeModelFilter) Refilter() {
276
277	xTreeModelFilterRefilter(x.GoPointer())
278
279}
280
281var xTreeModelFilterSetModifyFunc func(uintptr, int, []types.GType, uintptr, uintptr, uintptr)
282
283// With the @n_columns and @types parameters, you give an array of column
284// types for this model (which will be exposed to the parent model/view).
285// The @func, @data and @destroy parameters are for specifying the modify
286// function. The modify function will get called for each
287// data access, the goal of the modify function is to return the data which
288// should be displayed at the location specified using the parameters of the
289// modify function.
290//
291// Note that gtk_tree_model_filter_set_modify_func()
292// can only be called once for a given filter model.
293func (x *TreeModelFilter) SetModifyFunc(NColumnsVar int, TypesVar []types.GType, FuncVar *TreeModelFilterModifyFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify) {
294
295	var FuncVarRef uintptr
296	if FuncVar != nil {
297		FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
298		if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
299			FuncVarRef = cbRefPtr
300		} else {
301			fcb := func(arg0 uintptr, arg1 *TreeIter, arg2 *gobject.Value, arg3 int, arg4 uintptr) {
302				cbFn := *FuncVar
303				cbFn(arg0, arg1, arg2, arg3, arg4)
304			}
305			FuncVarRef = purego.NewCallback(fcb)
306			glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
307		}
308	}
309
310	var DestroyVarRef uintptr
311	if DestroyVar != nil {
312		DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
313		if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
314			DestroyVarRef = cbRefPtr
315		} else {
316			fcb := func(arg0 uintptr) {
317				cbFn := *DestroyVar
318				cbFn(arg0)
319			}
320			DestroyVarRef = purego.NewCallback(fcb)
321			glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
322		}
323	}
324
325	xTreeModelFilterSetModifyFunc(x.GoPointer(), NColumnsVar, TypesVar, FuncVarRef, DataVar, DestroyVarRef)
326
327}
328
329var xTreeModelFilterSetVisibleColumn func(uintptr, int)
330
331// Sets @column of the child_model to be the column where @filter should
332// look for visibility information. @columns should be a column of type
333// %G_TYPE_BOOLEAN, where %TRUE means that a row is visible, and %FALSE
334// if not.
335//
336// Note that gtk_tree_model_filter_set_visible_func() or
337// gtk_tree_model_filter_set_visible_column() can only be called
338// once for a given filter model.
339func (x *TreeModelFilter) SetVisibleColumn(ColumnVar int) {
340
341	xTreeModelFilterSetVisibleColumn(x.GoPointer(), ColumnVar)
342
343}
344
345var xTreeModelFilterSetVisibleFunc func(uintptr, uintptr, uintptr, uintptr)
346
347// Sets the visible function used when filtering the @filter to be @func.
348// The function should return %TRUE if the given row should be visible and
349// %FALSE otherwise.
350//
351// If the condition calculated by the function changes over time (e.g.
352// because it depends on some global parameters), you must call
353// gtk_tree_model_filter_refilter() to keep the visibility information
354// of the model up-to-date.
355//
356// Note that @func is called whenever a row is inserted, when it may still
357// be empty. The visible function should therefore take special care of empty
358// rows, like in the example below.
359//
360// ```c
361// static gboolean
362// visible_func (GtkTreeModel *model,
363//
364//	GtkTreeIter  *iter,
365//	gpointer      data)
366//
367//	{
368//	  // Visible if row is non-empty and first column is “HI”
369//	  char *str;
370//	  gboolean visible = FALSE;
371//
372//	  gtk_tree_model_get (model, iter, 0, &str, -1);
373//	  if (str && strcmp (str, "HI") == 0)
374//	    visible = TRUE;
375//	  g_free (str);
376//
377//	  return visible;
378//	}
379//
380// ```
381//
382// Note that gtk_tree_model_filter_set_visible_func() or
383// gtk_tree_model_filter_set_visible_column() can only be called
384// once for a given filter model.
385func (x *TreeModelFilter) SetVisibleFunc(FuncVar *TreeModelFilterVisibleFunc, DataVar uintptr, DestroyVar *glib.DestroyNotify) {
386
387	var FuncVarRef uintptr
388	if FuncVar != nil {
389		FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
390		if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
391			FuncVarRef = cbRefPtr
392		} else {
393			fcb := func(arg0 uintptr, arg1 *TreeIter, arg2 uintptr) bool {
394				cbFn := *FuncVar
395				return cbFn(arg0, arg1, arg2)
396			}
397			FuncVarRef = purego.NewCallback(fcb)
398			glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
399		}
400	}
401
402	var DestroyVarRef uintptr
403	if DestroyVar != nil {
404		DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
405		if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
406			DestroyVarRef = cbRefPtr
407		} else {
408			fcb := func(arg0 uintptr) {
409				cbFn := *DestroyVar
410				cbFn(arg0)
411			}
412			DestroyVarRef = purego.NewCallback(fcb)
413			glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
414		}
415	}
416
417	xTreeModelFilterSetVisibleFunc(x.GoPointer(), FuncVarRef, DataVar, DestroyVarRef)
418
419}
420
421func (c *TreeModelFilter) GoPointer() uintptr {
422	if c == nil {
423		return 0
424	}
425	return c.Ptr
426}
427
428func (c *TreeModelFilter) SetGoPointer(ptr uintptr) {
429	c.Ptr = ptr
430}
431
432// SetPropertyVirtualRoot sets the "virtual-root" property.
433// The virtual root of the tree model filter.
434func (x *TreeModelFilter) SetPropertyVirtualRoot(value uintptr) {
435	var v gobject.Value
436	v.Init(gobject.TypePointerVal)
437	v.SetPointer(value)
438	x.SetProperty("virtual-root", &v)
439}
440
441// GetPropertyVirtualRoot gets the "virtual-root" property.
442// The virtual root of the tree model filter.
443func (x *TreeModelFilter) GetPropertyVirtualRoot() uintptr {
444	var v gobject.Value
445	x.GetProperty("virtual-root", &v)
446	return v.GetPointer()
447}
448
449// Asks the `GtkTreeDragSource` to delete the row at @path, because
450// it was moved somewhere else via drag-and-drop. Returns %FALSE
451// if the deletion fails because @path no longer exists, or for
452// some model-specific reason. Should robustly handle a @path no
453// longer found in the model!
454func (x *TreeModelFilter) DragDataDelete(PathVar *TreePath) bool {
455
456	cret := XGtkTreeDragSourceDragDataDelete(x.GoPointer(), PathVar)
457	return cret
458}
459
460// Asks the `GtkTreeDragSource` to return a `GdkContentProvider` representing
461// the row at @path. Should robustly handle a @path no
462// longer found in the model!
463func (x *TreeModelFilter) DragDataGet(PathVar *TreePath) *gdk.ContentProvider {
464	var cls *gdk.ContentProvider
465
466	cret := XGtkTreeDragSourceDragDataGet(x.GoPointer(), PathVar)
467
468	if cret == 0 {
469		return nil
470	}
471	cls = &gdk.ContentProvider{}
472	cls.Ptr = cret
473	return cls
474}
475
476// Asks the `GtkTreeDragSource` whether a particular row can be used as
477// the source of a DND operation. If the source doesn’t implement
478// this interface, the row is assumed draggable.
479func (x *TreeModelFilter) RowDraggable(PathVar *TreePath) bool {
480
481	cret := XGtkTreeDragSourceRowDraggable(x.GoPointer(), PathVar)
482	return cret
483}
484
485// Creates a new `GtkTreeModel`, with @child_model as the child_model
486// and @root as the virtual root.
487func (x *TreeModelFilter) FilterNew(RootVar *TreePath) *TreeModelBase {
488	var cls *TreeModelBase
489
490	cret := XGtkTreeModelFilterNew(x.GoPointer(), RootVar)
491
492	if cret == 0 {
493		return nil
494	}
495	cls = &TreeModelBase{}
496	cls.Ptr = cret
497	return cls
498}
499
500// Calls @func on each node in model in a depth-first fashion.
501//
502// If @func returns %TRUE, then the tree ceases to be walked,
503// and gtk_tree_model_foreach() returns.
504func (x *TreeModelFilter) Foreach(FuncVar *TreeModelForeachFunc, UserDataVar uintptr) {
505
506	XGtkTreeModelForeach(x.GoPointer(), glib.NewCallback(FuncVar), UserDataVar)
507
508}
509
510// Gets the value of one or more cells in the row referenced by @iter.
511//
512// The variable argument list should contain integer column numbers,
513// each column number followed by a place to store the value being
514// retrieved.  The list is terminated by a -1. For example, to get a
515// value from column 0 with type %G_TYPE_STRING, you would
516// write: `gtk_tree_model_get (model, iter, 0, &place_string_here, -1)`,
517// where `place_string_here` is a #gchararray
518// to be filled with the string.
519//
520// Returned values with type %G_TYPE_OBJECT have to be unreferenced,
521// values with type %G_TYPE_STRING or %G_TYPE_BOXED have to be freed.
522// Other values are passed by value.
523func (x *TreeModelFilter) Get(IterVar *TreeIter, varArgs ...interface{}) {
524
525	XGtkTreeModelGet(x.GoPointer(), IterVar, varArgs...)
526
527}
528
529// Returns the type of the column.
530func (x *TreeModelFilter) GetColumnType(IndexVar int) types.GType {
531
532	cret := XGtkTreeModelGetColumnType(x.GoPointer(), IndexVar)
533	return cret
534}
535
536// Returns a set of flags supported by this interface.
537//
538// The flags are a bitwise combination of `GtkTreeModel`Flags.
539// The flags supported should not change during the lifetime
540// of the @tree_model.
541func (x *TreeModelFilter) GetFlags() TreeModelFlags {
542
543	cret := XGtkTreeModelGetFlags(x.GoPointer())
544	return cret
545}
546
547// Sets @iter to a valid iterator pointing to @path.
548//
549// If @path does not exist, @iter is set to an invalid
550// iterator and %FALSE is returned.
551func (x *TreeModelFilter) GetIter(IterVar *TreeIter, PathVar *TreePath) bool {
552
553	cret := XGtkTreeModelGetIter(x.GoPointer(), IterVar, PathVar)
554	return cret
555}
556
557// Initializes @iter with the first iterator in the tree
558// (the one at the path "0").
559//
560// Returns %FALSE if the tree is empty, %TRUE otherwise.
561func (x *TreeModelFilter) GetIterFirst(IterVar *TreeIter) bool {
562
563	cret := XGtkTreeModelGetIterFirst(x.GoPointer(), IterVar)
564	return cret
565}
566
567// Sets @iter to a valid iterator pointing to @path_string, if it
568// exists.
569//
570// Otherwise, @iter is left invalid and %FALSE is returned.
571func (x *TreeModelFilter) GetIterFromString(IterVar *TreeIter, PathStringVar string) bool {
572
573	cret := XGtkTreeModelGetIterFromString(x.GoPointer(), IterVar, PathStringVar)
574	return cret
575}
576
577// Returns the number of columns supported by @tree_model.
578func (x *TreeModelFilter) GetNColumns() int {
579
580	cret := XGtkTreeModelGetNColumns(x.GoPointer())
581	return cret
582}
583
584// Returns a newly-created `GtkTreePath` referenced by @iter.
585//
586// This path should be freed with gtk_tree_path_free().
587func (x *TreeModelFilter) GetPath(IterVar *TreeIter) *TreePath {
588
589	cret := XGtkTreeModelGetPath(x.GoPointer(), IterVar)
590	return cret
591}
592
593// Generates a string representation of the iter.
594//
595// This string is a “:” separated list of numbers.
596// For example, “4:10:0:3” would be an acceptable
597// return value for this string.
598func (x *TreeModelFilter) GetStringFromIter(IterVar *TreeIter) string {
599
600	cret := XGtkTreeModelGetStringFromIter(x.GoPointer(), IterVar)
601	return cret
602}
603
604// Gets the value of one or more cells in the row referenced by @iter.
605//
606// See [method@Gtk.TreeModel.get], this version takes a va_list
607// for language bindings to use.
608func (x *TreeModelFilter) GetValist(IterVar *TreeIter, VarArgsVar []interface{}) {
609
610	XGtkTreeModelGetValist(x.GoPointer(), IterVar, VarArgsVar)
611
612}
613
614// Initializes and sets @value to that at @column.
615//
616// When done with @value, g_value_unset() needs to be called
617// to free any allocated memory.
618func (x *TreeModelFilter) GetValue(IterVar *TreeIter, ColumnVar int, ValueVar *gobject.Value) {
619
620	XGtkTreeModelGetValue(x.GoPointer(), IterVar, ColumnVar, ValueVar)
621
622}
623
624// Sets @iter to point to the first child of @parent.
625//
626// If @parent has no children, %FALSE is returned and @iter is
627// set to be invalid. @parent will remain a valid node after this
628// function has been called.
629//
630// If @parent is %NULL returns the first node, equivalent to
631// `gtk_tree_model_get_iter_first (tree_model, iter);`
632func (x *TreeModelFilter) IterChildren(IterVar *TreeIter, ParentVar *TreeIter) bool {
633
634	cret := XGtkTreeModelIterChildren(x.GoPointer(), IterVar, ParentVar)
635	return cret
636}
637
638// Returns %TRUE if @iter has children, %FALSE otherwise.
639func (x *TreeModelFilter) IterHasChild(IterVar *TreeIter) bool {
640
641	cret := XGtkTreeModelIterHasChild(x.GoPointer(), IterVar)
642	return cret
643}
644
645// Returns the number of children that @iter has.
646//
647// As a special case, if @iter is %NULL, then the number
648// of toplevel nodes is returned.
649func (x *TreeModelFilter) IterNChildren(IterVar *TreeIter) int {
650
651	cret := XGtkTreeModelIterNChildren(x.GoPointer(), IterVar)
652	return cret
653}
654
655// Sets @iter to point to the node following it at the current level.
656//
657// If there is no next @iter, %FALSE is returned and @iter is set
658// to be invalid.
659func (x *TreeModelFilter) IterNext(IterVar *TreeIter) bool {
660
661	cret := XGtkTreeModelIterNext(x.GoPointer(), IterVar)
662	return cret
663}
664
665// Sets @iter to be the child of @parent, using the given index.
666//
667// The first index is 0. If @n is too big, or @parent has no children,
668// @iter is set to an invalid iterator and %FALSE is returned. @parent
669// will remain a valid node after this function has been called. As a
670// special case, if @parent is %NULL, then the @n-th root node
671// is set.
672func (x *TreeModelFilter) IterNthChild(IterVar *TreeIter, ParentVar *TreeIter, NVar int) bool {
673
674	cret := XGtkTreeModelIterNthChild(x.GoPointer(), IterVar, ParentVar, NVar)
675	return cret
676}
677
678// Sets @iter to be the parent of @child.
679//
680// If @child is at the toplevel, and doesn’t have a parent, then
681// @iter is set to an invalid iterator and %FALSE is returned.
682// @child will remain a valid node after this function has been
683// called.
684//
685// @iter will be initialized before the lookup is performed, so @child
686// and @iter cannot point to the same memory location.
687func (x *TreeModelFilter) IterParent(IterVar *TreeIter, ChildVar *TreeIter) bool {
688
689	cret := XGtkTreeModelIterParent(x.GoPointer(), IterVar, ChildVar)
690	return cret
691}
692
693// Sets @iter to point to the previous node at the current level.
694//
695// If there is no previous @iter, %FALSE is returned and @iter is
696// set to be invalid.
697func (x *TreeModelFilter) IterPrevious(IterVar *TreeIter) bool {
698
699	cret := XGtkTreeModelIterPrevious(x.GoPointer(), IterVar)
700	return cret
701}
702
703// Lets the tree ref the node.
704//
705// This is an optional method for models to implement.
706// To be more specific, models may ignore this call as it exists
707// primarily for performance reasons.
708//
709// This function is primarily meant as a way for views to let
710// caching models know when nodes are being displayed (and hence,
711// whether or not to cache that node). Being displayed means a node
712// is in an expanded branch, regardless of whether the node is currently
713// visible in the viewport. For example, a file-system based model
714// would not want to keep the entire file-hierarchy in memory,
715// just the sections that are currently being displayed by
716// every current view.
717//
718// A model should be expected to be able to get an iter independent
719// of its reffed state.
720func (x *TreeModelFilter) RefNode(IterVar *TreeIter) {
721
722	XGtkTreeModelRefNode(x.GoPointer(), IterVar)
723
724}
725
726// Emits the ::row-changed signal on @tree_model.
727//
728// See [signal@Gtk.TreeModel::row-changed].
729func (x *TreeModelFilter) RowChanged(PathVar *TreePath, IterVar *TreeIter) {
730
731	XGtkTreeModelRowChanged(x.GoPointer(), PathVar, IterVar)
732
733}
734
735// Emits the ::row-deleted signal on @tree_model.
736//
737// See [signal@Gtk.TreeModel::row-deleted].
738//
739// This should be called by models after a row has been removed.
740// The location pointed to by @path should be the location that
741// the row previously was at. It may not be a valid location anymore.
742//
743// Nodes that are deleted are not unreffed, this means that any
744// outstanding references on the deleted node should not be released.
745func (x *TreeModelFilter) RowDeleted(PathVar *TreePath) {
746
747	XGtkTreeModelRowDeleted(x.GoPointer(), PathVar)
748
749}
750
751// Emits the ::row-has-child-toggled signal on @tree_model.
752//
753// See [signal@Gtk.TreeModel::row-has-child-toggled].
754//
755// This should be called by models after the child
756// state of a node changes.
757func (x *TreeModelFilter) RowHasChildToggled(PathVar *TreePath, IterVar *TreeIter) {
758
759	XGtkTreeModelRowHasChildToggled(x.GoPointer(), PathVar, IterVar)
760
761}
762
763// Emits the ::row-inserted signal on @tree_model.
764//
765// See [signal@Gtk.TreeModel::row-inserted].
766func (x *TreeModelFilter) RowInserted(PathVar *TreePath, IterVar *TreeIter) {
767
768	XGtkTreeModelRowInserted(x.GoPointer(), PathVar, IterVar)
769
770}
771
772// Emits the ::rows-reordered signal on @tree_model.
773//
774// See [signal@Gtk.TreeModel::rows-reordered].
775//
776// This should be called by models when their rows have been
777// reordered.
778func (x *TreeModelFilter) RowsReordered(PathVar *TreePath, IterVar *TreeIter, NewOrderVar int) {
779
780	XGtkTreeModelRowsReordered(x.GoPointer(), PathVar, IterVar, NewOrderVar)
781
782}
783
784// Emits the ::rows-reordered signal on @tree_model.
785//
786// See [signal@Gtk.TreeModel::rows-reordered].
787//
788// This should be called by models when their rows have been
789// reordered.
790func (x *TreeModelFilter) RowsReorderedWithLength(PathVar *TreePath, IterVar *TreeIter, NewOrderVar []int, LengthVar int) {
791
792	XGtkTreeModelRowsReorderedWithLength(x.GoPointer(), PathVar, IterVar, NewOrderVar, LengthVar)
793
794}
795
796// Lets the tree unref the node.
797//
798// This is an optional method for models to implement.
799// To be more specific, models may ignore this call as it exists
800// primarily for performance reasons. For more information on what
801// this means, see gtk_tree_model_ref_node().
802//
803// Please note that nodes that are deleted are not unreffed.
804func (x *TreeModelFilter) UnrefNode(IterVar *TreeIter) {
805
806	XGtkTreeModelUnrefNode(x.GoPointer(), IterVar)
807
808}
809
810func init() {
811	core.SetPackageName("GTK", "gtk4")
812	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
813	var libs []uintptr
814	for _, libPath := range core.GetPaths("GTK") {
815		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
816		if err != nil {
817			panic(err)
818		}
819		libs = append(libs, lib)
820	}
821
822	core.PuregoSafeRegister(&xTreeModelFilterGLibType, libs, "gtk_tree_model_filter_get_type")
823
824	core.PuregoSafeRegister(&xTreeModelFilterClearCache, libs, "gtk_tree_model_filter_clear_cache")
825	core.PuregoSafeRegister(&xTreeModelFilterConvertChildIterToIter, libs, "gtk_tree_model_filter_convert_child_iter_to_iter")
826	core.PuregoSafeRegister(&xTreeModelFilterConvertChildPathToPath, libs, "gtk_tree_model_filter_convert_child_path_to_path")
827	core.PuregoSafeRegister(&xTreeModelFilterConvertIterToChildIter, libs, "gtk_tree_model_filter_convert_iter_to_child_iter")
828	core.PuregoSafeRegister(&xTreeModelFilterConvertPathToChildPath, libs, "gtk_tree_model_filter_convert_path_to_child_path")
829	core.PuregoSafeRegister(&xTreeModelFilterGetModel, libs, "gtk_tree_model_filter_get_model")
830	core.PuregoSafeRegister(&xTreeModelFilterRefilter, libs, "gtk_tree_model_filter_refilter")
831	core.PuregoSafeRegister(&xTreeModelFilterSetModifyFunc, libs, "gtk_tree_model_filter_set_modify_func")
832	core.PuregoSafeRegister(&xTreeModelFilterSetVisibleColumn, libs, "gtk_tree_model_filter_set_visible_column")
833	core.PuregoSafeRegister(&xTreeModelFilterSetVisibleFunc, libs, "gtk_tree_model_filter_set_visible_func")
834
835}

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