Changeset 249

Show
Ignore:
Timestamp:
03/31/07 13:06:52 (2 years ago)
Author:
Ant
Message:

started editor GtkSourceView? (incomplete). use -sv to use the new editor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/leds/CodeView.d

    r242 r249  
    2323module leds.CodeView; 
    2424 
     25debug = saveFile; 
     26 
    2527private: 
    2628import leds.FileView; 
     
    7779import leds.Scintilla; 
    7880import leds.SimpleCodeEdit; 
     81import leds.SourceViewEdit; 
    7982 
    8083private import gtk.Widget; 
     
    207210            { 
    208211                codeEdit = new SimpleCodeEdit(); 
    209         //      codeEdit = new Scintilla(); 
    210             } 
    211 //          else if ( Leds.leds.editorType == "textView" ) 
    212 //          { 
    213 //              codeEdit = new SimpleCodeEdit(); 
    214 //          } 
     212            } 
     213            else if ( Leds.leds.editorType == "textView" ) 
     214            { 
     215                codeEdit = new SimpleCodeEdit(); 
     216            } 
     217            else if ( Leds.leds.editorType == "sv" ) 
     218            { 
     219                codeEdit = new SourceViewEdit(); 
     220            } 
    215221            else 
    216222            { 
    217         //      codeEdit = new SimpleCodeEdit(); 
    218223                codeEdit = new Scintilla(); 
    219224            } 
     
    801806        int textLength = codeEdit.getLength(); 
    802807         
     808        debug(saveFile)writefln("CodeView.saveField 1"); 
    803809        String text = codeEdit.getText(); 
     810        debug(saveFile)writefln("CodeView.saveField 1 text:\n%s",text); 
    804811         
    805812        buf.write(text.toString()); 
  • trunk/src/leds/DockerFiles.d

    r242 r249  
    1919module leds.DockerFiles; 
    2020 
     21//debug = loadState; 
     22 
    2123private import leds.Docker; 
    2224 
     
    218220        Leds leds = Leds.leds; 
    219221        String ledsHome = leds.getHomeDir(); 
    220      
    221222 
    222223        XmlDocument xdoc = new XmlDocument("openedFiles1.leds"); 
     
    292293    public void loadState(char[] workspaceName) 
    293294    { 
     295        debug(loadState)writefln("DockerFiles.loadState 1"); 
    294296        Leds leds = Leds.leds; 
    295297        String ledsHome = leds.getHomeDir(); 
    296298        XmlParser parser = new XmlParser(); 
    297299        char[] text; 
    298         try { 
     300        try  
     301        { 
     302            debug(loadState)writefln("DockerFiles.loadState 2"); 
    299303            text = cast(char[])FileBuffer.read(Path.join(ledsHome,"openedFiles1.leds")); 
    300         } catch (FileException e) { 
     304        } 
     305        catch (FileException e)  
     306        { 
     307            debug(loadState)writefln("DockerFiles.loadState 3"); 
    301308            return; 
    302309        } 
     
    305312 
    306313        String currFile = null; 
     314        debug(loadState)writefln("DockerFiles.loadState 4"); 
    307315        foreach( XmlNode wspace ; wspaces ) 
    308316        { 
     317            debug(loadState)writefln("DockerFiles.loadState 5"); 
    309318            if ( workspaceName == wspace.getAttributeValue("name", "") ) 
    310319            { 
    311320                 
     321                debug(loadState)writefln("DockerFiles.loadState 6"); 
    312322                XmlNode xnode = wspace.getChildNode("view"); 
    313323                if ( xnode !is null ) 
    314324                { 
     325                    debug(loadState)writefln("DockerFiles.loadState 7"); 
    315326                    switch (xnode.getAttributeValue("tabsPosition", "top") ) 
    316327                    { 
     
    323334                } 
    324335                 
     336                debug(loadState)writefln("DockerFiles.loadState 8"); 
    325337                FileView currView = null; 
    326338                XmlNode xOpenedFiles = wspace.getChildNode("openedFiles"); 
    327339                foreach ( XmlNode xFile ; xOpenedFiles.getNodes("file") ) 
    328340                { 
     341                    debug(loadState)writefln("DockerFiles.loadState 9"); 
    329342                    XmlNode xProject = xFile.getChildNode("project"); 
    330343                    XmlNode xEditing = xFile.getChildNode("editing"); 
     
    334347                    if ( xFile.getAttributeValue("current", 0) == 1 ) 
    335348                    { 
     349                        debug(loadState)writefln("DockerFiles.loadState 10"); 
    336350                        currFile = new String(xFile.getAttributeValue("name", "untitled")); 
    337351                    } 
    338352                    if ( xEditing !is null ) 
    339353                    { 
     354                        debug(loadState)writefln("DockerFiles.loadState 11"); 
    340355                        firstLine = xEditing.getAttributeValue("firstLine", firstLine); 
    341356                        cursorPosition = xEditing.getAttributeValue("cursorPosition", cursorPosition); 
     
    349364                    // this would be better doing catch exceptions, but that fails for  
    350365                    // some reason. 
     366                    debug(loadState)writefln("DockerFiles.loadState 12"); 
    351367                    if (!Path.exists(new String(xFile.getAttributeValue("name", "untitled")))) { 
    352368                        continue; 
    353369                    } 
    354370                     
     371                    debug(loadState)writefln("DockerFiles.loadState 13"); 
    355372                    FileView fileView = workspace.openFile( 
    356373                            new String(xFile.getAttributeValue("name", "untitled")), 
    357374                            projectName, 
    358375                            false); 
     376                    debug(loadState)writefln("DockerFiles.loadState 14"); 
    359377                    fileView.lineScroll(firstLine); 
     378                    debug(loadState)writefln("DockerFiles.loadState 14a"); 
    360379                    fileView.gotoPos(cursorPosition); 
     380                    debug(loadState)writefln("DockerFiles.loadState 15"); 
    361381 
    362382                     
     
    366386            } 
    367387        } 
     388        debug(loadState)writefln("DockerFiles.loadState 16"); 
    368389        if ( currFile !is null ) 
    369390        { 
     391            debug(loadState)writefln("DockerFiles.loadState 17"); 
    370392            workspace.bringToFront(currFile); 
    371         } 
     393            debug(loadState)writefln("DockerFiles.loadState 18"); 
     394        } 
     395        debug(loadState)writefln("DockerFiles.loadState 19"); 
    372396    } 
    373397 
  • trunk/src/leds/LanguageD.d

    r246 r249  
    11module leds.LanguageD; 
    22 
    3 //debug=messages; 
     3//debug = messages; 
     4debug = setLex; 
    45 
    56import leds.Language; 
     
    749750    void setLex(Scintilla scintilla) 
    750751    { 
    751         //printf("setDLex 1\n"); 
     752        debug(setLex)printf("setDLex 1\n"); 
    752753        scintilla.send(SCI_SETLEXER, SCLEX_D, 0); 
    753754        scintilla.send(SCI_SETSTYLEBITS, 5, 0); // not sure what this does. 
     
    803804        //SCE_C_GLOBALCLASS=19;  
    804805 
    805         //printf("setDLex 2\n"); 
     806        debug(setLex)printf("setDColors 2\n"); 
    806807         
    807808        scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENT,         scintilla.getColor("color.Comment.D", 0x009000)); 
    808809        scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENTLINE,     scintilla.getColor("color.CommentLine.D", 0x009000)); 
    809810        scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENTDOC,      scintilla.getColor("color.CommentDoc.D", 0x009000)); 
    810         scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENTNESTED,      scintilla.getColor("color.CommentDoc.D", 0x009000)); 
     811        scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENTNESTED,   scintilla.getColor("color.CommentDoc.D", 0x009000)); 
    811812        scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENTLINEDOC,  scintilla.getColor("color.CommentDoc.D", 0x009000)); 
    812813        scintilla.send(SCI_STYLESETFORE, SCE_D_COMMENTDOCKEYWORD, scintilla.getColor("color.CommentDoc.D", 0x00C000)); 
  • trunk/src/leds/Leds.d

    r230 r249  
    5050const int VERSION_MINOR = 9; 
    5151const int VERSION_MICRO = 79; 
    52 const char[] VERSION_QUAL = "alpha"; 
     52const char[] VERSION_QUAL = "beta"; 
    5353 
    5454private: 
     
    7272"\n" 
    7373; 
    74  
    7574 
    7675static const char [] ledsAboutMessage =  
     
    261260                debug(startup) printf("Leds.init 10\n"); 
    262261                workspace.openSavedState(); 
     262                debug(startup) printf("Leds.init 10a\n"); 
    263263            } 
    264264            else 
     
    393393                        " --home          specify leds home directory [default ~/.leds]\n" 
    394394                        " --data          specify leds data directory [default ~/.leds_data]\n" 
    395                         " --editor          if 'textView' the internal code editor will be used instead of scintilla\n" 
    396                         " --nop             do not open project\n" 
     395                        " --editor        the editor to use\n" 
     396                        "                 'textView' the internal code editor (obsolete)\n" 
     397                        "                 'sv' the new GtkSourceView (incomplete)\n" 
     398                        "                 'sc' the Scintilla editor (default)\n" 
     399                        " --nop           do not open projects\n" 
    397400                        "\n" 
    398401                        "files            files to open\n" 
     
    410413            case "--editor": 
    411414                editorType = new String(args[++offset]); 
     415                break; 
     416             
     417            case "-sv": 
     418                editorType = new String("sv"); 
     419                break; 
    412420             
    413421            default: 
  • trunk/src/leds/Scintilla.d

    r242 r249  
    14171417    /* Assume scintilla.dll is in same directory as current executable */ 
    14181418    version(Windows) scintilla_Linker = new Linker("scintilla.dll"); 
    1419     version(linux)   scintilla_Linker = new Linker("libscintilla.so"); 
     1419    version(linux)   scintilla_Linker = new Linker("libscintilla.so.1.6.3"); 
    14201420    scintilla_Linker.link(scintillaLinks); 
    14211421}