pub fn add_dirty_callback<P: Fn(&Onscreen, &OnscreenDirtyInfo) + 'static>(
        &self,
        callback: P,
    ) -> Option<OnscreenDirtyClosure> {
        let callback_data: Box_<P> = Box_::new(callback);
        unsafe extern "C" fn callback_func<P: Fn(&Onscreen, &OnscreenDirtyInfo) + 'static>(
            onscreen: *mut ffi::CoglOnscreen,
            info: *const ffi::CoglOnscreenDirtyInfo,
            user_data: glib_sys::gpointer,
        ) {
            let onscreen = from_glib_borrow(onscreen);
            let info = from_glib_borrow(info);
            let callback: &P = &*(user_data as *mut _);
            (*callback)(&onscreen, &info);
        }
        let callback = Some(callback_func::<P> as _);
        let super_callback0: Box_<P> = callback_data;
        unsafe {
            from_glib_full(ffi::cogl_onscreen_add_dirty_callback(
                self.to_glib_none().0,
                callback,
                Box_::into_raw(super_callback0) as *mut _,
                None,
            ))
        }
    }
/// Installs a `callback` function that will be called whenever the
/// window system has lost the contents of a region of the onscreen
/// buffer and the application should redraw it to repair the buffer.
/// For example this may happen in a window system without a compositor
/// if a window that was previously covering up the onscreen window has
/// been moved causing a region of the onscreen to be exposed.
///
/// The `callback` will be passed a `OnscreenDirtyInfo` struct which
/// decribes a rectangle containing the newly dirtied region. Note that
/// this may be called multiple times to describe a non-rectangular
/// region composed of multiple smaller rectangles.
///
/// The dirty events are separate from `FrameEvent::Sync` events so
/// the application should also listen for this event before rendering
/// the dirty region to ensure that the framebuffer is actually ready
/// for rendering.
/// ## `callback`
/// A callback function to call for dirty events
/// ## `user_data`
/// A private pointer to be passed to `callback`
///
/// # Returns
///
/// a `OnscreenDirtyClosure` pointer that can be used to
///  remove the callback and associated `user_data` later.
Installs a `callback` function that will be called whenever the
window system has lost the contents of a region of the onscreen
buffer and the application should redraw it to repair the buffer.
For example this may happen in a window system without a compositor
if a window that was previously covering up the onscreen window has
been moved causing a region of the onscreen to be exposed.

The `callback` will be passed a `OnscreenDirtyInfo` struct which
decribes a rectangle containing the newly dirtied region. Note that
this may be called multiple times to describe a non-rectangular
region composed of multiple smaller rectangles.

The dirty events are separate from `FrameEvent::Sync` events so
the application should also listen for this event before rendering
the dirty region to ensure that the framebuffer is actually ready
for rendering.
Installs a ` callback ` function that will be called whenever the window system has lost the contents of a region of the onscreen buffer and the application should redraw it to repair the buffer . For example this may happen in a window system without a compositor if a window that was previously covering up the onscreen window has been moved causing a region of the onscreen to be exposed . The ` callback ` will be passed a ` OnscreenDirtyInfo ` struct which decribes a rectangle containing the newly dirtied region . Note that this may be called multiple times to describe a non - rectangular region composed of multiple smaller rectangles . The dirty events are separate from ` FrameEvent :: Sync ` events so the application should also listen for this event before rendering the dirty region to ensure that the framebuffer is actually ready for rendering .
pub fn add_dirty_callback<P: Fn(&Onscreen, &OnscreenDirtyInfo) + 'static>(
        &self,
        callback: P,
    ) -> Option<OnscreenDirtyClosure> {
        let callback_data: Box_<P> = Box_::new(callback);
        unsafe extern "C" fn callback_func<P: Fn(&Onscreen, &OnscreenDirtyInfo) + 'static>(
            onscreen: *mut ffi::CoglOnscreen,
            info: *const ffi::CoglOnscreenDirtyInfo,
            user_data: glib_sys::gpointer,
        ) {
            let onscreen = from_glib_borrow(onscreen);
            let info = from_glib_borrow(info);
            let callback: &P = &*(user_data as *mut _);
            (*callback)(&onscreen, &info);
        }
        let callback = Some(callback_func::<P> as _);
        let super_callback0: Box_<P> = callback_data;
        unsafe {
            from_glib_full(ffi::cogl_onscreen_add_dirty_callback(
                self.to_glib_none().0,
                callback,
                Box_::into_raw(super_callback0) as *mut _,
                None,
            ))
        }
    }
pub fn add_dirty_callback < P : Fn ( & Onscreen , & OnscreenDirtyInfo ) + ' static > ( & self , callback : P , ) -> Option < OnscreenDirtyClosure > { let callback_data : Box_ < P > = Box_ :: new ( callback ) ; unsafe extern " " fn callback_func < P : Fn ( & Onscreen , & OnscreenDirtyInfo ) + ' static > ( onscreen : * mut ffi :: CoglOnscreen , info : * const ffi :: CoglOnscreenDirtyInfo , user_data : glib_sys :: gpointer , ) { let onscreen = from_glib_borrow ( onscreen ) ; let info = from_glib_borrow ( info ) ; let callback : & P = & * ( user_data as * mut _ ) ; ( * callback ) ( & onscreen , & info ) ; } let callback = Some ( callback_func :: < P > as _ ) ; let super_callback0 : Box_ < P > = callback_data ; unsafe { from_glib_full ( ffi :: cogl_onscreen_add_dirty_callback ( self . to_glib_none ( ) . 0 , callback , Box_ :: into_raw ( super_callback0 ) as * mut _ , None , ) ) } }
Installs a `callback` function that will be called whenever the
window system has lost the contents of a region of the onscreen
buffer and the application should redraw it to repair the buffer.
Installs a ` callback ` function that will be called whenever the window system has lost the contents of a region of the onscreen buffer and the application should redraw it to repair the buffer .
&self
callback
P
a `OnscreenDirtyClosure` pointer that can be used to
remove the callback and associated `user_data` later.
a ` OnscreenDirtyClosure ` pointer that can be used to remove the callback and associated ` user_data ` later .
&self
callback
P
`callback`
A callback function to call for dirty events
A callback function to call for dirty events
`user_data`
A private pointer to be passed to `callback`
A private pointer to be passed to ` callback `