// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
#![allow(deprecated)]

use crate::{DrawContext, ffi};
use glib::translate::*;

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

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

impl CairoContext {
    #[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
    #[allow(deprecated)]
    #[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)) }
    }
}
