USING: accessors cairo cairo.ffi fry images images.memory kernel math.rectangles colors.constants images.memory.private destructors ; IN: cairo-png : make-png-image ( dim quot filename -- ) '[ _ [ malloc-bitmap-data ] keep &cairo_surface_destroy [ &cairo_destroy @ ] [ _ cairo_surface_write_to_png drop ] bi ] with-destructors ; inline : hello-cairo ( -- ) { 300 300 } [ { 100 100 } { 200 200 } fill-rect ] "hello.png" make-png-image ; MAIN: hello-cairo