///
/// Generate def for connecting events
///
/// TODO: Cleanup this code
Generate def for connecting events
TODO: Cleanup this code
Generate def for connecting events TODO : Cleanup this code
pub fn callback_fun_def_name(
        dest: &mut String,
        def: bool,
        name: &str,
        post_name: &str,
        func: &Function,
    ) {
        use std::fmt::Write;
        if def {
            write!(dest,
                "void (*set_{}{})(void* object, void* user_data, void* wrapped_func, void (*event)(",
                name, post_name).unwrap()
        } else {
            write!(
                dest,
                "void set_{}{}(void* object, void* user_data, void* wrapped_func, void (*event)(",
                name, post_name
            ).unwrap();
        };
        // TODO: Fix this hack
        if post_name != "_event" {
            write!(
                dest,
                "{})",
                func.gen_c_def_filter(Some(Some("void*, void*".into())), |_, _| None)
            ).unwrap()
        } else {
            write!(
                dest,
                "{})",
                func.gen_c_def_filter(Some(Some("void*, void*".into())), |_, _| None)
            ).unwrap()
        }
    }
pub fn callback_fun_def_name ( dest : & mut String , def : bool , name : & str , post_name : & str , func : & Function , ) { use std :: fmt :: Write ; if def { write ! ( dest " " name post_name ) . unwrap ( ) } else { write ! ( dest " " name post_name ) . unwrap ( ) ; } ; // TODO: Fix this hack if post_name != " " { write ! ( dest " " func gen_c_def_filter ( Some ( Some ( " " into ( ) ) ) None ) ) . unwrap ( ) } else { write ! ( dest " " func gen_c_def_filter ( Some ( Some ( " " into ( ) ) ) None ) ) . unwrap ( ) } }
Generate def for connecting events
TODO: Cleanup this code
Generate def for connecting events TODO : Cleanup this code
dest
&mut String
def
bool
name
&str
post_name
&str
func
&Function