v0.2.1 c0399be

gtkfontchooser.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/glib"
12	"github.com/bnema/puregotk/v4/gobject"
13	"github.com/bnema/puregotk/v4/gobject/types"
14	"github.com/bnema/puregotk/v4/pango"
15)
16
17// The type of function that is used for deciding what fonts get
18// shown in a `GtkFontChooser`.
19//
20// See [method@Gtk.FontChooser.set_filter_func].
21type FontFilterFunc func(uintptr, uintptr, uintptr) bool
22
23type FontChooserIface struct {
24	_ structs.HostLayout
25
26	BaseIface uintptr
27
28	xGetFontFamily uintptr
29
30	xGetFontFace uintptr
31
32	xGetFontSize uintptr
33
34	xSetFilterFunc uintptr
35
36	xFontActivated uintptr
37
38	xSetFontMap uintptr
39
40	xGetFontMap uintptr
41
42	Padding [10]uintptr
43}
44
45func (x *FontChooserIface) GoPointer() uintptr {
46	return uintptr(unsafe.Pointer(x))
47}
48
49// OverrideGetFontFamily sets the "get_font_family" callback function.
50func (x *FontChooserIface) OverrideGetFontFamily(cb func(FontChooser) *pango.FontFamily) {
51	if cb == nil {
52		x.xGetFontFamily = 0
53	} else {
54		x.xGetFontFamily = purego.NewCallback(func(FontchooserVarp uintptr) uintptr {
55			ret := cb(&FontChooserBase{Ptr: FontchooserVarp})
56			if ret == nil {
57				return 0
58			}
59			return ret.GoPointer()
60		})
61	}
62}
63
64// GetGetFontFamily gets the "get_font_family" callback function.
65func (x *FontChooserIface) GetGetFontFamily() func(FontChooser) *pango.FontFamily {
66	if x.xGetFontFamily == 0 {
67		return nil
68	}
69	var rawCallback func(FontchooserVarp uintptr) uintptr
70	purego.RegisterFunc(&rawCallback, x.xGetFontFamily)
71	return func(FontchooserVar FontChooser) *pango.FontFamily {
72		rawRet := rawCallback(FontchooserVar.GoPointer())
73		if rawRet == 0 {
74			return nil
75		}
76		ret := &pango.FontFamily{}
77		ret.Ptr = rawRet
78		return ret
79	}
80}
81
82// OverrideGetFontFace sets the "get_font_face" callback function.
83func (x *FontChooserIface) OverrideGetFontFace(cb func(FontChooser) *pango.FontFace) {
84	if cb == nil {
85		x.xGetFontFace = 0
86	} else {
87		x.xGetFontFace = purego.NewCallback(func(FontchooserVarp uintptr) uintptr {
88			ret := cb(&FontChooserBase{Ptr: FontchooserVarp})
89			if ret == nil {
90				return 0
91			}
92			return ret.GoPointer()
93		})
94	}
95}
96
97// GetGetFontFace gets the "get_font_face" callback function.
98func (x *FontChooserIface) GetGetFontFace() func(FontChooser) *pango.FontFace {
99	if x.xGetFontFace == 0 {
100		return nil
101	}
102	var rawCallback func(FontchooserVarp uintptr) uintptr
103	purego.RegisterFunc(&rawCallback, x.xGetFontFace)
104	return func(FontchooserVar FontChooser) *pango.FontFace {
105		rawRet := rawCallback(FontchooserVar.GoPointer())
106		if rawRet == 0 {
107			return nil
108		}
109		ret := &pango.FontFace{}
110		ret.Ptr = rawRet
111		return ret
112	}
113}
114
115// OverrideGetFontSize sets the "get_font_size" callback function.
116func (x *FontChooserIface) OverrideGetFontSize(cb func(FontChooser) int) {
117	if cb == nil {
118		x.xGetFontSize = 0
119	} else {
120		x.xGetFontSize = purego.NewCallback(func(FontchooserVarp uintptr) int {
121			return cb(&FontChooserBase{Ptr: FontchooserVarp})
122		})
123	}
124}
125
126// GetGetFontSize gets the "get_font_size" callback function.
127func (x *FontChooserIface) GetGetFontSize() func(FontChooser) int {
128	if x.xGetFontSize == 0 {
129		return nil
130	}
131	var rawCallback func(FontchooserVarp uintptr) int
132	purego.RegisterFunc(&rawCallback, x.xGetFontSize)
133	return func(FontchooserVar FontChooser) int {
134		return rawCallback(FontchooserVar.GoPointer())
135	}
136}
137
138// OverrideSetFilterFunc sets the "set_filter_func" callback function.
139func (x *FontChooserIface) OverrideSetFilterFunc(cb func(FontChooser, *FontFilterFunc, uintptr, *glib.DestroyNotify)) {
140	if cb == nil {
141		x.xSetFilterFunc = 0
142	} else {
143		x.xSetFilterFunc = purego.NewCallback(func(FontchooserVarp uintptr, FilterVarp uintptr, UserDataVarp uintptr, DestroyVarp uintptr) {
144			cb(&FontChooserBase{Ptr: FontchooserVarp}, (*FontFilterFunc)(unsafe.Pointer(FilterVarp)), UserDataVarp, (*glib.DestroyNotify)(unsafe.Pointer(DestroyVarp)))
145		})
146	}
147}
148
149// GetSetFilterFunc gets the "set_filter_func" callback function.
150func (x *FontChooserIface) GetSetFilterFunc() func(FontChooser, *FontFilterFunc, uintptr, *glib.DestroyNotify) {
151	if x.xSetFilterFunc == 0 {
152		return nil
153	}
154	var rawCallback func(FontchooserVarp uintptr, FilterVarp uintptr, UserDataVarp uintptr, DestroyVarp uintptr)
155	purego.RegisterFunc(&rawCallback, x.xSetFilterFunc)
156	return func(FontchooserVar FontChooser, FilterVar *FontFilterFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) {
157		rawCallback(FontchooserVar.GoPointer(), glib.NewCallbackNullable(FilterVar), UserDataVar, glib.NewCallback(DestroyVar))
158	}
159}
160
161// OverrideFontActivated sets the "font_activated" callback function.
162func (x *FontChooserIface) OverrideFontActivated(cb func(FontChooser, string)) {
163	if cb == nil {
164		x.xFontActivated = 0
165	} else {
166		x.xFontActivated = purego.NewCallback(func(ChooserVarp uintptr, FontnameVarp string) {
167			cb(&FontChooserBase{Ptr: ChooserVarp}, FontnameVarp)
168		})
169	}
170}
171
172// GetFontActivated gets the "font_activated" callback function.
173func (x *FontChooserIface) GetFontActivated() func(FontChooser, string) {
174	if x.xFontActivated == 0 {
175		return nil
176	}
177	var rawCallback func(ChooserVarp uintptr, FontnameVarp string)
178	purego.RegisterFunc(&rawCallback, x.xFontActivated)
179	return func(ChooserVar FontChooser, FontnameVar string) {
180		rawCallback(ChooserVar.GoPointer(), FontnameVar)
181	}
182}
183
184// OverrideSetFontMap sets the "set_font_map" callback function.
185func (x *FontChooserIface) OverrideSetFontMap(cb func(FontChooser, *pango.FontMap)) {
186	if cb == nil {
187		x.xSetFontMap = 0
188	} else {
189		x.xSetFontMap = purego.NewCallback(func(FontchooserVarp uintptr, FontmapVarp uintptr) {
190			cb(&FontChooserBase{Ptr: FontchooserVarp}, pango.FontMapNewFromInternalPtr(FontmapVarp))
191		})
192	}
193}
194
195// GetSetFontMap gets the "set_font_map" callback function.
196func (x *FontChooserIface) GetSetFontMap() func(FontChooser, *pango.FontMap) {
197	if x.xSetFontMap == 0 {
198		return nil
199	}
200	var rawCallback func(FontchooserVarp uintptr, FontmapVarp uintptr)
201	purego.RegisterFunc(&rawCallback, x.xSetFontMap)
202	return func(FontchooserVar FontChooser, FontmapVar *pango.FontMap) {
203		rawCallback(FontchooserVar.GoPointer(), FontmapVar.GoPointer())
204	}
205}
206
207// OverrideGetFontMap sets the "get_font_map" callback function.
208func (x *FontChooserIface) OverrideGetFontMap(cb func(FontChooser) *pango.FontMap) {
209	if cb == nil {
210		x.xGetFontMap = 0
211	} else {
212		x.xGetFontMap = purego.NewCallback(func(FontchooserVarp uintptr) uintptr {
213			ret := cb(&FontChooserBase{Ptr: FontchooserVarp})
214			if ret == nil {
215				return 0
216			}
217			return ret.GoPointer()
218		})
219	}
220}
221
222// GetGetFontMap gets the "get_font_map" callback function.
223func (x *FontChooserIface) GetGetFontMap() func(FontChooser) *pango.FontMap {
224	if x.xGetFontMap == 0 {
225		return nil
226	}
227	var rawCallback func(FontchooserVarp uintptr) uintptr
228	purego.RegisterFunc(&rawCallback, x.xGetFontMap)
229	return func(FontchooserVar FontChooser) *pango.FontMap {
230		rawRet := rawCallback(FontchooserVar.GoPointer())
231		if rawRet == 0 {
232			return nil
233		}
234		ret := &pango.FontMap{}
235		ret.Ptr = rawRet
236		return ret
237	}
238}
239
240// `GtkFontChooser` is an interface that can be implemented by widgets
241// for choosing fonts.
242//
243// In GTK, the main objects that implement this interface are
244// [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and
245// [class@Gtk.FontButton].
246type FontChooser interface {
247	GoPointer() uintptr
248	SetGoPointer(uintptr)
249	GetFont() string
250	GetFontDesc() *pango.FontDescription
251	GetFontFace() *pango.FontFace
252	GetFontFamily() *pango.FontFamily
253	GetFontFeatures() string
254	GetFontMap() *pango.FontMap
255	GetFontSize() int
256	GetLanguage() string
257	GetLevel() FontChooserLevel
258	GetPreviewText() string
259	GetShowPreviewEntry() bool
260	SetFilterFunc(FilterVar *FontFilterFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify)
261	SetFont(FontnameVar string)
262	SetFontDesc(FontDescVar *pango.FontDescription)
263	SetFontMap(FontmapVar *pango.FontMap)
264	SetLanguage(LanguageVar string)
265	SetLevel(LevelVar FontChooserLevel)
266	SetPreviewText(TextVar string)
267	SetShowPreviewEntry(ShowPreviewEntryVar bool)
268}
269
270var xFontChooserGLibType func() types.GType
271
272func FontChooserGLibType() types.GType {
273	return xFontChooserGLibType()
274}
275
276type FontChooserBase struct {
277	Ptr uintptr
278}
279
280func (x *FontChooserBase) GoPointer() uintptr {
281	if x == nil {
282		return 0
283	}
284	return x.Ptr
285}
286
287func (x *FontChooserBase) SetGoPointer(ptr uintptr) {
288	x.Ptr = ptr
289}
290
291// Gets the currently-selected font name.
292//
293// Note that this can be a different string than what you set with
294// [method@Gtk.FontChooser.set_font], as the font chooser widget may
295// normalize font names and thus return a string with a different
296// structure. For example, “Helvetica Italic Bold 12” could be
297// normalized to “Helvetica Bold Italic 12”.
298//
299// Use [method@Pango.FontDescription.equal] if you want to compare two
300// font descriptions.
301func (x *FontChooserBase) GetFont() string {
302
303	cret := XGtkFontChooserGetFont(x.GoPointer())
304	return cret
305}
306
307// Gets the currently-selected font.
308//
309// Note that this can be a different string than what you set with
310// [method@Gtk.FontChooser.set_font], as the font chooser widget may
311// normalize font names and thus return a string with a different
312// structure. For example, “Helvetica Italic Bold 12” could be
313// normalized to “Helvetica Bold Italic 12”.
314//
315// Use [method@Pango.FontDescription.equal] if you want to compare two
316// font descriptions.
317func (x *FontChooserBase) GetFontDesc() *pango.FontDescription {
318
319	cret := XGtkFontChooserGetFontDesc(x.GoPointer())
320	return cret
321}
322
323// Gets the `PangoFontFace` representing the selected font group
324// details (i.e. family, slant, weight, width, etc).
325//
326// If the selected font is not installed, returns %NULL.
327func (x *FontChooserBase) GetFontFace() *pango.FontFace {
328	var cls *pango.FontFace
329
330	cret := XGtkFontChooserGetFontFace(x.GoPointer())
331
332	if cret == 0 {
333		return nil
334	}
335	gobject.IncreaseRef(cret)
336	cls = &pango.FontFace{}
337	cls.Ptr = cret
338	return cls
339}
340
341// Gets the `PangoFontFamily` representing the selected font family.
342//
343// Font families are a collection of font faces.
344//
345// If the selected font is not installed, returns %NULL.
346func (x *FontChooserBase) GetFontFamily() *pango.FontFamily {
347	var cls *pango.FontFamily
348
349	cret := XGtkFontChooserGetFontFamily(x.GoPointer())
350
351	if cret == 0 {
352		return nil
353	}
354	gobject.IncreaseRef(cret)
355	cls = &pango.FontFamily{}
356	cls.Ptr = cret
357	return cls
358}
359
360// Gets the currently-selected font features.
361//
362// The format of the returned string is compatible with the
363// [CSS font-feature-settings property](https://www.w3.org/TR/css-fonts-4/#font-rend-desc).
364// It can be passed to [func@Pango.AttrFontFeatures.new].
365func (x *FontChooserBase) GetFontFeatures() string {
366
367	cret := XGtkFontChooserGetFontFeatures(x.GoPointer())
368	return cret
369}
370
371// Gets the custom font map of this font chooser widget,
372// or %NULL if it does not have one.
373func (x *FontChooserBase) GetFontMap() *pango.FontMap {
374	var cls *pango.FontMap
375
376	cret := XGtkFontChooserGetFontMap(x.GoPointer())
377
378	if cret == 0 {
379		return nil
380	}
381	cls = &pango.FontMap{}
382	cls.Ptr = cret
383	return cls
384}
385
386// The selected font size.
387func (x *FontChooserBase) GetFontSize() int {
388
389	cret := XGtkFontChooserGetFontSize(x.GoPointer())
390	return cret
391}
392
393// Gets the language that is used for font features.
394func (x *FontChooserBase) GetLanguage() string {
395
396	cret := XGtkFontChooserGetLanguage(x.GoPointer())
397	return cret
398}
399
400// Returns the current level of granularity for selecting fonts.
401func (x *FontChooserBase) GetLevel() FontChooserLevel {
402
403	cret := XGtkFontChooserGetLevel(x.GoPointer())
404	return cret
405}
406
407// Gets the text displayed in the preview area.
408func (x *FontChooserBase) GetPreviewText() string {
409
410	cret := XGtkFontChooserGetPreviewText(x.GoPointer())
411	return cret
412}
413
414// Returns whether the preview entry is shown or not.
415func (x *FontChooserBase) GetShowPreviewEntry() bool {
416
417	cret := XGtkFontChooserGetShowPreviewEntry(x.GoPointer())
418	return cret
419}
420
421// Adds a filter function that decides which fonts to display
422// in the font chooser.
423func (x *FontChooserBase) SetFilterFunc(FilterVar *FontFilterFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) {
424
425	XGtkFontChooserSetFilterFunc(x.GoPointer(), glib.NewCallbackNullable(FilterVar), UserDataVar, glib.NewCallback(DestroyVar))
426
427}
428
429// Sets the currently-selected font.
430func (x *FontChooserBase) SetFont(FontnameVar string) {
431
432	XGtkFontChooserSetFont(x.GoPointer(), FontnameVar)
433
434}
435
436// Sets the currently-selected font from @font_desc.
437func (x *FontChooserBase) SetFontDesc(FontDescVar *pango.FontDescription) {
438
439	XGtkFontChooserSetFontDesc(x.GoPointer(), FontDescVar)
440
441}
442
443// Sets a custom font map to use for this font chooser widget.
444//
445// A custom font map can be used to present application-specific
446// fonts instead of or in addition to the normal system fonts.
447//
448// ```c
449// FcConfig *config;
450// PangoFontMap *fontmap;
451//
452// config = FcInitLoadConfigAndFonts ();
453// FcConfigAppFontAddFile (config, my_app_font_file);
454//
455// fontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT);
456// pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
457//
458// gtk_font_chooser_set_font_map (font_chooser, fontmap);
459// ```
460//
461// Note that other GTK widgets will only be able to use the
462// application-specific font if it is present in the font map they use:
463//
464// ```c
465// context = gtk_widget_get_pango_context (label);
466// pango_context_set_font_map (context, fontmap);
467// ```
468func (x *FontChooserBase) SetFontMap(FontmapVar *pango.FontMap) {
469
470	XGtkFontChooserSetFontMap(x.GoPointer(), FontmapVar.GoPointer())
471
472}
473
474// Sets the language to use for font features.
475func (x *FontChooserBase) SetLanguage(LanguageVar string) {
476
477	XGtkFontChooserSetLanguage(x.GoPointer(), LanguageVar)
478
479}
480
481// Sets the desired level of granularity for selecting fonts.
482func (x *FontChooserBase) SetLevel(LevelVar FontChooserLevel) {
483
484	XGtkFontChooserSetLevel(x.GoPointer(), LevelVar)
485
486}
487
488// Sets the text displayed in the preview area.
489//
490// The @text is used to show how the selected font looks.
491func (x *FontChooserBase) SetPreviewText(TextVar string) {
492
493	XGtkFontChooserSetPreviewText(x.GoPointer(), TextVar)
494
495}
496
497// Shows or hides the editable preview entry.
498func (x *FontChooserBase) SetShowPreviewEntry(ShowPreviewEntryVar bool) {
499
500	XGtkFontChooserSetShowPreviewEntry(x.GoPointer(), ShowPreviewEntryVar)
501
502}
503
504// SetPropertyFont sets the "font" property.
505// The font description as a string, e.g. "Sans Italic 12".
506func (x *FontChooserBase) SetPropertyFont(value string) {
507	obj := gobject.Object{}
508	obj.Ptr = x.GoPointer()
509	var v gobject.Value
510	v.Init(gobject.TypeStringVal)
511	v.SetString(&value)
512	obj.SetProperty("font", &v)
513}
514
515// GetPropertyFont gets the "font" property.
516// The font description as a string, e.g. "Sans Italic 12".
517func (x *FontChooserBase) GetPropertyFont() string {
518	obj := gobject.Object{}
519	obj.Ptr = x.GoPointer()
520	var v gobject.Value
521	obj.GetProperty("font", &v)
522	return v.GetString()
523}
524
525// SetPropertyFontDesc sets the "font-desc" property.
526// The font description as a `PangoFontDescription`.
527func (x *FontChooserBase) SetPropertyFontDesc(value uintptr) {
528	obj := gobject.Object{}
529	obj.Ptr = x.GoPointer()
530	var v gobject.Value
531	v.Init(gobject.TypePointerVal)
532	v.SetPointer(value)
533	obj.SetProperty("font-desc", &v)
534}
535
536// GetPropertyFontDesc gets the "font-desc" property.
537// The font description as a `PangoFontDescription`.
538func (x *FontChooserBase) GetPropertyFontDesc() uintptr {
539	obj := gobject.Object{}
540	obj.Ptr = x.GoPointer()
541	var v gobject.Value
542	obj.GetProperty("font-desc", &v)
543	return v.GetPointer()
544}
545
546// GetPropertyFontFeatures gets the "font-features" property.
547// The selected font features.
548//
549// The format of the string is compatible with
550// CSS and with Pango attributes.
551func (x *FontChooserBase) GetPropertyFontFeatures() string {
552	obj := gobject.Object{}
553	obj.Ptr = x.GoPointer()
554	var v gobject.Value
555	obj.GetProperty("font-features", &v)
556	return v.GetString()
557}
558
559// SetPropertyLanguage sets the "language" property.
560// The language for which the font features were selected.
561func (x *FontChooserBase) SetPropertyLanguage(value string) {
562	obj := gobject.Object{}
563	obj.Ptr = x.GoPointer()
564	var v gobject.Value
565	v.Init(gobject.TypeStringVal)
566	v.SetString(&value)
567	obj.SetProperty("language", &v)
568}
569
570// GetPropertyLanguage gets the "language" property.
571// The language for which the font features were selected.
572func (x *FontChooserBase) GetPropertyLanguage() string {
573	obj := gobject.Object{}
574	obj.Ptr = x.GoPointer()
575	var v gobject.Value
576	obj.GetProperty("language", &v)
577	return v.GetString()
578}
579
580// SetPropertyPreviewText sets the "preview-text" property.
581// The string with which to preview the font.
582func (x *FontChooserBase) SetPropertyPreviewText(value string) {
583	obj := gobject.Object{}
584	obj.Ptr = x.GoPointer()
585	var v gobject.Value
586	v.Init(gobject.TypeStringVal)
587	v.SetString(&value)
588	obj.SetProperty("preview-text", &v)
589}
590
591// GetPropertyPreviewText gets the "preview-text" property.
592// The string with which to preview the font.
593func (x *FontChooserBase) GetPropertyPreviewText() string {
594	obj := gobject.Object{}
595	obj.Ptr = x.GoPointer()
596	var v gobject.Value
597	obj.GetProperty("preview-text", &v)
598	return v.GetString()
599}
600
601// SetPropertyShowPreviewEntry sets the "show-preview-entry" property.
602// Whether to show an entry to change the preview text.
603func (x *FontChooserBase) SetPropertyShowPreviewEntry(value bool) {
604	obj := gobject.Object{}
605	obj.Ptr = x.GoPointer()
606	var v gobject.Value
607	v.Init(gobject.TypeBooleanVal)
608	v.SetBoolean(value)
609	obj.SetProperty("show-preview-entry", &v)
610}
611
612// GetPropertyShowPreviewEntry gets the "show-preview-entry" property.
613// Whether to show an entry to change the preview text.
614func (x *FontChooserBase) GetPropertyShowPreviewEntry() bool {
615	obj := gobject.Object{}
616	obj.Ptr = x.GoPointer()
617	var v gobject.Value
618	obj.GetProperty("show-preview-entry", &v)
619	return v.GetBoolean()
620}
621
622var XGtkFontChooserGetFont func(uintptr) string
623var XGtkFontChooserGetFontDesc func(uintptr) *pango.FontDescription
624var XGtkFontChooserGetFontFace func(uintptr) uintptr
625var XGtkFontChooserGetFontFamily func(uintptr) uintptr
626var XGtkFontChooserGetFontFeatures func(uintptr) string
627var XGtkFontChooserGetFontMap func(uintptr) uintptr
628var XGtkFontChooserGetFontSize func(uintptr) int
629var XGtkFontChooserGetLanguage func(uintptr) string
630var XGtkFontChooserGetLevel func(uintptr) FontChooserLevel
631var XGtkFontChooserGetPreviewText func(uintptr) string
632var XGtkFontChooserGetShowPreviewEntry func(uintptr) bool
633var XGtkFontChooserSetFilterFunc func(uintptr, uintptr, uintptr, uintptr)
634var XGtkFontChooserSetFont func(uintptr, string)
635var XGtkFontChooserSetFontDesc func(uintptr, *pango.FontDescription)
636var XGtkFontChooserSetFontMap func(uintptr, uintptr)
637var XGtkFontChooserSetLanguage func(uintptr, string)
638var XGtkFontChooserSetLevel func(uintptr, FontChooserLevel)
639var XGtkFontChooserSetPreviewText func(uintptr, string)
640var XGtkFontChooserSetShowPreviewEntry func(uintptr, bool)
641
642// Specifies the granularity of font selection
643// that is desired in a `GtkFontChooser`.
644//
645// This enumeration may be extended in the future; applications should
646// ignore unknown values.
647type FontChooserLevel int
648
649var xFontChooserLevelGLibType func() types.GType
650
651func FontChooserLevelGLibType() types.GType {
652	return xFontChooserLevelGLibType()
653}
654
655const (
656
657	// Allow selecting a font family
658	FontChooserLevelFamilyValue FontChooserLevel = 0
659	// Allow selecting a specific font face
660	FontChooserLevelStyleValue FontChooserLevel = 1
661	// Allow selecting a specific font size
662	FontChooserLevelSizeValue FontChooserLevel = 2
663	// Allow changing OpenType font variation axes
664	FontChooserLevelVariationsValue FontChooserLevel = 4
665	// Allow selecting specific OpenType font features
666	FontChooserLevelFeaturesValue FontChooserLevel = 8
667)
668
669func init() {
670	core.SetPackageName("GTK", "gtk4")
671	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
672	var libs []uintptr
673	for _, libPath := range core.GetPaths("GTK") {
674		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
675		if err != nil {
676			panic(err)
677		}
678		libs = append(libs, lib)
679	}
680
681	core.PuregoSafeRegister(&xFontChooserLevelGLibType, libs, "gtk_font_chooser_level_get_type")
682
683	core.PuregoSafeRegister(&xFontChooserGLibType, libs, "gtk_font_chooser_get_type")
684
685	core.PuregoSafeRegister(&XGtkFontChooserGetFont, libs, "gtk_font_chooser_get_font")
686	core.PuregoSafeRegister(&XGtkFontChooserGetFontDesc, libs, "gtk_font_chooser_get_font_desc")
687	core.PuregoSafeRegister(&XGtkFontChooserGetFontFace, libs, "gtk_font_chooser_get_font_face")
688	core.PuregoSafeRegister(&XGtkFontChooserGetFontFamily, libs, "gtk_font_chooser_get_font_family")
689	core.PuregoSafeRegister(&XGtkFontChooserGetFontFeatures, libs, "gtk_font_chooser_get_font_features")
690	core.PuregoSafeRegister(&XGtkFontChooserGetFontMap, libs, "gtk_font_chooser_get_font_map")
691	core.PuregoSafeRegister(&XGtkFontChooserGetFontSize, libs, "gtk_font_chooser_get_font_size")
692	core.PuregoSafeRegister(&XGtkFontChooserGetLanguage, libs, "gtk_font_chooser_get_language")
693	core.PuregoSafeRegister(&XGtkFontChooserGetLevel, libs, "gtk_font_chooser_get_level")
694	core.PuregoSafeRegister(&XGtkFontChooserGetPreviewText, libs, "gtk_font_chooser_get_preview_text")
695	core.PuregoSafeRegister(&XGtkFontChooserGetShowPreviewEntry, libs, "gtk_font_chooser_get_show_preview_entry")
696	core.PuregoSafeRegister(&XGtkFontChooserSetFilterFunc, libs, "gtk_font_chooser_set_filter_func")
697	core.PuregoSafeRegister(&XGtkFontChooserSetFont, libs, "gtk_font_chooser_set_font")
698	core.PuregoSafeRegister(&XGtkFontChooserSetFontDesc, libs, "gtk_font_chooser_set_font_desc")
699	core.PuregoSafeRegister(&XGtkFontChooserSetFontMap, libs, "gtk_font_chooser_set_font_map")
700	core.PuregoSafeRegister(&XGtkFontChooserSetLanguage, libs, "gtk_font_chooser_set_language")
701	core.PuregoSafeRegister(&XGtkFontChooserSetLevel, libs, "gtk_font_chooser_set_level")
702	core.PuregoSafeRegister(&XGtkFontChooserSetPreviewText, libs, "gtk_font_chooser_set_preview_text")
703	core.PuregoSafeRegister(&XGtkFontChooserSetShowPreviewEntry, libs, "gtk_font_chooser_set_show_preview_entry")
704
705}

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