diff options
| author | Joel Klinghed <the_jk@opera.com> | 2020-07-17 11:45:25 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2020-07-17 11:45:25 +0200 |
| commit | eb5fd01c5aa7759bc626b9604bc786ea6c492a35 (patch) | |
| tree | 7a4309c02c7f25d86715b19d4153da5eb15aa3b8 /src/pango.hh | |
| parent | 97d7b6692202c755c8f47f3ae68f2675506c1c25 (diff) | |
Break out MonMon parts that are unrelated to Icecc to a separate class
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 |
