// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::DrawContext;
use glib::translate::*;
use std::fmt;

glib::wrapper! {
    #[doc(alias = "GdkCairoContext")]
    pub struct CairoContext(Object<ffi::GdkCairoContext>) @extends DrawContext;

    match fn {
        type_ => || ffi::gdk_cairo_context_get_type(),
    }
}

impl CairoContext {
    #[doc(alias = "gdk_cairo_context_cairo_create")]
    pub fn cairo_create(&self) -> Option<cairo::Context> {
        unsafe { from_glib_full(ffi::gdk_cairo_context_cairo_create(self.to_glib_none().0)) }
    }
}

impl fmt::Display for CairoContext {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("CairoContext")
    }
}
