dcjones/Compose.jl — pull request #76 by lobingera (2014-07-23 12:27:04+00:00)
Title: added CAIROSURFACE and helpers to render to a given Cairo surface

This should be straightforward: CAIROSURFACE as the output 'device' just reuses a given Cairo surface f.e. from a GtkWindow or similar.

A simple test:
```julia
using Compose
using Cairo
using Gadfly
p = plot(x=rand(8,1),y=rand(8,1));
co = render(p);
c = Cairo.CairoRGBSurface(400,300);
cr = Cairo.CairoContext(c);
set_source_rgb(cr,1,1,1);
paint(cr);
Compose.draw(CAIROSURFACE(c),co);
write_to_png(c,"cairosurface.png");
```
produces:
![cairosurface](https://cloud.githubusercontent.com/assets/5199059/3672772/a03796bc-1264-11e4-9811-8b85ade94920.png)