in order to do these are the steps that need to be taken:
-
types and procs interfacing directly with libcairo need to keep their original names
example type example proc
-
The "higher level" user api of this library will get shorter names like Surface, imageSurfaceCreate.
-
destructors will be attached to these types. it will look like this:
type
Surface = object
data: PSurface
`=destroy`(surface: var Surface)
`=`(dst: var Surface, src: Surface) {.error.}
These changes will break the api of this library but will allow the user to forget the closing of resources.