Changeset 119

Show
Ignore:
Timestamp:
12/02/06 20:39:23 (2 years ago)
Author:
Gregor
Message:

bcd.gen/bcd/gen/bcdgen.d: Proper support for static functions.

bcd.gen/scripts/fltk.sh, bindings/bcd/fltk/*: New FLTK1 bindings.

bindings/test/fltk.*, bindings/Makefile: fltkexa for the new FLTK1 bindings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bcd.gen/bcd/gen/bcdgen.d

    r116 r119  
    11111111 
    11121112void parse_Function_body(xmlNode *node, char[] name, char[] mangled, char[] demangled, ParsedType type, 
    1113                          char[] Dargs, char[] Deargs, char[] Cargs, char[] Dcall, char[] Ccall) 
     1113                         char[] Dargs, char[] Deargs, char[] Cargs, char[] Dcall, char[] Ccall, 
     1114                         bool isStatic = false) 
    11141115{ 
    11151116    // make sure it's not already defined (particularly problematic for overrides that aren't overrides in D) 
     
    11271128     
    11281129    if (!type.isClass) { 
    1129         dtail ~= type.DType ~ " " ~ name ~ "(" ~ Dargs ~ ") {\n"; 
     1130        dtail ~= (isStatic ? "static " : "") ~ 
     1131            type.DType ~ " " ~ name ~ "(" ~ Dargs ~ ") {\n"; 
    11301132        if (type.DType != "void") { 
    11311133            dtail ~= "return "; 
     
    12161218void parse_Method(xmlNode *node, bool reflection) 
    12171219{ 
     1220    /* If it's static, it's for all intents and purposes a function */ 
     1221    if (toStringFree(xmlGetProp(node, "static")) == "1") { 
     1222        if (!reflection) 
     1223            parse_Function(node, true); 
     1224        return; 
     1225    } 
     1226     
    12181227    char[] name = getNName(node); 
    12191228    char[] mangled = toStringFree(getMangled(node)); 
     
    14111420 * Parse a Function node 
    14121421 */ 
    1413 void parse_Function(xmlNode *node
     1422void parse_Function(xmlNode *node, bool isStatic = false
    14141423{ 
    14151424    char[] name = getNName(node); 
     
    14311440    parse_Arguments(node, Dargs, Deargs, Cargs, Dcall, Ccall); 
    14321441    parse_Function_body(node, safeName(name), mangled, demangled, type, 
    1433                         Dargs, Deargs, Cargs, Dcall, Ccall); 
     1442                        Dargs, Deargs, Cargs, Dcall, Ccall, isStatic); 
    14341443} 
    14351444 
  • trunk/bindings/Makefile

    r106 r119  
    66    @echo '<example> is one of:' 
    77    @echo 'cursesexa' 
     8    @echo 'fltkexa' 
    89    @echo 'fltk2exa' 
    910    @echo 'gtk2exa' 
     
    1314cursesexa: test/curses.d 
    1415    sh test/curses.sh ${DMD} 
     16 
     17fltkexa: test/fltk.d bcd/bind.d 
     18    sh test/fltk.sh ${DMD} 
    1519 
    1620fltk2exa: test/fltk2.d bcd/bind.d 
     
    2529vorbisexa: test/vorbis.d 
    2630    sh test/vorbis.sh ${DMD} 
    27  
    28