pub fn foreach_attribute<P: FnMut(&Primitive, &Attribute) -> i32>(&self, callback: P) {
        //TODO: should replace i32 to bool in callback
        let callback_data: P = callback;
        unsafe extern "C" fn callback_func<P: FnMut(&Primitive, &Attribute) -> i32>(
            primitive: *mut ffi::CoglPrimitive,
            attribute: *mut ffi::CoglAttribute,
            user_data: glib_sys::gpointer,
        ) -> ffi::CoglBool {
            let primitive = from_glib_borrow(primitive);
            let attribute = from_glib_borrow(attribute);
            let callback: *mut P = user_data as *const _ as usize as *mut P;
            (*callback)(&primitive, &attribute)
        }
        let callback = Some(callback_func::<P> as _);
        let super_callback0: &P = &callback_data;
        unsafe {
            ffi::cogl_primitive_foreach_attribute(
                self.to_glib_none().0,
                callback,
                super_callback0 as *const _ as usize as *mut _,
            );
        }
    }
/// Iterates all the attributes of the given `Primitive`.
/// ## `callback`
/// A `CoglPrimitiveAttributeCallback` to be
///  called for each attribute
/// ## `user_data`
/// Private data that will be passed to the
///  callback
Iterates all the attributes of the given `Primitive`.
Iterates all the attributes of the given ` Primitive ` .
pub fn foreach_attribute<P: FnMut(&Primitive, &Attribute) -> i32>(&self, callback: P) {
        //TODO: should replace i32 to bool in callback
        let callback_data: P = callback;
        unsafe extern "C" fn callback_func<P: FnMut(&Primitive, &Attribute) -> i32>(
            primitive: *mut ffi::CoglPrimitive,
            attribute: *mut ffi::CoglAttribute,
            user_data: glib_sys::gpointer,
        ) -> ffi::CoglBool {
            let primitive = from_glib_borrow(primitive);
            let attribute = from_glib_borrow(attribute);
            let callback: *mut P = user_data as *const _ as usize as *mut P;
            (*callback)(&primitive, &attribute)
        }
        let callback = Some(callback_func::<P> as _);
        let super_callback0: &P = &callback_data;
        unsafe {
            ffi::cogl_primitive_foreach_attribute(
                self.to_glib_none().0,
                callback,
                super_callback0 as *const _ as usize as *mut _,
            );
        }
    }
pub fn foreach_attribute < P : FnMut ( & Primitive , & Attribute ) -> i32 > ( & self , callback : P ) { //TODO: should replace i32 to bool in callback let callback_data : P = callback ; unsafe extern " " fn callback_func < P : FnMut ( & Primitive , & Attribute ) -> i32 > ( primitive : * mut ffi :: CoglPrimitive , attribute : * mut ffi :: CoglAttribute , user_data : glib_sys :: gpointer , ) -> ffi :: CoglBool { let primitive = from_glib_borrow ( primitive ) ; let attribute = from_glib_borrow ( attribute ) ; let callback : * mut P = user_data as * const _ as usize as * mut P ; ( * callback ) ( & primitive , & attribute ) } let callback = Some ( callback_func :: < P > as _ ) ; let super_callback0 : & P = & callback_data ; unsafe { ffi :: cogl_primitive_foreach_attribute ( self . to_glib_none ( ) . 0 , callback , super_callback0 as * const _ as usize as * mut _ , ) ; } }
Iterates all the attributes of the given `Primitive`.
Iterates all the attributes of the given ` Primitive ` .
&self
callback
P
&self
callback
P
`callback`
A `CoglPrimitiveAttributeCallback` to be
called for each attribute
A ` CoglPrimitiveAttributeCallback ` to be called for each attribute
`user_data`
Private data that will be passed to the
callback
Private data that will be passed to the callback