fn generate_static_get_functions<W: Write>(f: &mut W, api_def: &ApiDef) -> io::Result<()> {
    // TODO: Template here
    //
    // Generate create functions for all structs that are flagged with create function
    // and doesn't have manual create selected on them
    //
    for sdef in api_def
        .class_structs
        .iter()
        .filter(|s| s.has_static_functions())
    {
        f.write_all(SEPARATOR)?;
        let snake_name = sdef.name.to_snake_case();

        //
        // Get the name if we have remapped the name (for example we use Button while Qt uses
        // AbstractButton)
        //
        f.write_fmt(format_args!(
            "static struct RU{} get_{}(struct RUBase* priv_data) {{\n",
            sdef.name, snake_name
        ))?;
        f.write_all(b"    (void)priv_data;\n")?;
        f.write_fmt(format_args!("    RU{} ctl;\n", sdef.name))?;
        f.write_all(b"    ctl.qt_data = nullptr;\n")?;
        f.write_all(b"    ctl.host_data = nullptr;\n")?;
        f.write_fmt(format_args!(
            "    ctl.all_funcs = &s_{}_all_funcs;\n",
            snake_name
        ))?;
        f.write_all(b"    return ctl;\n}\n\n")?;
    }

    Ok(())
}
///
/// Generate get functions to be used with for static functions
///
Generate get functions to be used with for static functions
Generate get functions to be used with for static functions
fn generate_static_get_functions<W: Write>(f: &mut W, api_def: &ApiDef) -> io::Result<()> {
    // TODO: Template here
    //
    // Generate create functions for all structs that are flagged with create function
    // and doesn't have manual create selected on them
    //
    for sdef in api_def
        .class_structs
        .iter()
        .filter(|s| s.has_static_functions())
    {
        f.write_all(SEPARATOR)?;
        let snake_name = sdef.name.to_snake_case();
        //
        // Get the name if we have remapped the name (for example we use Button while Qt uses
        // AbstractButton)
        //
        f.write_fmt(format_args!(
            "static struct RU{} get_{}(struct RUBase* priv_data) {{\n",
            sdef.name, snake_name
        ))?;
        f.write_all(b"    (void)priv_data;\n")?;
        f.write_fmt(format_args!("    RU{} ctl;\n", sdef.name))?;
        f.write_all(b"    ctl.qt_data = nullptr;\n")?;
        f.write_all(b"    ctl.host_data = nullptr;\n")?;
        f.write_fmt(format_args!(
            "    ctl.all_funcs = &s_{}_all_funcs;\n",
            snake_name
        ))?;
        f.write_all(b"    return ctl;\n}\n\n")?;
    }
    Ok(())
}
fn generate_static_get_functions < W : Write > ( f : & mut W , api_def : & ApiDef ) -> io :: Result < ( ) > { // TODO: Template here // // Generate create functions for all structs that are flagged with create function // and doesn't have manual create selected on them // for sdef in api_def . class_structs . iter ( ) . filter ( | s | s . has_static_functions ( ) ) { f . write_all ( SEPARATOR ) ? ; let snake_name = sdef . name . to_snake_case ( ) ; // // Get the name if we have remapped the name (for example we use Button while Qt uses // AbstractButton) // f . write_fmt ( format_args ! ( " \n " sdef name snake_name ) ) ? ; f . write_all ( b" \n " ) ? ; f . write_fmt ( format_args ! ( " \n " sdef name ) ) ? ; f . write_all ( b" \n " ) ? ; f . write_all ( b" \n " ) ? ; f . write_fmt ( format_args ! ( " \n " snake_name ) ) ? ; f . write_all ( b" \n \n \n " ) ? ; } Ok ( ( ) ) }
Generate get functions to be used with for static functions
Generate get functions to be used with for static functions
f
&mut W
api_def
&ApiDef
f
&mut W
api_def
&ApiDef