From eb5fd01c5aa7759bc626b9604bc786ea6c492a35 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Fri, 17 Jul 2020 11:45:25 +0200 Subject: Break out MonMon parts that are unrelated to Icecc to a separate class --- src/cairo.hh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/cairo.hh (limited to 'src/cairo.hh') diff --git a/src/cairo.hh b/src/cairo.hh new file mode 100644 index 0000000..a53cee9 --- /dev/null +++ b/src/cairo.hh @@ -0,0 +1,50 @@ +#ifndef CAIRO_HH +#define CAIRO_HH + +#include +#include + +namespace cairo { + +namespace priv { + +struct CairoSurfaceDelete { + void operator()(cairo_surface_t* surface) const { + cairo_surface_destroy(surface); + } +}; + +struct CairoDelete { + void operator()(cairo_t* cairo) const { + cairo_destroy(cairo); + } +}; + +struct CairoPatternDelete { + void operator()(cairo_pattern_t* pattern) const { + cairo_pattern_destroy(pattern); + } +}; + +struct CairoPathDelete { + void operator()(cairo_path_t* path) const { + cairo_path_destroy(path); + } +}; + +} // namespace priv + +typedef std::unique_ptr + unique_surface; + +typedef std::unique_ptr + unique_path; + +typedef std::unique_ptr + unique_pattern; + +typedef std::unique_ptr unique; + +} // namespace cairo + +#endif // CAIRO_HH -- cgit v1.3