示例#1
0
文件: id.go 项目: jimmyfrasche/cairo
func deviceGetID(d *C.cairo_device_t) id {
	p := C.cairo_device_get_user_data(d, idkey)
	if p == nil {
		panic("device does not have ID - created outside of cairo binding and not registered")
	}
	return id(ctoint(p))
}
示例#2
0
文件: id.go 项目: jimmyfrasche/cairo
func deviceSetID(d *C.cairo_device_t) {
	if C.cairo_device_get_user_data(d, idkey) != nil {
		return
	}
	C.cairo_device_set_user_data(d, idkey, generateID(), free)
}