Exemplo n.º 1
0
// Conversion funcs
func newLayoutFromNative(obj unsafe.Pointer) interface{} {
	l := &Layout{}
	l.object = C.to_PangoLayout(obj)

	if gobject.IsObjectFloating(l) {
		gobject.RefSink(l)
	} else {
		gobject.Ref(l)
	}
	layoutFinalizer(l)

	return l
}
Exemplo n.º 2
0
// Conversion funcs
func newFontsetFromNative(obj unsafe.Pointer) interface{} {
	f := &Fontset{}
	f.object = C.to_PangoFontset(obj)

	if gobject.IsObjectFloating(f) {
		gobject.RefSink(f)
	} else {
		gobject.Ref(f)
	}
	fontsetFinalizer(f)

	return f
}
Exemplo n.º 3
0
// Conversion funcs
func newContextFromNative(obj unsafe.Pointer) interface{} {
	c := &Context{}
	c.object = C.to_PangoContext(obj)

	if gobject.IsObjectFloating(c) {
		gobject.RefSink(c)
	} else {
		gobject.Ref(c)
	}
	contextFinalizer(c)

	return c
}
Exemplo n.º 4
0
// Conversion function
func newWindowFromNative(obj unsafe.Pointer) interface{} {
	w := &Window{}
	w.object = C.to_GdkWindow(obj)

	if gobject.IsObjectFloating(w) {
		gobject.RefSink(w)
	} else {
		gobject.Ref(w)
	}
	windowFinalizer(w)

	return w
}
Exemplo n.º 5
0
// Conversion function
func newScreenFromNative(obj unsafe.Pointer) interface{} {
	s := &Screen{}
	s.object = C.to_GdkScreen(obj)

	if gobject.IsObjectFloating(s) {
		gobject.RefSink(s)
	} else {
		gobject.Ref(s)
	}
	screenFinalizer(s)

	return s
}
Exemplo n.º 6
0
// Conversion function
func newDeviceFromNative(obj unsafe.Pointer) interface{} {
	d := &Device{}
	d.object = C.to_GdkDevice(obj)

	if gobject.IsObjectFloating(d) {
		gobject.RefSink(d)
	} else {
		gobject.Ref(d)
	}
	deviceFinalizer(d)

	return d
}