// 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

use atk_sys;
use glib;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use Object;

glib_wrapper! {
    pub struct GObjectAccessible(Object<atk_sys::AtkGObjectAccessible, atk_sys::AtkGObjectAccessibleClass, GObjectAccessibleClass>) @extends Object;

    match fn {
        get_type => || atk_sys::atk_gobject_accessible_get_type(),
    }
}

impl GObjectAccessible {
    pub fn for_object<P: IsA<glib::Object>>(obj: &P) -> Option<Object> {
        assert_initialized_main_thread!();
        unsafe {
            from_glib_none(atk_sys::atk_gobject_accessible_for_object(
                obj.as_ref().to_glib_none().0,
            ))
        }
    }
}

pub const NONE_GOBJECT_ACCESSIBLE: Option<&GObjectAccessible> = None;

pub trait GObjectAccessibleExt: 'static {
    fn get_object(&self) -> Option<glib::Object>;
}

impl<O: IsA<GObjectAccessible>> GObjectAccessibleExt for O {
    fn get_object(&self) -> Option<glib::Object> {
        unsafe {
            from_glib_none(atk_sys::atk_gobject_accessible_get_object(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl fmt::Display for GObjectAccessible {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "GObjectAccessible")
    }
}
