File: print_export.go

package info (click to toggle)
golang-github-gotk3-gotk3 0.6.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,392 kB
  • sloc: ansic: 914; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package gtk

// #include <gtk/gtk.h>
import "C"
import (
	"unsafe"

	"github.com/gotk3/gotk3/glib"
	"github.com/gotk3/gotk3/internal/callback"
)

//export goPageSetupDone
func goPageSetupDone(setup *C.GtkPageSetup, data C.gpointer) {
	// This callback is only used once, so we can clean up immediately
	fn := callback.GetAndDelete(uintptr(data)).(PageSetupDoneCallback)
	fn(wrapPageSetup(glib.Take(unsafe.Pointer(setup))))
}

//export goPrintSettings
func goPrintSettings(key *C.gchar, value *C.gchar, userData C.gpointer) {
	fn := callback.Get(uintptr(userData)).(PrintSettingsCallback)
	fn(C.GoString((*C.char)(key)), C.GoString((*C.char)(value)))
}