示例#1
0
文件: io.go 项目: jimmyfrasche/cairo
//XtensionRegisterWriter registers the writer wrapped by XtensionWrapWriter
//with the surface so that it does not get garbage collected until libcairo
//releases the device.
//
//See XtensionWrapWriter for more information.
func (d *XtensionDevice) XtensionRegisterWriter(w unsafe.Pointer) {
	if err := d.Err(); err != nil {
		go_write_callback_reaper(w)
	}
	W := (*writer)(w)
	W.id = d.id()
	C.cairo_device_set_user_data(d.d, wkey, w, C.wreaper_getter())
	storeWriter(W)
}
示例#2
0
文件: io.go 项目: jimmyfrasche/cairo
//XtensionRegisterWriter registers the writer wrapped by XtensionWrapWriter
//with the surface so that it does not get garbage collected until libcairo
//releases the surface.
//
//See XtensionWrapWriter for more information.
func (s *XtensionSurface) XtensionRegisterWriter(w unsafe.Pointer) {
	if err := s.Err(); err != nil {
		go_write_callback_reaper(w)
	}
	W := (*writer)(w)
	W.id = s.id()
	C.cairo_surface_set_user_data(s.s, wkey, w, C.wreaper_getter())
	storeWriter(W)
}