Exemplo n.º 1
0
func marshalCertificateInfo(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	info := (*C.WebKitCertificateInfo)(unsafe.Pointer(c))
	wrapped := wrapCertificateInfo(info)
	runtime.SetFinalizer(wrapped, (*CertificateInfo).free)
	return wrapped, nil
}
Exemplo n.º 2
0
func fromGValue(v *C.GValue) (ret interface{}) {
	valueType := C.gvalue_get_type(v)
	fundamentalType := C.gtype_get_fundamental(valueType)
	switch fundamentalType {
	case C.G_TYPE_OBJECT:
		ret = unsafe.Pointer(C.g_value_get_object(v))
	case C.G_TYPE_STRING:
		ret = fromGStr(C.g_value_get_string(v))
	case C.G_TYPE_UINT:
		ret = int(C.g_value_get_uint(v))
	case C.G_TYPE_BOXED:
		ret = unsafe.Pointer(C.g_value_get_boxed(v))
	case C.G_TYPE_BOOLEAN:
		ret = C.g_value_get_boolean(v) == C.gboolean(1)
	default:
		fmt.Printf("from type %s %T\n", fromGStr(C.g_type_name(fundamentalType)), v)
		panic("FIXME") //TODO
	}
	return
}
Exemplo n.º 3
0
func marshalMessage(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	return &Message{(*C.GstMessage)(unsafe.Pointer(c))}, nil
}
Exemplo n.º 4
0
func marshalGValueArray(p uintptr) (interface{}, error) {
	c := (*C.GValueArray)(unsafe.Pointer(C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))))
	return sliceFromGValueArray(c), nil
}
Exemplo n.º 5
0
Arquivo: glib.go Projeto: vvanpo/gotk3
func marshalBoxed(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	return uintptr(unsafe.Pointer(c)), nil
}
Exemplo n.º 6
0
func marshalSurface(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	surface := (*C.cairo_surface_t)(unsafe.Pointer(c))
	return wrapSurface(surface), nil
}
Exemplo n.º 7
0
func marshalContext(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	context := (*C.cairo_t)(unsafe.Pointer(c))
	return wrapContext(context), nil
}
Exemplo n.º 8
0
func marshalFontDescription(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	c2 := (*C.PangoFontDescription)(unsafe.Pointer(c))
	return wrapFontDescription(c2), nil
}
Exemplo n.º 9
0
func marshalEvent(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	return &Event{(*C.GdkEvent)(unsafe.Pointer(c))}, nil
}
Exemplo n.º 10
0
func marshalRGBA(p uintptr) (interface{}, error) {
	c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
	c2 := (*C.GdkRGBA)(unsafe.Pointer(c))
	return wrapRGBA(c2), nil
}
Exemplo n.º 11
0
Arquivo: gobj.go Projeto: hwch/go-gtk
func (this *Value) GetBoxedInterface() interface{} {
	return *(*interface{})(C.g_value_get_boxed(this.asC()))
}
Exemplo n.º 12
0
Arquivo: gobj.go Projeto: hwch/go-gtk
// g_value_get_boxed
func (this *Value) GetBoxed() unsafe.Pointer {
	return unsafe.Pointer(C.g_value_get_boxed(this.asC()))
}