diff options
Diffstat (limited to 'src/pango.hh')
| -rw-r--r-- | src/pango.hh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/pango.hh b/src/pango.hh new file mode 100644 index 0000000..2b92366 --- /dev/null +++ b/src/pango.hh @@ -0,0 +1,41 @@ +#ifndef PANGO_HH +#define PANGO_HH + +#include <memory> +#include <pango/pangocairo.h> + +namespace pango { + +namespace priv { + +struct GObjectDelete { + void operator()(gpointer ptr) const { + g_object_unref(ptr); + } +}; + +struct PangoFontMetricsDelete { + void operator()(PangoFontMetrics* ptr) const { + pango_font_metrics_unref(ptr); + } +}; + +struct PangoFontDescriptionDelete { + void operator()(PangoFontDescription* ptr) const { + pango_font_description_free(ptr); + } +}; + +} // namespace priv + +typedef std::unique_ptr<PangoLayout, priv::GObjectDelete> unique_layout; + +typedef std::unique_ptr<PangoFontDescription, priv::PangoFontDescriptionDelete> + unique_font_description; + +typedef std::unique_ptr<PangoFontMetrics, priv::PangoFontMetricsDelete> + unique_font_metrics; + +} // namespace pango + +#endif // PANGO_HH |
