Exemplo n.º 1
0
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)
}
Exemplo n.º 2
0
//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))
}