func (c CairoContext) status() error { status := C.cairo_status(c.nativePointer()) if status != 0 { return cairoStatusToError(status) } return nil }
func NewSurfaceFromPNG(filename string) (*Surface, Status) { cstr := C.CString(filename) defer C.free(unsafe.Pointer(cstr)) surfaceNative := C.cairo_image_surface_create_from_png(cstr) status := Status(C.cairo_surface_status(surfaceNative)) if status != STATUS_SUCCESS { return nil, status } contextNative := C.cairo_create(surfaceNative) status = Status(C.cairo_status(contextNative)) if status != STATUS_SUCCESS { return nil, status } surface := &Surface{ surface: surfaceNative, context: contextNative, } return surface, STATUS_SUCCESS }
func (self *Surface) Status() Status { return Status(C.cairo_status(self.context)) }
// Status is a wrapper around cairo_status(). func (v *Context) Status() Status { c := C.cairo_status(v.native()) return Status(c) }
//Err reports the current error state of c. // //Originally cairo_status. func (c *Context) Err() error { if c.c == nil { return ErrInvalidLibcairoHandle } return toerr(C.cairo_status(c.c)) }
// gets the status of the cairo context and returns it as an error func (g *Graphic) cairoStatus() error { status := C.cairo_status(g.cr) return statusToError(status) }