v0.2.1 c0399be

gtknotebook.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"unsafe"
6
7	"github.com/ebitengine/purego"
8
9	"github.com/bnema/puregotk/pkg/core"
10	"github.com/bnema/puregotk/v4/gio"
11	"github.com/bnema/puregotk/v4/glib"
12	"github.com/bnema/puregotk/v4/gobject"
13	"github.com/bnema/puregotk/v4/gobject/types"
14)
15
16// The parameter used in the action signals of `GtkNotebook`.
17type NotebookTab int
18
19var xNotebookTabGLibType func() types.GType
20
21func NotebookTabGLibType() types.GType {
22	return xNotebookTabGLibType()
23}
24
25const (
26
27	// the first tab in the notebook
28	NotebookTabFirstValue NotebookTab = 0
29	// the last tab in the notebook
30	NotebookTabLastValue NotebookTab = 1
31)
32
33// Switches between children using tabs.
34//
35// <picture>
36//
37//	<source srcset="notebook-dark.png" media="(prefers-color-scheme: dark)">
38//	<img alt="An example GtkNotebook" src="notebook.png">
39//
40// </picture>
41//
42// There are many configuration options for `GtkNotebook`. Among
43// other things, you can choose on which edge the tabs appear
44// (see [method@Gtk.Notebook.set_tab_pos]), whether, if there are
45// too many tabs to fit the notebook should be made bigger or scrolling
46// arrows added (see [method@Gtk.Notebook.set_scrollable]), and whether
47// there will be a popup menu allowing the users to switch pages.
48// (see [method@Gtk.Notebook.popup_enable]).
49//
50// # GtkNotebook as GtkBuildable
51//
52// The `GtkNotebook` implementation of the `GtkBuildable` interface
53// supports placing children into tabs by specifying “tab” as the
54// “type” attribute of a `<child>` element. Note that the content
55// of the tab must be created before the tab can be filled.
56// A tab child can be specified without specifying a `<child>`
57// type attribute.
58//
59// To add a child widget in the notebooks action area, specify
60// "action-start" or “action-end” as the “type” attribute of the
61// `<child>` element.
62//
63// An example of a UI definition fragment with `GtkNotebook`:
64//
65// ```xml
66// <object class="GtkNotebook">
67//
68//	<child>
69//	  <object class="GtkLabel" id="notebook-content">
70//	    <property name="label">Content</property>
71//	  </object>
72//	</child>
73//	<child type="tab">
74//	  <object class="GtkLabel" id="notebook-tab">
75//	    <property name="label">Tab</property>
76//	  </object>
77//	</child>
78//
79// </object>
80// ```
81//
82// # Shortcuts and Gestures
83//
84// `GtkNotebook` supports the following keyboard shortcuts:
85//
86// - <kbd>Shift</kbd>+<kbd>F10</kbd> or <kbd>Menu</kbd> opens the context menu.
87// - <kbd>Home</kbd> moves the focus to the first tab.
88// - <kbd>End</kbd> moves the focus to the last tab.
89//
90// Additionally, the following signals have default keybindings:
91//
92// - [signal@Gtk.Notebook::change-current-page]
93// - [signal@Gtk.Notebook::focus-tab]
94// - [signal@Gtk.Notebook::move-focus-out]
95// - [signal@Gtk.Notebook::reorder-tab]
96// - [signal@Gtk.Notebook::select-page]
97//
98// Tabs support drag-and-drop between notebooks sharing the same `group-name`,
99// or to new windows by handling the `::create-window` signal.
100//
101// # Actions
102//
103// `GtkNotebook` defines a set of built-in actions:
104//
105// - `menu.popup` opens the tabs context menu.
106//
107// # CSS nodes
108//
109// ```
110// notebook
111// ├── header.top
112// │   ├── [<action widget>]
113// │   ├── tabs
114// │   │   ├── [arrow]
115// │   │   ├── tab
116// │   │   │   ╰── <tab label>
117// ┊   ┊   ┊
118// │   │   ├── tab[.reorderable-page]
119// │   │   │   ╰── <tab label>
120// │   │   ╰── [arrow]
121// │   ╰── [<action widget>]
122// │
123// ╰── stack
124//
125//	├── <child>
126//	┊
127//	╰── <child>
128//
129// ```
130//
131// `GtkNotebook` has a main CSS node with name `notebook`, a subnode
132// with name `header` and below that a subnode with name `tabs` which
133// contains one subnode per tab with name `tab`.
134//
135// If action widgets are present, their CSS nodes are placed next
136// to the `tabs` node. If the notebook is scrollable, CSS nodes with
137// name `arrow` are placed as first and last child of the `tabs` node.
138//
139// The main node gets the `.frame` style class when the notebook
140// has a border (see [method@Gtk.Notebook.set_show_border]).
141//
142// The header node gets one of the style class `.top`, `.bottom`,
143// `.left` or `.right`, depending on where the tabs are placed. For
144// reorderable pages, the tab node gets the `.reorderable-page` class.
145//
146// A `tab` node gets the `.dnd` style class while it is moved with drag-and-drop.
147//
148// The nodes are always arranged from left-to-right, regardless of text direction.
149//
150// # Accessibility
151//
152// `GtkNotebook` uses the following roles:
153//
154//   - [enum@Gtk.AccessibleRole.group] for the notebook widget
155//   - [enum@Gtk.AccessibleRole.tab_list] for the list of tabs
156//   - [enum@Gtk.AccessibleRole.tab] role for each tab
157//   - [enum@Gtk.AccessibleRole.tab_panel] for each page
158type Notebook struct {
159	Widget
160}
161
162var xNotebookGLibType func() types.GType
163
164func NotebookGLibType() types.GType {
165	return xNotebookGLibType()
166}
167
168func NotebookNewFromInternalPtr(ptr uintptr) *Notebook {
169	cls := &Notebook{}
170	cls.Ptr = ptr
171	return cls
172}
173
174var xNewNotebook func() uintptr
175
176// Creates a new `GtkNotebook` widget with no pages.
177func NewNotebook() *Notebook {
178	var cls *Notebook
179
180	cret := xNewNotebook()
181
182	if cret == 0 {
183		return nil
184	}
185	gobject.IncreaseRef(cret)
186	cls = &Notebook{}
187	cls.Ptr = cret
188	return cls
189}
190
191var xNotebookAppendPage func(uintptr, uintptr, uintptr) int
192
193// Appends a page to @notebook.
194func (x *Notebook) AppendPage(ChildVar *Widget, TabLabelVar *Widget) int {
195
196	cret := xNotebookAppendPage(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer())
197	return cret
198}
199
200var xNotebookAppendPageMenu func(uintptr, uintptr, uintptr, uintptr) int
201
202// Appends a page to @notebook, specifying the widget to use as the
203// label in the popup menu.
204func (x *Notebook) AppendPageMenu(ChildVar *Widget, TabLabelVar *Widget, MenuLabelVar *Widget) int {
205
206	cret := xNotebookAppendPageMenu(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer(), MenuLabelVar.GoPointer())
207	return cret
208}
209
210var xNotebookDetachTab func(uintptr, uintptr)
211
212// Removes the child from the notebook.
213//
214// This function is very similar to [method@Gtk.Notebook.remove_page],
215// but additionally informs the notebook that the removal
216// is happening as part of a tab DND operation, which should
217// not be cancelled.
218func (x *Notebook) DetachTab(ChildVar *Widget) {
219
220	xNotebookDetachTab(x.GoPointer(), ChildVar.GoPointer())
221
222}
223
224var xNotebookGetActionWidget func(uintptr, PackType) uintptr
225
226// Gets one of the action widgets.
227//
228// See [method@Gtk.Notebook.set_action_widget].
229func (x *Notebook) GetActionWidget(PackTypeVar PackType) *Widget {
230	var cls *Widget
231
232	cret := xNotebookGetActionWidget(x.GoPointer(), PackTypeVar)
233
234	if cret == 0 {
235		return nil
236	}
237	gobject.IncreaseRef(cret)
238	cls = &Widget{}
239	cls.Ptr = cret
240	return cls
241}
242
243var xNotebookGetCurrentPage func(uintptr) int
244
245// Returns the page number of the current page.
246func (x *Notebook) GetCurrentPage() int {
247
248	cret := xNotebookGetCurrentPage(x.GoPointer())
249	return cret
250}
251
252var xNotebookGetGroupName func(uintptr) string
253
254// Gets the current group name for @notebook.
255func (x *Notebook) GetGroupName() string {
256
257	cret := xNotebookGetGroupName(x.GoPointer())
258	return cret
259}
260
261var xNotebookGetMenuLabel func(uintptr, uintptr) uintptr
262
263// Retrieves the menu label widget of the page containing @child.
264func (x *Notebook) GetMenuLabel(ChildVar *Widget) *Widget {
265	var cls *Widget
266
267	cret := xNotebookGetMenuLabel(x.GoPointer(), ChildVar.GoPointer())
268
269	if cret == 0 {
270		return nil
271	}
272	gobject.IncreaseRef(cret)
273	cls = &Widget{}
274	cls.Ptr = cret
275	return cls
276}
277
278var xNotebookGetMenuLabelText func(uintptr, uintptr) string
279
280// Retrieves the text of the menu label for the page containing
281// @child.
282func (x *Notebook) GetMenuLabelText(ChildVar *Widget) string {
283
284	cret := xNotebookGetMenuLabelText(x.GoPointer(), ChildVar.GoPointer())
285	return cret
286}
287
288var xNotebookGetNPages func(uintptr) int
289
290// Gets the number of pages in a notebook.
291func (x *Notebook) GetNPages() int {
292
293	cret := xNotebookGetNPages(x.GoPointer())
294	return cret
295}
296
297var xNotebookGetNthPage func(uintptr, int) uintptr
298
299// Returns the child widget contained in page number @page_num.
300func (x *Notebook) GetNthPage(PageNumVar int) *Widget {
301	var cls *Widget
302
303	cret := xNotebookGetNthPage(x.GoPointer(), PageNumVar)
304
305	if cret == 0 {
306		return nil
307	}
308	gobject.IncreaseRef(cret)
309	cls = &Widget{}
310	cls.Ptr = cret
311	return cls
312}
313
314var xNotebookGetPage func(uintptr, uintptr) uintptr
315
316// Returns the `GtkNotebookPage` for @child.
317func (x *Notebook) GetPage(ChildVar *Widget) *NotebookPage {
318	var cls *NotebookPage
319
320	cret := xNotebookGetPage(x.GoPointer(), ChildVar.GoPointer())
321
322	if cret == 0 {
323		return nil
324	}
325	gobject.IncreaseRef(cret)
326	cls = &NotebookPage{}
327	cls.Ptr = cret
328	return cls
329}
330
331var xNotebookGetPages func(uintptr) uintptr
332
333// Returns a `GListModel` that contains the pages of the notebook.
334//
335// This can be used to keep an up-to-date view. The model also
336// implements [iface@Gtk.SelectionModel] and can be used to track
337// and modify the visible page.
338func (x *Notebook) GetPages() *gio.ListModelBase {
339	var cls *gio.ListModelBase
340
341	cret := xNotebookGetPages(x.GoPointer())
342
343	if cret == 0 {
344		return nil
345	}
346	cls = &gio.ListModelBase{}
347	cls.Ptr = cret
348	return cls
349}
350
351var xNotebookGetScrollable func(uintptr) bool
352
353// Returns whether the tab label area has arrows for scrolling.
354func (x *Notebook) GetScrollable() bool {
355
356	cret := xNotebookGetScrollable(x.GoPointer())
357	return cret
358}
359
360var xNotebookGetShowBorder func(uintptr) bool
361
362// Returns whether a bevel will be drawn around the notebook pages.
363func (x *Notebook) GetShowBorder() bool {
364
365	cret := xNotebookGetShowBorder(x.GoPointer())
366	return cret
367}
368
369var xNotebookGetShowTabs func(uintptr) bool
370
371// Returns whether the tabs of the notebook are shown.
372func (x *Notebook) GetShowTabs() bool {
373
374	cret := xNotebookGetShowTabs(x.GoPointer())
375	return cret
376}
377
378var xNotebookGetTabDetachable func(uintptr, uintptr) bool
379
380// Returns whether the tab contents can be detached from @notebook.
381func (x *Notebook) GetTabDetachable(ChildVar *Widget) bool {
382
383	cret := xNotebookGetTabDetachable(x.GoPointer(), ChildVar.GoPointer())
384	return cret
385}
386
387var xNotebookGetTabLabel func(uintptr, uintptr) uintptr
388
389// Returns the tab label widget for the page @child.
390//
391// %NULL is returned if @child is not in @notebook or
392// if no tab label has specifically been set for @child.
393func (x *Notebook) GetTabLabel(ChildVar *Widget) *Widget {
394	var cls *Widget
395
396	cret := xNotebookGetTabLabel(x.GoPointer(), ChildVar.GoPointer())
397
398	if cret == 0 {
399		return nil
400	}
401	gobject.IncreaseRef(cret)
402	cls = &Widget{}
403	cls.Ptr = cret
404	return cls
405}
406
407var xNotebookGetTabLabelText func(uintptr, uintptr) string
408
409// Retrieves the text of the tab label for the page containing
410// @child.
411func (x *Notebook) GetTabLabelText(ChildVar *Widget) string {
412
413	cret := xNotebookGetTabLabelText(x.GoPointer(), ChildVar.GoPointer())
414	return cret
415}
416
417var xNotebookGetTabPos func(uintptr) PositionType
418
419// Gets the edge at which the tabs are drawn.
420func (x *Notebook) GetTabPos() PositionType {
421
422	cret := xNotebookGetTabPos(x.GoPointer())
423	return cret
424}
425
426var xNotebookGetTabReorderable func(uintptr, uintptr) bool
427
428// Gets whether the tab can be reordered via drag and drop or not.
429func (x *Notebook) GetTabReorderable(ChildVar *Widget) bool {
430
431	cret := xNotebookGetTabReorderable(x.GoPointer(), ChildVar.GoPointer())
432	return cret
433}
434
435var xNotebookInsertPage func(uintptr, uintptr, uintptr, int) int
436
437// Insert a page into @notebook at the given position.
438func (x *Notebook) InsertPage(ChildVar *Widget, TabLabelVar *Widget, PositionVar int) int {
439
440	cret := xNotebookInsertPage(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer(), PositionVar)
441	return cret
442}
443
444var xNotebookInsertPageMenu func(uintptr, uintptr, uintptr, uintptr, int) int
445
446// Insert a page into @notebook at the given position, specifying
447// the widget to use as the label in the popup menu.
448func (x *Notebook) InsertPageMenu(ChildVar *Widget, TabLabelVar *Widget, MenuLabelVar *Widget, PositionVar int) int {
449
450	cret := xNotebookInsertPageMenu(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer(), MenuLabelVar.GoPointer(), PositionVar)
451	return cret
452}
453
454var xNotebookNextPage func(uintptr)
455
456// Switches to the next page.
457//
458// Nothing happens if the current page is the last page.
459func (x *Notebook) NextPage() {
460
461	xNotebookNextPage(x.GoPointer())
462
463}
464
465var xNotebookPageNum func(uintptr, uintptr) int
466
467// Finds the index of the page which contains the given child
468// widget.
469func (x *Notebook) PageNum(ChildVar *Widget) int {
470
471	cret := xNotebookPageNum(x.GoPointer(), ChildVar.GoPointer())
472	return cret
473}
474
475var xNotebookPopupDisable func(uintptr)
476
477// Disables the popup menu.
478func (x *Notebook) PopupDisable() {
479
480	xNotebookPopupDisable(x.GoPointer())
481
482}
483
484var xNotebookPopupEnable func(uintptr)
485
486// Enables the popup menu.
487//
488// If the user clicks with the right mouse button on the tab labels,
489// a menu with all the pages will be popped up.
490func (x *Notebook) PopupEnable() {
491
492	xNotebookPopupEnable(x.GoPointer())
493
494}
495
496var xNotebookPrependPage func(uintptr, uintptr, uintptr) int
497
498// Prepends a page to @notebook.
499func (x *Notebook) PrependPage(ChildVar *Widget, TabLabelVar *Widget) int {
500
501	cret := xNotebookPrependPage(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer())
502	return cret
503}
504
505var xNotebookPrependPageMenu func(uintptr, uintptr, uintptr, uintptr) int
506
507// Prepends a page to @notebook, specifying the widget to use as the
508// label in the popup menu.
509func (x *Notebook) PrependPageMenu(ChildVar *Widget, TabLabelVar *Widget, MenuLabelVar *Widget) int {
510
511	cret := xNotebookPrependPageMenu(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer(), MenuLabelVar.GoPointer())
512	return cret
513}
514
515var xNotebookPrevPage func(uintptr)
516
517// Switches to the previous page.
518//
519// Nothing happens if the current page is the first page.
520func (x *Notebook) PrevPage() {
521
522	xNotebookPrevPage(x.GoPointer())
523
524}
525
526var xNotebookRemovePage func(uintptr, int)
527
528// Removes a page from the notebook given its index
529// in the notebook.
530func (x *Notebook) RemovePage(PageNumVar int) {
531
532	xNotebookRemovePage(x.GoPointer(), PageNumVar)
533
534}
535
536var xNotebookReorderChild func(uintptr, uintptr, int)
537
538// Reorders the page containing @child, so that it appears in position
539// @position.
540//
541// If @position is greater than or equal to the number of children in
542// the list or negative, @child will be moved to the end of the list.
543func (x *Notebook) ReorderChild(ChildVar *Widget, PositionVar int) {
544
545	xNotebookReorderChild(x.GoPointer(), ChildVar.GoPointer(), PositionVar)
546
547}
548
549var xNotebookSetActionWidget func(uintptr, uintptr, PackType)
550
551// Sets @widget as one of the action widgets.
552//
553// Depending on the pack type the widget will be placed before
554// or after the tabs. You can use a `GtkBox` if you need to pack
555// more than one widget on the same side.
556func (x *Notebook) SetActionWidget(WidgetVar *Widget, PackTypeVar PackType) {
557
558	xNotebookSetActionWidget(x.GoPointer(), WidgetVar.GoPointer(), PackTypeVar)
559
560}
561
562var xNotebookSetCurrentPage func(uintptr, int)
563
564// Switches to the page number @page_num.
565//
566// Note that due to historical reasons, GtkNotebook refuses
567// to switch to a page unless the child widget is visible.
568// Therefore, it is recommended to show child widgets before
569// adding them to a notebook.
570func (x *Notebook) SetCurrentPage(PageNumVar int) {
571
572	xNotebookSetCurrentPage(x.GoPointer(), PageNumVar)
573
574}
575
576var xNotebookSetGroupName func(uintptr, uintptr)
577
578// Sets a group name for @notebook.
579//
580// Notebooks with the same name will be able to exchange tabs
581// via drag and drop. A notebook with a %NULL group name will
582// not be able to exchange tabs with any other notebook.
583func (x *Notebook) SetGroupName(GroupNameVar *string) {
584
585	GroupNameVarPtr := core.GStrdupNullable(GroupNameVar)
586	defer core.GFreeNullable(GroupNameVarPtr)
587
588	xNotebookSetGroupName(x.GoPointer(), GroupNameVarPtr)
589
590}
591
592var xNotebookSetMenuLabel func(uintptr, uintptr, uintptr)
593
594// Changes the menu label for the page containing @child.
595func (x *Notebook) SetMenuLabel(ChildVar *Widget, MenuLabelVar *Widget) {
596
597	xNotebookSetMenuLabel(x.GoPointer(), ChildVar.GoPointer(), MenuLabelVar.GoPointer())
598
599}
600
601var xNotebookSetMenuLabelText func(uintptr, uintptr, string)
602
603// Creates a new label and sets it as the menu label of @child.
604func (x *Notebook) SetMenuLabelText(ChildVar *Widget, MenuTextVar string) {
605
606	xNotebookSetMenuLabelText(x.GoPointer(), ChildVar.GoPointer(), MenuTextVar)
607
608}
609
610var xNotebookSetScrollable func(uintptr, bool)
611
612// Sets whether the tab label area will have arrows for
613// scrolling if there are too many tabs to fit in the area.
614func (x *Notebook) SetScrollable(ScrollableVar bool) {
615
616	xNotebookSetScrollable(x.GoPointer(), ScrollableVar)
617
618}
619
620var xNotebookSetShowBorder func(uintptr, bool)
621
622// Sets whether a bevel will be drawn around the notebook pages.
623//
624// This only has a visual effect when the tabs are not shown.
625func (x *Notebook) SetShowBorder(ShowBorderVar bool) {
626
627	xNotebookSetShowBorder(x.GoPointer(), ShowBorderVar)
628
629}
630
631var xNotebookSetShowTabs func(uintptr, bool)
632
633// Sets whether to show the tabs for the notebook or not.
634func (x *Notebook) SetShowTabs(ShowTabsVar bool) {
635
636	xNotebookSetShowTabs(x.GoPointer(), ShowTabsVar)
637
638}
639
640var xNotebookSetTabDetachable func(uintptr, uintptr, bool)
641
642// Sets whether the tab can be detached from @notebook to another
643// notebook or widget.
644//
645// Note that two notebooks must share a common group identifier
646// (see [method@Gtk.Notebook.set_group_name]) to allow automatic tabs
647// interchange between them.
648//
649// If you want a widget to interact with a notebook through DnD
650// (i.e.: accept dragged tabs from it) it must be set as a drop
651// destination by adding to it a [class@Gtk.DropTarget] controller that accepts
652// the GType `GTK_TYPE_NOTEBOOK_PAGE`. The `:value` of said drop target will be
653// preloaded with a [class@Gtk.NotebookPage] object that corresponds to the
654// dropped tab, so you can process the value via `::accept` or `::drop` signals.
655//
656// Note that you should use [method@Gtk.Notebook.detach_tab] instead
657// of [method@Gtk.Notebook.remove_page] if you want to remove the tab
658// from the source notebook as part of accepting a drop. Otherwise,
659// the source notebook will think that the dragged tab was removed
660// from underneath the ongoing drag operation, and will initiate a
661// drag cancel animation.
662//
663// ```c
664// static void
665// on_drag_data_received (GtkWidget        *widget,
666//
667//	GdkDrop          *drop,
668//	GtkSelectionData *data,
669//	guint             time,
670//	gpointer          user_data)
671//
672//	{
673//	  GtkDrag *drag;
674//	  GtkWidget *notebook;
675//	  GtkWidget **child;
676//
677//	  drag = gtk_drop_get_drag (drop);
678//	  notebook = g_object_get_data (drag, "gtk-notebook-drag-origin");
679//	  child = (void*) gtk_selection_data_get_data (data);
680//
681//	  // process_widget (*child);
682//
683//	  gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *child);
684//	}
685//
686// ```
687//
688// If you want a notebook to accept drags from other widgets,
689// you will have to set your own DnD code to do it.
690func (x *Notebook) SetTabDetachable(ChildVar *Widget, DetachableVar bool) {
691
692	xNotebookSetTabDetachable(x.GoPointer(), ChildVar.GoPointer(), DetachableVar)
693
694}
695
696var xNotebookSetTabLabel func(uintptr, uintptr, uintptr)
697
698// Changes the tab label for @child.
699//
700// If %NULL is specified for @tab_label, then the page will
701// have the label “page N”.
702func (x *Notebook) SetTabLabel(ChildVar *Widget, TabLabelVar *Widget) {
703
704	xNotebookSetTabLabel(x.GoPointer(), ChildVar.GoPointer(), TabLabelVar.GoPointer())
705
706}
707
708var xNotebookSetTabLabelText func(uintptr, uintptr, string)
709
710// Creates a new label and sets it as the tab label for the page
711// containing @child.
712func (x *Notebook) SetTabLabelText(ChildVar *Widget, TabTextVar string) {
713
714	xNotebookSetTabLabelText(x.GoPointer(), ChildVar.GoPointer(), TabTextVar)
715
716}
717
718var xNotebookSetTabPos func(uintptr, PositionType)
719
720// Sets the edge at which the tabs are drawn.
721func (x *Notebook) SetTabPos(PosVar PositionType) {
722
723	xNotebookSetTabPos(x.GoPointer(), PosVar)
724
725}
726
727var xNotebookSetTabReorderable func(uintptr, uintptr, bool)
728
729// Sets whether the notebook tab can be reordered
730// via drag and drop or not.
731func (x *Notebook) SetTabReorderable(ChildVar *Widget, ReorderableVar bool) {
732
733	xNotebookSetTabReorderable(x.GoPointer(), ChildVar.GoPointer(), ReorderableVar)
734
735}
736
737func (c *Notebook) GoPointer() uintptr {
738	if c == nil {
739		return 0
740	}
741	return c.Ptr
742}
743
744func (c *Notebook) SetGoPointer(ptr uintptr) {
745	c.Ptr = ptr
746}
747
748// SetPropertyEnablePopup sets the "enable-popup" property.
749// If %TRUE, pressing the right mouse button on the notebook shows a page switching menu.
750func (x *Notebook) SetPropertyEnablePopup(value bool) {
751	var v gobject.Value
752	v.Init(gobject.TypeBooleanVal)
753	v.SetBoolean(value)
754	x.SetProperty("enable-popup", &v)
755}
756
757// GetPropertyEnablePopup gets the "enable-popup" property.
758// If %TRUE, pressing the right mouse button on the notebook shows a page switching menu.
759func (x *Notebook) GetPropertyEnablePopup() bool {
760	var v gobject.Value
761	x.GetProperty("enable-popup", &v)
762	return v.GetBoolean()
763}
764
765// SetPropertyGroupName sets the "group-name" property.
766// Group name for tab drag and drop.
767func (x *Notebook) SetPropertyGroupName(value string) {
768	var v gobject.Value
769	v.Init(gobject.TypeStringVal)
770	v.SetString(&value)
771	x.SetProperty("group-name", &v)
772}
773
774// GetPropertyGroupName gets the "group-name" property.
775// Group name for tab drag and drop.
776func (x *Notebook) GetPropertyGroupName() string {
777	var v gobject.Value
778	x.GetProperty("group-name", &v)
779	return v.GetString()
780}
781
782// SetPropertyPage sets the "page" property.
783// The index of the current page.
784func (x *Notebook) SetPropertyPage(value int) {
785	var v gobject.Value
786	v.Init(gobject.TypeIntVal)
787	v.SetInt(value)
788	x.SetProperty("page", &v)
789}
790
791// GetPropertyPage gets the "page" property.
792// The index of the current page.
793func (x *Notebook) GetPropertyPage() int {
794	var v gobject.Value
795	x.GetProperty("page", &v)
796	return v.GetInt()
797}
798
799// SetPropertyScrollable sets the "scrollable" property.
800// If %TRUE, scroll arrows are added if there are too many pages to fit.
801func (x *Notebook) SetPropertyScrollable(value bool) {
802	var v gobject.Value
803	v.Init(gobject.TypeBooleanVal)
804	v.SetBoolean(value)
805	x.SetProperty("scrollable", &v)
806}
807
808// GetPropertyScrollable gets the "scrollable" property.
809// If %TRUE, scroll arrows are added if there are too many pages to fit.
810func (x *Notebook) GetPropertyScrollable() bool {
811	var v gobject.Value
812	x.GetProperty("scrollable", &v)
813	return v.GetBoolean()
814}
815
816// SetPropertyShowBorder sets the "show-border" property.
817// Whether the border should be shown.
818func (x *Notebook) SetPropertyShowBorder(value bool) {
819	var v gobject.Value
820	v.Init(gobject.TypeBooleanVal)
821	v.SetBoolean(value)
822	x.SetProperty("show-border", &v)
823}
824
825// GetPropertyShowBorder gets the "show-border" property.
826// Whether the border should be shown.
827func (x *Notebook) GetPropertyShowBorder() bool {
828	var v gobject.Value
829	x.GetProperty("show-border", &v)
830	return v.GetBoolean()
831}
832
833// SetPropertyShowTabs sets the "show-tabs" property.
834// Whether tabs should be shown.
835func (x *Notebook) SetPropertyShowTabs(value bool) {
836	var v gobject.Value
837	v.Init(gobject.TypeBooleanVal)
838	v.SetBoolean(value)
839	x.SetProperty("show-tabs", &v)
840}
841
842// GetPropertyShowTabs gets the "show-tabs" property.
843// Whether tabs should be shown.
844func (x *Notebook) GetPropertyShowTabs() bool {
845	var v gobject.Value
846	x.GetProperty("show-tabs", &v)
847	return v.GetBoolean()
848}
849
850// Emitted when the current page should be changed.
851//
852// The default bindings for this signal are
853// <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>PgUp</kbd>,
854// <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>PgDn</kbd>,
855// <kbd>Ctrl</kbd>+<kbd>PgUp</kbd> and <kbd>Ctrl</kbd>+<kbd>PgDn</kbd>.
856func (x *Notebook) ConnectChangeCurrentPage(cb *func(Notebook, int) bool) uint {
857	cbPtr := uintptr(unsafe.Pointer(cb))
858	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
859		handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)
860		glib.SaveHandlerMapping(handlerID, cbPtr)
861		return handlerID
862	}
863
864	fcb := func(clsPtr uintptr, PageVarp int) bool {
865		fa := Notebook{}
866		fa.Ptr = clsPtr
867		cbFn := *cb
868
869		return cbFn(fa, PageVarp)
870
871	}
872	cbRefPtr := purego.NewCallback(fcb)
873	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
874	handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)
875	glib.SaveHandlerMapping(handlerID, cbPtr)
876	return handlerID
877}
878
879// The ::create-window signal is emitted when a detachable
880// tab is dropped on the root window.
881//
882// A handler for this signal can create a window containing
883// a notebook where the tab will be attached. It is also
884// responsible for moving/resizing the window and adding the
885// necessary properties to the notebook (e.g. the
886// `GtkNotebook`:group-name ).
887func (x *Notebook) ConnectCreateWindow(cb *func(Notebook, uintptr) Notebook) uint {
888	cbPtr := uintptr(unsafe.Pointer(cb))
889	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
890		handlerID := gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)
891		glib.SaveHandlerMapping(handlerID, cbPtr)
892		return handlerID
893	}
894
895	fcb := func(clsPtr uintptr, PageVarp uintptr) uintptr {
896		fa := Notebook{}
897		fa.Ptr = clsPtr
898		cbFn := *cb
899
900		CreateWindowCls := cbFn(fa, PageVarp)
901		return CreateWindowCls.Ptr
902
903	}
904	cbRefPtr := purego.NewCallback(fcb)
905	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
906	handlerID := gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)
907	glib.SaveHandlerMapping(handlerID, cbPtr)
908	return handlerID
909}
910
911// Emitted when a tab should be focused.
912func (x *Notebook) ConnectFocusTab(cb *func(Notebook, NotebookTab) bool) uint {
913	cbPtr := uintptr(unsafe.Pointer(cb))
914	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
915		handlerID := gobject.SignalConnect(x.GoPointer(), "focus-tab", cbRefPtr)
916		glib.SaveHandlerMapping(handlerID, cbPtr)
917		return handlerID
918	}
919
920	fcb := func(clsPtr uintptr, TabVarp NotebookTab) bool {
921		fa := Notebook{}
922		fa.Ptr = clsPtr
923		cbFn := *cb
924
925		return cbFn(fa, TabVarp)
926
927	}
928	cbRefPtr := purego.NewCallback(fcb)
929	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
930	handlerID := gobject.SignalConnect(x.GoPointer(), "focus-tab", cbRefPtr)
931	glib.SaveHandlerMapping(handlerID, cbPtr)
932	return handlerID
933}
934
935// Emitted when focus was moved out.
936//
937// The default bindings for this signal are
938// <kbd>Ctrl</kbd>+<kbd>Tab</kbd>,
939// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Tab</kbd>,
940// <kbd>Ctrl</kbd>+<kbd>←</kbd>, <kbd>Ctrl</kbd>+<kbd>→</kbd>,
941// <kbd>Ctrl</kbd>+<kbd>↑</kbd> and <kbd>Ctrl</kbd>+<kbd>↓</kbd>.
942func (x *Notebook) ConnectMoveFocusOut(cb *func(Notebook, DirectionType)) uint {
943	cbPtr := uintptr(unsafe.Pointer(cb))
944	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
945		handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)
946		glib.SaveHandlerMapping(handlerID, cbPtr)
947		return handlerID
948	}
949
950	fcb := func(clsPtr uintptr, DirectionVarp DirectionType) {
951		fa := Notebook{}
952		fa.Ptr = clsPtr
953		cbFn := *cb
954
955		cbFn(fa, DirectionVarp)
956
957	}
958	cbRefPtr := purego.NewCallback(fcb)
959	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
960	handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)
961	glib.SaveHandlerMapping(handlerID, cbPtr)
962	return handlerID
963}
964
965// the ::page-added signal is emitted in the notebook
966// right after a page is added to the notebook.
967func (x *Notebook) ConnectPageAdded(cb *func(Notebook, uintptr, uint)) uint {
968	cbPtr := uintptr(unsafe.Pointer(cb))
969	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
970		handlerID := gobject.SignalConnect(x.GoPointer(), "page-added", cbRefPtr)
971		glib.SaveHandlerMapping(handlerID, cbPtr)
972		return handlerID
973	}
974
975	fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {
976		fa := Notebook{}
977		fa.Ptr = clsPtr
978		cbFn := *cb
979
980		cbFn(fa, ChildVarp, PageNumVarp)
981
982	}
983	cbRefPtr := purego.NewCallback(fcb)
984	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
985	handlerID := gobject.SignalConnect(x.GoPointer(), "page-added", cbRefPtr)
986	glib.SaveHandlerMapping(handlerID, cbPtr)
987	return handlerID
988}
989
990// the ::page-removed signal is emitted in the notebook
991// right after a page is removed from the notebook.
992func (x *Notebook) ConnectPageRemoved(cb *func(Notebook, uintptr, uint)) uint {
993	cbPtr := uintptr(unsafe.Pointer(cb))
994	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
995		handlerID := gobject.SignalConnect(x.GoPointer(), "page-removed", cbRefPtr)
996		glib.SaveHandlerMapping(handlerID, cbPtr)
997		return handlerID
998	}
999
1000	fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {
1001		fa := Notebook{}
1002		fa.Ptr = clsPtr
1003		cbFn := *cb
1004
1005		cbFn(fa, ChildVarp, PageNumVarp)
1006
1007	}
1008	cbRefPtr := purego.NewCallback(fcb)
1009	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1010	handlerID := gobject.SignalConnect(x.GoPointer(), "page-removed", cbRefPtr)
1011	glib.SaveHandlerMapping(handlerID, cbPtr)
1012	return handlerID
1013}
1014
1015// the ::page-reordered signal is emitted in the notebook
1016// right after a page has been reordered.
1017func (x *Notebook) ConnectPageReordered(cb *func(Notebook, uintptr, uint)) uint {
1018	cbPtr := uintptr(unsafe.Pointer(cb))
1019	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1020		handlerID := gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)
1021		glib.SaveHandlerMapping(handlerID, cbPtr)
1022		return handlerID
1023	}
1024
1025	fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {
1026		fa := Notebook{}
1027		fa.Ptr = clsPtr
1028		cbFn := *cb
1029
1030		cbFn(fa, ChildVarp, PageNumVarp)
1031
1032	}
1033	cbRefPtr := purego.NewCallback(fcb)
1034	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1035	handlerID := gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)
1036	glib.SaveHandlerMapping(handlerID, cbPtr)
1037	return handlerID
1038}
1039
1040// Emitted when the tab should be reordered.
1041//
1042// The default bindings for this signal are
1043// <kbd>Alt</kbd>+<kbd>Home</kbd>, <kbd>Alt</kbd>+<kbd>End</kbd>,
1044// <kbd>Alt</kbd>+<kbd>PgUp</kbd>, <kbd>Alt</kbd>+<kbd>PgDn</kbd>,
1045// <kbd>Alt</kbd>+<kbd>←</kbd>, <kbd>Alt</kbd>+<kbd>→</kbd>,
1046// <kbd>Alt</kbd>+<kbd>↑</kbd> and <kbd>Alt</kbd>+<kbd>↓</kbd>.
1047func (x *Notebook) ConnectReorderTab(cb *func(Notebook, DirectionType, bool) bool) uint {
1048	cbPtr := uintptr(unsafe.Pointer(cb))
1049	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1050		handlerID := gobject.SignalConnect(x.GoPointer(), "reorder-tab", cbRefPtr)
1051		glib.SaveHandlerMapping(handlerID, cbPtr)
1052		return handlerID
1053	}
1054
1055	fcb := func(clsPtr uintptr, DirectionVarp DirectionType, MoveToLastVarp bool) bool {
1056		fa := Notebook{}
1057		fa.Ptr = clsPtr
1058		cbFn := *cb
1059
1060		return cbFn(fa, DirectionVarp, MoveToLastVarp)
1061
1062	}
1063	cbRefPtr := purego.NewCallback(fcb)
1064	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1065	handlerID := gobject.SignalConnect(x.GoPointer(), "reorder-tab", cbRefPtr)
1066	glib.SaveHandlerMapping(handlerID, cbPtr)
1067	return handlerID
1068}
1069
1070// Emitted when a page should be selected.
1071//
1072// The default binding for this signal is <kbd>␣</kbd>.
1073func (x *Notebook) ConnectSelectPage(cb *func(Notebook, bool) bool) uint {
1074	cbPtr := uintptr(unsafe.Pointer(cb))
1075	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1076		handlerID := gobject.SignalConnect(x.GoPointer(), "select-page", cbRefPtr)
1077		glib.SaveHandlerMapping(handlerID, cbPtr)
1078		return handlerID
1079	}
1080
1081	fcb := func(clsPtr uintptr, MoveFocusVarp bool) bool {
1082		fa := Notebook{}
1083		fa.Ptr = clsPtr
1084		cbFn := *cb
1085
1086		return cbFn(fa, MoveFocusVarp)
1087
1088	}
1089	cbRefPtr := purego.NewCallback(fcb)
1090	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1091	handlerID := gobject.SignalConnect(x.GoPointer(), "select-page", cbRefPtr)
1092	glib.SaveHandlerMapping(handlerID, cbPtr)
1093	return handlerID
1094}
1095
1096// Emitted when the user or a function changes the current page.
1097func (x *Notebook) ConnectSwitchPage(cb *func(Notebook, uintptr, uint)) uint {
1098	cbPtr := uintptr(unsafe.Pointer(cb))
1099	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1100		handlerID := gobject.SignalConnect(x.GoPointer(), "switch-page", cbRefPtr)
1101		glib.SaveHandlerMapping(handlerID, cbPtr)
1102		return handlerID
1103	}
1104
1105	fcb := func(clsPtr uintptr, PageVarp uintptr, PageNumVarp uint) {
1106		fa := Notebook{}
1107		fa.Ptr = clsPtr
1108		cbFn := *cb
1109
1110		cbFn(fa, PageVarp, PageNumVarp)
1111
1112	}
1113	cbRefPtr := purego.NewCallback(fcb)
1114	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1115	handlerID := gobject.SignalConnect(x.GoPointer(), "switch-page", cbRefPtr)
1116	glib.SaveHandlerMapping(handlerID, cbPtr)
1117	return handlerID
1118}
1119
1120// Requests the user's screen reader to announce the given message.
1121//
1122// This kind of notification is useful for messages that
1123// either have only a visual representation or that are not
1124// exposed visually at all, e.g. a notification about a
1125// successful operation.
1126//
1127// Also, by using this API, you can ensure that the message
1128// does not interrupts the user's current screen reader output.
1129func (x *Notebook) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
1130
1131	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
1132
1133}
1134
1135// Retrieves the accessible parent for an accessible object.
1136//
1137// This function returns `NULL` for top level widgets.
1138func (x *Notebook) GetAccessibleParent() *AccessibleBase {
1139	var cls *AccessibleBase
1140
1141	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
1142
1143	if cret == 0 {
1144		return nil
1145	}
1146	cls = &AccessibleBase{}
1147	cls.Ptr = cret
1148	return cls
1149}
1150
1151// Retrieves the accessible role of an accessible object.
1152func (x *Notebook) GetAccessibleRole() AccessibleRole {
1153
1154	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
1155	return cret
1156}
1157
1158// Retrieves the implementation for the given accessible object.
1159func (x *Notebook) GetAtContext() *ATContext {
1160	var cls *ATContext
1161
1162	cret := XGtkAccessibleGetAtContext(x.GoPointer())
1163
1164	if cret == 0 {
1165		return nil
1166	}
1167	cls = &ATContext{}
1168	cls.Ptr = cret
1169	return cls
1170}
1171
1172// Queries the coordinates and dimensions of this accessible
1173//
1174// This functionality can be overridden by `GtkAccessible`
1175// implementations, e.g. to get the bounds from an ignored
1176// child widget.
1177func (x *Notebook) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
1178
1179	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
1180	return cret
1181}
1182
1183// Retrieves the first accessible child of an accessible object.
1184func (x *Notebook) GetFirstAccessibleChild() *AccessibleBase {
1185	var cls *AccessibleBase
1186
1187	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
1188
1189	if cret == 0 {
1190		return nil
1191	}
1192	cls = &AccessibleBase{}
1193	cls.Ptr = cret
1194	return cls
1195}
1196
1197// Retrieves the next accessible sibling of an accessible object
1198func (x *Notebook) GetNextAccessibleSibling() *AccessibleBase {
1199	var cls *AccessibleBase
1200
1201	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
1202
1203	if cret == 0 {
1204		return nil
1205	}
1206	cls = &AccessibleBase{}
1207	cls.Ptr = cret
1208	return cls
1209}
1210
1211// Queries a platform state, such as focus.
1212//
1213// This functionality can be overridden by `GtkAccessible`
1214// implementations, e.g. to get platform state from an ignored
1215// child widget, as is the case for `GtkText` wrappers.
1216func (x *Notebook) GetPlatformState(StateVar AccessiblePlatformState) bool {
1217
1218	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
1219	return cret
1220}
1221
1222// Resets the accessible property to its default value.
1223func (x *Notebook) ResetProperty(PropertyVar AccessibleProperty) {
1224
1225	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
1226
1227}
1228
1229// Resets the accessible relation to its default value.
1230func (x *Notebook) ResetRelation(RelationVar AccessibleRelation) {
1231
1232	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
1233
1234}
1235
1236// Resets the accessible state to its default value.
1237func (x *Notebook) ResetState(StateVar AccessibleState) {
1238
1239	XGtkAccessibleResetState(x.GoPointer(), StateVar)
1240
1241}
1242
1243// Sets the parent and sibling of an accessible object.
1244//
1245// This function is meant to be used by accessible implementations that are
1246// not part of the widget hierarchy, and but act as a logical bridge between
1247// widgets. For instance, if a widget creates an object that holds metadata
1248// for each child, and you want that object to implement the `GtkAccessible`
1249// interface, you will use this function to ensure that the parent of each
1250// child widget is the metadata object, and the parent of each metadata
1251// object is the container widget.
1252func (x *Notebook) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
1253
1254	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
1255
1256}
1257
1258// Updates the next accessible sibling.
1259//
1260// That might be useful when a new child of a custom accessible
1261// is created, and it needs to be linked to a previous child.
1262func (x *Notebook) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
1263
1264	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
1265
1266}
1267
1268// Informs ATs that the platform state has changed.
1269//
1270// This function should be used by `GtkAccessible` implementations that
1271// have a platform state but are not widgets. Widgets handle platform
1272// states automatically.
1273func (x *Notebook) UpdatePlatformState(StateVar AccessiblePlatformState) {
1274
1275	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
1276
1277}
1278
1279// Updates a list of accessible properties.
1280//
1281// See the [enum@Gtk.AccessibleProperty] documentation for the
1282// value types of accessible properties.
1283//
1284// This function should be called by `GtkWidget` types whenever
1285// an accessible property change must be communicated to assistive
1286// technologies.
1287//
1288// Example:
1289// ```c
1290// value = gtk_adjustment_get_value (adjustment);
1291// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1292//
1293//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1294//	-1);
1295//
1296// ```
1297func (x *Notebook) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
1298
1299	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1300
1301}
1302
1303// Updates an array of accessible properties.
1304//
1305// This function should be called by `GtkWidget` types whenever an accessible
1306// property change must be communicated to assistive technologies.
1307//
1308// This function is meant to be used by language bindings.
1309func (x *Notebook) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
1310
1311	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1312
1313}
1314
1315// Updates a list of accessible relations.
1316//
1317// This function should be called by `GtkWidget` types whenever an accessible
1318// relation change must be communicated to assistive technologies.
1319//
1320// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1321// you should pass each reference individually, followed by `NULL`, e.g.
1322//
1323// ```c
1324// gtk_accessible_update_relation (accessible,
1325//
1326//	GTK_ACCESSIBLE_RELATION_CONTROLS,
1327//	  ref1, NULL,
1328//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1329//	  ref1, ref2, ref3, NULL,
1330//	-1);
1331//
1332// ```
1333func (x *Notebook) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
1334
1335	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1336
1337}
1338
1339// Updates an array of accessible relations.
1340//
1341// This function should be called by `GtkWidget` types whenever an accessible
1342// relation change must be communicated to assistive technologies.
1343//
1344// This function is meant to be used by language bindings.
1345func (x *Notebook) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
1346
1347	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1348
1349}
1350
1351// Updates a list of accessible states.
1352//
1353// See the [enum@Gtk.AccessibleState] documentation for the
1354// value types of accessible states.
1355//
1356// This function should be called by `GtkWidget` types whenever
1357// an accessible state change must be communicated to assistive
1358// technologies.
1359//
1360// Example:
1361//
1362// ```c
1363// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1364// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1365//
1366//	GTK_ACCESSIBLE_STATE_CHECKED, value,
1367//	-1);
1368//
1369// ```
1370func (x *Notebook) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
1371
1372	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1373
1374}
1375
1376// Updates an array of accessible states.
1377//
1378// This function should be called by `GtkWidget` types whenever an accessible
1379// state change must be communicated to assistive technologies.
1380//
1381// This function is meant to be used by language bindings.
1382func (x *Notebook) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
1383
1384	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1385
1386}
1387
1388// Gets the ID of the @buildable object.
1389//
1390// `GtkBuilder` sets the name based on the ID attribute
1391// of the `<object>` tag used to construct the @buildable.
1392func (x *Notebook) GetBuildableId() string {
1393
1394	cret := XGtkBuildableGetBuildableId(x.GoPointer())
1395	return cret
1396}
1397
1398// An auxiliary object used by `GtkNotebook`.
1399type NotebookPage struct {
1400	gobject.Object
1401}
1402
1403var xNotebookPageGLibType func() types.GType
1404
1405func NotebookPageGLibType() types.GType {
1406	return xNotebookPageGLibType()
1407}
1408
1409func NotebookPageNewFromInternalPtr(ptr uintptr) *NotebookPage {
1410	cls := &NotebookPage{}
1411	cls.Ptr = ptr
1412	return cls
1413}
1414
1415var xNotebookPageGetChild func(uintptr) uintptr
1416
1417// Returns the notebook child to which @page belongs.
1418func (x *NotebookPage) GetChild() *Widget {
1419	var cls *Widget
1420
1421	cret := xNotebookPageGetChild(x.GoPointer())
1422
1423	if cret == 0 {
1424		return nil
1425	}
1426	gobject.IncreaseRef(cret)
1427	cls = &Widget{}
1428	cls.Ptr = cret
1429	return cls
1430}
1431
1432func (c *NotebookPage) GoPointer() uintptr {
1433	if c == nil {
1434		return 0
1435	}
1436	return c.Ptr
1437}
1438
1439func (c *NotebookPage) SetGoPointer(ptr uintptr) {
1440	c.Ptr = ptr
1441}
1442
1443// SetPropertyDetachable sets the "detachable" property.
1444// Whether the tab is detachable.
1445func (x *NotebookPage) SetPropertyDetachable(value bool) {
1446	var v gobject.Value
1447	v.Init(gobject.TypeBooleanVal)
1448	v.SetBoolean(value)
1449	x.SetProperty("detachable", &v)
1450}
1451
1452// GetPropertyDetachable gets the "detachable" property.
1453// Whether the tab is detachable.
1454func (x *NotebookPage) GetPropertyDetachable() bool {
1455	var v gobject.Value
1456	x.GetProperty("detachable", &v)
1457	return v.GetBoolean()
1458}
1459
1460// SetPropertyMenuLabel sets the "menu-label" property.
1461// The text of the menu widget.
1462func (x *NotebookPage) SetPropertyMenuLabel(value string) {
1463	var v gobject.Value
1464	v.Init(gobject.TypeStringVal)
1465	v.SetString(&value)
1466	x.SetProperty("menu-label", &v)
1467}
1468
1469// GetPropertyMenuLabel gets the "menu-label" property.
1470// The text of the menu widget.
1471func (x *NotebookPage) GetPropertyMenuLabel() string {
1472	var v gobject.Value
1473	x.GetProperty("menu-label", &v)
1474	return v.GetString()
1475}
1476
1477// SetPropertyPosition sets the "position" property.
1478// The index of the child in the parent.
1479func (x *NotebookPage) SetPropertyPosition(value int) {
1480	var v gobject.Value
1481	v.Init(gobject.TypeIntVal)
1482	v.SetInt(value)
1483	x.SetProperty("position", &v)
1484}
1485
1486// GetPropertyPosition gets the "position" property.
1487// The index of the child in the parent.
1488func (x *NotebookPage) GetPropertyPosition() int {
1489	var v gobject.Value
1490	x.GetProperty("position", &v)
1491	return v.GetInt()
1492}
1493
1494// SetPropertyReorderable sets the "reorderable" property.
1495// Whether the tab is reorderable by user action.
1496func (x *NotebookPage) SetPropertyReorderable(value bool) {
1497	var v gobject.Value
1498	v.Init(gobject.TypeBooleanVal)
1499	v.SetBoolean(value)
1500	x.SetProperty("reorderable", &v)
1501}
1502
1503// GetPropertyReorderable gets the "reorderable" property.
1504// Whether the tab is reorderable by user action.
1505func (x *NotebookPage) GetPropertyReorderable() bool {
1506	var v gobject.Value
1507	x.GetProperty("reorderable", &v)
1508	return v.GetBoolean()
1509}
1510
1511// SetPropertyTabExpand sets the "tab-expand" property.
1512// Whether to expand the child's tab.
1513func (x *NotebookPage) SetPropertyTabExpand(value bool) {
1514	var v gobject.Value
1515	v.Init(gobject.TypeBooleanVal)
1516	v.SetBoolean(value)
1517	x.SetProperty("tab-expand", &v)
1518}
1519
1520// GetPropertyTabExpand gets the "tab-expand" property.
1521// Whether to expand the child's tab.
1522func (x *NotebookPage) GetPropertyTabExpand() bool {
1523	var v gobject.Value
1524	x.GetProperty("tab-expand", &v)
1525	return v.GetBoolean()
1526}
1527
1528// SetPropertyTabFill sets the "tab-fill" property.
1529// Whether the child's tab should fill the allocated area.
1530func (x *NotebookPage) SetPropertyTabFill(value bool) {
1531	var v gobject.Value
1532	v.Init(gobject.TypeBooleanVal)
1533	v.SetBoolean(value)
1534	x.SetProperty("tab-fill", &v)
1535}
1536
1537// GetPropertyTabFill gets the "tab-fill" property.
1538// Whether the child's tab should fill the allocated area.
1539func (x *NotebookPage) GetPropertyTabFill() bool {
1540	var v gobject.Value
1541	x.GetProperty("tab-fill", &v)
1542	return v.GetBoolean()
1543}
1544
1545// SetPropertyTabLabel sets the "tab-label" property.
1546// The text of the tab widget.
1547func (x *NotebookPage) SetPropertyTabLabel(value string) {
1548	var v gobject.Value
1549	v.Init(gobject.TypeStringVal)
1550	v.SetString(&value)
1551	x.SetProperty("tab-label", &v)
1552}
1553
1554// GetPropertyTabLabel gets the "tab-label" property.
1555// The text of the tab widget.
1556func (x *NotebookPage) GetPropertyTabLabel() string {
1557	var v gobject.Value
1558	x.GetProperty("tab-label", &v)
1559	return v.GetString()
1560}
1561
1562func init() {
1563	core.SetPackageName("GTK", "gtk4")
1564	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
1565	var libs []uintptr
1566	for _, libPath := range core.GetPaths("GTK") {
1567		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1568		if err != nil {
1569			panic(err)
1570		}
1571		libs = append(libs, lib)
1572	}
1573
1574	core.PuregoSafeRegister(&xNotebookTabGLibType, libs, "gtk_notebook_tab_get_type")
1575
1576	core.PuregoSafeRegister(&xNotebookGLibType, libs, "gtk_notebook_get_type")
1577
1578	core.PuregoSafeRegister(&xNewNotebook, libs, "gtk_notebook_new")
1579
1580	core.PuregoSafeRegister(&xNotebookAppendPage, libs, "gtk_notebook_append_page")
1581	core.PuregoSafeRegister(&xNotebookAppendPageMenu, libs, "gtk_notebook_append_page_menu")
1582	core.PuregoSafeRegister(&xNotebookDetachTab, libs, "gtk_notebook_detach_tab")
1583	core.PuregoSafeRegister(&xNotebookGetActionWidget, libs, "gtk_notebook_get_action_widget")
1584	core.PuregoSafeRegister(&xNotebookGetCurrentPage, libs, "gtk_notebook_get_current_page")
1585	core.PuregoSafeRegister(&xNotebookGetGroupName, libs, "gtk_notebook_get_group_name")
1586	core.PuregoSafeRegister(&xNotebookGetMenuLabel, libs, "gtk_notebook_get_menu_label")
1587	core.PuregoSafeRegister(&xNotebookGetMenuLabelText, libs, "gtk_notebook_get_menu_label_text")
1588	core.PuregoSafeRegister(&xNotebookGetNPages, libs, "gtk_notebook_get_n_pages")
1589	core.PuregoSafeRegister(&xNotebookGetNthPage, libs, "gtk_notebook_get_nth_page")
1590	core.PuregoSafeRegister(&xNotebookGetPage, libs, "gtk_notebook_get_page")
1591	core.PuregoSafeRegister(&xNotebookGetPages, libs, "gtk_notebook_get_pages")
1592	core.PuregoSafeRegister(&xNotebookGetScrollable, libs, "gtk_notebook_get_scrollable")
1593	core.PuregoSafeRegister(&xNotebookGetShowBorder, libs, "gtk_notebook_get_show_border")
1594	core.PuregoSafeRegister(&xNotebookGetShowTabs, libs, "gtk_notebook_get_show_tabs")
1595	core.PuregoSafeRegister(&xNotebookGetTabDetachable, libs, "gtk_notebook_get_tab_detachable")
1596	core.PuregoSafeRegister(&xNotebookGetTabLabel, libs, "gtk_notebook_get_tab_label")
1597	core.PuregoSafeRegister(&xNotebookGetTabLabelText, libs, "gtk_notebook_get_tab_label_text")
1598	core.PuregoSafeRegister(&xNotebookGetTabPos, libs, "gtk_notebook_get_tab_pos")
1599	core.PuregoSafeRegister(&xNotebookGetTabReorderable, libs, "gtk_notebook_get_tab_reorderable")
1600	core.PuregoSafeRegister(&xNotebookInsertPage, libs, "gtk_notebook_insert_page")
1601	core.PuregoSafeRegister(&xNotebookInsertPageMenu, libs, "gtk_notebook_insert_page_menu")
1602	core.PuregoSafeRegister(&xNotebookNextPage, libs, "gtk_notebook_next_page")
1603	core.PuregoSafeRegister(&xNotebookPageNum, libs, "gtk_notebook_page_num")
1604	core.PuregoSafeRegister(&xNotebookPopupDisable, libs, "gtk_notebook_popup_disable")
1605	core.PuregoSafeRegister(&xNotebookPopupEnable, libs, "gtk_notebook_popup_enable")
1606	core.PuregoSafeRegister(&xNotebookPrependPage, libs, "gtk_notebook_prepend_page")
1607	core.PuregoSafeRegister(&xNotebookPrependPageMenu, libs, "gtk_notebook_prepend_page_menu")
1608	core.PuregoSafeRegister(&xNotebookPrevPage, libs, "gtk_notebook_prev_page")
1609	core.PuregoSafeRegister(&xNotebookRemovePage, libs, "gtk_notebook_remove_page")
1610	core.PuregoSafeRegister(&xNotebookReorderChild, libs, "gtk_notebook_reorder_child")
1611	core.PuregoSafeRegister(&xNotebookSetActionWidget, libs, "gtk_notebook_set_action_widget")
1612	core.PuregoSafeRegister(&xNotebookSetCurrentPage, libs, "gtk_notebook_set_current_page")
1613	core.PuregoSafeRegister(&xNotebookSetGroupName, libs, "gtk_notebook_set_group_name")
1614	core.PuregoSafeRegister(&xNotebookSetMenuLabel, libs, "gtk_notebook_set_menu_label")
1615	core.PuregoSafeRegister(&xNotebookSetMenuLabelText, libs, "gtk_notebook_set_menu_label_text")
1616	core.PuregoSafeRegister(&xNotebookSetScrollable, libs, "gtk_notebook_set_scrollable")
1617	core.PuregoSafeRegister(&xNotebookSetShowBorder, libs, "gtk_notebook_set_show_border")
1618	core.PuregoSafeRegister(&xNotebookSetShowTabs, libs, "gtk_notebook_set_show_tabs")
1619	core.PuregoSafeRegister(&xNotebookSetTabDetachable, libs, "gtk_notebook_set_tab_detachable")
1620	core.PuregoSafeRegister(&xNotebookSetTabLabel, libs, "gtk_notebook_set_tab_label")
1621	core.PuregoSafeRegister(&xNotebookSetTabLabelText, libs, "gtk_notebook_set_tab_label_text")
1622	core.PuregoSafeRegister(&xNotebookSetTabPos, libs, "gtk_notebook_set_tab_pos")
1623	core.PuregoSafeRegister(&xNotebookSetTabReorderable, libs, "gtk_notebook_set_tab_reorderable")
1624
1625	core.PuregoSafeRegister(&xNotebookPageGLibType, libs, "gtk_notebook_page_get_type")
1626
1627	core.PuregoSafeRegister(&xNotebookPageGetChild, libs, "gtk_notebook_page_get_child")
1628
1629}

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