func newCairoDevice(d *C.cairo_device_t) (Device, error) { t := deviceType(C.cairo_device_get_type(d)) _ = deviceGetID(d) //panics if created outside of cairo without being registered f, ok := cdevtogodev[t] if !ok { D := NewXtensionDevice(d) return D, D.Err() } return f(d) }
//Type reports the type of this device. // //Originally cairo_device_get_type. func (c *XtensionDevice) Type() deviceType { return deviceType(C.cairo_device_get_type(c.d)) }