v0.2.1 c0399be

gtkprintsettings.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)
15
16// Function called by [method@Gtk.PrintSettings.foreach] on every key/value pair
17// inside a [class@Gtk.PrintSettings].
18type PrintSettingsFunc func(string, string, uintptr)
19
20// A range of pages to print.
21//
22// See also [method@Gtk.PrintSettings.set_page_ranges].
23type PageRange struct {
24	_ structs.HostLayout
25
26	Start int
27
28	End int
29}
30
31func (x *PageRange) GoPointer() uintptr {
32	return uintptr(unsafe.Pointer(x))
33}
34
35const (
36	// The key used by the “Print to file” printer to store whether to collate the
37	// printed pages.
38	PRINT_SETTINGS_COLLATE string = "collate"
39	// The key used by the “Print to file” printer to store the default source.
40	PRINT_SETTINGS_DEFAULT_SOURCE string = "default-source"
41	// The key used by the “Print to file” printer to store the dither used.
42	PRINT_SETTINGS_DITHER string = "dither"
43	// The key used by the “Print to file” printer to store whether to print the
44	// output in duplex.
45	PRINT_SETTINGS_DUPLEX string = "duplex"
46	// The key used by the “Print to file” printer to store the finishings.
47	PRINT_SETTINGS_FINISHINGS string = "finishings"
48	// The key used by the “Print to file” printer to store the media type.
49	//
50	// The set of media types is defined in PWG 5101.1-2002 PWG.
51	PRINT_SETTINGS_MEDIA_TYPE string = "media-type"
52	// The key used by the “Print to file” printer to store the number of pages per
53	// sheet.
54	PRINT_SETTINGS_NUMBER_UP string = "number-up"
55	// The key used by the “Print to file” printer to store the number of pages per
56	// sheet in number-up mode.
57	PRINT_SETTINGS_NUMBER_UP_LAYOUT string = "number-up-layout"
58	// The key used by the “Print to file” printer to store the number of copies.
59	PRINT_SETTINGS_N_COPIES string = "n-copies"
60	// The key used by the “Print to file” printer to store the orientation.
61	PRINT_SETTINGS_ORIENTATION string = "orientation"
62	// The key used by the “Print to file” printer to store the file
63	// name of the output without the path to the directory and the
64	// file extension.
65	PRINT_SETTINGS_OUTPUT_BASENAME string = "output-basename"
66	// The key used by the “Print to file” printer to store the output bin.
67	PRINT_SETTINGS_OUTPUT_BIN string = "output-bin"
68	// The key used by the “Print to file” printer to store the
69	// directory to which the output should be written.
70	PRINT_SETTINGS_OUTPUT_DIR string = "output-dir"
71	// The key used by the “Print to file” printer to store the format
72	// of the output. The supported values are “PS” and “PDF”.
73	PRINT_SETTINGS_OUTPUT_FILE_FORMAT string = "output-file-format"
74	// The key used by the “Print to file” printer to store the URI
75	// to which the output should be written. GTK itself supports
76	// only “file://” URIs.
77	PRINT_SETTINGS_OUTPUT_URI string = "output-uri"
78	// The key used by the “Print to file” printer to store the array of page ranges
79	// to print.
80	PRINT_SETTINGS_PAGE_RANGES string = "page-ranges"
81	// The key used by the “Print to file” printer to store the set of pages to print.
82	PRINT_SETTINGS_PAGE_SET string = "page-set"
83	// The key used by the “Print to file” printer to store the page format.
84	PRINT_SETTINGS_PAPER_FORMAT string = "paper-format"
85	// The key used by the “Print to file” printer to store the page height.
86	PRINT_SETTINGS_PAPER_HEIGHT string = "paper-height"
87	// The key used by the “Print to file” printer to store the paper width.
88	PRINT_SETTINGS_PAPER_WIDTH string = "paper-width"
89	// The key used by the “Print to file” printer to store the printer name.
90	PRINT_SETTINGS_PRINTER string = "printer"
91	// The key used by the “Print to file” printer to store the resolution in lines
92	// per inch.
93	PRINT_SETTINGS_PRINTER_LPI string = "printer-lpi"
94	// The key used by the “Print to file” printer to store which pages to print.
95	PRINT_SETTINGS_PRINT_PAGES string = "print-pages"
96	// The key used by the “Print to file” printer to store the printing quality.
97	PRINT_SETTINGS_QUALITY string = "quality"
98	// The key used by the “Print to file” printer to store the resolution in DPI.
99	PRINT_SETTINGS_RESOLUTION string = "resolution"
100	// The key used by the “Print to file” printer to store the horizontal
101	// resolution in DPI.
102	PRINT_SETTINGS_RESOLUTION_X string = "resolution-x"
103	// The key used by the “Print to file” printer to store the vertical resolution
104	// in DPI.
105	PRINT_SETTINGS_RESOLUTION_Y string = "resolution-y"
106	// The key used by the “Print to file” printer to store whether to reverse the
107	// order of the printed pages.
108	PRINT_SETTINGS_REVERSE string = "reverse"
109	// The key used by the “Print to file” printer to store the scale.
110	PRINT_SETTINGS_SCALE string = "scale"
111	// The key used by the “Print to file” printer to store whether to print with
112	// colors.
113	PRINT_SETTINGS_USE_COLOR string = "use-color"
114	// The key used by the “Print to file” printer to store 32-bit Windows extra
115	// driver.
116	PRINT_SETTINGS_WIN32_DRIVER_EXTRA string = "win32-driver-extra"
117	// The key used by the “Print to file” printer to store the 32-bit Windows
118	// driver version.
119	PRINT_SETTINGS_WIN32_DRIVER_VERSION string = "win32-driver-version"
120)
121
122// Collects the settings of a print dialog in a system-independent way.
123//
124// The main use for this object is that once you’ve printed you can get a
125// settings object that represents the settings the user chose, and the next
126// time you print you can pass that object in so that the user doesn’t have
127// to re-set all his settings.
128//
129// Its also possible to enumerate the settings so that you can easily save
130// the settings for the next time your app runs, or even store them in a
131// document. The predefined keys try to use shared values as much as possible
132// so that moving such a document between systems still works.
133type PrintSettings struct {
134	gobject.Object
135}
136
137var xPrintSettingsGLibType func() types.GType
138
139func PrintSettingsGLibType() types.GType {
140	return xPrintSettingsGLibType()
141}
142
143func PrintSettingsNewFromInternalPtr(ptr uintptr) *PrintSettings {
144	cls := &PrintSettings{}
145	cls.Ptr = ptr
146	return cls
147}
148
149var xNewPrintSettings func() uintptr
150
151// Creates a new `GtkPrintSettings` object.
152func NewPrintSettings() *PrintSettings {
153	var cls *PrintSettings
154
155	cret := xNewPrintSettings()
156
157	if cret == 0 {
158		return nil
159	}
160	cls = &PrintSettings{}
161	cls.Ptr = cret
162	return cls
163}
164
165var xNewPrintSettingsFromFile func(string, **glib.Error) uintptr
166
167// Reads the print settings from @file_name.
168//
169// Returns a new `GtkPrintSettings` object with the restored settings,
170// or %NULL if an error occurred. If the file could not be loaded then
171// error is set to either a `GFileError` or `GKeyFileError`.
172//
173// See [method@Gtk.PrintSettings.to_file].
174func NewPrintSettingsFromFile(FileNameVar string) (*PrintSettings, error) {
175	var cls *PrintSettings
176	var cerr *glib.Error
177
178	cret := xNewPrintSettingsFromFile(FileNameVar, &cerr)
179
180	if cret == 0 {
181		return nil, cerr
182	}
183	cls = &PrintSettings{}
184	cls.Ptr = cret
185	if cerr == nil {
186		return cls, nil
187	}
188	return cls, cerr
189
190}
191
192var xNewPrintSettingsFromGvariant func(*glib.Variant) uintptr
193
194// Deserialize print settings from an a{sv} variant.
195//
196// The variant must be in the format produced by
197// [method@Gtk.PrintSettings.to_gvariant].
198func NewPrintSettingsFromGvariant(VariantVar *glib.Variant) *PrintSettings {
199	var cls *PrintSettings
200
201	cret := xNewPrintSettingsFromGvariant(VariantVar)
202
203	if cret == 0 {
204		return nil
205	}
206	cls = &PrintSettings{}
207	cls.Ptr = cret
208	return cls
209}
210
211var xNewPrintSettingsFromKeyFile func(*glib.KeyFile, uintptr, **glib.Error) uintptr
212
213// Reads the print settings from the group @group_name in @key_file.
214//
215// Returns a new `GtkPrintSettings` object with the restored settings,
216// or %NULL if an error occurred. If the file could not be loaded then
217// error is set to either `GFileError` or `GKeyFileError`.
218func NewPrintSettingsFromKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (*PrintSettings, error) {
219	var cls *PrintSettings
220	var cerr *glib.Error
221
222	GroupNameVarPtr := core.GStrdupNullable(GroupNameVar)
223	defer core.GFreeNullable(GroupNameVarPtr)
224
225	cret := xNewPrintSettingsFromKeyFile(KeyFileVar, GroupNameVarPtr, &cerr)
226
227	if cret == 0 {
228		return nil, cerr
229	}
230	cls = &PrintSettings{}
231	cls.Ptr = cret
232	if cerr == nil {
233		return cls, nil
234	}
235	return cls, cerr
236
237}
238
239var xPrintSettingsCopy func(uintptr) uintptr
240
241// Copies a `GtkPrintSettings` object.
242func (x *PrintSettings) Copy() *PrintSettings {
243	var cls *PrintSettings
244
245	cret := xPrintSettingsCopy(x.GoPointer())
246
247	if cret == 0 {
248		return nil
249	}
250	cls = &PrintSettings{}
251	cls.Ptr = cret
252	return cls
253}
254
255var xPrintSettingsForeach func(uintptr, uintptr, uintptr)
256
257// Calls @func for each key-value pair of @settings.
258func (x *PrintSettings) Foreach(FuncVar *PrintSettingsFunc, UserDataVar uintptr) {
259
260	var FuncVarRef uintptr
261	if FuncVar != nil {
262		FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
263		if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
264			FuncVarRef = cbRefPtr
265		} else {
266			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) {
267				cbFn := *FuncVar
268				cbFn(core.GoString(arg0), core.GoString(arg1), arg2)
269			}
270			FuncVarRef = purego.NewCallback(fcb)
271			glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
272		}
273	}
274
275	xPrintSettingsForeach(x.GoPointer(), FuncVarRef, UserDataVar)
276
277}
278
279var xPrintSettingsGet func(uintptr, string) string
280
281// Looks up the string value associated with @key.
282func (x *PrintSettings) Get(KeyVar string) string {
283
284	cret := xPrintSettingsGet(x.GoPointer(), KeyVar)
285	return cret
286}
287
288var xPrintSettingsGetBool func(uintptr, string) bool
289
290// Returns the boolean represented by the value
291// that is associated with @key.
292//
293// The string “true” represents %TRUE, any other
294// string %FALSE.
295func (x *PrintSettings) GetBool(KeyVar string) bool {
296
297	cret := xPrintSettingsGetBool(x.GoPointer(), KeyVar)
298	return cret
299}
300
301var xPrintSettingsGetCollate func(uintptr) bool
302
303// Gets the value of %GTK_PRINT_SETTINGS_COLLATE.
304func (x *PrintSettings) GetCollate() bool {
305
306	cret := xPrintSettingsGetCollate(x.GoPointer())
307	return cret
308}
309
310var xPrintSettingsGetDefaultSource func(uintptr) string
311
312// Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
313func (x *PrintSettings) GetDefaultSource() string {
314
315	cret := xPrintSettingsGetDefaultSource(x.GoPointer())
316	return cret
317}
318
319var xPrintSettingsGetDither func(uintptr) string
320
321// Gets the value of %GTK_PRINT_SETTINGS_DITHER.
322func (x *PrintSettings) GetDither() string {
323
324	cret := xPrintSettingsGetDither(x.GoPointer())
325	return cret
326}
327
328var xPrintSettingsGetDouble func(uintptr, string) float64
329
330// Returns the double value associated with @key, or 0.
331func (x *PrintSettings) GetDouble(KeyVar string) float64 {
332
333	cret := xPrintSettingsGetDouble(x.GoPointer(), KeyVar)
334	return cret
335}
336
337var xPrintSettingsGetDoubleWithDefault func(uintptr, string, float64) float64
338
339// Returns the floating point number represented by
340// the value that is associated with @key, or @default_val
341// if the value does not represent a floating point number.
342//
343// Floating point numbers are parsed with g_ascii_strtod().
344func (x *PrintSettings) GetDoubleWithDefault(KeyVar string, DefVar float64) float64 {
345
346	cret := xPrintSettingsGetDoubleWithDefault(x.GoPointer(), KeyVar, DefVar)
347	return cret
348}
349
350var xPrintSettingsGetDuplex func(uintptr) PrintDuplex
351
352// Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.
353func (x *PrintSettings) GetDuplex() PrintDuplex {
354
355	cret := xPrintSettingsGetDuplex(x.GoPointer())
356	return cret
357}
358
359var xPrintSettingsGetFinishings func(uintptr) string
360
361// Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
362func (x *PrintSettings) GetFinishings() string {
363
364	cret := xPrintSettingsGetFinishings(x.GoPointer())
365	return cret
366}
367
368var xPrintSettingsGetInt func(uintptr, string) int
369
370// Returns the integer value of @key, or 0.
371func (x *PrintSettings) GetInt(KeyVar string) int {
372
373	cret := xPrintSettingsGetInt(x.GoPointer(), KeyVar)
374	return cret
375}
376
377var xPrintSettingsGetIntWithDefault func(uintptr, string, int) int
378
379// Returns the value of @key, interpreted as
380// an integer, or the default value.
381func (x *PrintSettings) GetIntWithDefault(KeyVar string, DefVar int) int {
382
383	cret := xPrintSettingsGetIntWithDefault(x.GoPointer(), KeyVar, DefVar)
384	return cret
385}
386
387var xPrintSettingsGetLength func(uintptr, string, Unit) float64
388
389// Returns the value associated with @key, interpreted
390// as a length.
391//
392// The returned value is converted to @units.
393func (x *PrintSettings) GetLength(KeyVar string, UnitVar Unit) float64 {
394
395	cret := xPrintSettingsGetLength(x.GoPointer(), KeyVar, UnitVar)
396	return cret
397}
398
399var xPrintSettingsGetMediaType func(uintptr) string
400
401// Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
402//
403// The set of media types is defined in PWG 5101.1-2002 PWG.
404func (x *PrintSettings) GetMediaType() string {
405
406	cret := xPrintSettingsGetMediaType(x.GoPointer())
407	return cret
408}
409
410var xPrintSettingsGetNCopies func(uintptr) int
411
412// Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
413func (x *PrintSettings) GetNCopies() int {
414
415	cret := xPrintSettingsGetNCopies(x.GoPointer())
416	return cret
417}
418
419var xPrintSettingsGetNumberUp func(uintptr) int
420
421// Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
422func (x *PrintSettings) GetNumberUp() int {
423
424	cret := xPrintSettingsGetNumberUp(x.GoPointer())
425	return cret
426}
427
428var xPrintSettingsGetNumberUpLayout func(uintptr) NumberUpLayout
429
430// Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
431func (x *PrintSettings) GetNumberUpLayout() NumberUpLayout {
432
433	cret := xPrintSettingsGetNumberUpLayout(x.GoPointer())
434	return cret
435}
436
437var xPrintSettingsGetOrientation func(uintptr) PageOrientation
438
439// Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
440// converted to a `GtkPageOrientation`.
441func (x *PrintSettings) GetOrientation() PageOrientation {
442
443	cret := xPrintSettingsGetOrientation(x.GoPointer())
444	return cret
445}
446
447var xPrintSettingsGetOutputBin func(uintptr) string
448
449// Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
450func (x *PrintSettings) GetOutputBin() string {
451
452	cret := xPrintSettingsGetOutputBin(x.GoPointer())
453	return cret
454}
455
456var xPrintSettingsGetPageRanges func(uintptr, *int) uintptr
457
458// Gets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
459func (x *PrintSettings) GetPageRanges(NumRangesVar *int) uintptr {
460
461	cret := xPrintSettingsGetPageRanges(x.GoPointer(), NumRangesVar)
462	return cret
463}
464
465var xPrintSettingsGetPageSet func(uintptr) PageSet
466
467// Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
468func (x *PrintSettings) GetPageSet() PageSet {
469
470	cret := xPrintSettingsGetPageSet(x.GoPointer())
471	return cret
472}
473
474var xPrintSettingsGetPaperHeight func(uintptr, Unit) float64
475
476// Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT,
477// converted to @unit.
478func (x *PrintSettings) GetPaperHeight(UnitVar Unit) float64 {
479
480	cret := xPrintSettingsGetPaperHeight(x.GoPointer(), UnitVar)
481	return cret
482}
483
484var xPrintSettingsGetPaperSize func(uintptr) *PaperSize
485
486// Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
487// converted to a `GtkPaperSize`.
488func (x *PrintSettings) GetPaperSize() *PaperSize {
489
490	cret := xPrintSettingsGetPaperSize(x.GoPointer())
491	return cret
492}
493
494var xPrintSettingsGetPaperWidth func(uintptr, Unit) float64
495
496// Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH,
497// converted to @unit.
498func (x *PrintSettings) GetPaperWidth(UnitVar Unit) float64 {
499
500	cret := xPrintSettingsGetPaperWidth(x.GoPointer(), UnitVar)
501	return cret
502}
503
504var xPrintSettingsGetPrintPages func(uintptr) PrintPages
505
506// Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
507func (x *PrintSettings) GetPrintPages() PrintPages {
508
509	cret := xPrintSettingsGetPrintPages(x.GoPointer())
510	return cret
511}
512
513var xPrintSettingsGetPrinter func(uintptr) string
514
515// Convenience function to obtain the value of
516// %GTK_PRINT_SETTINGS_PRINTER.
517func (x *PrintSettings) GetPrinter() string {
518
519	cret := xPrintSettingsGetPrinter(x.GoPointer())
520	return cret
521}
522
523var xPrintSettingsGetPrinterLpi func(uintptr) float64
524
525// Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
526func (x *PrintSettings) GetPrinterLpi() float64 {
527
528	cret := xPrintSettingsGetPrinterLpi(x.GoPointer())
529	return cret
530}
531
532var xPrintSettingsGetQuality func(uintptr) PrintQuality
533
534// Gets the value of %GTK_PRINT_SETTINGS_QUALITY.
535func (x *PrintSettings) GetQuality() PrintQuality {
536
537	cret := xPrintSettingsGetQuality(x.GoPointer())
538	return cret
539}
540
541var xPrintSettingsGetResolution func(uintptr) int
542
543// Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.
544func (x *PrintSettings) GetResolution() int {
545
546	cret := xPrintSettingsGetResolution(x.GoPointer())
547	return cret
548}
549
550var xPrintSettingsGetResolutionX func(uintptr) int
551
552// Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.
553func (x *PrintSettings) GetResolutionX() int {
554
555	cret := xPrintSettingsGetResolutionX(x.GoPointer())
556	return cret
557}
558
559var xPrintSettingsGetResolutionY func(uintptr) int
560
561// Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.
562func (x *PrintSettings) GetResolutionY() int {
563
564	cret := xPrintSettingsGetResolutionY(x.GoPointer())
565	return cret
566}
567
568var xPrintSettingsGetReverse func(uintptr) bool
569
570// Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
571func (x *PrintSettings) GetReverse() bool {
572
573	cret := xPrintSettingsGetReverse(x.GoPointer())
574	return cret
575}
576
577var xPrintSettingsGetScale func(uintptr) float64
578
579// Gets the value of %GTK_PRINT_SETTINGS_SCALE.
580func (x *PrintSettings) GetScale() float64 {
581
582	cret := xPrintSettingsGetScale(x.GoPointer())
583	return cret
584}
585
586var xPrintSettingsGetUseColor func(uintptr) bool
587
588// Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
589func (x *PrintSettings) GetUseColor() bool {
590
591	cret := xPrintSettingsGetUseColor(x.GoPointer())
592	return cret
593}
594
595var xPrintSettingsHasKey func(uintptr, string) bool
596
597// Returns %TRUE, if a value is associated with @key.
598func (x *PrintSettings) HasKey(KeyVar string) bool {
599
600	cret := xPrintSettingsHasKey(x.GoPointer(), KeyVar)
601	return cret
602}
603
604var xPrintSettingsLoadFile func(uintptr, string, **glib.Error) bool
605
606// Reads the print settings from @file_name.
607//
608// If the file could not be loaded then error is set to either
609// a `GFileError` or `GKeyFileError`.
610//
611// See [method@Gtk.PrintSettings.to_file].
612func (x *PrintSettings) LoadFile(FileNameVar string) (bool, error) {
613	var cerr *glib.Error
614
615	cret := xPrintSettingsLoadFile(x.GoPointer(), FileNameVar, &cerr)
616	if cerr == nil {
617		return cret, nil
618	}
619	return cret, cerr
620
621}
622
623var xPrintSettingsLoadKeyFile func(uintptr, *glib.KeyFile, uintptr, **glib.Error) bool
624
625// Reads the print settings from the group @group_name in @key_file.
626//
627// If the file could not be loaded then error is set to either a
628// `GFileError` or `GKeyFileError`.
629func (x *PrintSettings) LoadKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) (bool, error) {
630	var cerr *glib.Error
631
632	GroupNameVarPtr := core.GStrdupNullable(GroupNameVar)
633	defer core.GFreeNullable(GroupNameVarPtr)
634
635	cret := xPrintSettingsLoadKeyFile(x.GoPointer(), KeyFileVar, GroupNameVarPtr, &cerr)
636	if cerr == nil {
637		return cret, nil
638	}
639	return cret, cerr
640
641}
642
643var xPrintSettingsSet func(uintptr, string, uintptr)
644
645// Associates @value with @key.
646func (x *PrintSettings) Set(KeyVar string, ValueVar *string) {
647
648	ValueVarPtr := core.GStrdupNullable(ValueVar)
649	defer core.GFreeNullable(ValueVarPtr)
650
651	xPrintSettingsSet(x.GoPointer(), KeyVar, ValueVarPtr)
652
653}
654
655var xPrintSettingsSetBool func(uintptr, string, bool)
656
657// Sets @key to a boolean value.
658func (x *PrintSettings) SetBool(KeyVar string, ValueVar bool) {
659
660	xPrintSettingsSetBool(x.GoPointer(), KeyVar, ValueVar)
661
662}
663
664var xPrintSettingsSetCollate func(uintptr, bool)
665
666// Sets the value of %GTK_PRINT_SETTINGS_COLLATE.
667func (x *PrintSettings) SetCollate(CollateVar bool) {
668
669	xPrintSettingsSetCollate(x.GoPointer(), CollateVar)
670
671}
672
673var xPrintSettingsSetDefaultSource func(uintptr, string)
674
675// Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
676func (x *PrintSettings) SetDefaultSource(DefaultSourceVar string) {
677
678	xPrintSettingsSetDefaultSource(x.GoPointer(), DefaultSourceVar)
679
680}
681
682var xPrintSettingsSetDither func(uintptr, string)
683
684// Sets the value of %GTK_PRINT_SETTINGS_DITHER.
685func (x *PrintSettings) SetDither(DitherVar string) {
686
687	xPrintSettingsSetDither(x.GoPointer(), DitherVar)
688
689}
690
691var xPrintSettingsSetDouble func(uintptr, string, float64)
692
693// Sets @key to a double value.
694func (x *PrintSettings) SetDouble(KeyVar string, ValueVar float64) {
695
696	xPrintSettingsSetDouble(x.GoPointer(), KeyVar, ValueVar)
697
698}
699
700var xPrintSettingsSetDuplex func(uintptr, PrintDuplex)
701
702// Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.
703func (x *PrintSettings) SetDuplex(DuplexVar PrintDuplex) {
704
705	xPrintSettingsSetDuplex(x.GoPointer(), DuplexVar)
706
707}
708
709var xPrintSettingsSetFinishings func(uintptr, string)
710
711// Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
712func (x *PrintSettings) SetFinishings(FinishingsVar string) {
713
714	xPrintSettingsSetFinishings(x.GoPointer(), FinishingsVar)
715
716}
717
718var xPrintSettingsSetInt func(uintptr, string, int)
719
720// Sets @key to an integer value.
721func (x *PrintSettings) SetInt(KeyVar string, ValueVar int) {
722
723	xPrintSettingsSetInt(x.GoPointer(), KeyVar, ValueVar)
724
725}
726
727var xPrintSettingsSetLength func(uintptr, string, float64, Unit)
728
729// Associates a length in units of @unit with @key.
730func (x *PrintSettings) SetLength(KeyVar string, ValueVar float64, UnitVar Unit) {
731
732	xPrintSettingsSetLength(x.GoPointer(), KeyVar, ValueVar, UnitVar)
733
734}
735
736var xPrintSettingsSetMediaType func(uintptr, string)
737
738// Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
739//
740// The set of media types is defined in PWG 5101.1-2002 PWG.
741func (x *PrintSettings) SetMediaType(MediaTypeVar string) {
742
743	xPrintSettingsSetMediaType(x.GoPointer(), MediaTypeVar)
744
745}
746
747var xPrintSettingsSetNCopies func(uintptr, int)
748
749// Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
750func (x *PrintSettings) SetNCopies(NumCopiesVar int) {
751
752	xPrintSettingsSetNCopies(x.GoPointer(), NumCopiesVar)
753
754}
755
756var xPrintSettingsSetNumberUp func(uintptr, int)
757
758// Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
759func (x *PrintSettings) SetNumberUp(NumberUpVar int) {
760
761	xPrintSettingsSetNumberUp(x.GoPointer(), NumberUpVar)
762
763}
764
765var xPrintSettingsSetNumberUpLayout func(uintptr, NumberUpLayout)
766
767// Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
768func (x *PrintSettings) SetNumberUpLayout(NumberUpLayoutVar NumberUpLayout) {
769
770	xPrintSettingsSetNumberUpLayout(x.GoPointer(), NumberUpLayoutVar)
771
772}
773
774var xPrintSettingsSetOrientation func(uintptr, PageOrientation)
775
776// Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.
777func (x *PrintSettings) SetOrientation(OrientationVar PageOrientation) {
778
779	xPrintSettingsSetOrientation(x.GoPointer(), OrientationVar)
780
781}
782
783var xPrintSettingsSetOutputBin func(uintptr, string)
784
785// Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
786func (x *PrintSettings) SetOutputBin(OutputBinVar string) {
787
788	xPrintSettingsSetOutputBin(x.GoPointer(), OutputBinVar)
789
790}
791
792var xPrintSettingsSetPageRanges func(uintptr, []PageRange, int)
793
794// Sets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
795func (x *PrintSettings) SetPageRanges(PageRangesVar []PageRange, NumRangesVar int) {
796
797	xPrintSettingsSetPageRanges(x.GoPointer(), PageRangesVar, NumRangesVar)
798
799}
800
801var xPrintSettingsSetPageSet func(uintptr, PageSet)
802
803// Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
804func (x *PrintSettings) SetPageSet(PageSetVar PageSet) {
805
806	xPrintSettingsSetPageSet(x.GoPointer(), PageSetVar)
807
808}
809
810var xPrintSettingsSetPaperHeight func(uintptr, float64, Unit)
811
812// Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
813func (x *PrintSettings) SetPaperHeight(HeightVar float64, UnitVar Unit) {
814
815	xPrintSettingsSetPaperHeight(x.GoPointer(), HeightVar, UnitVar)
816
817}
818
819var xPrintSettingsSetPaperSize func(uintptr, *PaperSize)
820
821// Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
822// %GTK_PRINT_SETTINGS_PAPER_WIDTH and
823// %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
824func (x *PrintSettings) SetPaperSize(PaperSizeVar *PaperSize) {
825
826	xPrintSettingsSetPaperSize(x.GoPointer(), PaperSizeVar)
827
828}
829
830var xPrintSettingsSetPaperWidth func(uintptr, float64, Unit)
831
832// Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.
833func (x *PrintSettings) SetPaperWidth(WidthVar float64, UnitVar Unit) {
834
835	xPrintSettingsSetPaperWidth(x.GoPointer(), WidthVar, UnitVar)
836
837}
838
839var xPrintSettingsSetPrintPages func(uintptr, PrintPages)
840
841// Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
842func (x *PrintSettings) SetPrintPages(PagesVar PrintPages) {
843
844	xPrintSettingsSetPrintPages(x.GoPointer(), PagesVar)
845
846}
847
848var xPrintSettingsSetPrinter func(uintptr, string)
849
850// Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
851// to @printer.
852func (x *PrintSettings) SetPrinter(PrinterVar string) {
853
854	xPrintSettingsSetPrinter(x.GoPointer(), PrinterVar)
855
856}
857
858var xPrintSettingsSetPrinterLpi func(uintptr, float64)
859
860// Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
861func (x *PrintSettings) SetPrinterLpi(LpiVar float64) {
862
863	xPrintSettingsSetPrinterLpi(x.GoPointer(), LpiVar)
864
865}
866
867var xPrintSettingsSetQuality func(uintptr, PrintQuality)
868
869// Sets the value of %GTK_PRINT_SETTINGS_QUALITY.
870func (x *PrintSettings) SetQuality(QualityVar PrintQuality) {
871
872	xPrintSettingsSetQuality(x.GoPointer(), QualityVar)
873
874}
875
876var xPrintSettingsSetResolution func(uintptr, int)
877
878// Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
879// %GTK_PRINT_SETTINGS_RESOLUTION_X and
880// %GTK_PRINT_SETTINGS_RESOLUTION_Y.
881func (x *PrintSettings) SetResolution(ResolutionVar int) {
882
883	xPrintSettingsSetResolution(x.GoPointer(), ResolutionVar)
884
885}
886
887var xPrintSettingsSetResolutionXy func(uintptr, int, int)
888
889// Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
890// %GTK_PRINT_SETTINGS_RESOLUTION_X and
891// %GTK_PRINT_SETTINGS_RESOLUTION_Y.
892func (x *PrintSettings) SetResolutionXy(ResolutionXVar int, ResolutionYVar int) {
893
894	xPrintSettingsSetResolutionXy(x.GoPointer(), ResolutionXVar, ResolutionYVar)
895
896}
897
898var xPrintSettingsSetReverse func(uintptr, bool)
899
900// Sets the value of %GTK_PRINT_SETTINGS_REVERSE.
901func (x *PrintSettings) SetReverse(ReverseVar bool) {
902
903	xPrintSettingsSetReverse(x.GoPointer(), ReverseVar)
904
905}
906
907var xPrintSettingsSetScale func(uintptr, float64)
908
909// Sets the value of %GTK_PRINT_SETTINGS_SCALE.
910func (x *PrintSettings) SetScale(ScaleVar float64) {
911
912	xPrintSettingsSetScale(x.GoPointer(), ScaleVar)
913
914}
915
916var xPrintSettingsSetUseColor func(uintptr, bool)
917
918// Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
919func (x *PrintSettings) SetUseColor(UseColorVar bool) {
920
921	xPrintSettingsSetUseColor(x.GoPointer(), UseColorVar)
922
923}
924
925var xPrintSettingsToFile func(uintptr, string, **glib.Error) bool
926
927// This function saves the print settings from @settings to @file_name.
928//
929// If the file could not be written then error is set to either a
930// `GFileError` or `GKeyFileError`.
931func (x *PrintSettings) ToFile(FileNameVar string) (bool, error) {
932	var cerr *glib.Error
933
934	cret := xPrintSettingsToFile(x.GoPointer(), FileNameVar, &cerr)
935	if cerr == nil {
936		return cret, nil
937	}
938	return cret, cerr
939
940}
941
942var xPrintSettingsToGvariant func(uintptr) *glib.Variant
943
944// Serialize print settings to an a{sv} variant.
945func (x *PrintSettings) ToGvariant() *glib.Variant {
946
947	cret := xPrintSettingsToGvariant(x.GoPointer())
948	return cret
949}
950
951var xPrintSettingsToKeyFile func(uintptr, *glib.KeyFile, uintptr)
952
953// This function adds the print settings from @settings to @key_file.
954func (x *PrintSettings) ToKeyFile(KeyFileVar *glib.KeyFile, GroupNameVar *string) {
955
956	GroupNameVarPtr := core.GStrdupNullable(GroupNameVar)
957	defer core.GFreeNullable(GroupNameVarPtr)
958
959	xPrintSettingsToKeyFile(x.GoPointer(), KeyFileVar, GroupNameVarPtr)
960
961}
962
963var xPrintSettingsUnset func(uintptr, string)
964
965// Removes any value associated with @key.
966//
967// This has the same effect as setting the value to %NULL.
968func (x *PrintSettings) Unset(KeyVar string) {
969
970	xPrintSettingsUnset(x.GoPointer(), KeyVar)
971
972}
973
974func (c *PrintSettings) GoPointer() uintptr {
975	if c == nil {
976		return 0
977	}
978	return c.Ptr
979}
980
981func (c *PrintSettings) SetGoPointer(ptr uintptr) {
982	c.Ptr = ptr
983}
984
985func init() {
986	core.SetPackageName("GTK", "gtk4")
987	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
988	var libs []uintptr
989	for _, libPath := range core.GetPaths("GTK") {
990		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
991		if err != nil {
992			panic(err)
993		}
994		libs = append(libs, lib)
995	}
996
997	core.PuregoSafeRegister(&xPrintSettingsGLibType, libs, "gtk_print_settings_get_type")
998
999	core.PuregoSafeRegister(&xNewPrintSettings, libs, "gtk_print_settings_new")
1000	core.PuregoSafeRegister(&xNewPrintSettingsFromFile, libs, "gtk_print_settings_new_from_file")
1001	core.PuregoSafeRegister(&xNewPrintSettingsFromGvariant, libs, "gtk_print_settings_new_from_gvariant")
1002	core.PuregoSafeRegister(&xNewPrintSettingsFromKeyFile, libs, "gtk_print_settings_new_from_key_file")
1003
1004	core.PuregoSafeRegister(&xPrintSettingsCopy, libs, "gtk_print_settings_copy")
1005	core.PuregoSafeRegister(&xPrintSettingsForeach, libs, "gtk_print_settings_foreach")
1006	core.PuregoSafeRegister(&xPrintSettingsGet, libs, "gtk_print_settings_get")
1007	core.PuregoSafeRegister(&xPrintSettingsGetBool, libs, "gtk_print_settings_get_bool")
1008	core.PuregoSafeRegister(&xPrintSettingsGetCollate, libs, "gtk_print_settings_get_collate")
1009	core.PuregoSafeRegister(&xPrintSettingsGetDefaultSource, libs, "gtk_print_settings_get_default_source")
1010	core.PuregoSafeRegister(&xPrintSettingsGetDither, libs, "gtk_print_settings_get_dither")
1011	core.PuregoSafeRegister(&xPrintSettingsGetDouble, libs, "gtk_print_settings_get_double")
1012	core.PuregoSafeRegister(&xPrintSettingsGetDoubleWithDefault, libs, "gtk_print_settings_get_double_with_default")
1013	core.PuregoSafeRegister(&xPrintSettingsGetDuplex, libs, "gtk_print_settings_get_duplex")
1014	core.PuregoSafeRegister(&xPrintSettingsGetFinishings, libs, "gtk_print_settings_get_finishings")
1015	core.PuregoSafeRegister(&xPrintSettingsGetInt, libs, "gtk_print_settings_get_int")
1016	core.PuregoSafeRegister(&xPrintSettingsGetIntWithDefault, libs, "gtk_print_settings_get_int_with_default")
1017	core.PuregoSafeRegister(&xPrintSettingsGetLength, libs, "gtk_print_settings_get_length")
1018	core.PuregoSafeRegister(&xPrintSettingsGetMediaType, libs, "gtk_print_settings_get_media_type")
1019	core.PuregoSafeRegister(&xPrintSettingsGetNCopies, libs, "gtk_print_settings_get_n_copies")
1020	core.PuregoSafeRegister(&xPrintSettingsGetNumberUp, libs, "gtk_print_settings_get_number_up")
1021	core.PuregoSafeRegister(&xPrintSettingsGetNumberUpLayout, libs, "gtk_print_settings_get_number_up_layout")
1022	core.PuregoSafeRegister(&xPrintSettingsGetOrientation, libs, "gtk_print_settings_get_orientation")
1023	core.PuregoSafeRegister(&xPrintSettingsGetOutputBin, libs, "gtk_print_settings_get_output_bin")
1024	core.PuregoSafeRegister(&xPrintSettingsGetPageRanges, libs, "gtk_print_settings_get_page_ranges")
1025	core.PuregoSafeRegister(&xPrintSettingsGetPageSet, libs, "gtk_print_settings_get_page_set")
1026	core.PuregoSafeRegister(&xPrintSettingsGetPaperHeight, libs, "gtk_print_settings_get_paper_height")
1027	core.PuregoSafeRegister(&xPrintSettingsGetPaperSize, libs, "gtk_print_settings_get_paper_size")
1028	core.PuregoSafeRegister(&xPrintSettingsGetPaperWidth, libs, "gtk_print_settings_get_paper_width")
1029	core.PuregoSafeRegister(&xPrintSettingsGetPrintPages, libs, "gtk_print_settings_get_print_pages")
1030	core.PuregoSafeRegister(&xPrintSettingsGetPrinter, libs, "gtk_print_settings_get_printer")
1031	core.PuregoSafeRegister(&xPrintSettingsGetPrinterLpi, libs, "gtk_print_settings_get_printer_lpi")
1032	core.PuregoSafeRegister(&xPrintSettingsGetQuality, libs, "gtk_print_settings_get_quality")
1033	core.PuregoSafeRegister(&xPrintSettingsGetResolution, libs, "gtk_print_settings_get_resolution")
1034	core.PuregoSafeRegister(&xPrintSettingsGetResolutionX, libs, "gtk_print_settings_get_resolution_x")
1035	core.PuregoSafeRegister(&xPrintSettingsGetResolutionY, libs, "gtk_print_settings_get_resolution_y")
1036	core.PuregoSafeRegister(&xPrintSettingsGetReverse, libs, "gtk_print_settings_get_reverse")
1037	core.PuregoSafeRegister(&xPrintSettingsGetScale, libs, "gtk_print_settings_get_scale")
1038	core.PuregoSafeRegister(&xPrintSettingsGetUseColor, libs, "gtk_print_settings_get_use_color")
1039	core.PuregoSafeRegister(&xPrintSettingsHasKey, libs, "gtk_print_settings_has_key")
1040	core.PuregoSafeRegister(&xPrintSettingsLoadFile, libs, "gtk_print_settings_load_file")
1041	core.PuregoSafeRegister(&xPrintSettingsLoadKeyFile, libs, "gtk_print_settings_load_key_file")
1042	core.PuregoSafeRegister(&xPrintSettingsSet, libs, "gtk_print_settings_set")
1043	core.PuregoSafeRegister(&xPrintSettingsSetBool, libs, "gtk_print_settings_set_bool")
1044	core.PuregoSafeRegister(&xPrintSettingsSetCollate, libs, "gtk_print_settings_set_collate")
1045	core.PuregoSafeRegister(&xPrintSettingsSetDefaultSource, libs, "gtk_print_settings_set_default_source")
1046	core.PuregoSafeRegister(&xPrintSettingsSetDither, libs, "gtk_print_settings_set_dither")
1047	core.PuregoSafeRegister(&xPrintSettingsSetDouble, libs, "gtk_print_settings_set_double")
1048	core.PuregoSafeRegister(&xPrintSettingsSetDuplex, libs, "gtk_print_settings_set_duplex")
1049	core.PuregoSafeRegister(&xPrintSettingsSetFinishings, libs, "gtk_print_settings_set_finishings")
1050	core.PuregoSafeRegister(&xPrintSettingsSetInt, libs, "gtk_print_settings_set_int")
1051	core.PuregoSafeRegister(&xPrintSettingsSetLength, libs, "gtk_print_settings_set_length")
1052	core.PuregoSafeRegister(&xPrintSettingsSetMediaType, libs, "gtk_print_settings_set_media_type")
1053	core.PuregoSafeRegister(&xPrintSettingsSetNCopies, libs, "gtk_print_settings_set_n_copies")
1054	core.PuregoSafeRegister(&xPrintSettingsSetNumberUp, libs, "gtk_print_settings_set_number_up")
1055	core.PuregoSafeRegister(&xPrintSettingsSetNumberUpLayout, libs, "gtk_print_settings_set_number_up_layout")
1056	core.PuregoSafeRegister(&xPrintSettingsSetOrientation, libs, "gtk_print_settings_set_orientation")
1057	core.PuregoSafeRegister(&xPrintSettingsSetOutputBin, libs, "gtk_print_settings_set_output_bin")
1058	core.PuregoSafeRegister(&xPrintSettingsSetPageRanges, libs, "gtk_print_settings_set_page_ranges")
1059	core.PuregoSafeRegister(&xPrintSettingsSetPageSet, libs, "gtk_print_settings_set_page_set")
1060	core.PuregoSafeRegister(&xPrintSettingsSetPaperHeight, libs, "gtk_print_settings_set_paper_height")
1061	core.PuregoSafeRegister(&xPrintSettingsSetPaperSize, libs, "gtk_print_settings_set_paper_size")
1062	core.PuregoSafeRegister(&xPrintSettingsSetPaperWidth, libs, "gtk_print_settings_set_paper_width")
1063	core.PuregoSafeRegister(&xPrintSettingsSetPrintPages, libs, "gtk_print_settings_set_print_pages")
1064	core.PuregoSafeRegister(&xPrintSettingsSetPrinter, libs, "gtk_print_settings_set_printer")
1065	core.PuregoSafeRegister(&xPrintSettingsSetPrinterLpi, libs, "gtk_print_settings_set_printer_lpi")
1066	core.PuregoSafeRegister(&xPrintSettingsSetQuality, libs, "gtk_print_settings_set_quality")
1067	core.PuregoSafeRegister(&xPrintSettingsSetResolution, libs, "gtk_print_settings_set_resolution")
1068	core.PuregoSafeRegister(&xPrintSettingsSetResolutionXy, libs, "gtk_print_settings_set_resolution_xy")
1069	core.PuregoSafeRegister(&xPrintSettingsSetReverse, libs, "gtk_print_settings_set_reverse")
1070	core.PuregoSafeRegister(&xPrintSettingsSetScale, libs, "gtk_print_settings_set_scale")
1071	core.PuregoSafeRegister(&xPrintSettingsSetUseColor, libs, "gtk_print_settings_set_use_color")
1072	core.PuregoSafeRegister(&xPrintSettingsToFile, libs, "gtk_print_settings_to_file")
1073	core.PuregoSafeRegister(&xPrintSettingsToGvariant, libs, "gtk_print_settings_to_gvariant")
1074	core.PuregoSafeRegister(&xPrintSettingsToKeyFile, libs, "gtk_print_settings_to_key_file")
1075	core.PuregoSafeRegister(&xPrintSettingsUnset, libs, "gtk_print_settings_unset")
1076
1077}

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