Changeset 84

Show
Ignore:
Timestamp:
08/17/06 17:22:05 (2 years ago)
Author:
Gregor
Message:

bcd.gen/bcd/gen/bcdgen.d: New options thanks to "MrSunshine?": -P and -DV

bcd.gen/scripts/fltk2.sh, bindings/bcd/fltk2: New options which, as it turns out, were quite helpful for FLTK2!

Files:

Legend:

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

    r80 r84  
    22 * Generate bindings for C[++] in D 
    33 *  
    4  * Authors: Gregor Richards 
     4 * Authors: 
     5 *  Gregor Richards 
     6 *  Tomas "MrSunshine" Wilhelmsson 
    57 *  
    68 * License: 
    79 *  Copyright (C) 2006  Gregor Richards 
     10 *  Copyright (C) 2006  Tomas "MrSunshine" Wilhelmsson 
    811 *   
    912 *  This program is free software; you can redistribute it and/or 
     
    7477/** Should we output symbols provided by any header in the dir? */ 
    7578bool outputAll; 
     79/** Should we generate default values? */ 
     80bool defaultValues = false; 
    7681/** Should we generate consts for enums? */ 
    7782bool outputEnumConst; 
     
    7984bool outputReflections; 
    8085/** Other BCD requirements */ 
     86bool polluteNamespace = false; 
    8187char[][char[]] reqDependencies; 
    8288/** The root to the XML tree */ 
     
    128134        writefln("    the count."); 
    129135        writefln("  -N<symbol to ignore>"); 
     136        writefln("  -P"); 
     137        writefln("    Pollute namespaces (make named enum values public)"); 
    130138        writefln("  -b"); 
    131139        writefln("    Do not prepend 'bcd.' to the D namespace."); 
     140        writefln("  -DV"); 
     141        writefln("    Generate default values for function arguments."); 
    132142        return 1; 
    133143    } 
     
    188198             
    189199            templates ~= "> __IGNORE_" ~ temp ~ ";\n"; 
    190              
     200        } else if (args[i] == "-P") { 
     201            polluteNamespace = true; 
    191202        } else if (args[i] == "-E") { 
    192203            outputEnumConst = true; 
     
    197208        } else if (args[i] == "-b") { 
    198209            dNamespaceBase = ""; 
    199  
     210        } else if (args[i] == "-DV") { 
     211            defaultValues = true; 
    200212        } else { 
    201213            writefln("Argument %s not recognized.", args[i]); 
     
    942954        if (curNode.type == xmlElementType.XML_ELEMENT_NODE) { 
    943955            char[] nname = toString(curNode.name); 
    944              
     956            char[] def = toString(xmlGetProp(curNode, "default")); 
     957 
     958            if(def == "NULL") 
     959                def = "null"; 
     960 
    945961            if (nname == "Argument") { 
    946962                ParsedType atype = parseType(toStringFree(xmlGetProp(curNode, "type"))); 
     
    949965                aname = safeName(aname); 
    950966                 
     967                if(def == "0" && 
     968                   (find(atype.DType, "*") != -1 || 
     969                    atype.isFunctionPtr)) 
     970                    def = "null"; 
     971 
    951972                if (Dargs != "") { 
    952973                    Dargs ~= ", "; 
    953974                } 
     975                 
    954976                if (!reflection || (!atype.isClass && !atype.isClassPtr)) { 
    955                     Dargs ~= atype.DType ~ " " ~ aname; 
     977                    if(def != "" && defaultValues) 
     978                        Dargs ~= atype.DType ~ " " ~ aname ~ " = " ~ def; 
     979                    else 
     980                        Dargs ~= atype.DType ~ " " ~ aname; 
    956981                } else { 
    957982                    Dargs ~= "void *" ~ aname; 
     
    14991524        handledEnums[type] = true; 
    15001525         
    1501         if (aname[0] == '.') return; 
    1502          
    1503         dhead ~= "enum " ~ safeName(aname) ~ " {\n"; 
    1504          
    15051526        xmlNode *curNode = null; 
    15061527         
    1507         for (curNode = node.children; curNode; curNode = curNode.next) { 
    1508             if (curNode.type == xmlElementType.XML_ELEMENT_NODE) { 
    1509                 char[] nname = toString(curNode.name); 
    1510                  
    1511                 if (nname == "EnumValue") { 
    1512                     dhead ~= safeName(getNName(curNode)) ~ "=" ~ 
    1513                     toStringFree(xmlGetProp(curNode, "init")) ~ ",\n"; 
    1514                 } else { 
    1515                     writefln("I don't know how to parse %s!", nname); 
    1516                 } 
    1517             } 
    1518         } 
    1519          
    1520         dhead ~= "}\n"; 
    1521          
     1528        if (aname[0] != '.') 
     1529        { 
     1530         
     1531            dhead ~= "enum " ~ safeName(aname) ~ " {\n"; 
     1532         
     1533         
     1534            for (curNode = node.children; curNode; curNode = curNode.next) { 
     1535                if (curNode.type == xmlElementType.XML_ELEMENT_NODE) { 
     1536                    char[] nname = toString(curNode.name); 
     1537                 
     1538                    if (nname == "EnumValue") { 
     1539                        dhead ~= safeName(getNName(curNode)) ~ "=" ~ 
     1540                        toStringFree(xmlGetProp(curNode, "init")) ~ ",\n"; 
     1541                    } else { 
     1542                        writefln("I don't know how to parse %s!", nname); 
     1543                    } 
     1544                } 
     1545            } 
     1546         
     1547            dhead ~= "}\n"; 
     1548 
     1549            if(polluteNamespace) 
     1550            { 
     1551            for (curNode = node.children; curNode; curNode = curNode.next) { 
     1552                if (curNode.type == xmlElementType.XML_ELEMENT_NODE) { 
     1553                    char[] nname = toString(curNode.name); 
     1554                 
     1555                    if (nname == "EnumValue") { 
     1556                            dhead ~= "alias " ~ safeName(aname) ~ "." ~ safeName(getNName(curNode)) ~ " " ~ 
     1557                            safeName(getNName(curNode)) ~ ";\n"; 
     1558                } else { 
     1559                        writefln("I don't know how to parse %s!", nname); 
     1560                    } 
     1561            } 
     1562        } 
     1563            } 
     1564        } 
    15221565        // then generate consts for it 
    15231566        if (outputEnumConst && !realName) { 
     
    15611604        pt.isClassPtr = isClassPtr; 
    15621605        pt.isFunction = isFunction; 
     1606        pt.isFunctionPtr = isFunctionPtr; 
    15631607        pt.isStaticArray = isStaticArray; 
    15641608        return pt; 
     
    15711615    bool isClassPtr; 
    15721616    bool isFunction; 
     1617    bool isFunctionPtr; 
    15731618    bool isStaticArray; 
    15741619} 
     
    17221767                         
    17231768                        parsedCache[type] = pt; 
    1724                     } else { 
    1725                         parsedCache[type] = new ParsedType(baseType); 
     1769                    } else if (baseType.isFunction) { 
     1770                        ParsedType pt = new ParsedType(baseType); 
     1771                        pt.isFunctionPtr = true; 
     1772                        parsedCache[type] = pt; 
    17261773                    } 
    17271774                     
  • trunk/bcd.gen/scripts/fltk2.sh

    r82 r84  
    1212        echo $i 
    1313         
    14         ./bcdgen $1/${i}.h fltk2 -Ifltk/ -r
     14        ./bcdgen $1/${i}.h fltk2 -Ifltk/ -r -E -P -DV
    1515          -N"fltk::GlutWindow::menu" \ 
    1616          -N"fltk::HelpTarget::name" \ 
  • trunk/bindings/bcd/fltk2/Adjuster.d

    r80 r84  
    5353return _BCD_get__ZN4fltk8Adjuster13default_styleE(__C_data); 
    5454} 
    55 this(int x, int y, int w, int h, char * l) { 
     55this(int x, int y, int w, int h, char * l = null) { 
    5656super(cast(ifloat) 0); 
    5757__C_data = _BCD_new__ZN4fltk8AdjusterC1EiiiiPKc(x, y, w, h, l); 
     
    7373__C_data = null; 
    7474} 
    75 this(int x, int y, int w, int h, char * l) { 
     75this(int x, int y, int w, int h, char * l = null) { 
    7676super(cast(ifloat) 0); 
    7777__C_data = _BCD_new__ZN4fltk8AdjusterC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/AlignGroup.d

    r80 r84  
    5656_BCD__ZN4fltk10AlignGroup6layoutEv(__C_data); 
    5757} 
    58 this(int X, int Y, int W, int H, char * L, char n_to_break, bool vertical, int align_, char dw, char dh) { 
     58this(int X, int Y, int W, int H, char * L = null, char n_to_break = 0, bool vertical = 1, int align_ = ALIGN_LEFT, char dw = 0, char dh = 0) { 
    5959super(cast(ifloat) 0); 
    6060__C_data = _BCD_new__ZN4fltk10AlignGroupC1EiiiiPKchbihh(X, Y, W, H, L, n_to_break, vertical, align_, dw, dh); 
     
    9797__C_data = null; 
    9898} 
    99 this(int X, int Y, int W, int H, char * L, char n_to_break, bool vertical, int align_, char dw, char dh) { 
     99this(int X, int Y, int W, int H, char * L = null, char n_to_break = 0, bool vertical = 1, int align_ = ALIGN_LEFT, char dw = 0, char dh = 0) { 
    100100super(cast(ifloat) 0); 
    101101__C_data = _BCD_new__ZN4fltk10AlignGroupC1EiiiiPKchbihh_R(X, Y, W, H, L, n_to_break, vertical, align_, dw, dh); 
  • trunk/bindings/bcd/fltk2/BarGroup.d

    r80 r84  
    8181return _BCD_get__ZN4fltk8BarGroup13default_styleE(__C_data); 
    8282} 
    83 this(int x, int y, int w, int h, char * l) { 
     83this(int x, int y, int w, int h, char * l = null) { 
    8484super(cast(ifloat) 0); 
    8585__C_data = _BCD_new__ZN4fltk8BarGroupC1EiiiiPKc(x, y, w, h, l); 
     
    119119__C_data = null; 
    120120} 
    121 this(int x, int y, int w, int h, char * l) { 
     121this(int x, int y, int w, int h, char * l = null) { 
    122122super(cast(ifloat) 0); 
    123123__C_data = _BCD_new__ZN4fltk8BarGroupC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/Box.d

    r80 r84  
    288288return _BCD__ZNK4fltk8FrameBox8is_frameEv(__C_data); 
    289289} 
    290 this(char * name, int dx, int dy, int dw, int dh, char * pattern, Symbol * down) { 
     290this(char * name, int dx, int dy, int dw, int dh, char * pattern, Symbol * down = null) { 
    291291super(cast(ifloat) 0); 
    292292__C_data = _BCD_new__ZN4fltk8FrameBoxC1EPKciiiiS2_PKNS_6SymbolE(name, dx, dy, dw, dh, pattern, down.__C_data); 
     
    299299__C_data = null; 
    300300} 
    301 this(char * name, int dx, int dy, int dw, int dh, char * pattern, Symbol * down) { 
     301this(char * name, int dx, int dy, int dw, int dh, char * pattern, Symbol * down = null) { 
    302302super(cast(ifloat) 0); 
    303303__C_data = _BCD_new__ZN4fltk8FrameBoxC1EPKciiiiS2_PKNS_6SymbolE_R(name, dx, dy, dw, dh, pattern, down.__C_data); 
  • trunk/bindings/bcd/fltk2/Browser.d

    r82 r84  
    5757BOTTOM=3, 
    5858} 
     59alias linepos.NOSCROLL NOSCROLL; 
     60alias linepos.TOP TOP; 
     61alias linepos.MIDDLE MIDDLE; 
     62alias linepos.BOTTOM BOTTOM; 
    5963extern (C) bool _BCD__ZN4fltk7Browser17make_item_visibleENS0_7lineposE(void *This, int); 
    6064extern (C) void _BCD__ZN4fltk7Browser11damage_itemEv(void *This); 
     
    8690LEAF=1, 
    8791} 
     92alias NodeType.GROUP GROUP; 
     93alias NodeType.LEAF LEAF; 
    8894extern (C) void _BCD__ZN4fltk7Browser10set_symbolENS0_8NodeTypeEPKNS_6SymbolES4_S4_(void *This, int, void *, void *, void *); 
    8995extern (C) bcd.bind.BoundClass * _BCD__ZNK4fltk7Browser10get_symbolENS0_8NodeTypeEi(void *This, int, int); 
     
    135141alias void function(Widget *, void *) _BCD_func__172; 
    136142alias bool function() _BCD_func__563; 
     143const int IS_MULTI = 1; 
     144const int NORMAL = 224; 
     145const int MULTI = 225; 
     146const int NO_COLUMN_SELECTED = -1; 
     147const int HERE = 0; 
     148const int FOCUS = 1; 
     149const int FIRST_VISIBLE = 2; 
     150const int REDRAW_0 = 3; 
     151const int REDRAW_1 = 4; 
     152const int OPEN = 5; 
     153const int TEMP = 6; 
     154const int TREE_TRAVERSAL = 7; 
     155const int USER1 = 8; 
     156const int USER2 = 9; 
     157const int NUMMARKS = 10; 
    137158class Browser : Menu { 
    138159this(ifloat ignore) { 
     
    175196_BCD__ZN4fltk7Browser4drawEv(__C_data); 
    176197} 
    177 this(int X, int Y, int W, int H, char * l) { 
     198this(int X, int Y, int W, int H, char * l = null) { 
    178199super(cast(ifloat) 0); 
    179200__C_data = _BCD_new__ZN4fltk7BrowserC1EiiiiPKc(X, Y, W, H, l); 
     
    225246return _BCD__ZN4fltk7Browser10goto_indexEi(__C_data, _0); 
    226247} 
    227 Widget * goto_index(int _0, int _1, int _2, int _3, int _4) { 
     248Widget * goto_index(int _0, int _1, int _2 = -1, int _3 = -1, int _4 = -1) { 
    228249return _BCD__ZN4fltk7Browser10goto_indexEiiiii(__C_data, _0, _1, _2, _3, _4); 
    229250} 
     
    252273return _BCD__ZN4fltk7Browser9set_focusEv(__C_data); 
    253274} 
    254 bool set_item_selected(bool value, int do_callback) { 
     275bool set_item_selected(bool value = true, int do_callback = 0) { 
    255276return _BCD__ZN4fltk7Browser17set_item_selectedEbi(__C_data, value, do_callback); 
    256277} 
    257 bool select_only_this(int do_callback) { 
     278bool select_only_this(int do_callback = 0) { 
    258279return _BCD__ZN4fltk7Browser16select_only_thisEi(__C_data, do_callback); 
    259280} 
    260 bool deselect(int do_callback) { 
     281bool deselect(int do_callback = 0) { 
    261282return _BCD__ZN4fltk7Browser8deselectEi(__C_data, do_callback); 
    262283} 
    263 bool make_item_visible(int _0) { 
     284bool make_item_visible(int _0 = NOSCROLL) { 
    264285return _BCD__ZN4fltk7Browser17make_item_visibleENS0_7lineposE(__C_data, _0); 
    265286} 
     
    306327return _BCD__ZN4fltk7Browser16set_column_startEii(__C_data, column, x); 
    307328} 
    308 bool select(int line, bool value) { 
     329bool select(int line, bool value = true) { 
    309330return _BCD__ZN4fltk7Browser6selectEib(__C_data, line, value); 
    310331} 
     
    327348return _BCD__ZN4fltk7Browser9displayedEi(__C_data, line); 
    328349} 
    329 bool display(int line, bool value) { 
     350bool display(int line, bool value = true) { 
    330351return _BCD__ZN4fltk7Browser7displayEib(__C_data, line, value); 
    331352} 
     
    336357return _BCD__ZNK4fltk7Browser7nheaderEv(__C_data); 
    337358} 
    338 void set_symbol(int nodetype, bcd.bind.BoundClass * imgClosed, bcd.bind.BoundClass * imgFocus, bcd.bind.BoundClass * imgOpen) { 
     359void set_symbol(int nodetype, bcd.bind.BoundClass * imgClosed = null, bcd.bind.BoundClass * imgFocus = null, bcd.bind.BoundClass * imgOpen = null) { 
    339360_BCD__ZN4fltk7Browser10set_symbolENS0_8NodeTypeEPKNS_6SymbolES4_S4_(__C_data, nodetype, imgClosed.__C_data, imgFocus.__C_data, imgOpen.__C_data); 
    340361} 
    341 bcd.bind.BoundClass * get_symbol(int nodetype, int f) { 
     362bcd.bind.BoundClass * get_symbol(int nodetype, int f = NO_FLAGS) { 
    342363return _BCD__ZNK4fltk7Browser10get_symbolENS0_8NodeTypeEi(__C_data, nodetype, f); 
    343364} 
    344 bcd.bind.BoundClass * add_group(char * label, Group * parent, int state, bcd.bind.BoundClass * imgClosed, bcd.bind.BoundClass * imgFocus, bcd.bind.BoundClass * imgOpen) { 
     365bcd.bind.BoundClass * add_group(char * label, Group * parent = null, int state = VALUE, bcd.bind.BoundClass * imgClosed = null, bcd.bind.BoundClass * imgFocus = null, bcd.bind.BoundClass * imgOpen = null) { 
    345366return _BCD__ZN4fltk7Browser9add_groupEPKcPNS_5GroupEiPKNS_6SymbolES7_S7_(__C_data, label, parent.__C_data, state, imgClosed.__C_data, imgFocus.__C_data, imgOpen.__C_data); 
    346367} 
    347 bcd.bind.BoundClass * add_leaf(char * label, Group * parent, bcd.bind.BoundClass * img, bcd.bind.BoundClass * imgFocus) { 
     368bcd.bind.BoundClass * add_leaf(char * label, Group * parent = null, bcd.bind.BoundClass * img = null, bcd.bind.BoundClass * imgFocus = null) { 
    348369return _BCD__ZN4fltk7Browser8add_leafEPKcPNS_5GroupEPKNS_6SymbolES7_(__C_data, label, parent.__C_data, img.__C_data, imgFocus.__C_data); 
    349370} 
     
    369390__C_data = null; 
    370391} 
    371 this(int X, int Y, int W, int H, char * l) { 
     392this(int X, int Y, int W, int H, char * l = null) { 
    372393super(cast(ifloat) 0); 
    373394__C_data = _BCD_new__ZN4fltk7BrowserC1EiiiiPKc_R(X, Y, W, H, l); 
  • trunk/bindings/bcd/fltk2/Button.d

    r80 r84  
    5050alias void function(Widget *, void *) _BCD_func__155; 
    5151alias bool function() _BCD_func__268; 
     52const int HIDDEN = 3; 
    5253class Button : Widget { 
    5354this(ifloat ignore) { 
     
    9091return _BCD__ZN4fltk6Button6handleEiRKNS_9RectangleE(__C_data, event, _1.__C_data); 
    9192} 
    92 this(int _0, int _1, int _2, int _3, char * _4) { 
     93this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    9394super(cast(ifloat) 0); 
    9495__C_data = _BCD_new__ZN4fltk6ButtonC1EiiiiPKc(_0, _1, _2, _3, _4); 
     
    107108__C_data = null; 
    108109} 
    109 this(int _0, int _1, int _2, int _3, char * _4) { 
     110this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    110111super(cast(ifloat) 0); 
    111112__C_data = _BCD_new__ZN4fltk6ButtonC1EiiiiPKc_R(_0, _1, _2, _3, _4); 
  • trunk/bindings/bcd/fltk2/CheckButton.d

    r80 r84  
    5151return _BCD_get__ZN4fltk11CheckButton13default_styleE(__C_data); 
    5252} 
    53 this(int x, int y, int w, int h, char * l) { 
     53this(int x, int y, int w, int h, char * l = null) { 
    5454super(cast(ifloat) 0); 
    5555__C_data = _BCD_new__ZN4fltk11CheckButtonC1EiiiiPKc(x, y, w, h, l); 
     
    6565__C_data = null; 
    6666} 
    67 this(int x, int y, int w, int h, char * l) { 
     67this(int x, int y, int w, int h, char * l = null) { 
    6868super(cast(ifloat) 0); 
    6969__C_data = _BCD_new__ZN4fltk11CheckButtonC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/Choice.d

    r80 r84  
    7171return _BCD__ZN4fltk6Choice6handleEiRKNS_9RectangleE(__C_data, _0, _1.__C_data); 
    7272} 
    73 this(int _0, int _1, int _2, int _3, char * _4) { 
     73this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    7474super(cast(ifloat) 0); 
    7575__C_data = _BCD_new__ZN4fltk6ChoiceC1EiiiiPKc(_0, _1, _2, _3, _4); 
     
    8585__C_data = null; 
    8686} 
    87 this(int _0, int _1, int _2, int _3, char * _4) { 
     87this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    8888super(cast(ifloat) 0); 
    8989__C_data = _BCD_new__ZN4fltk6ChoiceC1EiiiiPKc_R(_0, _1, _2, _3, _4); 
  • trunk/bindings/bcd/fltk2/Clock.d

    r80 r84  
    4343alias void function(Widget *, void *) _BCD_func__157; 
    4444alias bool function() _BCD_func__279; 
     45const int SQUARE = 0; 
     46const int ANALOG = 0; 
     47const int ROUND = 1; 
     48const int DIGITAL = 2; 
    4549class Clock : ClockOutput { 
    4650this(ifloat ignore) { 
     
    6872_BCD__ZN4fltk5Clock6updateEv(__C_data); 
    6973} 
    70 this(int x, int y, int w, int h, char * l) { 
     74this(int x, int y, int w, int h, char * l = null) { 
    7175super(cast(ifloat) 0); 
    7276__C_data = _BCD_new__ZN4fltk5ClockC1EiiiiPKc(x, y, w, h, l); 
     
    7983__C_data = null; 
    8084} 
    81 this(int x, int y, int w, int h, char * l) { 
     85this(int x, int y, int w, int h, char * l = null) { 
    8286super(cast(ifloat) 0); 
    8387__C_data = _BCD_new__ZN4fltk5ClockC1EiiiiPKc_R(x, y, w, h, l); 
     
    99103__C_data = null; 
    100104} 
    101 this(int x, int y, int w, int h, char * l) { 
     105this(int x, int y, int w, int h, char * l = null) { 
    102106super(cast(ifloat) 0); 
    103107__C_data = _BCD_new__ZN4fltk11ClockOutputC1EiiiiPKc(x, y, w, h, l); 
     
    128132__C_data = null; 
    129133} 
    130 this(int x, int y, int w, int h, char * l) { 
     134this(int x, int y, int w, int h, char * l = null) { 
    131135super(cast(ifloat) 0); 
    132136__C_data = _BCD_new__ZN4fltk11ClockOutputC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/Color.d

    r62 r84  
    1818extern (C) uint _BCD__ZN4fltk5colorEh(char); 
    1919extern (C) uint _BCD__ZN4fltk5colorEhhh(char, char, char); 
     20const int NO_COLOR = 0; 
     21const int FREE_COLOR = 16; 
     22const int NUM_FREE_COLOR = 16; 
     23const int GRAY00 = 32; 
     24const int GRAY05 = 33; 
     25const int GRAY10 = 34; 
     26const int GRAY15 = 35; 
     27const int GRAY20 = 36; 
     28const int GRAY25 = 37; 
     29const int GRAY30 = 38; 
     30const int GRAY33 = 39; 
     31const int GRAY35 = 40; 
     32const int GRAY40 = 41; 
     33const int GRAY45 = 42; 
     34const int GRAY50 = 43; 
     35const int GRAY55 = 44; 
     36const int GRAY60 = 45; 
     37const int GRAY65 = 46; 
     38const int GRAY66 = 47; 
     39const int GRAY70 = 48; 
     40const int GRAY75 = 49; 
     41const int GRAY80 = 50; 
     42const int GRAY85 = 51; 
     43const int GRAY90 = 53; 
     44const int GRAY95 = 54; 
     45const int GRAY99 = 55; 
     46const int BLACK = 56; 
     47const int RED = 88; 
     48const int GREEN = 63; 
     49const int YELLOW = 95; 
     50const int BLUE = 216; 
     51const int MAGENTA = 248; 
     52const int CYAN = 223; 
     53const int WHITE = 255; 
     54const int DARK_RED = 72; 
     55const int DARK_GREEN = 60; 
     56const int DARK_YELLOW = 76; 
     57const int DARK_BLUE = 136; 
     58const int DARK_MAGENTA = 152; 
     59const int DARK_CYAN = 140; 
     60const int WINDOWS_BLUE = 136; 
    2061int parse_color(char * p, char * r, char * g, char * b) { 
    2162return _BCD__ZN4fltk11parse_colorEPKcRhS2_S2_(p, r, g, b); 
  • trunk/bindings/bcd/fltk2/ColorChooser.d

    r80 r84  
    173173_BCD__ZN4fltk12ColorChooser7rgb2hsvEfffRfS1_S1_(__C_data, _0, _1, _2, _3, _4, _5); 
    174174} 
    175 this(int _0, int _1, int _2, int _3, char * _4) { 
     175this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    176176super(cast(ifloat) 0); 
    177177__C_data = _BCD_new__ZN4fltk12ColorChooserC1EiiiiPKc(_0, _1, _2, _3, _4); 
     
    193193__C_data = null; 
    194194} 
    195 this(int _0, int _1, int _2, int _3, char * _4) { 
     195this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    196196super(cast(ifloat) 0); 
    197197__C_data = _BCD_new__ZN4fltk12ColorChooserC1EiiiiPKc_R(_0, _1, _2, _3, _4); 
  • trunk/bindings/bcd/fltk2/ComboBox.d

    r80 r84  
    122122return _BCD_get__ZN4fltk8ComboBox13default_styleE(__C_data); 
    123123} 
    124 this(int _0, int _1, int _2, int _3, char * _4) { 
     124this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    125125super(cast(ifloat) 0); 
    126126__C_data = _BCD_new__ZN4fltk8ComboBoxC1EiiiiPKc(_0, _1, _2, _3, _4); 
     
    136136return _BCD__ZN4fltk8ComboBox6handleEi(__C_data, _0); 
    137137} 
    138 int popup(Rectangle _0, char * title, bool menubar) { 
     138int popup(Rectangle _0, char * title = null, bool menubar = false) { 
    139139return _BCD__ZN4fltk8ComboBox5popupERKNS_9RectangleEPKcb(__C_data, _0.__C_data, title, menubar); 
    140140} 
     
    196196return _BCD__ZN4fltk8ComboBox3cutEii(__C_data, a, b); 
    197197} 
    198 bool insert(char * t, int l) { 
     198bool insert(char * t, int l = 0) { 
    199199return _BCD__ZN4fltk8ComboBox6insertEPKci(__C_data, t, l); 
    200200} 
     
    202202return _BCD__ZN4fltk8ComboBox7replaceEiic(__C_data, a, b, c); 
    203203} 
    204 bool copy(bool clipboard) { 
     204bool copy(bool clipboard = true) { 
    205205return _BCD__ZN4fltk8ComboBox4copyEb(__C_data, clipboard); 
    206206} 
     
    241241__C_data = null; 
    242242} 
    243 this(int _0, int _1, int _2, int _3, char * _4) { 
     243this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    244244super(cast(ifloat) 0); 
    245245__C_data = _BCD_new__ZN4fltk8ComboBoxC1EiiiiPKc_R(_0, _1, _2, _3, _4); 
  • trunk/bindings/bcd/fltk2/CycleButton.d

    r80 r84  
    5555return _BCD__ZN4fltk11CycleButton6handleEi(__C_data, _0); 
    5656} 
    57 this(int _0, int _1, int _2, int _3, char * _4) { 
     57this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    5858super(cast(ifloat) 0); 
    5959__C_data = _BCD_new__ZN4fltk11CycleButtonC1EiiiiPKc(_0, _1, _2, _3, _4); 
     
    6666__C_data = null; 
    6767} 
    68 this(int _0, int _1, int _2, int _3, char * _4) { 
     68this(int _0, int _1, int _2, int _3, char * _4 = null) { 
    6969super(cast(ifloat) 0); 
    7070__C_data = _BCD_new__ZN4fltk11CycleButtonC1EiiiiPKc_R(_0, _1, _2, _3, _4); 
  • trunk/bindings/bcd/fltk2/Dial.d

    r80 r84  
    3737alias void function(Widget *, void *) _BCD_func__157; 
    3838alias bool function() _BCD_func__298; 
     39const int NORMAL = 0; 
     40const int LINE = 1; 
     41const int FILL = 2; 
    3942class Dial : Valuator { 
    4043this(ifloat ignore) { 
     
    5962return _BCD__ZN4fltk4Dial6handleEi(__C_data, _0); 
    6063} 
    61 this(int x, int y, int w, int h, char * l) { 
     64this(int x, int y, int w, int h, char * l = null) { 
    6265super(cast(ifloat) 0); 
    6366__C_data = _BCD_new__ZN4fltk4DialC1EiiiiPKc(x, y, w, h, l); 
     
    8588__C_data = null; 
    8689} 
    87 this(int x, int y, int w, int h, char * l) { 
     90this(int x, int y, int w, int h, char * l = null) { 
    8891super(cast(ifloat) 0); 
    8992__C_data = _BCD_new__ZN4fltk4DialC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/DoubleBufferWindow.d

    r80 r84  
    3434__C_data = null; 
    3535} 
    36 this(int x, int y, int w, int h, char * l) { 
     36this(int x, int y, int w, int h, char * l = null) { 
    3737super(cast(ifloat) 0); 
    3838__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiiiPKc(x, y, w, h, l); 
    3939__C_data_owned = true; 
    4040} 
    41 this(int x, int y, char * l) { 
     41this(int x, int y, char * l = null) { 
    4242super(cast(ifloat) 0); 
    4343__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiPKc(x, y, l); 
     
    5050__C_data = null; 
    5151} 
    52 this(int x, int y, int w, int h, char * l) { 
     52this(int x, int y, int w, int h, char * l = null) { 
    5353super(cast(ifloat) 0); 
    5454__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiiiPKc_R(x, y, w, h, l); 
     
    5656_BCD_RI_N4fltk18DoubleBufferWindowE(__C_data, cast(void *) this); 
    5757} 
    58 this(int x, int y, char * l) { 
     58this(int x, int y, char * l = null) { 
    5959super(cast(ifloat) 0); 
    6060__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiPKc_R(x, y, l); 
  • trunk/bindings/bcd/fltk2/FileIcon.d

    r80 r84  
    5858__D_class._draw(cast(Rectangle) new Rectangle(cast(ifloat) 0, r)); 
    5959} 
     60const int ANY = 0; 
     61const int PLAIN = 1; 
     62const int FIFO = 2; 
     63const int DEVICE = 3; 
     64const int LINK = 4; 
     65const int DIRECTORY = 5; 
     66const int END = 0; 
     67const int COLOR = 1; 
     68const int LINE = 2; 
     69const int CLOSEDLINE = 3; 
     70const int POLYGON = 4; 
     71const int OUTLINEPOLYGON = 5; 
     72const int VERTEX = 6; 
    6073class FileIcon : Symbol { 
    6174this(ifloat ignore) { 
     
    7184__C_data = null; 
    7285} 
    73 this(char * p, int t, int nd, short * d) { 
     86this(char * p, int t, int nd = 0, short * d = null) { 
    7487super(cast(ifloat) 0); 
    7588__C_data = _BCD_new__ZN4fltk8FileIconC1EPKciiPs(p, t, nd, d); 
     
    96109_BCD__ZN4fltk8FileIcon5clearEv(__C_data); 
    97110} 
    98 void image(Symbol * direct_raster, bool owned) { 
     111void image(Symbol * direct_raster, bool owned = true) { 
    99112_BCD__ZN4fltk8FileIcon5imageEPKNS_6SymbolEb(__C_data, direct_raster.__C_data, owned); 
    100113} 
     
    126139return _BCD__ZN4fltk8FileIcon4dataEv(__C_data); 
    127140} 
    128 FileIcon * find(char * filename, int filetype) { 
     141FileIcon * find(char * filename, int filetype = ANY) { 
    129142return _BCD__ZN4fltk8FileIcon4findEPKci(__C_data, filename, filetype); 
    130143} 
     
    135148_BCD__ZN4fltk8FileIcon17load_system_iconsEv(__C_data); 
    136149} 
    137 void value(bcd.bind.BoundClass * i, bool on_select) { 
     150void value(bcd.bind.BoundClass * i, bool on_select = false) { 
    138151_BCD__ZN4fltk8FileIcon5valueEPNS_6WidgetEb(__C_data, i.__C_data, on_select); 
    139152} 
     
    150163__C_data = null; 
    151164} 
    152 this(char * p, int t, int nd, short * d) { 
     165this(char * p, int t, int nd = 0, short * d = null) { 
    153166super(cast(ifloat) 0); 
    154167__C_data = _BCD_new__ZN4fltk8FileIconC1EPKciiPs_R(p, t, nd, d); 
  • trunk/bindings/bcd/fltk2/FillDial.d

    r80 r84  
    3232__C_data = null; 
    3333} 
    34 this(int x, int y, int w, int h, char * l) { 
     34this(int x, int y, int w, int h, char * l = null) { 
    3535super(cast(ifloat) 0); 
    3636__C_data = _BCD_new__ZN4fltk8FillDialC1EiiiiPKc(x, y, w, h, l); 
     
    4343__C_data = null; 
    4444} 
    45 this(int x, int y, int w, int h, char * l) { 
     45this(int x, int y, int w, int h, char * l = null) { 
    4646super(cast(ifloat) 0); 
    4747__C_data = _BCD_new__ZN4fltk8FillDialC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/FillSlider.d

    r80 r84  
    3232__C_data = null; 
    3333} 
    34 this(int x, int y, int w, int h, char * l) { 
     34this(int x, int y, int w, int h, char * l = null) { 
    3535super(cast(ifloat) 0); 
    3636__C_data = _BCD_new__ZN4fltk10FillSliderC1EiiiiPKc(x, y, w, h, l); 
     
    4343__C_data = null; 
    4444} 
    45 this(int x, int y, int w, int h, char * l) { 
     45this(int x, int y, int w, int h, char * l = null) { 
    4646super(cast(ifloat) 0); 
    4747__C_data = _BCD_new__ZN4fltk10FillSliderC1EiiiiPKc_R(x, y, w, h, l); 
  • trunk/bindings/bcd/fltk2/Flags.d

    r58 r84  
    22module bcd.fltk2.Flags; 
    33import bcd.bind; 
     4