├── lc3edit ├── wxScintilla │ ├── src │ │ ├── scintilla │ │ │ ├── version.txt │ │ │ ├── doc │ │ │ │ ├── SciRest.jpg │ │ │ │ ├── SciWord.jpg │ │ │ │ ├── SciBreak.jpg │ │ │ │ ├── SciTEIco.png │ │ │ │ ├── annotations.png │ │ │ │ ├── styledmargin.png │ │ │ │ ├── Icons.html │ │ │ │ ├── ScintillaDownload.html │ │ │ │ └── ScintillaToDo.html │ │ │ ├── lexers │ │ │ │ ├── LexCSS.cxx │ │ │ │ ├── LexErlang.cxx │ │ │ │ ├── LexMMIXAL.cxx │ │ │ │ ├── LexMatlab.cxx │ │ │ │ └── LexKix.cxx │ │ │ ├── src │ │ │ │ ├── SciTE.properties │ │ │ │ ├── FontQuality.h │ │ │ │ ├── Catalogue.h │ │ │ │ ├── Indicator.h │ │ │ │ ├── UniConversion.h │ │ │ │ ├── CharClassify.h │ │ │ │ ├── KeyMap.h │ │ │ │ ├── Decoration.h │ │ │ │ ├── RunStyles.h │ │ │ │ ├── ContractionState.h │ │ │ │ ├── CharClassify.cxx │ │ │ │ ├── RESearch.h │ │ │ │ ├── LineMarker.h │ │ │ │ ├── Style.h │ │ │ │ ├── AutoComplete.h │ │ │ │ ├── ExternalLexer.h │ │ │ │ ├── CallTip.h │ │ │ │ ├── ScintillaBase.h │ │ │ │ ├── SVector.h │ │ │ │ ├── PerLine.h │ │ │ │ ├── XPM.h │ │ │ │ ├── Style.cxx │ │ │ │ ├── ViewStyle.h │ │ │ │ ├── ExternalLexer.cxx │ │ │ │ ├── Decoration.cxx │ │ │ │ └── PositionCache.h │ │ │ ├── License.txt │ │ │ ├── lexlib │ │ │ │ ├── LexerSimple.h │ │ │ │ ├── PropSetSimple.h │ │ │ │ ├── Accessor.h │ │ │ │ ├── WordList.h │ │ │ │ ├── LexerNoExceptions.h │ │ │ │ ├── LexerBase.h │ │ │ │ ├── CharacterSet.cxx │ │ │ │ ├── StyleContext.cxx │ │ │ │ ├── LexerSimple.cxx │ │ │ │ ├── LexerBase.cxx │ │ │ │ ├── LexerNoExceptions.cxx │ │ │ │ ├── LexerModule.h │ │ │ │ ├── Accessor.cxx │ │ │ │ ├── LexerModule.cxx │ │ │ │ ├── SparseState.h │ │ │ │ ├── OptionSet.h │ │ │ │ ├── CharacterSet.h │ │ │ │ └── StyleContext.h │ │ │ ├── include │ │ │ │ ├── ScintillaWidget.h │ │ │ │ ├── HFacer.py │ │ │ │ ├── ILexer.h │ │ │ │ └── Face.py │ │ │ └── README │ │ ├── PlatWX.h │ │ └── scintilla_generator │ │ │ └── readme.txt │ ├── lib │ │ └── dummy │ ├── build │ │ ├── wxscintilla.dsw │ │ ├── BuildInfo.txt │ │ └── Makefile │ └── Readme ├── closebutton.png ├── src │ ├── EditorPanel.cpp │ ├── EditorPanel.hpp │ ├── resources.hpp │ ├── AsmFileDocument.hpp │ ├── EditorView.hpp │ ├── EditorView.cpp │ ├── LC3EditApp.hpp │ ├── version.h │ ├── AsmFileDocument.cpp │ ├── EditorPanelDecl.hpp │ ├── LC3EditFrame.hpp │ ├── LC3EditFrameDecl.h │ ├── LC3EditApp.cpp │ ├── EditorPanelDecl.cpp │ ├── LC3EditFrameDecl.cpp │ └── LC3EditFrame.cpp └── wxFlatNotebook │ ├── wx │ └── wxFlatNotebook │ │ ├── xh_fnb.h │ │ ├── fnb_resources.h │ │ ├── fnb_singleton.h │ │ ├── popup_dlg.h │ │ ├── fnb_customize_dlg.h │ │ ├── wxFNBDropTarget.h │ │ └── fnb_smart_ptr.h │ └── xh_fnb.cpp ├── .gitignore ├── demos ├── helloworld.asm ├── multest.asm ├── randtest.asm ├── interrupt_test.asm ├── udivtest.asm ├── colorlcdtest.asm ├── bwlcdtest.asm └── game.asm ├── logging ├── logger.hpp └── logger.cpp └── README.md /lc3edit/wxScintilla/src/scintilla/version.txt: -------------------------------------------------------------------------------- 1 | 323 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | build/ 3 | 4 | /pylc3/unittests/*.pyc 5 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/lib/dummy: -------------------------------------------------------------------------------- 1 | I'm just here to force the creation of a LIB directory. 2 | -------------------------------------------------------------------------------- /lc3edit/closebutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/closebutton.png -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/SciRest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/doc/SciRest.jpg -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/SciWord.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/doc/SciWord.jpg -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/SciBreak.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/doc/SciBreak.jpg -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/SciTEIco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/doc/SciTEIco.png -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexers/LexCSS.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/lexers/LexCSS.cxx -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/annotations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/doc/annotations.png -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/styledmargin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/doc/styledmargin.png -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexers/LexErlang.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/lexers/LexErlang.cxx -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexers/LexMMIXAL.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/lexers/LexMMIXAL.cxx -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexers/LexMatlab.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TricksterGuy/complx/HEAD/lc3edit/wxScintilla/src/scintilla/lexers/LexMatlab.cxx -------------------------------------------------------------------------------- /demos/helloworld.asm: -------------------------------------------------------------------------------- 1 | .orig x3000 2 | LEA R0, HELLOWORLD_STR ; Load address of "Hello world!" 3 | PUTS ; Display Hello world! 4 | HALT ; The end 5 | ; Hello world 6 | HELLOWORLD_STR .stringz "Hello world!" 7 | .end 8 | -------------------------------------------------------------------------------- /demos/multest.asm: -------------------------------------------------------------------------------- 1 | ;@plugin filename=lc3_multiply 2 | 3 | .orig x3000 4 | ; The error instruction is now multiply 5 | MUL R0, R0, 1 6 | MUL R0, R1, 1 7 | MUL R0, R0, 0 8 | MUL R0, R0, 2 9 | MUL R0, R1, 2 10 | MUL R0, R0, R1 11 | MUL R0, R1, R2 12 | 13 | MUL R0, R0, R0 14 | HALT 15 | .end 16 | -------------------------------------------------------------------------------- /lc3edit/src/EditorPanel.cpp: -------------------------------------------------------------------------------- 1 | #include "EditorPanel.hpp" 2 | 3 | void EditorPanel::LoadFile(const wxString& file) 4 | { 5 | editor->LoadFile(file); 6 | } 7 | 8 | void EditorPanel::SaveFile(const wxString& file) 9 | { 10 | editor->SaveFile(file); 11 | } 12 | 13 | void EditorPanel::Clear() 14 | { 15 | editor->ClearAll(); 16 | } 17 | -------------------------------------------------------------------------------- /demos/randtest.asm: -------------------------------------------------------------------------------- 1 | ;@plugin filename=lc3_random address=xFEED 2 | 3 | .orig x3000 4 | ; Set the random seed by storing to the device register 5 | AND R0, R0, 0 6 | ADD R0, R0, 10 7 | STI R0, RANDOM_DEVREG 8 | ; Reading from the device register gives you a random number 9 | LDI R0, RANDOM_DEVREG 10 | HALT 11 | 12 | RANDOM_DEVREG .fill xFEED 13 | .end 14 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/SciTE.properties: -------------------------------------------------------------------------------- 1 | # SciTE.properties is the per directory local options file and can be used to override 2 | # settings made in SciTEGlobal.properties 3 | command.build.directory.*.cxx=..\win32 4 | command.build.directory.*.h=..\win32 5 | command.build.*.cxx=nmake -f scintilla.mak QUIET=1 6 | command.build.*.h=nmake -f scintilla.mak QUIET=1 7 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/build/wxscintilla.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | Project: "wxScintilla"=.\wxscintilla.dsp - Package Owner=<4> 6 | 7 | Package=<5> 8 | {{{ 9 | }}} 10 | 11 | Package=<4> 12 | {{{ 13 | }}} 14 | 15 | ############################################################################### 16 | -------------------------------------------------------------------------------- /demos/interrupt_test.asm: -------------------------------------------------------------------------------- 1 | ; Demo showing LC3 interrupts 2 | .orig x180 3 | .fill INTERRUPTHANDLER 4 | .end 5 | 6 | .orig x3000 7 | LD R0, KBSRIE 8 | STI R0, KBSR 9 | 10 | LOOP BR LOOP 11 | HALT 12 | 13 | INTERRUPTHANDLER 14 | 15 | LEA R0, MSG 16 | PUTS 17 | LDI R0, KBDR 18 | OUT 19 | AND R0, R0, 0 20 | ADD R0, R0, 10 21 | OUT 22 | RTI 23 | 24 | 25 | 26 | 27 | 28 | KBSRIE .fill x4000 29 | KBSR .fill xFE00 30 | KBDR .fill xFE02 31 | MSG .stringz "You typed: " 32 | 33 | .end 34 | -------------------------------------------------------------------------------- /lc3edit/src/EditorPanel.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EDITORPANEL_HPP 2 | #define EDITORPANEL_HPP 3 | 4 | #include 5 | #include 6 | #include "EditorPanelDecl.hpp" 7 | 8 | class EditorPanel : public EditorPanelDecl 9 | { 10 | public: 11 | EditorPanel(wxWindow* parent) : EditorPanelDecl(parent) {} 12 | ~EditorPanel() {} 13 | void LoadFile(const wxString& file); 14 | void SaveFile(const wxString& file); 15 | void Clear(); 16 | }; 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /demos/udivtest.asm: -------------------------------------------------------------------------------- 1 | ;@plugin filename=lc3_udiv vector=x80 2 | 3 | ; Demo that shows how to divide two numbers using UDIV. 4 | ; UDIV is a custom trap implemented in C++ and will be available at trap vector x80. 5 | ; UDIV preconditions R0 = A, R1 = B 6 | ; UDIV postconditions R0 = A / B, R1 = A % B 7 | ; CC is unchanged, % result has the same behaviour as C and Java in regards to negative numbers 8 | .orig x3000 9 | LD R0, A 10 | LD R1, B 11 | udiv ; or trap x80 12 | HALT 13 | 14 | A .fill 2000 15 | B .fill 8 16 | 17 | .end 18 | 19 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/Readme: -------------------------------------------------------------------------------- 1 | Component: wxScintilla 2 | Release: 1.71.1 3 | Documents: http://wxcode.sourceforge.net/components/wxscintilla/index.php 4 | wxWidgets: 2.6.x 5 | Maintainer: Otto Wyss (wyo) 6 | Subdir: wxscintilla 7 | 8 | Description: 9 | wxScintilla implements the Scintilla editing control (see 10 | http://scintilla.sourceforge.net/) with the wxWidgets API. It's derived 11 | from wxStyledTextCtrl and has the same functionality and a similar API. 12 | 13 | For further instructions see the BuildInfo.txt inside the "build" directory. -------------------------------------------------------------------------------- /lc3edit/src/resources.hpp: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCES_HPP 2 | #define RESOURCES_HPP 3 | 4 | extern const char* new_xpm[]; 5 | extern const char* open_xpm[]; 6 | extern const char* save_xpm[]; 7 | extern const char* saveall_xpm[]; 8 | extern const char* undo_xpm[]; 9 | extern const char* redo_xpm[]; 10 | extern const char* cut_xpm[]; 11 | extern const char* copy_xpm[]; 12 | extern const char* paste_xpm[]; 13 | extern const char* find_xpm[]; 14 | extern const char* replace_xpm[]; 15 | extern const char* assemble_xpm[]; 16 | extern const char* run_xpm[]; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lc3edit/src/AsmFileDocument.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ASM_FILE_DOCUMENT_HPP 2 | #define ASM_FILE_DOCUMENT_HPP 3 | 4 | #include 5 | #include 6 | 7 | class AsmFileDocument : public wxDocument 8 | { 9 | DECLARE_DYNAMIC_CLASS(AsmFileDocument) 10 | public: 11 | AsmFileDocument() {} 12 | ~AsmFileDocument() {} 13 | bool DeleteContents(); 14 | protected: 15 | bool DoSaveDocument(const wxString& file); 16 | bool DoOpenDocument(const wxString& file); 17 | private: 18 | wxFileName filename; 19 | }; 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/FontQuality.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file FontQuality.h 3 | ** Definitions to control font anti-aliasing. 4 | **/ 5 | // Copyright 1998-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #define SC_EFF_QUALITY_MASK 0xF 9 | #define SC_EFF_QUALITY_DEFAULT 0 10 | #define SC_EFF_QUALITY_NON_ANTIALIASED 1 11 | #define SC_EFF_QUALITY_ANTIALIASED 2 12 | #define SC_EFF_QUALITY_LCD_OPTIMIZED 3 13 | 14 | #define SCWIN_TECH_GDI 0 15 | #define SCWIN_TECH_DIRECTWRITE 1 16 | -------------------------------------------------------------------------------- /lc3edit/src/EditorView.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EDITOR_VIEW_HPP 2 | #define EDITOR_VIEW_HPP 3 | 4 | #include 5 | #include "EditorPanel.hpp" 6 | #include 7 | 8 | class EditorView : public wxView 9 | { 10 | DECLARE_DYNAMIC_CLASS(EditorView) 11 | public: 12 | EditorView() : panel(nullptr), notebook(nullptr) {} 13 | ~EditorView() {} 14 | void OnInit(wxFlatNotebook* notebook); 15 | void LoadFile(const wxString& file); 16 | void SaveFile(const wxString& file); 17 | void Clear(); 18 | void OnDraw(wxDC* dc) {} 19 | private: 20 | EditorPanel* panel; 21 | wxFlatNotebook* notebook; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/Catalogue.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Catalogue.h 3 | ** Lexer infrastructure. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CATALOGUE_H 9 | #define CATALOGUE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class Catalogue { 16 | public: 17 | static const LexerModule *Find(int language); 18 | static const LexerModule *Find(const char *languageName); 19 | static void AddLexerModule(LexerModule *plm); 20 | }; 21 | 22 | #ifdef SCI_NAMESPACE 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lc3edit/src/EditorView.cpp: -------------------------------------------------------------------------------- 1 | #include "EditorView.hpp" 2 | 3 | IMPLEMENT_DYNAMIC_CLASS(EditorView, wxView) 4 | 5 | void EditorView::OnInit(wxFlatNotebook* n) 6 | { 7 | notebook = n; 8 | wxString title = "Untitled.asm"; 9 | wxDocument* doc = GetDocument(); 10 | panel = new EditorPanel(notebook); 11 | if (doc) 12 | { 13 | title = doc->GetTitle(); 14 | panel->LoadFile(doc->GetFilename()); 15 | } 16 | notebook->AddPage(panel, title, false); 17 | } 18 | 19 | void EditorView::LoadFile(const wxString& file) 20 | { 21 | if (panel) 22 | panel->LoadFile(file); 23 | } 24 | 25 | void EditorView::SaveFile(const wxString& file) 26 | { 27 | if (panel) 28 | panel->SaveFile(file); 29 | } 30 | 31 | void EditorView::Clear() 32 | { 33 | if (panel) 34 | panel->Clear(); 35 | } 36 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/Indicator.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Indicator.h 3 | ** Defines the style of indicators which are text decorations such as underlining. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef INDICATOR_H 9 | #define INDICATOR_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class Indicator { 18 | public: 19 | int style; 20 | bool under; 21 | ColourDesired fore; 22 | int fillAlpha; 23 | int outlineAlpha; 24 | Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)), fillAlpha(30), outlineAlpha(50) { 25 | } 26 | void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine); 27 | }; 28 | 29 | #ifdef SCI_NAMESPACE 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /demos/colorlcdtest.asm: -------------------------------------------------------------------------------- 1 | ;@plugin filename=lc3_colorlcd width=8 height=8 initaddr=x4000 startaddr=x6000 2 | ;@plugin filename=lc3_random address=xFEED 3 | 4 | ; Simple demo that initializes a color display and then fills it with random colors. 5 | .orig x3000 6 | ; initialize display 7 | LD R3, DISPLAYINITVALUE 8 | STI R3, DISPLAYINITADDR 9 | 10 | ; display starting address 11 | LD R4, DISPLAYSTART 12 | 13 | AND R2, R2, 0 14 | ADD R2, R2, 15 15 | ADD R2, R2, 15 16 | ADD R2, R2, 15 17 | ADD R2, R2, 15 18 | ADD R2, R2, 4 19 | 20 | COLORLOOP 21 | LDI R0, RANDOMADDR 22 | LD R1, COLORMAX 23 | AND R0, R0, R1 24 | STR R0, R4, #0 25 | ADD R4, R4, 1 26 | ADD R2, R2, -1 27 | BRP COLORLOOP 28 | 29 | HALT 30 | 31 | DISPLAYINITADDR .fill x4000 32 | DISPLAYINITVALUE .fill x8000 33 | RANDOMADDR .fill xFEED 34 | DISPLAYSTART .fill x6000 35 | COLORMAX .fill x7FFF ; x7FFF is while 36 | ; colors are 15 bits rrrrrgggggbbbbb 5 bits per component. 37 | 38 | .end 39 | -------------------------------------------------------------------------------- /lc3edit/src/LC3EditApp.hpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Name: LC3EditApp.hpp 3 | * Purpose: Defines Application Class 4 | * Author: Brandon (brandon.whitehead@gatech.edu) 5 | * Created: 2010-06-28 6 | * Copyright: Brandon () 7 | * License: 8 | **************************************************************/ 9 | 10 | #ifndef LC3EDITAPP_HPP 11 | #define LC3EDITAPP_HPP 12 | 13 | #include 14 | #include 15 | 16 | class LC3EditFrame; 17 | 18 | class LC3EditApp : public wxApp 19 | { 20 | public: 21 | virtual bool OnInit(); 22 | virtual void OnInitCmdLine(wxCmdLineParser& parser); 23 | virtual bool OnCmdLineParsed(wxCmdLineParser& parser); 24 | int OnRun(); 25 | LC3EditFrame* GetFrame() const {return frame;} 26 | private: 27 | LC3EditFrame* frame; 28 | wxDocManager* manager; 29 | wxDocTemplate* templ; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/License.txt: -------------------------------------------------------------------------------- 1 | License for Scintilla and SciTE 2 | 3 | Copyright 1998-2003 by Neil Hodgson 4 | 5 | All Rights Reserved 6 | 7 | Permission to use, copy, modify, and distribute this software and its 8 | documentation for any purpose and without fee is hereby granted, 9 | provided that the above copyright notice appear in all copies and that 10 | both that copyright notice and this permission notice appear in 11 | supporting documentation. 12 | 13 | NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 14 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 15 | AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY 16 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 18 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE 20 | OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /lc3edit/src/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | namespace AutoVersion{ 5 | 6 | //Date Version Types 7 | static const char DATE[] = "25"; 8 | static const char MONTH[] = "2"; 9 | static const char YEAR[] = "2013"; 10 | static const char UBUNTU_VERSION_STYLE[] = "13.2"; 11 | 12 | //Software Status 13 | static const char STATUS[] = "Release"; 14 | static const char STATUS_SHORT[] = "r"; 15 | 16 | //Standard Version Type 17 | static const long MAJOR = 4; 18 | static const long MINOR = 2; 19 | static const long BUILD = 0; 20 | static const long REVISION = 0; 21 | 22 | //Miscellaneous Version Types 23 | static const long BUILDS_COUNT = 0; 24 | #define RC_FILEVERSION 4,2,0,0 25 | #define RC_FILEVERSION_STRING "4, 2, 0, 0\0" 26 | static const char FULLVERSION_STRING[] = "4.2.0.0"; 27 | 28 | //These values are to keep track of your versioning state, don't modify them. 29 | static const long BUILD_HISTORY = 0; 30 | 31 | 32 | } 33 | #endif //VERSION_H 34 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerSimple.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerSimple.h 3 | ** A simple lexer with no state. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LEXERSIMPLE_H 9 | #define LEXERSIMPLE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | // A simple lexer with no state 16 | class LexerSimple : public LexerBase { 17 | const LexerModule *module; 18 | std::string wordLists; 19 | public: 20 | LexerSimple(const LexerModule *module_); 21 | const char * SCI_METHOD DescribeWordListSets(); 22 | void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); 23 | void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); 24 | }; 25 | 26 | #ifdef SCI_NAMESPACE 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/PropSetSimple.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file PropSetSimple.h 3 | ** A basic string to string map. 4 | **/ 5 | // Copyright 1998-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef PROPSETSIMPLE_H 9 | #define PROPSETSIMPLE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class PropSetSimple { 16 | void *impl; 17 | void Set(const char *keyVal); 18 | public: 19 | PropSetSimple(); 20 | virtual ~PropSetSimple(); 21 | void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1); 22 | void SetMultiple(const char *); 23 | const char *Get(const char *key) const; 24 | char *Expanded(const char *key) const; 25 | int GetExpanded(const char *key, char *result) const; 26 | int GetInt(const char *key, int defaultValue=0) const; 27 | }; 28 | 29 | #ifdef SCI_NAMESPACE 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /demos/bwlcdtest.asm: -------------------------------------------------------------------------------- 1 | ;@plugin filename=lc3_bwlcd width=8 height=8 initaddr=x4000 startaddr=x6000 2 | 3 | ; Demo that initializes a black and white LCD and draws a smiley 4 | .orig x3000 5 | ; initialize display 6 | LD R0, DISPLAYINITVALUE 7 | STI R0, DISPLAYINITADDR 8 | 9 | ; display starting address 10 | LD R0, DISPLAYSTART 11 | 12 | ; Value to write to display 13 | AND R1, R1, 0 14 | ADD R1, R1, 1 15 | 16 | STR R1, R0, 0 17 | STR R1, R0, 1 18 | STR R1, R0, 8 19 | STR R1, R0, 9 20 | 21 | STR R1, R0, 6 22 | STR R1, R0, 7 23 | STR R1, R0, 14 24 | STR R1, R0, 15 25 | 26 | ADD R0, R0, 15 27 | ADD R0, R0, 15 28 | ADD R0, R0, 2 29 | 30 | STR R1, R0, 0 31 | STR R1, R0, 1 32 | STR R1, R0, 8 33 | STR R1, R0, 9 34 | 35 | STR R1, R0, 6 36 | STR R1, R0, 7 37 | STR R1, R0, 14 38 | STR R1, R0, 15 39 | 40 | AND R3, R3, 0 41 | ADD R3, R3, -16 42 | ADD R0, R0, 15 43 | ADD R0, R0, 1 44 | 45 | stloop 46 | STR R1, R0, 0 47 | ADD R0, R0, 1 48 | ADD R3, R3, 1 49 | BRN stloop 50 | 51 | HALT 52 | 53 | DISPLAYINITVALUE .fill x8000 54 | DISPLAYINITADDR .fill x4000 55 | DISPLAYSTART .fill x6000 56 | .end 57 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/Accessor.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Accessor.h 3 | ** Interfaces between Scintilla and lexers. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef ACCESSOR_H 9 | #define ACCESSOR_H 10 | 11 | /* C::B begin */ 12 | #include "LexAccessor.h" 13 | /* C::B end */ 14 | 15 | #ifdef SCI_NAMESPACE 16 | namespace Scintilla { 17 | #endif 18 | 19 | enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8}; 20 | 21 | class Accessor; 22 | class WordList; 23 | class PropSetSimple; 24 | 25 | typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len); 26 | 27 | class Accessor : public LexAccessor { 28 | public: 29 | PropSetSimple *pprops; 30 | Accessor(IDocument *pAccess_, PropSetSimple *pprops_); 31 | int GetPropertyInt(const char *, int defaultValue=0); 32 | int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); 33 | }; 34 | 35 | #ifdef SCI_NAMESPACE 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/UniConversion.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file UniConversion.h 3 | ** Functions to handle UTF-8 and UTF-16 strings. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | const int UTF8MaxBytes = 4; 9 | 10 | unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen); 11 | void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len); 12 | unsigned int UTF8CharLength(unsigned char ch); 13 | unsigned int UTF16Length(const char *s, unsigned int len); 14 | unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen); 15 | 16 | extern int UTF8BytesOfLead[256]; 17 | void UTF8BytesOfLeadInitialise(); 18 | 19 | inline bool UTF8IsTrailByte(int ch) { 20 | return (ch >= 0x80) && (ch < 0xc0); 21 | } 22 | 23 | inline bool UTF8IsAscii(int ch) { 24 | return ch < 0x80; 25 | } 26 | 27 | enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 }; 28 | int UTF8Classify(const unsigned char *us, int len); 29 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/CharClassify.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CharClassify.h 3 | ** Character classifications used by Document and RESearch. 4 | **/ 5 | // Copyright 2006-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CHARCLASSIFY_H 9 | #define CHARCLASSIFY_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class CharClassify { 16 | public: 17 | CharClassify(); 18 | 19 | enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation }; 20 | void SetDefaultCharClasses(bool includeWordClass); 21 | void SetCharClasses(const unsigned char *chars, cc newCharClass); 22 | int GetCharsOfClass(cc charClass, unsigned char *buffer); 23 | cc GetClass(unsigned char ch) const { return static_cast(charClass[ch]);} 24 | bool IsWord(unsigned char ch) const { return static_cast(charClass[ch]) == ccWord;} 25 | 26 | private: 27 | enum { maxChar=256 }; 28 | unsigned char charClass[maxChar]; // not type cc to save space 29 | }; 30 | 31 | #ifdef SCI_NAMESPACE 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /lc3edit/src/AsmFileDocument.cpp: -------------------------------------------------------------------------------- 1 | #include "AsmFileDocument.hpp" 2 | #include "EditorPanel.hpp" 3 | 4 | IMPLEMENT_DYNAMIC_CLASS(AsmFileDocument, wxDocument) 5 | 6 | bool AsmFileDocument::DeleteContents() 7 | { 8 | m_documentTitle = "Untitled.asm"; 9 | m_documentFile = wxEmptyString; 10 | filename.Clear(); 11 | EditorPanel* view = dynamic_cast(GetFirstView()); 12 | if (view) 13 | view->Clear(); 14 | return true; 15 | } 16 | 17 | bool AsmFileDocument::DoSaveDocument(const wxString& file) 18 | { 19 | filename = file; 20 | m_documentTitle = filename.GetFullName(); 21 | m_documentFile = filename.GetFullPath(); 22 | EditorPanel* view = dynamic_cast(GetFirstView()); 23 | if (view) 24 | view->SaveFile(m_documentFile); 25 | return true; 26 | } 27 | 28 | bool AsmFileDocument::DoOpenDocument(const wxString& file) 29 | { 30 | filename = file; 31 | m_documentTitle = filename.GetFullName(); 32 | m_documentFile = filename.GetFullPath(); 33 | EditorPanel* view = dynamic_cast(GetFirstView()); 34 | if (view) 35 | view->LoadFile(m_documentFile); 36 | return true; 37 | } 38 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/WordList.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file WordList.h 3 | ** Hold a list of words. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef WORDLIST_H 9 | #define WORDLIST_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class WordList { 18 | public: 19 | // Each word contains at least one character - a empty word acts as sentinel at the end. 20 | char **words; 21 | char *list; 22 | int len; 23 | bool onlyLineEnds; ///< Delimited by any white space or only line ends 24 | int starts[256]; 25 | WordList(bool onlyLineEnds_ = false) : 26 | words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_) 27 | {} 28 | ~WordList() { Clear(); } 29 | operator bool() const { return len ? true : false; } 30 | bool operator!=(const WordList &other) const; 31 | void Clear(); 32 | void Set(const char *s); 33 | bool InList(const char *s) const; 34 | bool InListAbbreviated(const char *s, const char marker) const; 35 | }; 36 | 37 | #ifdef SCI_NAMESPACE 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/xh_fnb.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: xh_fnb.h 3 | // Purpose: XRC resource for wxFlatNotebook 4 | // Author: Armel Asselin 5 | // Created: 2006/10/30 6 | // RCS-ID: $Id: $ 7 | // Copyright: (c) 2006 Armel Asselin 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #ifndef _WX_XH_FLATNOTBK_H_ 12 | #define _WX_XH_FLATNOTBK_H_ 13 | 14 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 15 | #pragma interface "xh_notbk.h" 16 | #endif 17 | 18 | #include "wx/xrc/xmlres.h" 19 | 20 | #if wxUSE_NOTEBOOK 21 | 22 | #include "wx/wxFlatNotebook/wxFlatNotebook.h" 23 | 24 | class WXDLLIMPEXP_FNB wxFlatNotebook; 25 | 26 | class WXDLLIMPEXP_FNB wxFlatNotebookXmlHandler : public wxXmlResourceHandler 27 | { 28 | DECLARE_DYNAMIC_CLASS(wxFlatNotebookXmlHandler) 29 | public: 30 | wxFlatNotebookXmlHandler(); 31 | virtual wxObject *DoCreateResource(); 32 | virtual bool CanHandle(wxXmlNode *node); 33 | 34 | private: 35 | bool m_isInside; 36 | wxFlatNotebook *m_notebook; 37 | }; 38 | 39 | #endif 40 | 41 | #endif // _WX_XH_NOTBK_H_ 42 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/KeyMap.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file KeyMap.h 3 | ** Defines a mapping between keystrokes and commands. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef KEYTOCOMMAND_H 9 | #define KEYTOCOMMAND_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | #define SCI_NORM 0 16 | #define SCI_SHIFT SCMOD_SHIFT 17 | #define SCI_CTRL SCMOD_CTRL 18 | #define SCI_ALT SCMOD_ALT 19 | #define SCI_META SCMOD_META 20 | #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT) 21 | #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT) 22 | 23 | /** 24 | */ 25 | class KeyToCommand { 26 | public: 27 | int key; 28 | int modifiers; 29 | unsigned int msg; 30 | }; 31 | 32 | /** 33 | */ 34 | class KeyMap { 35 | KeyToCommand *kmap; 36 | int len; 37 | int alloc; 38 | static const KeyToCommand MapDefault[]; 39 | 40 | public: 41 | KeyMap(); 42 | ~KeyMap(); 43 | void Clear(); 44 | void AssignCmdKey(int key, int modifiers, unsigned int msg); 45 | unsigned int Find(int key, int modifiers); // 0 returned on failure 46 | }; 47 | 48 | #ifdef SCI_NAMESPACE 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerNoExceptions.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerNoExceptions.h 3 | ** A simple lexer with no state. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LexerNoExceptions_H 9 | #define LexerNoExceptions_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | // A simple lexer with no state 16 | class LexerNoExceptions : public LexerBase { 17 | public: 18 | // TODO Also need to prevent exceptions in constructor and destructor 19 | int SCI_METHOD PropertySet(const char *key, const char *val); 20 | int SCI_METHOD WordListSet(int n, const char *wl); 21 | void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); 22 | void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *); 23 | 24 | virtual void Lexer(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0; 25 | virtual void Folder(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0; 26 | }; 27 | 28 | #ifdef SCI_NAMESPACE 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/fnb_resources.h: -------------------------------------------------------------------------------- 1 | #ifndef FNB_RESOURCES_H 2 | #define FNB_RESOURCES_H 3 | 4 | extern size_t tab_selection_png_size; 5 | extern unsigned char tab_selection_png[]; 6 | 7 | // Control left arrow images 8 | extern char *left_arrow_disabled_xpm[]; 9 | extern char *left_arrow_hilite_xpm[]; 10 | extern char *left_arrow_xpm[]; 11 | extern char *left_arrow_pressed_xpm[]; 12 | 13 | // Control right arrow 14 | extern char *right_arrow_hilite_xpm[]; 15 | extern char *right_arrow_pressed_xpm[]; 16 | extern char *right_arrow_xpm[]; 17 | extern char *right_arrow_disabled_xpm[]; 18 | 19 | // Cotrol down arrow 20 | extern char *down_arrow_hilite_xpm[]; 21 | extern char *down_arrow_pressed_xpm[]; 22 | extern char *down_arrow_xpm[]; 23 | 24 | // X button 25 | extern char *x_button_hilite_xpm[]; 26 | extern char *tab_x_button_pressed_xpm[]; 27 | extern char *x_button_pressed_xpm[]; 28 | extern char *x_button_xpm[]; 29 | 30 | // Popup dialog xpm 31 | extern unsigned char signpost_alpha[]; 32 | extern char *signpost_xpm[]; 33 | 34 | // Drag hint arrows 35 | extern char *arrow_down_blue_xpm[]; 36 | extern char *arrow_up_blue_xpm[]; 37 | extern unsigned char arrow_down_blue_alpha[]; 38 | extern unsigned char arrow_up_blue_alpha[]; 39 | 40 | #endif // FNB_RESOURCES_H 41 | 42 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/PlatWX.h: -------------------------------------------------------------------------------- 1 | // Scintilla platform layer for wxWidgets 2 | 3 | #ifndef PLATWX_H 4 | #define PLATWX_H 5 | 6 | #include "Platform.h" 7 | 8 | #include 9 | #include // wxRect 10 | 11 | class wxDC; 12 | 13 | #ifdef SCI_NAMESPACE 14 | namespace Scintilla { 15 | #endif 16 | 17 | inline wxColour wxColourFromCDandAlpha(ColourDesired cd, int alpha) 18 | { 19 | return wxColour((unsigned char)cd.GetRed(), 20 | (unsigned char)cd.GetGreen(), 21 | (unsigned char)cd.GetBlue(), 22 | (unsigned char)alpha); 23 | } 24 | 25 | inline wxColour wxColourFromCD(ColourDesired cd) 26 | { 27 | unsigned int r = cd.GetRed(); 28 | unsigned int g = cd.GetGreen(); 29 | unsigned int b = cd.GetBlue(); 30 | return wxColour((unsigned char)r, (unsigned char)g, (unsigned char)b); 31 | } 32 | 33 | inline wxRect wxRectFromPRectangle(PRectangle prc) 34 | { 35 | return wxRect(prc.left, prc.top, prc.Width(), prc.Height()); 36 | } 37 | 38 | inline PRectangle PRectangleFromwxRect(wxRect rc) 39 | { 40 | return PRectangle(rc.GetLeft(), rc.GetTop(), rc.GetRight()+1, rc.GetBottom()+1); 41 | } 42 | 43 | inline Point Point::FromLong(long lpoint) 44 | { 45 | return Point(lpoint & 0xFFFF, lpoint >> 16); 46 | } 47 | 48 | #ifdef SCI_NAMESPACE 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/fnb_singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef FNB_SINGLETON_H 2 | #define FNB_SINGLETON_H 3 | 4 | /** 5 | * A template class that implements the wxFNBSingleton pattern. 6 | * 7 | * \date 08-23-2006 8 | * \author eran 9 | */ 10 | template 11 | class wxFNBSingleton 12 | { 13 | static T* ms_instance; 14 | public: 15 | /** 16 | * Static method to access the only pointer of this instance. 17 | * \return a pointer to the only instance of this 18 | */ 19 | static T* Get(); 20 | 21 | /** 22 | * Release resources. 23 | */ 24 | static void Free(); 25 | 26 | protected: 27 | /** 28 | * Default constructor. 29 | */ 30 | wxFNBSingleton(); 31 | 32 | /** 33 | * Destructor. 34 | */ 35 | virtual ~wxFNBSingleton(); 36 | }; 37 | template 38 | T* wxFNBSingleton::ms_instance = 0; 39 | 40 | template 41 | wxFNBSingleton::wxFNBSingleton() 42 | { 43 | } 44 | 45 | template 46 | wxFNBSingleton::~wxFNBSingleton() 47 | { 48 | } 49 | 50 | template 51 | T* wxFNBSingleton::Get() 52 | { 53 | if(!ms_instance) 54 | ms_instance = new T(); 55 | return ms_instance; 56 | } 57 | 58 | template 59 | void wxFNBSingleton::Free() 60 | { 61 | if( ms_instance ) 62 | { 63 | delete ms_instance; 64 | ms_instance = 0; 65 | } 66 | } 67 | 68 | #endif // FNB_SINGLETON_H 69 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla_generator/readme.txt: -------------------------------------------------------------------------------- 1 | Generation: 2 | ----------- 3 | These files are taken from wxWidgets SVN sources to create the interface. 4 | 5 | The folder is... 6 | older wxWidgets ( <=2.8 ) -> {wxWidgets.svn}\contrib\src\stc 7 | newer wxWidgets ( > 2.8 ) -> {wxWidgets.svn}\src\stc 8 | and {wxWidgets.svn}\include\wx\stc\stc.h 9 | The files are... 10 | - gen_iface.py (modified for C::B, sync!) 11 | - stc.cpp.in 12 | - stc.h.in 13 | (Re-)Generated files will be... 14 | - stc.h 15 | - stc.cpp 16 | - stc.doc 17 | 18 | PLACE A COPY OF A RECENT SCINTILLA IN A SUBFOLDER NAMED "scintilla" TO WORK! 19 | 20 | Calling "gen_iface.py" actually creates the interface. 21 | 22 | This will (re-)generate ("sync") stc.h with {scintilla}\include\SciLexer.h 23 | (starting in stc.h with the comment "// For SciLexer.h"). 24 | 25 | Compare: 26 | stc.cpp with wxscintilla.cpp 27 | and 28 | stc.h with wxscintilla.h 29 | afterwards. 30 | 31 | Issues with interface generation: 32 | --------------------------------- 33 | In Scintilla.iface in "SetSelectionNEnd" (around line 2000) the comma before the 34 | closing bracket of the second parameter must be removed, thus: 35 | set void SetSelectionNEnd=2586(int selection, position pos,) 36 | -> 37 | set void SetSelectionNEnd=2586(int selection, position pos) 38 | Having the comma there the line cannot be parsed as the syntax does not match 39 | the allowed syntax of the reg-exe's 40 | -------------------------------------------------------------------------------- /lc3edit/src/EditorPanelDecl.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Oct 8 2012) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __EDITORFRAMEDECL_H__ 9 | #define __EDITORFRAMEDECL_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #ifdef __VISUALC__ 20 | #include 21 | #endif //__VISUALC__ 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | /////////////////////////////////////////////////////////////////////////////// 29 | /// Class EditorPanelDecl 30 | /////////////////////////////////////////////////////////////////////////////// 31 | class EditorPanelDecl : public wxPanel 32 | { 33 | private: 34 | 35 | protected: 36 | wxScintilla* editor; 37 | 38 | public: 39 | 40 | EditorPanelDecl( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL ); 41 | ~EditorPanelDecl(); 42 | 43 | }; 44 | 45 | #endif //__EDITORFRAMEDECL_H__ 46 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/popup_dlg.h: -------------------------------------------------------------------------------- 1 | #ifndef FNB_POPUPDLG_H 2 | #define FNB_POPUPDLG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class wxListBox; 9 | class wxFlatNotebook; 10 | class wxPanel; 11 | 12 | class wxTabNavigatorWindow : public wxDialog 13 | { 14 | protected: 15 | wxListBox *m_listBox; 16 | long m_selectedItem; 17 | std::map m_indexMap; 18 | wxPanel *m_panel; 19 | static wxBitmap m_bmp; 20 | 21 | protected: 22 | void CloseDialog(); 23 | 24 | public: 25 | /** 26 | * Parameterized constructor 27 | * \param parent dialog parent window 28 | */ 29 | wxTabNavigatorWindow(wxWindow* parent); 30 | 31 | /** 32 | * Default constructor 33 | */ 34 | wxTabNavigatorWindow(); 35 | 36 | /** 37 | * Destructor 38 | */ 39 | virtual ~wxTabNavigatorWindow(); 40 | 41 | /** 42 | * Create the dialog, usually part of the two steps construction of a 43 | * dialog 44 | * \param parent dialog parent window 45 | */ 46 | void Create(wxWindow* parent); 47 | 48 | /// Event handling 49 | void OnKeyUp(wxKeyEvent &event); 50 | void OnNavigationKey(wxNavigationKeyEvent &event); 51 | void OnItemSelected(wxCommandEvent &event); 52 | void OnPanelPaint(wxPaintEvent &event); 53 | void OnPanelEraseBg(wxEraseEvent &event); 54 | void PopulateListControl(wxFlatNotebook *book); 55 | }; 56 | 57 | #endif // FNB_POPUPDLG_H 58 | 59 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerBase.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerBase.h 3 | ** A simple lexer with no state. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LEXERBASE_H 9 | #define LEXERBASE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | // A simple lexer with no state 16 | class LexerBase : public ILexer { 17 | protected: 18 | PropSetSimple props; 19 | enum {numWordLists=KEYWORDSET_MAX+1}; 20 | WordList *keyWordLists[numWordLists+1]; 21 | public: 22 | LexerBase(); 23 | virtual ~LexerBase(); 24 | void SCI_METHOD Release(); 25 | int SCI_METHOD Version() const; 26 | const char * SCI_METHOD PropertyNames(); 27 | int SCI_METHOD PropertyType(const char *name); 28 | const char * SCI_METHOD DescribeProperty(const char *name); 29 | int SCI_METHOD PropertySet(const char *key, const char *val); 30 | const char * SCI_METHOD DescribeWordListSets(); 31 | int SCI_METHOD WordListSet(int n, const char *wl); 32 | void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; 33 | void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; 34 | void * SCI_METHOD PrivateCall(int operation, void *pointer); 35 | }; 36 | 37 | #ifdef SCI_NAMESPACE 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/CharacterSet.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CharacterSet.cxx 3 | ** Simple case functions for ASCII. 4 | ** Lexer infrastructure. 5 | **/ 6 | // Copyright 1998-2010 by Neil Hodgson 7 | // The License.txt file describes the conditions under which this software may be distributed. 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "CharacterSet.h" 16 | 17 | #ifdef SCI_NAMESPACE 18 | using namespace Scintilla; 19 | #endif 20 | 21 | #ifdef SCI_NAMESPACE 22 | namespace Scintilla { 23 | #endif 24 | 25 | int CompareCaseInsensitive(const char *a, const char *b) { 26 | while (*a && *b) { 27 | if (*a != *b) { 28 | char upperA = MakeUpperCase(*a); 29 | char upperB = MakeUpperCase(*b); 30 | if (upperA != upperB) 31 | return upperA - upperB; 32 | } 33 | a++; 34 | b++; 35 | } 36 | // Either *a or *b is nul 37 | return *a - *b; 38 | } 39 | 40 | int CompareNCaseInsensitive(const char *a, const char *b, size_t len) { 41 | while (*a && *b && len) { 42 | if (*a != *b) { 43 | char upperA = MakeUpperCase(*a); 44 | char upperB = MakeUpperCase(*b); 45 | if (upperA != upperB) 46 | return upperA - upperB; 47 | } 48 | a++; 49 | b++; 50 | len--; 51 | } 52 | if (len == 0) 53 | return 0; 54 | else 55 | // Either *a or *b is nul 56 | return *a - *b; 57 | } 58 | 59 | #ifdef SCI_NAMESPACE 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/StyleContext.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file StyleContext.cxx 3 | ** Lexer infrastructure. 4 | **/ 5 | // Copyright 1998-2004 by Neil Hodgson 6 | // This file is in the public domain. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "ILexer.h" 15 | 16 | #include "LexAccessor.h" 17 | #include "Accessor.h" 18 | #include "StyleContext.h" 19 | 20 | #ifdef SCI_NAMESPACE 21 | using namespace Scintilla; 22 | #endif 23 | 24 | static void getRange(unsigned int start, 25 | unsigned int end, 26 | LexAccessor &styler, 27 | char *s, 28 | unsigned int len) { 29 | unsigned int i = 0; 30 | while ((i < end - start + 1) && (i < len-1)) { 31 | s[i] = styler[start + i]; 32 | i++; 33 | } 34 | s[i] = '\0'; 35 | } 36 | 37 | void StyleContext::GetCurrent(char *s, unsigned int len) { 38 | getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len); 39 | } 40 | 41 | static void getRangeLowered(unsigned int start, 42 | unsigned int end, 43 | LexAccessor &styler, 44 | char *s, 45 | unsigned int len) { 46 | unsigned int i = 0; 47 | while ((i < end - start + 1) && (i < len-1)) { 48 | s[i] = static_cast(tolower(styler[start + i])); 49 | i++; 50 | } 51 | s[i] = '\0'; 52 | } 53 | 54 | void StyleContext::GetCurrentLowered(char *s, unsigned int len) { 55 | getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len); 56 | } 57 | -------------------------------------------------------------------------------- /lc3edit/src/LC3EditFrame.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LC3EDITFRAME_HPP 2 | #define LC3EDITFRAME_HPP 3 | 4 | #include 5 | #include "LC3EditFrameDecl.h" 6 | 7 | #define ID_NEW 1000 8 | #define ID_OPEN 1001 9 | #define ID_SAVE 1002 10 | #define ID_SAVE_ALL 1003 11 | #define ID_UNDO 1004 12 | #define ID_REDO 1005 13 | #define ID_CUT 1006 14 | #define ID_COPY 1007 15 | #define ID_PASTE 1008 16 | #define ID_FIND 1009 17 | #define ID_REPLACE 1010 18 | #define ID_ASSEMBLE 1011 19 | #define ID_RUN 1012 20 | 21 | class LC3EditFrame : public LC3EditFrameDecl 22 | { 23 | public: 24 | LC3EditFrame(wxDocManager* manager, const wxArrayString& files); 25 | ~LC3EditFrame(); 26 | void DoLoadFile(const wxString& file); 27 | private: 28 | wxToolBar* toolbar; 29 | wxDocManager* manager; 30 | void SetupToolbar(); 31 | void OnNew(wxCommandEvent& event) {event.Skip();} 32 | void OnOpen(wxCommandEvent& event) {event.Skip();} 33 | void OnSave(wxCommandEvent& event) {event.Skip();} 34 | void OnSaveAll(wxCommandEvent& event) {event.Skip();} 35 | void OnUndo(wxCommandEvent& event) {event.Skip();} 36 | void OnRedo(wxCommandEvent& event) {event.Skip();} 37 | void OnCut(wxCommandEvent& event) {event.Skip();} 38 | void OnCopy(wxCommandEvent& event) {event.Skip();} 39 | void OnPaste(wxCommandEvent& event) {event.Skip();} 40 | void OnFind(wxCommandEvent& event) {event.Skip();} 41 | void OnReplace(wxCommandEvent& event) {event.Skip();} 42 | void OnAssemble(wxCommandEvent& event) {event.Skip();} 43 | void OnRun(wxCommandEvent& event) {event.Skip();} 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/fnb_customize_dlg.h: -------------------------------------------------------------------------------- 1 | #ifndef __fnb_customize_dlg__ 2 | #define __fnb_customize_dlg__ 3 | 4 | #include 5 | #include 6 | #include "wx/dialog.h" 7 | #include "wx/panel.h" 8 | 9 | class wxCheckBox; 10 | class wxRadioBox; 11 | 12 | /////////////////////////////////////////////////////////////////////////////// 13 | /// Class wxFNBCustomizeDialog 14 | /////////////////////////////////////////////////////////////////////////////// 15 | class wxFNBCustomizeDialog : public wxDialog 16 | { 17 | protected: 18 | wxStaticLine* m_staticline2; 19 | wxButton* m_close; 20 | long m_options; 21 | 22 | // Option's page members 23 | wxRadioBox* m_styles; 24 | wxRadioBox* m_tabVPosition; 25 | wxRadioBox* m_navigationStyle; 26 | wxCheckBox* m_tabBorder; 27 | wxCheckBox* m_hideCloseButton; 28 | wxCheckBox* m_mouseMiddleCloseTab; 29 | wxCheckBox* m_xButtonOnTab; 30 | wxCheckBox* m_dlbClickCloseTab; 31 | wxCheckBox* m_smartTabbing; 32 | wxCheckBox* m_allowDragAndDrop; 33 | wxCheckBox* m_foreignDnD; 34 | wxCheckBox* m_gradient; 35 | wxCheckBox* m_colorfulTab; 36 | 37 | public: 38 | wxFNBCustomizeDialog( wxWindow* parent, long options, int id = wxID_ANY, wxString title = wxT("Customize"), wxPoint pos = wxDefaultPosition, wxSize size = wxDefaultSize, int style = wxDEFAULT_DIALOG_STYLE ); 39 | 40 | protected: 41 | void OnClose(wxCommandEvent &event); 42 | void OnStyle(wxCommandEvent &event); 43 | 44 | private: 45 | wxPanel *CreateOptionsPage(); 46 | void ConnectEvents(); 47 | }; 48 | 49 | #endif //__fnb_customize_dlg__ 50 | 51 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/Decoration.h: -------------------------------------------------------------------------------- 1 | /** @file Decoration.h 2 | ** Visual elements added over text. 3 | **/ 4 | // Copyright 1998-2007 by Neil Hodgson 5 | // The License.txt file describes the conditions under which this software may be distributed. 6 | 7 | #ifndef DECORATION_H 8 | #define DECORATION_H 9 | 10 | #ifdef SCI_NAMESPACE 11 | namespace Scintilla { 12 | #endif 13 | 14 | class Decoration { 15 | public: 16 | Decoration *next; 17 | RunStyles rs; 18 | int indicator; 19 | 20 | Decoration(int indicator_); 21 | ~Decoration(); 22 | 23 | bool Empty(); 24 | }; 25 | 26 | class DecorationList { 27 | int currentIndicator; 28 | int currentValue; 29 | Decoration *current; 30 | int lengthDocument; 31 | Decoration *DecorationFromIndicator(int indicator); 32 | Decoration *Create(int indicator, int length); 33 | void Delete(int indicator); 34 | void DeleteAnyEmpty(); 35 | public: 36 | Decoration *root; 37 | bool clickNotified; 38 | 39 | DecorationList(); 40 | ~DecorationList(); 41 | 42 | void SetCurrentIndicator(int indicator); 43 | int GetCurrentIndicator() const { return currentIndicator; } 44 | 45 | void SetCurrentValue(int value); 46 | int GetCurrentValue() const { return currentValue; } 47 | 48 | // Returns true if some values may have changed 49 | bool FillRange(int &position, int value, int &fillLength); 50 | 51 | void InsertSpace(int position, int insertLength); 52 | void DeleteRange(int position, int deleteLength); 53 | 54 | int AllOnFor(int position); 55 | int ValueAt(int indicator, int position); 56 | int Start(int indicator, int position); 57 | int End(int indicator, int position); 58 | }; 59 | 60 | #ifdef SCI_NAMESPACE 61 | } 62 | #endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/include/ScintillaWidget.h: -------------------------------------------------------------------------------- 1 | /* Scintilla source code edit control */ 2 | /** @file ScintillaWidget.h 3 | ** Definition of Scintilla widget for GTK+. 4 | ** Only needed by GTK+ code but is harmless on other platforms. 5 | **/ 6 | /* Copyright 1998-2001 by Neil Hodgson 7 | * The License.txt file describes the conditions under which this software may be distributed. */ 8 | 9 | #ifndef SCINTILLAWIDGET_H 10 | #define SCINTILLAWIDGET_H 11 | 12 | /* C::B begin */ 13 | #if defined(__WXGTK__) 14 | #include 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | /* C::B end */ 19 | 20 | #define SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject) 21 | #define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass) 22 | #define IS_SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ()) 23 | 24 | typedef struct _ScintillaObject ScintillaObject; 25 | typedef struct _ScintillaClass ScintillaClass; 26 | 27 | struct _ScintillaObject { 28 | GtkContainer cont; 29 | void *pscin; 30 | }; 31 | 32 | struct _ScintillaClass { 33 | GtkContainerClass parent_class; 34 | 35 | void (* command) (ScintillaObject *ttt); 36 | void (* notify) (ScintillaObject *ttt); 37 | }; 38 | 39 | GType scintilla_get_type (void); 40 | GtkWidget* scintilla_new (void); 41 | void scintilla_set_id (ScintillaObject *sci, uptr_t id); 42 | sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); 43 | void scintilla_release_resources(void); 44 | 45 | #define SCINTILLA_NOTIFY "sci-notify" 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerSimple.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerSimple.cxx 3 | ** A simple lexer with no state. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "ILexer.h" 18 | #include "Scintilla.h" 19 | #include "SciLexer.h" 20 | 21 | #include "PropSetSimple.h" 22 | #include "WordList.h" 23 | #include "LexAccessor.h" 24 | #include "Accessor.h" 25 | #include "LexerModule.h" 26 | #include "LexerBase.h" 27 | #include "LexerSimple.h" 28 | 29 | #ifdef SCI_NAMESPACE 30 | using namespace Scintilla; 31 | #endif 32 | 33 | LexerSimple::LexerSimple(const LexerModule *module_) : module(module_) { 34 | for (int wl = 0; wl < module->GetNumWordLists(); wl++) { 35 | if (!wordLists.empty()) 36 | wordLists += "\n"; 37 | wordLists += module->GetWordListDescription(wl); 38 | } 39 | } 40 | 41 | const char * SCI_METHOD LexerSimple::DescribeWordListSets() { 42 | return wordLists.c_str(); 43 | } 44 | 45 | void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) { 46 | Accessor astyler(pAccess, &props); 47 | module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler); 48 | astyler.Flush(); 49 | } 50 | 51 | void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) { 52 | if (props.GetInt("fold")) { 53 | Accessor astyler(pAccess, &props); 54 | module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler); 55 | astyler.Flush(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/RunStyles.h: -------------------------------------------------------------------------------- 1 | /** @file RunStyles.h 2 | ** Data structure used to store sparse styles. 3 | **/ 4 | // Copyright 1998-2007 by Neil Hodgson 5 | // The License.txt file describes the conditions under which this software may be distributed. 6 | 7 | /// Styling buffer using one element for each run rather than using 8 | /// a filled buffer. 9 | 10 | #ifndef RUNSTYLES_H 11 | #define RUNSTYLES_H 12 | 13 | /* C::B begin */ 14 | #include "Partitioning.h" 15 | /* C::B end */ 16 | 17 | #ifdef SCI_NAMESPACE 18 | namespace Scintilla { 19 | #endif 20 | 21 | class RunStyles { 22 | private: 23 | Partitioning *starts; 24 | SplitVector *styles; 25 | int RunFromPosition(int position) const; 26 | int SplitRun(int position); 27 | void RemoveRun(int run); 28 | void RemoveRunIfEmpty(int run); 29 | void RemoveRunIfSameAsPrevious(int run); 30 | public: 31 | RunStyles(); 32 | ~RunStyles(); 33 | int Length() const; 34 | int ValueAt(int position) const; 35 | int FindNextChange(int position, int end); 36 | int StartRun(int position); 37 | int EndRun(int position); 38 | // Returns true if some values may have changed 39 | bool FillRange(int &position, int value, int &fillLength); 40 | void SetValueAt(int position, int value); 41 | void InsertSpace(int position, int insertLength); 42 | void DeleteAll(); 43 | void DeleteRange(int position, int deleteLength); 44 | int Runs() const; 45 | bool AllSame() const; 46 | bool AllSameAs(int value) const; 47 | int Find(int value, int start) const; 48 | 49 | /* CHANGEBAR begin */ 50 | char *PersistantForm() const; 51 | void FromPersistant(const char *form); 52 | static bool PersistantSame(const char *form1, const char *form2); 53 | /* CHANGEBAR end */ 54 | }; 55 | 56 | #ifdef SCI_NAMESPACE 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/Icons.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Scintilla icons 11 | 12 | 13 | 14 | 15 | 16 | 19 | 23 | 24 |
17 | Scintilla icon 18 | 20 | Scintilla 21 | and SciTE 22 |
25 |

26 | Icons 27 |

28 |

29 | These images may be used under the same license as Scintilla. 30 |

31 |

32 | Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson. 33 |

34 |

35 | zip format (70K) 36 |

37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
For autocompletion listsFor margin markers
12x1216x1624x2432x32
55 | 56 | 57 | -------------------------------------------------------------------------------- /lc3edit/src/LC3EditFrameDecl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 17 2015) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __LC3EDITFRAMEDECL_H__ 9 | #define __LC3EDITFRAMEDECL_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | /////////////////////////////////////////////////////////////////////////// 32 | 33 | 34 | /////////////////////////////////////////////////////////////////////////////// 35 | /// Class LC3EditFrameDecl 36 | /////////////////////////////////////////////////////////////////////////////// 37 | class LC3EditFrameDecl : public wxDocMDIParentFrame 38 | { 39 | private: 40 | 41 | protected: 42 | wxPanel* m_panel1; 43 | wxFlatNotebook* fileNotebook; 44 | wxStatusBar* statusBar; 45 | wxMenuBar* m_menubar1; 46 | wxMenu* file; 47 | wxMenu* edit; 48 | wxMenu* view; 49 | wxMenu* run; 50 | wxMenu* help; 51 | 52 | public: 53 | 54 | LC3EditFrameDecl( wxDocManager* manager, wxFrame* parent, wxWindowID id = wxID_ANY, const wxString& title = _("LC3-Edit"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 640,480 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); 55 | 56 | ~LC3EditFrameDecl(); 57 | 58 | }; 59 | 60 | #endif //__LC3EDITFRAMEDECL_H__ 61 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/ContractionState.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ContractionState.h 3 | ** Manages visibility of lines for folding and wrapping. 4 | **/ 5 | // Copyright 1998-2007 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CONTRACTIONSTATE_H 9 | #define CONTRACTIONSTATE_H 10 | 11 | /* C::B begin */ 12 | #include "RunStyles.h" 13 | /* C::B end */ 14 | 15 | #ifdef SCI_NAMESPACE 16 | namespace Scintilla { 17 | #endif 18 | 19 | /** 20 | */ 21 | class ContractionState { 22 | // These contain 1 element for every document line. 23 | RunStyles *visible; 24 | RunStyles *expanded; 25 | RunStyles *heights; 26 | Partitioning *displayLines; 27 | int linesInDocument; 28 | 29 | void EnsureData(); 30 | 31 | bool OneToOne() const { 32 | // True when each document line is exactly one display line so need for 33 | // complex data structures. 34 | return visible == 0; 35 | } 36 | 37 | public: 38 | ContractionState(); 39 | virtual ~ContractionState(); 40 | 41 | void Clear(); 42 | 43 | int LinesInDoc() const; 44 | int LinesDisplayed() const; 45 | int DisplayFromDoc(int lineDoc) const; 46 | int DocFromDisplay(int lineDisplay) const; 47 | 48 | void InsertLine(int lineDoc); 49 | void InsertLines(int lineDoc, int lineCount); 50 | void DeleteLine(int lineDoc); 51 | void DeleteLines(int lineDoc, int lineCount); 52 | 53 | bool GetVisible(int lineDoc) const; 54 | bool SetVisible(int lineDocStart, int lineDocEnd, bool visible); 55 | bool HiddenLines() const; 56 | 57 | bool GetExpanded(int lineDoc) const; 58 | bool SetExpanded(int lineDoc, bool expanded); 59 | int ContractedNext(int lineDocStart) const; 60 | 61 | int GetHeight(int lineDoc) const; 62 | bool SetHeight(int lineDoc, int height); 63 | 64 | void ShowAll(); 65 | void Check() const; 66 | }; 67 | 68 | #ifdef SCI_NAMESPACE 69 | } 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/CharClassify.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CharClassify.cxx 3 | ** Character classifications used by Document and RESearch. 4 | **/ 5 | // Copyright 2006 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | 11 | #include "CharClassify.h" 12 | 13 | #ifdef SCI_NAMESPACE 14 | using namespace Scintilla; 15 | #endif 16 | 17 | // Shut up annoying Visual C++ warnings: 18 | #ifdef _MSC_VER 19 | #pragma warning(disable: 4514) 20 | #endif 21 | 22 | CharClassify::CharClassify() { 23 | SetDefaultCharClasses(true); 24 | } 25 | 26 | void CharClassify::SetDefaultCharClasses(bool includeWordClass) { 27 | // Initialize all char classes to default values 28 | for (int ch = 0; ch < 256; ch++) { 29 | if (ch == '\r' || ch == '\n') 30 | charClass[ch] = ccNewLine; 31 | else if (ch < 0x20 || ch == ' ') 32 | charClass[ch] = ccSpace; 33 | else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_')) 34 | charClass[ch] = ccWord; 35 | else 36 | charClass[ch] = ccPunctuation; 37 | } 38 | } 39 | 40 | void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) { 41 | // Apply the newCharClass to the specifed chars 42 | if (chars) { 43 | while (*chars) { 44 | charClass[*chars] = static_cast(newCharClass); 45 | chars++; 46 | } 47 | } 48 | } 49 | 50 | int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) { 51 | // Get characters belonging to the given char class; return the number 52 | // of characters (if the buffer is NULL, don't write to it). 53 | int count = 0; 54 | for (int ch = maxChar - 1; ch >= 0; --ch) { 55 | if (charClass[ch] == characterClass) { 56 | ++count; 57 | if (buffer) { 58 | *buffer = static_cast(ch); 59 | buffer++; 60 | } 61 | } 62 | } 63 | return count; 64 | } 65 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/RESearch.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file RESearch.h 3 | ** Interface to the regular expression search library. 4 | **/ 5 | // Written by Neil Hodgson 6 | // Based on the work of Ozan S. Yigit. 7 | // This file is in the public domain. 8 | 9 | #ifndef RESEARCH_H 10 | #define RESEARCH_H 11 | 12 | #ifdef SCI_NAMESPACE 13 | namespace Scintilla { 14 | #endif 15 | 16 | /* 17 | * The following defines are not meant to be changeable. 18 | * They are for readability only. 19 | */ 20 | #define MAXCHR 256 21 | #define CHRBIT 8 22 | #define BITBLK MAXCHR/CHRBIT 23 | 24 | class CharacterIndexer { 25 | public: 26 | virtual char CharAt(int index)=0; 27 | virtual ~CharacterIndexer() { 28 | } 29 | }; 30 | 31 | class RESearch { 32 | 33 | public: 34 | RESearch(CharClassify *charClassTable); 35 | ~RESearch(); 36 | bool GrabMatches(CharacterIndexer &ci); 37 | const char *Compile(const char *pattern, int length, bool caseSensitive, bool posix); 38 | int Execute(CharacterIndexer &ci, int lp, int endp); 39 | int Substitute(CharacterIndexer &ci, char *src, char *dst); 40 | 41 | enum { MAXTAG=10 }; 42 | enum { MAXNFA=2048 }; 43 | enum { NOTFOUND=-1 }; 44 | 45 | int bopat[MAXTAG]; 46 | int eopat[MAXTAG]; 47 | char *pat[MAXTAG]; 48 | 49 | private: 50 | void Init(); 51 | void Clear(); 52 | void ChSet(unsigned char c); 53 | void ChSetWithCase(unsigned char c, bool caseSensitive); 54 | int GetBackslashExpression(const char *pattern, int &incr); 55 | 56 | int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap); 57 | 58 | int bol; 59 | int tagstk[MAXTAG]; /* subpat tag stack */ 60 | char nfa[MAXNFA]; /* automaton */ 61 | int sta; 62 | unsigned char bittab[BITBLK]; /* bit table for CCL pre-set bits */ 63 | int failure; 64 | CharClassify *charClass; 65 | bool iswordc(unsigned char x) { 66 | return charClass->IsWord(x); 67 | } 68 | }; 69 | 70 | #ifdef SCI_NAMESPACE 71 | } 72 | #endif 73 | 74 | #endif 75 | 76 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerBase.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerSimple.cxx 3 | ** A simple lexer with no state. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ILexer.h" 16 | #include "Scintilla.h" 17 | #include "SciLexer.h" 18 | 19 | #include "PropSetSimple.h" 20 | #include "WordList.h" 21 | #include "LexAccessor.h" 22 | #include "Accessor.h" 23 | #include "LexerModule.h" 24 | #include "LexerBase.h" 25 | 26 | #ifdef SCI_NAMESPACE 27 | using namespace Scintilla; 28 | #endif 29 | 30 | LexerBase::LexerBase() { 31 | for (int wl = 0; wl < numWordLists; wl++) 32 | keyWordLists[wl] = new WordList; 33 | keyWordLists[numWordLists] = 0; 34 | } 35 | 36 | LexerBase::~LexerBase() { 37 | for (int wl = 0; wl < numWordLists; wl++) { 38 | delete keyWordLists[wl]; 39 | keyWordLists[wl] = 0; 40 | } 41 | keyWordLists[numWordLists] = 0; 42 | } 43 | 44 | void SCI_METHOD LexerBase::Release() { 45 | delete this; 46 | } 47 | 48 | int SCI_METHOD LexerBase::Version() const { 49 | return lvOriginal; 50 | } 51 | 52 | const char * SCI_METHOD LexerBase::PropertyNames() { 53 | return ""; 54 | } 55 | 56 | int SCI_METHOD LexerBase::PropertyType(const char *) { 57 | return SC_TYPE_BOOLEAN; 58 | } 59 | 60 | const char * SCI_METHOD LexerBase::DescribeProperty(const char *) { 61 | return ""; 62 | } 63 | 64 | int SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) { 65 | const char *valOld = props.Get(key); 66 | if (strcmp(val, valOld) != 0) { 67 | props.Set(key, val); 68 | return 0; 69 | } else { 70 | return -1; 71 | } 72 | } 73 | 74 | const char * SCI_METHOD LexerBase::DescribeWordListSets() { 75 | return ""; 76 | } 77 | 78 | int SCI_METHOD LexerBase::WordListSet(int n, const char *wl) { 79 | if (n < numWordLists) { 80 | WordList wlNew; 81 | wlNew.Set(wl); 82 | if (*keyWordLists[n] != wlNew) { 83 | keyWordLists[n]->Set(wl); 84 | return 0; 85 | } 86 | } 87 | return -1; 88 | } 89 | 90 | void * SCI_METHOD LexerBase::PrivateCall(int, void *) { 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/LineMarker.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LineMarker.h 3 | ** Defines the look of a line marker in the margin . 4 | **/ 5 | // Copyright 1998-2011 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LINEMARKER_H 9 | #define LINEMARKER_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | 16 | /** 17 | */ 18 | class LineMarker { 19 | public: 20 | enum typeOfFold { undefined, head, body, tail, headWithTail }; 21 | 22 | int markType; 23 | ColourDesired fore; 24 | ColourDesired back; 25 | ColourDesired backSelected; 26 | int alpha; 27 | XPM *pxpm; 28 | RGBAImage *image; 29 | LineMarker() { 30 | markType = SC_MARK_CIRCLE; 31 | fore = ColourDesired(0,0,0); 32 | back = ColourDesired(0xff,0xff,0xff); 33 | backSelected = ColourDesired(0xff,0x00,0x00); 34 | alpha = SC_ALPHA_NOALPHA; 35 | pxpm = NULL; 36 | image = NULL; 37 | } 38 | LineMarker(const LineMarker &) { 39 | // Defined to avoid pxpm being blindly copied, not as a complete copy constructor 40 | markType = SC_MARK_CIRCLE; 41 | fore = ColourDesired(0,0,0); 42 | back = ColourDesired(0xff,0xff,0xff); 43 | backSelected = ColourDesired(0xff,0x00,0x00); 44 | alpha = SC_ALPHA_NOALPHA; 45 | pxpm = NULL; 46 | image = NULL; 47 | } 48 | ~LineMarker() { 49 | delete pxpm; 50 | delete image; 51 | } 52 | LineMarker &operator=(const LineMarker &other) { 53 | // Defined to avoid pxpm being blindly copied, not as a complete assignment operator 54 | if (this != &other) { 55 | markType = SC_MARK_CIRCLE; 56 | fore = ColourDesired(0,0,0); 57 | back = ColourDesired(0xff,0xff,0xff); 58 | backSelected = ColourDesired(0xff,0x00,0x00); 59 | alpha = SC_ALPHA_NOALPHA; 60 | delete pxpm; 61 | pxpm = NULL; 62 | delete image; 63 | image = NULL; 64 | } 65 | return *this; 66 | } 67 | void SetXPM(const char *textForm); 68 | void SetXPM(const char *const *linesForm); 69 | void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage); 70 | void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle); 71 | }; 72 | 73 | #ifdef SCI_NAMESPACE 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerNoExceptions.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerNoExceptions.cxx 3 | ** A simple lexer with no state which does not throw exceptions so can be used in an external lexer. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ILexer.h" 16 | #include "Scintilla.h" 17 | #include "SciLexer.h" 18 | 19 | #include "PropSetSimple.h" 20 | #include "WordList.h" 21 | #include "LexAccessor.h" 22 | #include "Accessor.h" 23 | #include "LexerModule.h" 24 | #include "LexerBase.h" 25 | #include "LexerNoExceptions.h" 26 | 27 | #ifdef SCI_NAMESPACE 28 | using namespace Scintilla; 29 | #endif 30 | 31 | int SCI_METHOD LexerNoExceptions::PropertySet(const char *key, const char *val) { 32 | try { 33 | return LexerBase::PropertySet(key, val); 34 | } catch (...) { 35 | // Should not throw into caller as may be compiled with different compiler or options 36 | } 37 | return -1; 38 | } 39 | 40 | int SCI_METHOD LexerNoExceptions::WordListSet(int n, const char *wl) { 41 | try { 42 | return LexerBase::WordListSet(n, wl); 43 | } catch (...) { 44 | // Should not throw into caller as may be compiled with different compiler or options 45 | } 46 | return -1; 47 | } 48 | 49 | void SCI_METHOD LexerNoExceptions::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { 50 | try { 51 | Accessor astyler(pAccess, &props); 52 | Lexer(startPos, length, initStyle, pAccess, astyler); 53 | astyler.Flush(); 54 | } catch (...) { 55 | // Should not throw into caller as may be compiled with different compiler or options 56 | pAccess->SetErrorStatus(SC_STATUS_FAILURE); 57 | } 58 | } 59 | void SCI_METHOD LexerNoExceptions::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { 60 | try { 61 | Accessor astyler(pAccess, &props); 62 | Folder(startPos, length, initStyle, pAccess, astyler); 63 | astyler.Flush(); 64 | } catch (...) { 65 | // Should not throw into caller as may be compiled with different compiler or options 66 | pAccess->SetErrorStatus(SC_STATUS_FAILURE); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lc3edit/src/LC3EditApp.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Name: LC3EditApp.hpp 3 | * Purpose: Code For Application Class 4 | * Author: Brandon (brandon.whitehead@gatech.edu) 5 | * Created: 2010-06-28 6 | * Copyright: Brandon () 7 | * License: 8 | **************************************************************/ 9 | 10 | #include "LC3EditApp.hpp" 11 | #include "LC3EditFrame.hpp" 12 | #include "version.h" 13 | #include "AsmFileDocument.hpp" 14 | #include "EditorPanel.hpp" 15 | 16 | #include 17 | #include 18 | 19 | 20 | static const wxCmdLineEntryDesc cmd_descriptions[] = 21 | { 22 | { wxCMD_LINE_PARAM, NULL, NULL, "input file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL}, 23 | { wxCMD_LINE_NONE } 24 | }; 25 | 26 | 27 | IMPLEMENT_APP(LC3EditApp); 28 | 29 | // Command line 30 | wxArrayString files; 31 | LC3EditFrame* lc3editframe; 32 | 33 | /** OnInit 34 | * 35 | * Initializes the program 36 | */ 37 | bool LC3EditApp::OnInit() 38 | { 39 | if (!wxApp::OnInit()) return false; 40 | 41 | srand(time(NULL)); 42 | manager = new wxDocManager(); 43 | templ = new wxDocTemplate(manager, "asm files", "*.asm", wxEmptyString, "asm", "asmdoc", "asmview", CLASSINFO(AsmFileDocument), CLASSINFO(EditorPanel)); 44 | frame = new LC3EditFrame(manager, files); 45 | 46 | //wxIcon icon(icon32_xpm); 47 | //lc3editframe->SetIcon(icon); 48 | 49 | SetTopWindow(frame); 50 | frame->Centre(); 51 | frame->Show(); 52 | 53 | //frame->UpdateStatusBar(); 54 | 55 | return true; 56 | } 57 | 58 | int LC3EditApp::OnRun() 59 | { 60 | int exitcode = wxApp::OnRun(); 61 | //wxTheClipboard->Flush(); 62 | return exitcode; 63 | } 64 | 65 | /** @brief OnCmdLineParsed 66 | * 67 | * @todo: document this function 68 | */ 69 | bool LC3EditApp::OnCmdLineParsed(wxCmdLineParser& parser) 70 | { 71 | // get unnamed parameters 72 | for (unsigned int i = 0; i < parser.GetParamCount(); i++) 73 | { 74 | files.Add(parser.GetParam(i)); 75 | } 76 | 77 | return true; 78 | } 79 | 80 | /** @brief OnInitCmdLine 81 | * 82 | * @todo: document this function 83 | */ 84 | void LC3EditApp::OnInitCmdLine(wxCmdLineParser& parser) 85 | { 86 | parser.SetLogo(wxString::Format(_("LC3Edit Version %ld.%ld"), AutoVersion::MAJOR, AutoVersion::MINOR)); 87 | parser.SetDesc(cmd_descriptions); 88 | parser.SetSwitchChars (_("-")); 89 | } 90 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/build/BuildInfo.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | ## File: BuildInfo.txt 3 | ## Purpose: Installation info 4 | ## Maintainer: Otto Wyss 5 | ## Created: 2004-11-14 6 | ## RCS-ID: $Id: BuildInfo.txt 4946 2008-03-13 09:14:30Z mortenmacfly $ 7 | ## Copyright: (c) 2004 wxCode 8 | ## Licence: wxWindows 9 | ############################################################################## 10 | 11 | Requirements 12 | ============ 13 | To build successfully you need at least wxWidgets 2.6.1 (stable). 14 | 15 | 16 | Generel building rules 17 | ====================== 18 | 1. Build or get the wxWidgets libraries however this is done on your platform 19 | (e.g. packages wxGTK2.4 from Debian/sarge). If the libraries are installed, 20 | nothing additional has to be done. Otherwise you have to set the $WXWIN 21 | environment variable to point to the base directory of wxWidgets (e.g. 22 | "/usr/src/wxWidgets" then "WXWIN=/usr/src/wxWidgets"). 23 | 24 | 2. Extract the sources into a working directory. 25 | 26 | 3. Now follow the platform specific instructions. 27 | 28 | If you want to build any development target don't forget to set the environment 29 | variable WXDEVEL (e.g. "C:\Devel\wxWidgetsDev" then 30 | "WXDEVEL=C:\Devel\wxWidgetsDev"). 31 | 32 | 33 | Linux (wxGTK, wxUniv/GTK) 34 | ------------------------- 35 | Use "make" for the release version, "make debug" for the debug version. For 36 | wxUniv need to make "make univdebug" and variable WXDEVEL has to be set. 37 | 38 | MacOS (wxMAC) 39 | ------------- 40 | ??? Try the Linux build rules. 41 | 42 | Windows (wxMSW, wxUniv/MSW) 43 | --------------------------- 44 | There is a VC++ project file which _requires_ the environment variables 45 | WXWIN pointing to the base directory of wxWidgets (e.g. "C:\Devel\wxWidgets" 46 | then "WXWIN=C:\Devel\wxWidgets". Build the "wxscintilla - Win32 Release" 47 | target. 48 | 49 | Building on other ports 50 | ----------------------- 51 | There is currently no support to build on other ports. If you are able to deduct 52 | how to build on your platform it would be nice if you submit them to the project. 53 | 54 | 55 | Generel installation rules 56 | ========================== 57 | 58 | There is currently no installation mostly because I don't know how in each case. 59 | Simply do it as it is usual on your platform, e.g. on Linux it's probably moving 60 | the library into /usr/lib. On Windows follow the rules of the application which 61 | wants to link with. 62 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/Style.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Style.h 3 | ** Defines the font and colour style for a class of text. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef STYLE_H 9 | #define STYLE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | struct FontSpecification { 16 | const char *fontName; 17 | int weight; 18 | bool italic; 19 | int size; 20 | int characterSet; 21 | int extraFontFlag; 22 | FontSpecification() : 23 | fontName(0), 24 | weight(SC_WEIGHT_NORMAL), 25 | italic(false), 26 | size(10 * SC_FONT_SIZE_MULTIPLIER), 27 | characterSet(0), 28 | extraFontFlag(0) { 29 | } 30 | bool EqualTo(const FontSpecification &other) const; 31 | }; 32 | 33 | // Just like Font but only has a copy of the FontID so should not delete it 34 | class FontAlias : public Font { 35 | // Private so FontAlias objects can not be copied 36 | FontAlias(const FontAlias &); 37 | FontAlias &operator=(const FontAlias &); 38 | public: 39 | FontAlias(); 40 | virtual ~FontAlias(); 41 | void MakeAlias(Font &fontOrigin); 42 | void ClearFont(); 43 | }; 44 | 45 | struct FontMeasurements { 46 | unsigned int ascent; 47 | unsigned int descent; 48 | XYPOSITION aveCharWidth; 49 | XYPOSITION spaceWidth; 50 | int sizeZoomed; 51 | FontMeasurements(); 52 | void Clear(); 53 | }; 54 | 55 | /** 56 | */ 57 | class Style : public FontSpecification, public FontMeasurements { 58 | public: 59 | ColourDesired fore; 60 | ColourDesired back; 61 | bool eolFilled; 62 | bool underline; 63 | enum ecaseForced {caseMixed, caseUpper, caseLower}; 64 | ecaseForced caseForce; 65 | bool visible; 66 | bool changeable; 67 | bool hotspot; 68 | 69 | FontAlias font; 70 | 71 | Style(); 72 | Style(const Style &source); 73 | ~Style(); 74 | Style &operator=(const Style &source); 75 | void Clear(ColourDesired fore_, ColourDesired back_, 76 | int size_, 77 | const char *fontName_, int characterSet_, 78 | int weight_, bool italic_, bool eolFilled_, 79 | bool underline_, ecaseForced caseForce_, 80 | bool visible_, bool changeable_, bool hotspot_); 81 | void ClearTo(const Style &source); 82 | void Copy(Font &font_, const FontMeasurements &fm_); 83 | bool IsProtected() const { return !(changeable && visible);} 84 | }; 85 | 86 | #ifdef SCI_NAMESPACE 87 | } 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerModule.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerModule.h 3 | ** Colourise for particular languages. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LEXERMODULE_H 9 | #define LEXERMODULE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class Accessor; 16 | class WordList; 17 | 18 | typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle, 19 | WordList *keywordlists[], Accessor &styler); 20 | typedef ILexer *(*LexerFactoryFunction)(); 21 | 22 | /** 23 | * A LexerModule is responsible for lexing and folding a particular language. 24 | * The class maintains a list of LexerModules which can be searched to find a 25 | * module appropriate to a particular language. 26 | */ 27 | class LexerModule { 28 | protected: 29 | int language; 30 | LexerFunction fnLexer; 31 | LexerFunction fnFolder; 32 | LexerFactoryFunction fnFactory; 33 | const char * const * wordListDescriptions; 34 | int styleBits; 35 | 36 | public: 37 | const char *languageName; 38 | LexerModule(int language_, 39 | LexerFunction fnLexer_, 40 | const char *languageName_=0, 41 | LexerFunction fnFolder_=0, 42 | const char * const wordListDescriptions_[] = NULL, 43 | int styleBits_=5); 44 | LexerModule(int language_, 45 | LexerFactoryFunction fnFactory_, 46 | const char *languageName_, 47 | const char * const wordListDescriptions_[] = NULL, 48 | int styleBits_=8); 49 | virtual ~LexerModule() { 50 | } 51 | int GetLanguage() const { return language; } 52 | 53 | // -1 is returned if no WordList information is available 54 | int GetNumWordLists() const; 55 | const char *GetWordListDescription(int index) const; 56 | 57 | int GetStyleBitsNeeded() const; 58 | 59 | ILexer *Create() const; 60 | 61 | virtual void Lex(unsigned int startPos, int length, int initStyle, 62 | WordList *keywordlists[], Accessor &styler) const; 63 | virtual void Fold(unsigned int startPos, int length, int initStyle, 64 | WordList *keywordlists[], Accessor &styler) const; 65 | 66 | friend class Catalogue; 67 | }; 68 | 69 | inline int Maximum(int a, int b) { 70 | return (a > b) ? a : b; 71 | } 72 | 73 | // Shut up annoying Visual C++ warnings: 74 | #ifdef _MSC_VER 75 | #pragma warning(disable: 4244 4309 4514 4710) 76 | #endif 77 | 78 | #ifdef SCI_NAMESPACE 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/README: -------------------------------------------------------------------------------- 1 | README for building of Scintilla and SciTE 2 | 3 | Scintilla can be built by itself. 4 | To build SciTE, Scintilla must first be built. 5 | 6 | 7 | *** GTK+/Linux version *** 8 | 9 | You must first have GTK+ 2.0 or later and GCC (4.1 or better) installed. 10 | GTK+ 1.x will not work. 11 | Other C++ compilers may work but may require tweaking the make file. 12 | 13 | To build Scintilla, use the makefile located in the scintilla/gtk directory 14 | cd scintilla/gtk 15 | make 16 | cd ../.. 17 | 18 | To build and install SciTE, use the makefile located in the scite/gtk directory 19 | cd scite/gtk 20 | make 21 | make install 22 | 23 | This installs SciTE into $prefix/bin. The value of $prefix is determined from 24 | the location of Gnome if it is installed. This is usually /usr if installed 25 | with Linux or /usr/local if built from source. If Gnome is not installed 26 | /usr/bin is used as the prefix. The prefix can be overridden on the command 27 | line like "make prefix=/opt" but the same value should be used for both make 28 | and make install as this location is compiled into the executable. The global 29 | properties file is installed at $prefix/share/scite/SciTEGlobal.properties. 30 | The language specific properties files are also installed into this directory. 31 | 32 | To remove SciTE 33 | make uninstall 34 | 35 | To clean the object files which may be needed to change $prefix 36 | make clean 37 | 38 | The current make file only supports static linking between SciTE and Scintilla. 39 | 40 | 41 | *** Windows version *** 42 | 43 | A C++ compiler is required. Visual Studio .NET 2010 is the development system 44 | used for most development although TDM Mingw32 4.4.1 is also supported. 45 | 46 | To build Scintilla, make in the scintilla/win32 directory 47 | cd scintilla\win32 48 | GCC: mingw32-make 49 | VS .NET: nmake -f scintilla.mak 50 | cd ..\.. 51 | 52 | To build SciTE, use the makefiles located in the scite/win32 directory 53 | cd scite\win32 54 | GCC: mingw32-make 55 | VS .NET: nmake -f scite.mak 56 | 57 | An executable SciTE will now be in scite\bin. 58 | 59 | The Visual C++ 6.0 project (.dsp) and make files are no longer supported but are left 60 | in the download for people that are prepared to update them. 61 | 62 | *** GTK+/Windows version *** 63 | 64 | Mingw32 is known to work. Other compilers will probably not work. 65 | 66 | Only Scintilla will build with GTK+ on Windows. SciTE will not work. 67 | 68 | To build Scintilla, make in the scintilla/gtk directory 69 | cd scintilla\gtk 70 | mingw32-make 71 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/Accessor.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file KeyWords.cxx 3 | ** Colourise for particular languages. 4 | **/ 5 | // Copyright 1998-2002 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ILexer.h" 16 | #include "Scintilla.h" 17 | #include "SciLexer.h" 18 | 19 | #include "PropSetSimple.h" 20 | #include "WordList.h" 21 | #include "LexAccessor.h" 22 | #include "Accessor.h" 23 | 24 | #ifdef SCI_NAMESPACE 25 | using namespace Scintilla; 26 | #endif 27 | 28 | Accessor::Accessor(IDocument *pAccess_, PropSetSimple *pprops_) : LexAccessor(pAccess_), pprops(pprops_) { 29 | } 30 | 31 | int Accessor::GetPropertyInt(const char *key, int defaultValue) { 32 | return pprops->GetInt(key, defaultValue); 33 | } 34 | 35 | int Accessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) { 36 | int end = Length(); 37 | int spaceFlags = 0; 38 | 39 | // Determines the indentation level of the current line and also checks for consistent 40 | // indentation compared to the previous line. 41 | // Indentation is judged consistent when the indentation whitespace of each line lines 42 | // the same or the indentation of one line is a prefix of the other. 43 | 44 | int pos = LineStart(line); 45 | char ch = (*this)[pos]; 46 | int indent = 0; 47 | bool inPrevPrefix = line > 0; 48 | int posPrev = inPrevPrefix ? LineStart(line-1) : 0; 49 | while ((ch == ' ' || ch == '\t') && (pos < end)) { 50 | if (inPrevPrefix) { 51 | char chPrev = (*this)[posPrev++]; 52 | if (chPrev == ' ' || chPrev == '\t') { 53 | if (chPrev != ch) 54 | spaceFlags |= wsInconsistent; 55 | } else { 56 | inPrevPrefix = false; 57 | } 58 | } 59 | if (ch == ' ') { 60 | spaceFlags |= wsSpace; 61 | indent++; 62 | } else { // Tab 63 | spaceFlags |= wsTab; 64 | if (spaceFlags & wsSpace) 65 | spaceFlags |= wsSpaceTab; 66 | indent = (indent / 8 + 1) * 8; 67 | } 68 | ch = (*this)[++pos]; 69 | } 70 | 71 | *flags = spaceFlags; 72 | indent += SC_FOLDLEVELBASE; 73 | // if completely empty line or the start of a comment... 74 | if ((LineStart(line) == Length()) || (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') || 75 | (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos))) 76 | return indent | SC_FOLDLEVELWHITEFLAG; 77 | else 78 | return indent; 79 | } 80 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/include/HFacer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface 3 | # definition file. 4 | # The header files are copied to a temporary file apart from the section between a /* ++Autogenerated*/ 5 | # comment and a /* --Autogenerated*/ comment which is generated by the printHFile and printLexHFile 6 | # functions. After the temporary file is created, it is copied back to the original file name. 7 | 8 | import sys 9 | import os 10 | import Face 11 | 12 | def Contains(s,sub): 13 | return s.find(sub) != -1 14 | 15 | def printLexHFile(f,out): 16 | for name in f.order: 17 | v = f.features[name] 18 | if v["FeatureType"] in ["val"]: 19 | if Contains(name, "SCE_") or Contains(name, "SCLEX_"): 20 | out.write("#define " + name + " " + v["Value"] + "\n") 21 | 22 | def printHFile(f,out): 23 | for name in f.order: 24 | v = f.features[name] 25 | if v["Category"] != "Deprecated": 26 | if v["FeatureType"] in ["fun", "get", "set"]: 27 | featureDefineName = "SCI_" + name.upper() 28 | out.write("#define " + featureDefineName + " " + v["Value"] + "\n") 29 | elif v["FeatureType"] in ["evt"]: 30 | featureDefineName = "SCN_" + name.upper() 31 | out.write("#define " + featureDefineName + " " + v["Value"] + "\n") 32 | elif v["FeatureType"] in ["val"]: 33 | if not (Contains(name, "SCE_") or Contains(name, "SCLEX_")): 34 | out.write("#define " + name + " " + v["Value"] + "\n") 35 | 36 | def CopyWithInsertion(input, output, genfn, definition): 37 | copying = 1 38 | for line in input.readlines(): 39 | if copying: 40 | output.write(line) 41 | if Contains(line, "/* ++Autogenerated"): 42 | copying = 0 43 | genfn(definition, output) 44 | if Contains(line, "/* --Autogenerated"): 45 | copying = 1 46 | output.write(line) 47 | 48 | def contents(filename): 49 | f = open(filename) 50 | t = f.read() 51 | f.close() 52 | return t 53 | 54 | def Regenerate(filename, genfn, definition): 55 | inText = contents(filename) 56 | tempname = "HFacer.tmp" 57 | out = open(tempname,"w") 58 | hfile = open(filename) 59 | CopyWithInsertion(hfile, out, genfn, definition) 60 | out.close() 61 | hfile.close() 62 | outText = contents(tempname) 63 | if inText == outText: 64 | os.unlink(tempname) 65 | else: 66 | os.unlink(filename) 67 | os.rename(tempname, filename) 68 | 69 | f = Face.Face() 70 | try: 71 | f.ReadFromFile("Scintilla.iface") 72 | Regenerate("Scintilla.h", printHFile, f) 73 | Regenerate("SciLexer.h", printLexHFile, f) 74 | print("Maximum ID is %s" % max([x for x in f.values if int(x) < 3000])) 75 | except: 76 | raise 77 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/AutoComplete.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file AutoComplete.h 3 | ** Defines the auto completion list box. 4 | **/ 5 | // Copyright 1998-2003 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef AUTOCOMPLETE_H 9 | #define AUTOCOMPLETE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class AutoComplete { 18 | bool active; 19 | char stopChars[256]; 20 | char fillUpChars[256]; 21 | char separator; 22 | char typesep; // Type seperator 23 | enum { maxItemLen=1000 }; 24 | 25 | public: 26 | 27 | bool ignoreCase; 28 | bool chooseSingle; 29 | ListBox *lb; 30 | int posStart; 31 | int startLen; 32 | /// Should autocompletion be canceled if editor's currentPos <= startPos? 33 | bool cancelAtStartPos; 34 | bool autoHide; 35 | bool dropRestOfWord; 36 | unsigned int ignoreCaseBehaviour; 37 | int widthLBDefault; 38 | int heightLBDefault; 39 | 40 | AutoComplete(); 41 | ~AutoComplete(); 42 | 43 | /// Is the auto completion list displayed? 44 | bool Active() const; 45 | 46 | /// Display the auto completion list positioned to be near a character position 47 | void Start(Window &parent, int ctrlID, int position, Point location, 48 | int startLen_, int lineHeight, bool unicodeMode, int technology); 49 | 50 | /// The stop chars are characters which, when typed, cause the auto completion list to disappear 51 | void SetStopChars(const char *stopChars_); 52 | bool IsStopChar(char ch); 53 | 54 | /// The fillup chars are characters which, when typed, fill up the selected word 55 | void SetFillUpChars(const char *fillUpChars_); 56 | bool IsFillUpChar(char ch); 57 | 58 | /// The separator character is used when interpreting the list in SetList 59 | void SetSeparator(char separator_); 60 | char GetSeparator() const; 61 | 62 | /// The typesep character is used for seperating the word from the type 63 | void SetTypesep(char separator_); 64 | char GetTypesep() const; 65 | 66 | /// The list string contains a sequence of words separated by the separator character 67 | void SetList(const char *list); 68 | 69 | /// Return the position of the currently selected list item 70 | int GetSelection() const; 71 | 72 | /// Return the value of an item in the list 73 | std::string GetValue(int item) const; 74 | 75 | void Show(bool show); 76 | void Cancel(); 77 | 78 | /// Move the current list element by delta, scrolling appropriately 79 | void Move(int delta); 80 | 81 | /// Select a list element that starts with word as the current element 82 | void Select(const char *word); 83 | }; 84 | 85 | #ifdef SCI_NAMESPACE 86 | } 87 | #endif 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /lc3edit/src/EditorPanelDecl.cpp: -------------------------------------------------------------------------------- 1 | #include "EditorPanelDecl.hpp" 2 | 3 | EditorPanelDecl::EditorPanelDecl( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) 4 | { 5 | wxBoxSizer* bSizer3; 6 | bSizer3 = new wxBoxSizer( wxVERTICAL ); 7 | 8 | editor = new wxScintilla( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); 9 | editor->SetUseTabs( false ); 10 | editor->SetTabWidth( 4 ); 11 | editor->SetIndent( 4 ); 12 | editor->SetTabIndents( true ); 13 | editor->SetBackSpaceUnIndents( true ); 14 | editor->SetViewEOL( false ); 15 | editor->SetViewWhiteSpace( false ); 16 | editor->SetMarginWidth( 2, 0 ); 17 | editor->SetIndentationGuides( false ); 18 | editor->SetMarginType( 1, wxSCI_MARGIN_SYMBOL ); 19 | editor->SetMarginMask( 1, wxSCI_MASK_FOLDERS ); 20 | editor->SetMarginWidth( 1, 16); 21 | editor->SetMarginSensitive( 1, true ); 22 | editor->SetProperty( wxT("fold"), wxT("1") ); 23 | editor->SetFoldFlags( wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED ); 24 | editor->SetMarginType( 0, wxSCI_MARGIN_NUMBER ); 25 | editor->SetMarginWidth( 0, editor->TextWidth( wxSCI_STYLE_LINENUMBER, wxT("_99999") ) ); 26 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDER, wxSCI_MARK_BOXPLUS ); 27 | editor->MarkerSetBackground( wxSCI_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) ); 28 | editor->MarkerSetForeground( wxSCI_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) ); 29 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARK_BOXMINUS ); 30 | editor->MarkerSetBackground( wxSCI_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) ); 31 | editor->MarkerSetForeground( wxSCI_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) ); 32 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDERSUB, wxSCI_MARK_EMPTY ); 33 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDEREND, wxSCI_MARK_BOXPLUS ); 34 | editor->MarkerSetBackground( wxSCI_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) ); 35 | editor->MarkerSetForeground( wxSCI_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) ); 36 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARK_BOXMINUS ); 37 | editor->MarkerSetBackground( wxSCI_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) ); 38 | editor->MarkerSetForeground( wxSCI_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) ); 39 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARK_EMPTY ); 40 | editor->MarkerDefine( wxSCI_MARKNUM_FOLDERTAIL, wxSCI_MARK_EMPTY ); 41 | editor->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) ); 42 | editor->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) ); 43 | bSizer3->Add( editor, 1, wxEXPAND | wxALL, 0 ); 44 | 45 | 46 | this->SetSizer( bSizer3 ); 47 | this->Layout(); 48 | } 49 | 50 | EditorPanelDecl::~EditorPanelDecl() 51 | { 52 | } 53 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/ExternalLexer.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ExternalLexer.h 3 | ** Support external lexers in DLLs. 4 | **/ 5 | // Copyright 2001 Simon Steele , portions copyright Neil Hodgson. 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef EXTERNALLEXER_H 9 | #define EXTERNALLEXER_H 10 | 11 | #if PLAT_WIN 12 | #define EXT_LEXER_DECL __stdcall 13 | #else 14 | #define EXT_LEXER_DECL 15 | #endif 16 | 17 | /* C::B begin */ 18 | #include 19 | #include "LexerModule.h" 20 | /* C::B end */ 21 | 22 | #ifdef SCI_NAMESPACE 23 | namespace Scintilla { 24 | #endif 25 | 26 | typedef void*(EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index); 27 | typedef int (EXT_LEXER_DECL *GetLexerCountFn)(); 28 | typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength); 29 | typedef LexerFactoryFunction(EXT_LEXER_DECL *GetLexerFactoryFunction)(unsigned int Index); 30 | 31 | /// Sub-class of LexerModule to use an external lexer. 32 | class ExternalLexerModule : public LexerModule { 33 | protected: 34 | GetLexerFactoryFunction fneFactory; 35 | char name[100]; 36 | public: 37 | ExternalLexerModule(int language_, LexerFunction fnLexer_, 38 | const char *languageName_=0, LexerFunction fnFolder_=0) : 39 | LexerModule(language_, fnLexer_, 0, fnFolder_), 40 | fneFactory(0) { 41 | strncpy(name, languageName_, sizeof(name)); 42 | name[sizeof(name)-1] = '\0'; 43 | languageName = name; 44 | } 45 | virtual void SetExternal(GetLexerFactoryFunction fFactory, int index); 46 | }; 47 | 48 | /// LexerMinder points to an ExternalLexerModule - so we don't leak them. 49 | class LexerMinder { 50 | public: 51 | ExternalLexerModule *self; 52 | LexerMinder *next; 53 | }; 54 | 55 | /// LexerLibrary exists for every External Lexer DLL, contains LexerMinders. 56 | class LexerLibrary { 57 | DynamicLibrary *lib; 58 | LexerMinder *first; 59 | LexerMinder *last; 60 | 61 | public: 62 | LexerLibrary(const char *ModuleName); 63 | ~LexerLibrary(); 64 | void Release(); 65 | 66 | LexerLibrary *next; 67 | std::string m_sModuleName; 68 | }; 69 | 70 | /// LexerManager manages external lexers, contains LexerLibrarys. 71 | class LexerManager { 72 | public: 73 | ~LexerManager(); 74 | 75 | static LexerManager *GetInstance(); 76 | static void DeleteInstance(); 77 | 78 | void Load(const char *path); 79 | void Clear(); 80 | 81 | private: 82 | LexerManager(); 83 | static LexerManager *theInstance; 84 | 85 | void LoadLexerLibrary(const char *module); 86 | LexerLibrary *first; 87 | LexerLibrary *last; 88 | }; 89 | 90 | class LMMinder { 91 | public: 92 | ~LMMinder(); 93 | }; 94 | 95 | #ifdef SCI_NAMESPACE 96 | } 97 | #endif 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/ScintillaDownload.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Download Scintilla 11 | 12 | 13 | 14 | 15 | 16 | 19 | 23 | 24 |
17 | Scintilla icon 18 | 20 | Download 21 | Scintilla 22 |
25 | 26 | 27 | 34 | 35 |
28 | 29 | Windows   30 | 31 | GTK+/Linux   32 | 33 |
36 |

37 | Download. 38 |

39 |

40 | The license for using Scintilla or SciTE is similar to that of Python 41 | containing very few restrictions. 42 |

43 |

44 | Release 3.2.3 45 |

46 |

47 | Source Code 48 |

49 | The source code package contains all of the source code for Scintilla but no binary 50 | executable code and is available in 51 |
    52 |
  • zip format (1250K) commonly used on Windows
  • 53 |
  • tgz format (1100K) commonly used on Linux and compatible operating systems
  • 54 |
55 | Instructions for building on both Windows and Linux are included in the readme file. 56 |

57 | Windows Executable Code 58 |

59 | There is no download available containing only the Scintilla DLL. 60 | However, it is included in the SciTE 61 | executable full download as SciLexer.DLL. 62 |

63 | SciTE is a good demonstration of Scintilla. 64 |

65 |

66 | Previous versions can be downloaded from the history 67 | page. 68 |

69 | 70 | 71 | -------------------------------------------------------------------------------- /logging/logger.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LOGGER_HPP 2 | #define LOGGER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | enum class LogLevel 10 | { 11 | FATAL = 0, // printed and stops program 12 | DEBUG = 1, 13 | WARNING = 2, 14 | INFO = 3, 15 | VERBOSE = 4, 16 | }; 17 | 18 | class AbstractLogger 19 | { 20 | public: 21 | AbstractLogger(std::ostream* target = &std::cerr) : out(target), log_level(LogLevel::INFO), log_time(true) {} 22 | virtual ~AbstractLogger() {} 23 | virtual void Log(LogLevel level, const char* format, va_list ap); 24 | virtual void DoLog(LogLevel level, const char* format, va_list ap) {} 25 | void SetLogTarget(std::ostream* stream) 26 | { 27 | out = stream; 28 | } 29 | void SetLogLevel(LogLevel level) 30 | { 31 | log_level = level; 32 | } 33 | void SetLogTime(bool logging_time) 34 | { 35 | log_time = logging_time; 36 | } 37 | protected: 38 | std::ostream* out; 39 | LogLevel log_level; 40 | bool log_time; 41 | }; 42 | 43 | class Logger : public AbstractLogger 44 | { 45 | public: 46 | virtual void DoLog(LogLevel level, const char* format, va_list ap); 47 | }; 48 | 49 | extern std::unique_ptr logger; 50 | 51 | void SetLogger(AbstractLogger* logobj); 52 | 53 | static inline void Log(LogLevel level, const char* format, ...) 54 | { 55 | va_list argptr; 56 | va_start(argptr, format); 57 | logger->Log(level, format, argptr); 58 | va_end(argptr); 59 | } 60 | 61 | static inline void Log(LogLevel level, const char* format, va_list arg) 62 | { 63 | logger->Log(level, format, arg); 64 | } 65 | 66 | static inline void FatalLog(const char* format, ...) 67 | { 68 | va_list argptr; 69 | va_start(argptr, format); 70 | Log(LogLevel::FATAL, format, argptr); 71 | va_end(argptr); 72 | } 73 | 74 | static inline void DebugLog(const char* format, ...) 75 | { 76 | va_list argptr; 77 | va_start(argptr, format); 78 | Log(LogLevel::DEBUG, format, argptr); 79 | va_end(argptr); 80 | } 81 | 82 | static inline void WarnLog(const char* format, ...) 83 | { 84 | va_list argptr; 85 | va_start(argptr, format); 86 | Log(LogLevel::WARNING, format, argptr); 87 | va_end(argptr); 88 | } 89 | 90 | static inline void InfoLog(const char* format, ...) 91 | { 92 | va_list argptr; 93 | va_start(argptr, format); 94 | Log(LogLevel::INFO, format, argptr); 95 | va_end(argptr); 96 | } 97 | 98 | static inline void VerboseLog(const char* format, ...) 99 | { 100 | va_list argptr; 101 | va_start(argptr, format); 102 | Log(LogLevel::VERBOSE, format, argptr); 103 | va_end(argptr); 104 | } 105 | 106 | /** Object that only exists to print out start and end of event call in a function */ 107 | class EventLog 108 | { 109 | public: 110 | EventLog(const char* function); 111 | ~EventLog(); 112 | private: 113 | const char* func; 114 | std::chrono::time_point startTime; 115 | }; 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/CallTip.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CallTip.h 3 | ** Interface to the call tip control. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CALLTIP_H 9 | #define CALLTIP_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class CallTip { 18 | int startHighlight; // character offset to start and... 19 | int endHighlight; // ...end of highlighted text 20 | char *val; 21 | Font font; 22 | PRectangle rectUp; // rectangle of last up angle in the tip 23 | PRectangle rectDown; // rectangle of last down arrow in the tip 24 | int lineHeight; // vertical line spacing 25 | int offsetMain; // The alignment point of the call tip 26 | int tabSize; // Tab size in pixels, <=0 no TAB expand 27 | bool useStyleCallTip; // if true, STYLE_CALLTIP should be used 28 | bool above; // if true, display calltip above text 29 | 30 | // Private so CallTip objects can not be copied 31 | CallTip(const CallTip &); 32 | CallTip &operator=(const CallTip &); 33 | void DrawChunk(Surface *surface, int &x, const char *s, 34 | int posStart, int posEnd, int ytext, PRectangle rcClient, 35 | bool highlight, bool draw); 36 | int PaintContents(Surface *surfaceWindow, bool draw); 37 | bool IsTabCharacter(char c) const; 38 | int NextTabPos(int x); 39 | 40 | public: 41 | Window wCallTip; 42 | Window wDraw; 43 | bool inCallTipMode; 44 | int posStartCallTip; 45 | ColourDesired colourBG; 46 | ColourDesired colourUnSel; 47 | ColourDesired colourSel; 48 | ColourDesired colourShade; 49 | ColourDesired colourLight; 50 | int codePage; 51 | int clickPlace; 52 | 53 | int insetX; // text inset in x from calltip border 54 | int widthArrow; 55 | int borderHeight; 56 | int verticalOffset; // pixel offset up or down of the calltip with respect to the line 57 | 58 | CallTip(); 59 | ~CallTip(); 60 | 61 | void PaintCT(Surface *surfaceWindow); 62 | 63 | void MouseClick(Point pt); 64 | 65 | /// Setup the calltip and return a rectangle of the area required. 66 | PRectangle CallTipStart(int pos, Point pt, int textHeight, const char *defn, 67 | const char *faceName, int size, int codePage_, 68 | int characterSet, int technology, Window &wParent); 69 | 70 | void CallTipCancel(); 71 | 72 | /// Set a range of characters to be displayed in a highlight style. 73 | /// Commonly used to highlight the current parameter. 74 | void SetHighlight(int start, int end); 75 | 76 | /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand. 77 | void SetTabSize(int tabSz); 78 | 79 | /// Set calltip position. 80 | void SetPosition(bool aboveText); 81 | 82 | /// Used to determine which STYLE_xxxx to use for call tip information 83 | bool UseStyleCallTip() const { return useStyleCallTip;} 84 | 85 | // Modify foreground and background colours 86 | void SetForeBack(const ColourDesired &fore, const ColourDesired &back); 87 | }; 88 | 89 | #ifdef SCI_NAMESPACE 90 | } 91 | #endif 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/ScintillaBase.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ScintillaBase.h 3 | ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu. 4 | **/ 5 | // Copyright 1998-2002 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef SCINTILLABASE_H 9 | #define SCINTILLABASE_H 10 | 11 | /* C::B begin */ 12 | #include "PropSetSimple.h" 13 | /* C::B end */ 14 | 15 | #ifdef SCI_NAMESPACE 16 | namespace Scintilla { 17 | #endif 18 | 19 | #ifdef SCI_LEXER 20 | class LexState; 21 | #endif 22 | 23 | /** 24 | */ 25 | class ScintillaBase : public Editor { 26 | // Private so ScintillaBase objects can not be copied 27 | ScintillaBase(const ScintillaBase &); 28 | ScintillaBase &operator=(const ScintillaBase &); 29 | 30 | protected: 31 | /** Enumeration of commands and child windows. */ 32 | enum { 33 | idCallTip=1, 34 | idAutoComplete=2, 35 | 36 | idcmdUndo=10, 37 | idcmdRedo=11, 38 | idcmdCut=12, 39 | idcmdCopy=13, 40 | idcmdPaste=14, 41 | idcmdDelete=15, 42 | idcmdSelectAll=16 43 | }; 44 | 45 | bool displayPopupMenu; 46 | Menu popup; 47 | AutoComplete ac; 48 | 49 | CallTip ct; 50 | 51 | int listType; ///< 0 is an autocomplete list 52 | int maxListWidth; /// Maximum width of list, in average character widths 53 | 54 | #ifdef SCI_LEXER 55 | LexState *DocumentLexState(); 56 | void SetLexer(uptr_t wParam); 57 | void SetLexerLanguage(const char *languageName); 58 | void Colourise(int start, int end); 59 | #endif 60 | 61 | ScintillaBase(); 62 | virtual ~ScintillaBase(); 63 | virtual void Initialise() = 0; 64 | virtual void Finalise() = 0; 65 | 66 | virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false); 67 | void Command(int cmdId); 68 | virtual void CancelModes(); 69 | virtual int KeyCommand(unsigned int iMessage); 70 | 71 | void AutoCompleteStart(int lenEntered, const char *list); 72 | void AutoCompleteCancel(); 73 | void AutoCompleteMove(int delta); 74 | int AutoCompleteGetCurrent(); 75 | int AutoCompleteGetCurrentText(char *buffer); 76 | void AutoCompleteCharacterAdded(char ch); 77 | void AutoCompleteCharacterDeleted(); 78 | void AutoCompleteCompleted(); 79 | void AutoCompleteMoveToCurrentWord(); 80 | static void AutoCompleteDoubleClick(void *p); 81 | 82 | void CallTipClick(); 83 | void CallTipShow(Point pt, const char *defn); 84 | virtual void CreateCallTipWindow(PRectangle rc) = 0; 85 | 86 | virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0; 87 | void ContextMenu(Point pt); 88 | 89 | virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); 90 | 91 | void NotifyStyleToNeeded(int endStyleNeeded); 92 | void NotifyLexerChanged(Document *doc, void *userData); 93 | 94 | public: 95 | // Public so scintilla_send_message can use it 96 | virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); 97 | }; 98 | 99 | #ifdef SCI_NAMESPACE 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/SVector.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file SVector.h 3 | ** A simple expandable vector. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef SVECTOR_H 9 | #define SVECTOR_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | * A simple expandable integer vector. 17 | * Storage not allocated for elements until an element is used. 18 | * This makes it very lightweight unless used so is a good match for optional features. 19 | */ 20 | class SVector { 21 | enum { allocSize = 4000 }; 22 | 23 | int *v; ///< The vector 24 | unsigned int size; ///< Number of elements allocated 25 | unsigned int len; ///< Number of elements used in vector 26 | 27 | /** Internally allocate more elements than the user wants 28 | * to avoid thrashing the memory allocator. */ 29 | void SizeTo(int newSize) { 30 | if (newSize < allocSize) 31 | newSize += allocSize; 32 | else 33 | newSize = (newSize * 3) / 2; 34 | int *newv = new int[newSize]; 35 | size = newSize; 36 | unsigned int i=0; 37 | for (; i 0) { 62 | SizeTo(other.Length()); 63 | for (int i=0; i 0) { 76 | SizeTo(other.Length()); 77 | for (int i=0; i= len) { 89 | if (i >= size) { 90 | SizeTo(i); 91 | } 92 | len = i+1; 93 | } 94 | return v[i]; 95 | } 96 | /// Reset vector. 97 | void Free() { 98 | delete []v; 99 | v = 0; 100 | size = 0; 101 | len = 0; 102 | } 103 | /** @brief Grow vector size. 104 | * Doesn't allow a vector to be shrinked. */ 105 | void SetLength(unsigned int newLength) { 106 | if (newLength > len) { 107 | if (newLength >= size) { 108 | SizeTo(newLength); 109 | } 110 | } 111 | len = newLength; 112 | } 113 | /// Get the current length (number of used elements) of the vector. 114 | int Length() const { 115 | return len; 116 | } 117 | }; 118 | 119 | #ifdef SCI_NAMESPACE 120 | } 121 | #endif 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /logging/logger.cpp: -------------------------------------------------------------------------------- 1 | #include "logger.hpp" 2 | #include 3 | #include 4 | #include 5 | 6 | std::string time_to_string(std::chrono::system_clock::time_point& time_point) 7 | { 8 | std::time_t time_secs = std::chrono::system_clock::to_time_t(time_point); 9 | std::chrono::system_clock::time_point time_point_sec = std::chrono::system_clock::from_time_t(time_secs); 10 | std::chrono::milliseconds ms = std::chrono::duration_cast(time_point - time_point_sec); 11 | 12 | char buffer[128]; 13 | strftime(buffer, 128, "%H:%M:%S", localtime(&time_secs)); 14 | char currentTime[128] = ""; 15 | snprintf(currentTime, 128, "%s.%03d", buffer, (int)ms.count()); 16 | 17 | return currentTime; 18 | } 19 | 20 | std::unique_ptr logger(new Logger()); 21 | 22 | void SetLogger(AbstractLogger* logobj) 23 | { 24 | logger.reset(logobj); 25 | } 26 | 27 | inline const char* GetLogAbbrev(LogLevel level) 28 | { 29 | switch(level) 30 | { 31 | case LogLevel::FATAL: 32 | return "F"; 33 | case LogLevel::DEBUG: 34 | return "D"; 35 | case LogLevel::WARNING: 36 | return "W"; 37 | case LogLevel::INFO: 38 | return "I"; 39 | case LogLevel::VERBOSE: 40 | return "V"; 41 | default: 42 | return "?"; 43 | } 44 | } 45 | 46 | inline const char* GetLogColor(LogLevel level) 47 | { 48 | #ifndef WINDOWS 49 | switch(level) 50 | { 51 | case LogLevel::FATAL: 52 | return "\033[1;31m"; 53 | case LogLevel::DEBUG: 54 | return "\033[1;33m"; 55 | case LogLevel::WARNING: 56 | return "\033[1;33m"; 57 | case LogLevel::INFO: 58 | return ""; 59 | case LogLevel::VERBOSE: 60 | return "\033[2;34m"; 61 | default: 62 | return ""; 63 | } 64 | #else 65 | return ""; 66 | #endif 67 | } 68 | 69 | inline const char* EndLogColor() 70 | { 71 | #ifndef WINDOWS 72 | return "\033[0m"; 73 | #else 74 | return ""; 75 | #endif 76 | } 77 | 78 | void AbstractLogger::Log(LogLevel level, const char* format, va_list ap) 79 | { 80 | if (level > log_level) 81 | return; 82 | 83 | if (log_time) 84 | { 85 | std::chrono::time_point time_now(std::chrono::system_clock::now()); 86 | (*out) << GetLogColor(level) << GetLogAbbrev(level) << "[" << time_to_string(time_now) << "]" << EndLogColor(); 87 | } 88 | 89 | DoLog(level, format, ap); 90 | } 91 | 92 | void Logger::DoLog(LogLevel level, const char* format, va_list ap) 93 | { 94 | char buffer[1024]; 95 | vsnprintf(buffer, 1024, format, ap); 96 | (*out) << buffer << std::endl; 97 | if (level == LogLevel::FATAL) exit(EXIT_FAILURE); 98 | } 99 | 100 | EventLog::EventLog(const char* function) : func(function), startTime(std::chrono::system_clock::now()) 101 | { 102 | VerboseLog("start: %s", func); 103 | } 104 | 105 | EventLog::~EventLog() 106 | { 107 | std::chrono::time_point endTime(std::chrono::system_clock::now()); 108 | std::chrono::duration elapsed_seconds = endTime-startTime; 109 | VerboseLog("end: %s time: %fs", func, elapsed_seconds.count()); 110 | } 111 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/include/ILexer.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ILexer.h 3 | ** Interface between Scintilla and lexers. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef ILEXER_H 9 | #define ILEXER_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | #ifdef _WIN32 16 | #define SCI_METHOD __stdcall 17 | #else 18 | #define SCI_METHOD 19 | #endif 20 | 21 | enum { dvOriginal=0 }; 22 | 23 | class IDocument { 24 | public: 25 | virtual int SCI_METHOD Version() const = 0; 26 | virtual void SCI_METHOD SetErrorStatus(int status) = 0; 27 | virtual int SCI_METHOD Length() const = 0; 28 | virtual void SCI_METHOD GetCharRange(char *buffer, int position, int lengthRetrieve) const = 0; 29 | virtual char SCI_METHOD StyleAt(int position) const = 0; 30 | virtual int SCI_METHOD LineFromPosition(int position) const = 0; 31 | virtual int SCI_METHOD LineStart(int line) const = 0; 32 | virtual int SCI_METHOD GetLevel(int line) const = 0; 33 | virtual int SCI_METHOD SetLevel(int line, int level) = 0; 34 | virtual int SCI_METHOD GetLineState(int line) const = 0; 35 | virtual int SCI_METHOD SetLineState(int line, int state) = 0; 36 | virtual void SCI_METHOD StartStyling(int position, char mask) = 0; 37 | virtual bool SCI_METHOD SetStyleFor(int length, char style) = 0; 38 | virtual bool SCI_METHOD SetStyles(int length, const char *styles) = 0; 39 | virtual void SCI_METHOD DecorationSetCurrentIndicator(int indicator) = 0; 40 | virtual void SCI_METHOD DecorationFillRange(int position, int value, int fillLength) = 0; 41 | virtual void SCI_METHOD ChangeLexerState(int start, int end) = 0; 42 | virtual int SCI_METHOD CodePage() const = 0; 43 | virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0; 44 | virtual const char * SCI_METHOD BufferPointer() = 0; 45 | virtual int SCI_METHOD GetLineIndentation(int line) = 0; 46 | /* C::B begin */ 47 | virtual ~IDocument(){} 48 | /* C::B end */ 49 | }; 50 | 51 | enum { lvOriginal=0 }; 52 | 53 | class ILexer { 54 | public: 55 | /* C::B begin */ 56 | virtual ~ILexer() {} 57 | /* C::B end */ 58 | virtual int SCI_METHOD Version() const = 0; 59 | virtual void SCI_METHOD Release() = 0; 60 | virtual const char * SCI_METHOD PropertyNames() = 0; 61 | virtual int SCI_METHOD PropertyType(const char *name) = 0; 62 | virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0; 63 | virtual int SCI_METHOD PropertySet(const char *key, const char *val) = 0; 64 | virtual const char * SCI_METHOD DescribeWordListSets() = 0; 65 | virtual int SCI_METHOD WordListSet(int n, const char *wl) = 0; 66 | virtual void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; 67 | virtual void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; 68 | virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0; 69 | }; 70 | 71 | class ILoader { 72 | public: 73 | virtual int SCI_METHOD Release() = 0; 74 | // Returns a status code from SC_STATUS_* 75 | virtual int SCI_METHOD AddData(char *data, int length) = 0; 76 | virtual void * SCI_METHOD ConvertToDocument() = 0; 77 | /* C::B begin */ 78 | virtual ~ILoader(){} 79 | /* C::B end */ 80 | }; 81 | 82 | #ifdef SCI_NAMESPACE 83 | } 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/LexerModule.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerModule.cxx 3 | ** Colourise for particular languages. 4 | **/ 5 | // Copyright 1998-2010 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "ILexer.h" 18 | #include "Scintilla.h" 19 | #include "SciLexer.h" 20 | 21 | #include "PropSetSimple.h" 22 | #include "WordList.h" 23 | #include "LexAccessor.h" 24 | #include "Accessor.h" 25 | #include "LexerModule.h" 26 | #include "LexerBase.h" 27 | #include "LexerSimple.h" 28 | 29 | #ifdef SCI_NAMESPACE 30 | using namespace Scintilla; 31 | #endif 32 | 33 | LexerModule::LexerModule(int language_, 34 | LexerFunction fnLexer_, 35 | const char *languageName_, 36 | LexerFunction fnFolder_, 37 | const char *const wordListDescriptions_[], 38 | int styleBits_) : 39 | language(language_), 40 | fnLexer(fnLexer_), 41 | fnFolder(fnFolder_), 42 | fnFactory(0), 43 | wordListDescriptions(wordListDescriptions_), 44 | styleBits(styleBits_), 45 | languageName(languageName_) { 46 | } 47 | 48 | LexerModule::LexerModule(int language_, 49 | LexerFactoryFunction fnFactory_, 50 | const char *languageName_, 51 | const char * const wordListDescriptions_[], 52 | int styleBits_) : 53 | language(language_), 54 | fnLexer(0), 55 | fnFolder(0), 56 | fnFactory(fnFactory_), 57 | wordListDescriptions(wordListDescriptions_), 58 | styleBits(styleBits_), 59 | languageName(languageName_) { 60 | } 61 | 62 | int LexerModule::GetNumWordLists() const { 63 | if (wordListDescriptions == NULL) { 64 | return -1; 65 | } else { 66 | int numWordLists = 0; 67 | 68 | while (wordListDescriptions[numWordLists]) { 69 | ++numWordLists; 70 | } 71 | 72 | return numWordLists; 73 | } 74 | } 75 | 76 | const char *LexerModule::GetWordListDescription(int index) const { 77 | static const char *emptyStr = ""; 78 | 79 | assert(index < GetNumWordLists()); 80 | if (index >= GetNumWordLists()) { 81 | return emptyStr; 82 | } else { 83 | return wordListDescriptions[index]; 84 | } 85 | } 86 | 87 | int LexerModule::GetStyleBitsNeeded() const { 88 | return styleBits; 89 | } 90 | 91 | ILexer *LexerModule::Create() const { 92 | if (fnFactory) 93 | return fnFactory(); 94 | else 95 | return new LexerSimple(this); 96 | } 97 | 98 | void LexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle, 99 | WordList *keywordlists[], Accessor &styler) const { 100 | if (fnLexer) 101 | fnLexer(startPos, lengthDoc, initStyle, keywordlists, styler); 102 | } 103 | 104 | void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle, 105 | WordList *keywordlists[], Accessor &styler) const { 106 | if (fnFolder) { 107 | int lineCurrent = styler.GetLine(startPos); 108 | // Move back one line in case deletion wrecked current line fold state 109 | if (lineCurrent > 0) { 110 | lineCurrent--; 111 | int newStartPos = styler.LineStart(lineCurrent); 112 | lengthDoc += startPos - newStartPos; 113 | startPos = newStartPos; 114 | initStyle = 0; 115 | if (startPos > 0) { 116 | initStyle = styler.StyleAt(startPos - 1); 117 | } 118 | } 119 | fnFolder(startPos, lengthDoc, initStyle, keywordlists, styler); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/SparseState.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file SparseState.h 3 | ** Hold lexer state that may change rarely. 4 | ** This is often per-line state such as whether a particular type of section has been entered. 5 | ** A state continues until it is changed. 6 | **/ 7 | // Copyright 2011 by Neil Hodgson 8 | // The License.txt file describes the conditions under which this software may be distributed. 9 | 10 | #ifndef SPARSESTATE_H 11 | #define SPARSESTATE_H 12 | 13 | #ifdef SCI_NAMESPACE 14 | namespace Scintilla { 15 | #endif 16 | 17 | template 18 | class SparseState { 19 | struct State { 20 | int position; 21 | T value; 22 | State(int position_, T value_) : position(position_), value(value_) { 23 | } 24 | inline bool operator<(const State &other) const { 25 | return position < other.position; 26 | } 27 | inline bool operator==(const State &other) const { 28 | return (position == other.position) && (value == other.value); 29 | } 30 | }; 31 | int positionFirst; 32 | typedef std::vector stateVector; 33 | stateVector states; 34 | 35 | typename stateVector::iterator Find(int position) { 36 | State searchValue(position, T()); 37 | return std::lower_bound(states.begin(), states.end(), searchValue); 38 | } 39 | 40 | public: 41 | SparseState(int positionFirst_=-1) { 42 | positionFirst = positionFirst_; 43 | } 44 | void Set(int position, T value) { 45 | Delete(position); 46 | if (states.empty() || (value != states[states.size()-1].value)) { 47 | states.push_back(State(position, value)); 48 | } 49 | } 50 | T ValueAt(int position) { 51 | if (states.empty()) 52 | return T(); 53 | if (position < states[0].position) 54 | return T(); 55 | typename stateVector::iterator low = Find(position); 56 | if (low == states.end()) { 57 | return states[states.size()-1].value; 58 | } else { 59 | if (low->position > position) { 60 | --low; 61 | } 62 | return low->value; 63 | } 64 | } 65 | bool Delete(int position) { 66 | typename stateVector::iterator low = Find(position); 67 | if (low != states.end()) { 68 | states.erase(low, states.end()); 69 | return true; 70 | } 71 | return false; 72 | } 73 | size_t size() const { 74 | return states.size(); 75 | } 76 | 77 | // Returns true if Merge caused a significant change 78 | bool Merge(const SparseState &other, int ignoreAfter) { 79 | // Changes caused beyond ignoreAfter are not significant 80 | Delete(ignoreAfter+1); 81 | 82 | bool different = true; 83 | bool changed = false; 84 | typename stateVector::iterator low = Find(other.positionFirst); 85 | if (static_cast(states.end() - low) == other.states.size()) { 86 | // Same number in other as after positionFirst in this 87 | different = !std::equal(low, states.end(), other.states.begin()); 88 | } 89 | if (different) { 90 | if (low != states.end()) { 91 | states.erase(low, states.end()); 92 | changed = true; 93 | } 94 | typename stateVector::const_iterator startOther = other.states.begin(); 95 | if (!states.empty() && !other.states.empty() && states.back().value == startOther->value) 96 | ++startOther; 97 | if (startOther != other.states.end()) { 98 | states.insert(states.end(), startOther, other.states.end()); 99 | changed = true; 100 | } 101 | } 102 | return changed; 103 | } 104 | }; 105 | 106 | #ifdef SCI_NAMESPACE 107 | } 108 | #endif 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/PerLine.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file PerLine.h 3 | ** Manages data associated with each line of the document 4 | **/ 5 | // Copyright 1998-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef PERLINE_H 9 | #define PERLINE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | * This holds the marker identifier and the marker type to display. 17 | * MarkerHandleNumbers are members of lists. 18 | */ 19 | struct MarkerHandleNumber { 20 | int handle; 21 | int number; 22 | MarkerHandleNumber *next; 23 | }; 24 | 25 | /** 26 | * A marker handle set contains any number of MarkerHandleNumbers. 27 | */ 28 | class MarkerHandleSet { 29 | MarkerHandleNumber *root; 30 | 31 | public: 32 | MarkerHandleSet(); 33 | ~MarkerHandleSet(); 34 | int Length() const; 35 | int NumberFromHandle(int handle) const; 36 | int MarkValue() const; ///< Bit set of marker numbers. 37 | bool Contains(int handle) const; 38 | bool InsertHandle(int handle, int markerNum); 39 | void RemoveHandle(int handle); 40 | bool RemoveNumber(int markerNum, bool all); 41 | void CombineWith(MarkerHandleSet *other); 42 | }; 43 | 44 | class LineMarkers : public PerLine { 45 | SplitVector markers; 46 | /// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big. 47 | int handleCurrent; 48 | public: 49 | LineMarkers() : handleCurrent(0) { 50 | } 51 | virtual ~LineMarkers(); 52 | virtual void Init(); 53 | virtual void InsertLine(int line); 54 | virtual void RemoveLine(int line); 55 | 56 | int MarkValue(int line); 57 | int MarkerNext(int lineStart, int mask) const; 58 | int AddMark(int line, int marker, int lines); 59 | void MergeMarkers(int pos); 60 | bool DeleteMark(int line, int markerNum, bool all); 61 | void DeleteMarkFromHandle(int markerHandle); 62 | int LineFromHandle(int markerHandle); 63 | }; 64 | 65 | class LineLevels : public PerLine { 66 | SplitVector levels; 67 | public: 68 | virtual ~LineLevels(); 69 | virtual void Init(); 70 | virtual void InsertLine(int line); 71 | virtual void RemoveLine(int line); 72 | 73 | void ExpandLevels(int sizeNew=-1); 74 | void ClearLevels(); 75 | int SetLevel(int line, int level, int lines); 76 | int GetLevel(int line); 77 | }; 78 | 79 | class LineState : public PerLine { 80 | SplitVector lineStates; 81 | public: 82 | LineState() { 83 | } 84 | virtual ~LineState(); 85 | virtual void Init(); 86 | virtual void InsertLine(int line); 87 | virtual void RemoveLine(int line); 88 | 89 | int SetLineState(int line, int state); 90 | int GetLineState(int line); 91 | int GetMaxLineState(); 92 | }; 93 | 94 | class LineAnnotation : public PerLine { 95 | SplitVector annotations; 96 | public: 97 | LineAnnotation() { 98 | } 99 | virtual ~LineAnnotation(); 100 | virtual void Init(); 101 | virtual void InsertLine(int line); 102 | virtual void RemoveLine(int line); 103 | 104 | bool AnySet() const; 105 | bool MultipleStyles(int line) const; 106 | int Style(int line); 107 | const char *Text(int line) const; 108 | const unsigned char *Styles(int line) const; 109 | void SetText(int line, const char *text); 110 | void ClearAll(); 111 | void SetStyle(int line, int style); 112 | void SetStyles(int line, const unsigned char *styles); 113 | int Length(int line) const; 114 | int Lines(int line) const; 115 | }; 116 | 117 | #ifdef SCI_NAMESPACE 118 | } 119 | #endif 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /lc3edit/src/LC3EditFrameDecl.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 17 2015) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #include "LC3EditFrameDecl.h" 9 | 10 | /////////////////////////////////////////////////////////////////////////// 11 | 12 | LC3EditFrameDecl::LC3EditFrameDecl( wxDocManager* manager, wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDocMDIParentFrame( manager, parent, id, title, pos, size, style ) 13 | { 14 | this->SetSizeHints( wxDefaultSize, wxDefaultSize ); 15 | 16 | wxBoxSizer* bSizer1; 17 | bSizer1 = new wxBoxSizer( wxVERTICAL ); 18 | 19 | m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); 20 | wxBoxSizer* bSizer2; 21 | bSizer2 = new wxBoxSizer( wxVERTICAL ); 22 | 23 | fileNotebook = new wxFlatNotebook(m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFNB_FANCY_TABS|wxFNB_NO_X_BUTTON|wxFNB_SMART_TABS|wxFNB_X_ON_TAB); 24 | 25 | fileNotebook->SetCustomizeOptions( wxFNB_CUSTOM_ALL ); 26 | fileNotebook->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); 27 | 28 | 29 | bSizer2->Add( fileNotebook, 1, wxEXPAND | wxALL, 5 ); 30 | 31 | 32 | m_panel1->SetSizer( bSizer2 ); 33 | m_panel1->Layout(); 34 | bSizer2->Fit( m_panel1 ); 35 | bSizer1->Add( m_panel1, 1, wxEXPAND, 5 ); 36 | 37 | 38 | this->SetSizer( bSizer1 ); 39 | this->Layout(); 40 | statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY ); 41 | m_menubar1 = new wxMenuBar( 0 ); 42 | file = new wxMenu(); 43 | wxMenuItem* fileNew; 44 | fileNew = new wxMenuItem( file, wxID_NEW, wxString( _("&New") ) + wxT('\t') + wxT("Ctrl+N"), wxEmptyString, wxITEM_NORMAL ); 45 | file->Append( fileNew ); 46 | 47 | wxMenuItem* fileOpen; 48 | fileOpen = new wxMenuItem( file, wxID_OPEN, wxString( _("&Open") ) + wxT('\t') + wxT("Ctrl+O"), wxEmptyString, wxITEM_NORMAL ); 49 | file->Append( fileOpen ); 50 | 51 | file->AppendSeparator(); 52 | 53 | wxMenuItem* fileSave; 54 | fileSave = new wxMenuItem( file, wxID_SAVE, wxString( _("&Save") ) + wxT('\t') + wxT("Ctrl+S"), wxEmptyString, wxITEM_NORMAL ); 55 | file->Append( fileSave ); 56 | 57 | wxMenuItem* fileSaveAs; 58 | fileSaveAs = new wxMenuItem( file, wxID_SAVEAS, wxString( _("Save As...") ) + wxT('\t') + wxT("F12"), wxEmptyString, wxITEM_NORMAL ); 59 | file->Append( fileSaveAs ); 60 | 61 | file->AppendSeparator(); 62 | 63 | wxMenuItem* fileExit; 64 | fileExit = new wxMenuItem( file, wxID_EXIT, wxString( _("Exit") ) + wxT('\t') + wxT("Alt+F4"), wxEmptyString, wxITEM_NORMAL ); 65 | file->Append( fileExit ); 66 | 67 | m_menubar1->Append( file, _("&File") ); 68 | 69 | edit = new wxMenu(); 70 | wxMenuItem* editUndo; 71 | editUndo = new wxMenuItem( edit, wxID_UNDO, wxString( _("&Undo") ) + wxT('\t') + wxT("Ctrl+Z"), wxEmptyString, wxITEM_NORMAL ); 72 | edit->Append( editUndo ); 73 | 74 | wxMenuItem* editRedo; 75 | editRedo = new wxMenuItem( edit, wxID_REDO, wxString( _("&Redo") ) + wxT('\t') + wxT("Ctrl+Y"), wxEmptyString, wxITEM_NORMAL ); 76 | edit->Append( editRedo ); 77 | 78 | m_menubar1->Append( edit, _("&Edit") ); 79 | 80 | view = new wxMenu(); 81 | m_menubar1->Append( view, _("&View") ); 82 | 83 | run = new wxMenu(); 84 | m_menubar1->Append( run, _("&Run") ); 85 | 86 | help = new wxMenu(); 87 | m_menubar1->Append( help, _("&Help") ); 88 | 89 | this->SetMenuBar( m_menubar1 ); 90 | 91 | 92 | this->Centre( wxBOTH ); 93 | } 94 | 95 | LC3EditFrameDecl::~LC3EditFrameDecl() 96 | { 97 | } 98 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/include/Face.py: -------------------------------------------------------------------------------- 1 | # Module for reading and parsing Scintilla.iface file 2 | 3 | def sanitiseLine(line): 4 | if line[-1:] == '\n': line = line[:-1] 5 | if line.find("##") != -1: 6 | line = line[:line.find("##")] 7 | line = line.strip() 8 | return line 9 | 10 | def decodeFunction(featureVal): 11 | retType, rest = featureVal.split(" ", 1) 12 | nameIdent, params = rest.split("(") 13 | name, value = nameIdent.split("=") 14 | params, rest = params.split(")") 15 | param1, param2 = params.split(",") 16 | return retType, name, value, param1, param2 17 | 18 | def decodeEvent(featureVal): 19 | retType, rest = featureVal.split(" ", 1) 20 | nameIdent, params = rest.split("(") 21 | name, value = nameIdent.split("=") 22 | return retType, name, value 23 | 24 | def decodeParam(p): 25 | param = p.strip() 26 | type = "" 27 | name = "" 28 | value = "" 29 | if " " in param: 30 | type, nv = param.split(" ") 31 | if "=" in nv: 32 | name, value = nv.split("=") 33 | else: 34 | name = nv 35 | return type, name, value 36 | 37 | class Face: 38 | 39 | def __init__(self): 40 | self.order = [] 41 | self.features = {} 42 | self.values = {} 43 | self.events = {} 44 | 45 | def ReadFromFile(self, name): 46 | currentCategory = "" 47 | currentComment = [] 48 | currentCommentFinished = 0 49 | file = open(name) 50 | for line in file.readlines(): 51 | line = sanitiseLine(line) 52 | if line: 53 | if line[0] == "#": 54 | if line[1] == " ": 55 | if currentCommentFinished: 56 | currentComment = [] 57 | currentCommentFinished = 0 58 | currentComment.append(line[2:]) 59 | else: 60 | currentCommentFinished = 1 61 | featureType, featureVal = line.split(" ", 1) 62 | if featureType in ["fun", "get", "set"]: 63 | try: 64 | retType, name, value, param1, param2 = decodeFunction(featureVal) 65 | except ValueError: 66 | print("Failed to decode %s" % line) 67 | raise 68 | p1 = decodeParam(param1) 69 | p2 = decodeParam(param2) 70 | self.features[name] = { 71 | "FeatureType": featureType, 72 | "ReturnType": retType, 73 | "Value": value, 74 | "Param1Type": p1[0], "Param1Name": p1[1], "Param1Value": p1[2], 75 | "Param2Type": p2[0], "Param2Name": p2[1], "Param2Value": p2[2], 76 | "Category": currentCategory, "Comment": currentComment 77 | } 78 | if value in self.values: 79 | raise Exception("Duplicate value " + value + " " + name) 80 | self.values[value] = 1 81 | self.order.append(name) 82 | elif featureType == "evt": 83 | retType, name, value = decodeEvent(featureVal) 84 | self.features[name] = { 85 | "FeatureType": featureType, 86 | "ReturnType": retType, 87 | "Value": value, 88 | "Category": currentCategory, "Comment": currentComment 89 | } 90 | if value in self.events: 91 | raise Exception("Duplicate event " + value + " " + name) 92 | self.events[value] = 1 93 | self.order.append(name) 94 | elif featureType == "cat": 95 | currentCategory = featureVal 96 | elif featureType == "val": 97 | try: 98 | name, value = featureVal.split("=", 1) 99 | except ValueError: 100 | print("Failure %s" % featureVal) 101 | raise Exception() 102 | self.features[name] = { 103 | "FeatureType": featureType, 104 | "Category": currentCategory, 105 | "Value": value } 106 | self.order.append(name) 107 | elif featureType == "enu" or featureType == "lex": 108 | name, value = featureVal.split("=", 1) 109 | self.features[name] = { 110 | "FeatureType": featureType, 111 | "Category": currentCategory, 112 | "Value": value } 113 | self.order.append(name) 114 | 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | complx 2 | ====== 3 | 4 | This repository is **SUPER** deprecated, The current codebase is now split up under [complx-tools (organization)](https://github.com/complx-tools) however that is still deprecated. All newer development will be done here [complx-tools (repo)](https://github.com/TricksterGuy/complx-tools) 5 | 6 | Extensible LC-3 Simulator written in C++. Includes a Graphical User Interface and Command Line Interface simulator, Assembler, [Python Bindings](https://pypi.org/project/pyLC3), and Python Autograder (Examples)[https://github.com/TricksterGuy/pylc3-examples]. Mainly used in CS2110 at Georgia Tech. Maintained by Brandon. 7 | 8 | __Special Note__ Let me know if your school is using any portion of the tools provided here. The tools are subject to change every semester as new features are added or stuff is tweaked based on student feedback. I don't want to break anyone's setup, and would like to keep users in the loop with changes and suggest features. 9 | 10 | # Overview 11 | complx is a suite of educational tools for learning lc3 assembly. It includes both a gui and cli based simulator (named complx and comp respectively), an assembler (as2obj), python bindings via pyLC3, and an autograder framework written in python. Complx also be extended with plugins that add additional functionality to the LC3. The tools also come with a C++ interface to the LC3 (liblc3) along with python bindings to it via [pyLC3](https://pypi.org/project/pyLC3). Complx, the GUI simulator, was written using the wxWidgets library. 12 | 13 | # Installation 14 | 15 | [Installing Prebuilt Binaries](https://github.com/TricksterGuy/complx/wiki/Installing-Prebuilt-Binaries) 16 | 17 | [Build Instructions for Linux](https://github.com/TricksterGuy/complx/wiki/Building-for-Linux) 18 | 19 | # Features 20 | * Both a textual and graphical user interface available 21 | * Support for all instructions including LC3 interrupts. 22 | * Support for the LC-3 calling convention 23 | * Comes with its own assembler 24 | * Many options for running assembly code 25 | * Such as: 26 | * Backstepping/Undoing instructions 27 | * Stepping into/out/over a subroutine 28 | * Running X number of instructions 29 | * Powerful Debugger 30 | * Ability to set breakpoints at specific locations 31 | * Ability to create watchpoints which trigger when a write to a register/memory location happens 32 | * Ability to set a temporary breakpoint/watchpoint that only triggers X times 33 | * Ability to mark a subroutine/trap as a blackbox and have the simulator automatically step over it 34 | * For the above ability to add a condition for the breakpoint/watchpoint to trigger 35 | * Ability to define all of the above in the assembly source file for easier debugging (and won't affect the grader) 36 | * Ability to view the activation stack and view subroutine parameters and rewind to a subroutine call 37 | * Interface 38 | * Full view of LC-3 Memory with the ability to edit values in hexadecimal, decimal, binary, instruction, or add/edit/remove a label 39 | * Registers values can be edited and be displayed in different bases 40 | * Can also have multiple views of the lc-3 memory (useful for viewing the stack and the program at the same time) 41 | * Can rearrange memory view, and filter out memory addresses you don't care about 42 | * Console which accepts input and displays output (and various warnings) 43 | * Can view comments from code from within simulator 44 | * Python bindings and a Python autograder framework via [pyLC3](https://github.com/zucchini/pyLC3) 45 | * Ability to extend complx via plugins 46 | * Currently complx ships with 5 plugins 47 | 1. Black and white Display device 48 | 2. Colored Display device 49 | 3. Random number generator that can be seeded via a write to its address 50 | 4. Plugin that changes opcode 0xD with a multiplication instruction 51 | 5. Plugin that adds a new trap that performs division and modulus 52 | * Plugins can add new device registers, traps, send interrupts, and add a new instruction 53 | 54 | # Screenshot 55 | ![Main Screen](https://github.com/TricksterGuy/complx/blob/master/doc/main_screen.png) 56 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexers/LexKix.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexKix.cxx 3 | ** Lexer for KIX-Scripts. 4 | **/ 5 | // Copyright 2004 by Manfred Becker 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ILexer.h" 16 | #include "Scintilla.h" 17 | #include "SciLexer.h" 18 | 19 | #include "WordList.h" 20 | #include "LexAccessor.h" 21 | #include "Accessor.h" 22 | #include "StyleContext.h" 23 | #include "CharacterSet.h" 24 | #include "LexerModule.h" 25 | 26 | #ifdef SCI_NAMESPACE 27 | using namespace Scintilla; 28 | #endif 29 | 30 | // Extended to accept accented characters 31 | static inline bool IsAWordChar(int ch) { 32 | return ch >= 0x80 || isalnum(ch) || ch == '_'; 33 | } 34 | 35 | static inline bool IsOperator(const int ch) { 36 | return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '&' || ch == '|' || ch == '<' || ch == '>' || ch == '='); 37 | } 38 | 39 | static void ColouriseKixDoc(unsigned int startPos, int length, int initStyle, 40 | WordList *keywordlists[], Accessor &styler) { 41 | 42 | WordList &keywords = *keywordlists[0]; 43 | WordList &keywords2 = *keywordlists[1]; 44 | WordList &keywords3 = *keywordlists[2]; 45 | // WordList &keywords4 = *keywordlists[3]; 46 | 47 | styler.StartAt(startPos); 48 | 49 | StyleContext sc(startPos, length, initStyle, styler); 50 | 51 | for (; sc.More(); sc.Forward()) { 52 | 53 | if (sc.state == SCE_KIX_COMMENT) { 54 | if (sc.atLineEnd) { 55 | sc.SetState(SCE_KIX_DEFAULT); 56 | } 57 | } else if (sc.state == SCE_KIX_STRING1) { 58 | // This is a doubles quotes string 59 | if (sc.ch == '\"') { 60 | sc.ForwardSetState(SCE_KIX_DEFAULT); 61 | } 62 | } else if (sc.state == SCE_KIX_STRING2) { 63 | // This is a single quote string 64 | if (sc.ch == '\'') { 65 | sc.ForwardSetState(SCE_KIX_DEFAULT); 66 | } 67 | } else if (sc.state == SCE_KIX_NUMBER) { 68 | if (!IsADigit(sc.ch)) { 69 | sc.SetState(SCE_KIX_DEFAULT); 70 | } 71 | } else if (sc.state == SCE_KIX_VAR) { 72 | if (!IsAWordChar(sc.ch)) { 73 | sc.SetState(SCE_KIX_DEFAULT); 74 | } 75 | } else if (sc.state == SCE_KIX_MACRO) { 76 | if (!IsAWordChar(sc.ch) && !IsADigit(sc.ch)) { 77 | char s[100]; 78 | sc.GetCurrentLowered(s, sizeof(s)); 79 | 80 | if (!keywords3.InList(&s[1])) { 81 | sc.ChangeState(SCE_KIX_DEFAULT); 82 | } 83 | sc.SetState(SCE_KIX_DEFAULT); 84 | } 85 | } else if (sc.state == SCE_KIX_OPERATOR) { 86 | if (!IsOperator(sc.ch)) { 87 | sc.SetState(SCE_KIX_DEFAULT); 88 | } 89 | } else if (sc.state == SCE_KIX_IDENTIFIER) { 90 | if (!IsAWordChar(sc.ch)) { 91 | char s[100]; 92 | sc.GetCurrentLowered(s, sizeof(s)); 93 | 94 | if (keywords.InList(s)) { 95 | sc.ChangeState(SCE_KIX_KEYWORD); 96 | } else if (keywords2.InList(s)) { 97 | sc.ChangeState(SCE_KIX_FUNCTIONS); 98 | } 99 | sc.SetState(SCE_KIX_DEFAULT); 100 | } 101 | } 102 | 103 | // Determine if a new state should be entered. 104 | if (sc.state == SCE_KIX_DEFAULT) { 105 | if (sc.ch == ';') { 106 | sc.SetState(SCE_KIX_COMMENT); 107 | } else if (sc.ch == '\"') { 108 | sc.SetState(SCE_KIX_STRING1); 109 | } else if (sc.ch == '\'') { 110 | sc.SetState(SCE_KIX_STRING2); 111 | } else if (sc.ch == '$') { 112 | sc.SetState(SCE_KIX_VAR); 113 | } else if (sc.ch == '@') { 114 | sc.SetState(SCE_KIX_MACRO); 115 | } else if (IsADigit(sc.ch) || ((sc.ch == '.' || sc.ch == '&') && IsADigit(sc.chNext))) { 116 | sc.SetState(SCE_KIX_NUMBER); 117 | } else if (IsOperator(sc.ch)) { 118 | sc.SetState(SCE_KIX_OPERATOR); 119 | } else if (IsAWordChar(sc.ch)) { 120 | sc.SetState(SCE_KIX_IDENTIFIER); 121 | } 122 | } 123 | } 124 | sc.Complete(); 125 | } 126 | 127 | 128 | LexerModule lmKix(SCLEX_KIX, ColouriseKixDoc, "kix"); 129 | 130 | -------------------------------------------------------------------------------- /demos/game.asm: -------------------------------------------------------------------------------- 1 | ;@plugin filename=lc3_colorlcd width=8 height=8 initaddr=x4000 startaddr=x6000 2 | ;@plugin filename=lc3_random address=xFEED 3 | ;@plugin filename=lc3_udiv vector=x30 4 | ;@plugin filename=lc3_multiply 5 | 6 | ; A simple game made for the lc3 showing off many plugins 7 | ; A player that is controlled by the keyboard and food 8 | ; movement is controlled by WSAD. 9 | 10 | .orig x180 11 | .fill KEYBOARDINTHANDLER 12 | .end 13 | 14 | .orig x3000 15 | LD R6, STACK 16 | ; initialize dat display 17 | LD R3, DISPLAYINITVALUE 18 | STI R3, DISPLAYINITADDR 19 | 20 | ; display starting address 21 | LD R4, DISPLAYSTART 22 | 23 | JSR INIT 24 | JSR REFRESH 25 | 26 | ; set up interrupts 27 | LD R3, KBSRIE 28 | STI R3, KBSR 29 | 30 | LOOP BR LOOP 31 | HALT 32 | 33 | INIT 34 | ADD R6, R6, -1 35 | STR R7, R6, 0 36 | 37 | ; Player is at (0, 0) (R0, R1) 38 | AND R0, R0, 0 39 | ST R0, PLAYERX 40 | ST R0, PLAYERY 41 | 42 | JSR GENFOOD 43 | 44 | LDR R7, R6, 0 45 | ADD R6, R6, 1 46 | RET 47 | 48 | GENFOOD 49 | ADD R6, R6, -1 50 | STR R7, R6, 0 51 | ; Food is at (1-7, 1-7) (R2, R3) 52 | LDI R0, RANDOMADDR 53 | AND R1, R1, 0 54 | ADD R1, R1, 7 55 | UDIV 56 | ADD R0, R1, 7 57 | AND R1, R1, 0 58 | ADD R1, R1, 7 59 | UDIV 60 | ADD R0, R1, 1 61 | ST R0, FOODX 62 | 63 | LDI R0, RANDOMADDR 64 | AND R1, R1, 0 65 | ADD R1, R1, 7 66 | UDIV 67 | ADD R0, R1, 7 68 | AND R1, R1, 0 69 | ADD R1, R1, 7 70 | UDIV 71 | ADD R0, R1, 1 72 | ST R0, FOODY 73 | LDR R7, R6, 0 74 | ADD R6, R6, 1 75 | RET 76 | 77 | REFRESH 78 | LD R2, SCREENSIZE 79 | AND R0, R0, 0 80 | CLEARLOOP 81 | ADD R1, R4, R2 82 | STR R0, R1, 0 83 | ADD R2, R2, -1 84 | BRZP CLEARLOOP 85 | 86 | ADD R6, R6, -1 87 | STR R7, R6, 0 88 | 89 | LD R0, FOODY 90 | AND R1, R1, 0 91 | ADD R1, R1, 8 92 | MUL R0, R0, R1 93 | LD R1, FOODX 94 | ADD R0, R0, R1 95 | 96 | ADD R1, R0, R4 97 | LD R0, FOODCOLOR 98 | STR R0, R1, 0 ; Set Food 99 | 100 | LD R0, PLAYERY 101 | AND R1, R1, 0 102 | ADD R1, R1, 8 103 | MUL R0, R0, R1 104 | LD R1, PLAYERX 105 | ADD R0, R0, R1 106 | 107 | ADD R1, R0, R4 108 | LD R0, PLAYERCOLOR 109 | STR R0, R1, 0 ; Set Player 110 | 111 | 112 | 113 | LDR R7, R6, 0 114 | ADD R6, R6, 1 115 | RET 116 | 117 | KEYBOARDINTHANDLER 118 | LDI R0, KBDR ; Get the key 119 | ADD R0, R0, -16 120 | ADD R0, R0, -16 121 | ADD R0, R0, -16 122 | ADD R0, R0, -16 123 | ADD R0, R0, -16 124 | ADD R0, R0, -16 125 | ADD R0, R0, -1 ; 'a' 126 | BRZ HANDLE_LEFT 127 | ADD R0, R0, -3 ; 'd' 128 | BRZ HANDLE_RIGHT 129 | ADD R0, R0, -15; 's' 130 | BRZ HANDLE_DOWN 131 | ADD R0, R0, -4; 'w' 132 | BRZ HANDLE_UP 133 | END_HANDLING 134 | LD R0, PLAYERX 135 | LD R1, FOODX 136 | NOT R1, R1 137 | ADD R0, R1, R0 138 | ADD R0, R0, 1 139 | BRNP DONE_CHECK 140 | LD R0, PLAYERY 141 | LD R1, FOODY 142 | NOT R1, R1 143 | ADD R0, R1, R0 144 | ADD R0, R0, 1 145 | BRNP DONE_CHECK 146 | JSR GENFOOD 147 | DONE_CHECK 148 | JSR REFRESH 149 | RTI 150 | 151 | HANDLE_LEFT 152 | LD R0, PLAYERX 153 | ADD R0, R0, -1 154 | BRZP CONT_LEFT 155 | ADD R0, R0, 1 156 | CONT_LEFT 157 | ST R0, PLAYERX 158 | BR END_HANDLING 159 | 160 | HANDLE_RIGHT 161 | LD R0, PLAYERX 162 | ADD R0, R0, 1 163 | ADD R5, R0, -8 164 | BRN CONT_LEFT 165 | ADD R0, R0, -1 166 | CONT_RIGHT 167 | ST R0, PLAYERX 168 | BR END_HANDLING 169 | 170 | HANDLE_UP 171 | LD R0, PLAYERY 172 | ADD R0, R0, -1 173 | BRZP CONT_UP 174 | ADD R0, R0, 1 175 | CONT_UP 176 | ST R0, PLAYERY 177 | BR END_HANDLING 178 | 179 | HANDLE_DOWN 180 | LD R0, PLAYERY 181 | ADD R0, R0, 1 182 | ADD R5, R0, -8 183 | BRN CONT_DOWN 184 | ADD R0, R0, -1 185 | CONT_DOWN 186 | ST R0, PLAYERY 187 | BR END_HANDLING 188 | 189 | DISPLAYINITADDR .fill x4000 190 | DISPLAYINITVALUE .fill x8000 191 | RANDOMADDR .fill xFEED 192 | DISPLAYSTART .fill x6000 193 | SCREENSIZE .fill 64 194 | COLORMAX .fill x7FFF 195 | PLAYERX .fill 0 196 | PLAYERY .fill 0 197 | PLAYERCOLOR .fill x7C00 198 | FOODX .fill 0 199 | FOODY .fill 0 200 | FOODCOLOR .fill x03E0 201 | KBSRIE .fill x4000 202 | KBSR .fill xFE00 203 | KBDR .fill xFE02 204 | STACK .fill xF000 205 | 206 | .end 207 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/XPM.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file XPM.h 3 | ** Define a class that holds data in the X Pixmap (XPM) format. 4 | **/ 5 | // Copyright 1998-2003 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef XPM_H 9 | #define XPM_H 10 | 11 | /* C::B begin */ 12 | #include 13 | #include 14 | /* C::B end */ 15 | 16 | #ifdef SCI_NAMESPACE 17 | namespace Scintilla { 18 | #endif 19 | 20 | /** 21 | * Hold a pixmap in XPM format. 22 | */ 23 | class XPM { 24 | int pid; // Assigned by container 25 | int height; 26 | int width; 27 | int nColours; 28 | char *data; 29 | char codeTransparent; 30 | char *codes; 31 | ColourDesired *colours; 32 | ColourDesired ColourDesiredFromCode(int ch) const; 33 | ColourDesired ColourFromCode(int ch) const; 34 | void FillRun(Surface *surface, int code, int startX, int y, int x); 35 | char **lines; 36 | ColourDesired *colourCodeTable[256]; 37 | public: 38 | XPM(const char *textForm); 39 | XPM(const char *const *linesForm); 40 | ~XPM(); 41 | void Init(const char *textForm); 42 | void Init(const char *const *linesForm); 43 | void Clear(); 44 | /// Decompose image into runs and use FillRectangle for each run 45 | void Draw(Surface *surface, PRectangle &rc); 46 | char **InLinesForm() { return lines; } 47 | void SetId(int pid_) { pid = pid_; } 48 | int GetId() const { return pid; } 49 | int GetHeight() const { return height; } 50 | int GetWidth() const { return width; } 51 | void PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const; 52 | static const char **LinesFormFromTextForm(const char *textForm); 53 | }; 54 | 55 | /** 56 | * A collection of pixmaps indexed by integer id. 57 | */ 58 | class XPMSet { 59 | XPM **set; ///< The stored XPMs. 60 | int len; ///< Current number of XPMs. 61 | int maximum; ///< Current maximum number of XPMs, increased by steps if reached. 62 | int height; ///< Memorize largest height of the set. 63 | int width; ///< Memorize largest width of the set. 64 | public: 65 | XPMSet(); 66 | ~XPMSet(); 67 | /// Remove all XPMs. 68 | void Clear(); 69 | /// Add a XPM. 70 | void Add(int ident, const char *textForm); 71 | /// Get XPM by id. 72 | XPM *Get(int ident); 73 | /// Give the largest height of the set. 74 | int GetHeight(); 75 | /// Give the largest width of the set. 76 | int GetWidth(); 77 | }; 78 | 79 | /** 80 | * An translucent image stoed as a sequence of RGBA bytes. 81 | */ 82 | class RGBAImage { 83 | // Private so RGBAImage objects can not be copied 84 | RGBAImage(const RGBAImage &); 85 | RGBAImage &operator=(const RGBAImage &); 86 | int height; 87 | int width; 88 | float scale; 89 | std::vector pixelBytes; 90 | public: 91 | RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_); 92 | RGBAImage(const XPM &xpm); 93 | virtual ~RGBAImage(); 94 | int GetHeight() const { return height; } 95 | int GetWidth() const { return width; } 96 | float GetScale() const { return scale; } 97 | float GetScaledHeight() const { return height / scale; } 98 | float GetScaledWidth() const { return width / scale; } 99 | int CountBytes() const; 100 | const unsigned char *Pixels() const; 101 | void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff); 102 | }; 103 | 104 | /** 105 | * A collection of RGBAImage pixmaps indexed by integer id. 106 | */ 107 | class RGBAImageSet { 108 | typedef std::map ImageMap; 109 | ImageMap images; 110 | mutable int height; ///< Memorize largest height of the set. 111 | mutable int width; ///< Memorize largest width of the set. 112 | public: 113 | RGBAImageSet(); 114 | ~RGBAImageSet(); 115 | /// Remove all images. 116 | void Clear(); 117 | /// Add an image. 118 | void Add(int ident, RGBAImage *image); 119 | /// Get image by id. 120 | RGBAImage *Get(int ident); 121 | /// Give the largest height of the set. 122 | int GetHeight() const; 123 | /// Give the largest width of the set. 124 | int GetWidth() const; 125 | }; 126 | 127 | #ifdef SCI_NAMESPACE 128 | } 129 | #endif 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/OptionSet.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file OptionSet.h 3 | ** Manage descriptive information about an options struct for a lexer. 4 | ** Hold the names, positions, and descriptions of boolean, integer and string options and 5 | ** allow setting options and retrieving metadata about the options. 6 | **/ 7 | // Copyright 2010 by Neil Hodgson 8 | // The License.txt file describes the conditions under which this software may be distributed. 9 | 10 | #ifndef OPTIONSET_H 11 | #define OPTIONSET_H 12 | 13 | #ifdef SCI_NAMESPACE 14 | namespace Scintilla { 15 | #endif 16 | 17 | template 18 | class OptionSet { 19 | typedef T Target; 20 | typedef bool T::*plcob; 21 | typedef int T::*plcoi; 22 | typedef std::string T::*plcos; 23 | struct Option { 24 | int opType; 25 | union { 26 | plcob pb; 27 | plcoi pi; 28 | plcos ps; 29 | }; 30 | std::string description; 31 | Option() : 32 | opType(SC_TYPE_BOOLEAN), pb(0), description("") { 33 | } 34 | Option(plcob pb_, std::string description_="") : 35 | opType(SC_TYPE_BOOLEAN), pb(pb_), description(description_) { 36 | } 37 | Option(plcoi pi_, std::string description_) : 38 | opType(SC_TYPE_INTEGER), pi(pi_), description(description_) { 39 | } 40 | Option(plcos ps_, std::string description_) : 41 | opType(SC_TYPE_STRING), ps(ps_), description(description_) { 42 | } 43 | bool Set(T *base, const char *val) { 44 | switch (opType) { 45 | case SC_TYPE_BOOLEAN: { 46 | bool option = atoi(val) != 0; 47 | if ((*base).*pb != option) { 48 | (*base).*pb = option; 49 | return true; 50 | } 51 | break; 52 | } 53 | case SC_TYPE_INTEGER: { 54 | int option = atoi(val); 55 | if ((*base).*pi != option) { 56 | (*base).*pi = option; 57 | return true; 58 | } 59 | break; 60 | } 61 | case SC_TYPE_STRING: { 62 | if ((*base).*ps != val) { 63 | (*base).*ps = val; 64 | return true; 65 | } 66 | break; 67 | } 68 | } 69 | return false; 70 | } 71 | }; 72 | typedef std::map OptionMap; 73 | OptionMap nameToDef; 74 | std::string names; 75 | std::string wordLists; 76 | 77 | void AppendName(const char *name) { 78 | if (!names.empty()) 79 | names += "\n"; 80 | names += name; 81 | } 82 | public: 83 | virtual ~OptionSet() { 84 | } 85 | void DefineProperty(const char *name, plcob pb, std::string description="") { 86 | nameToDef[name] = Option(pb, description); 87 | AppendName(name); 88 | } 89 | void DefineProperty(const char *name, plcoi pi, std::string description="") { 90 | nameToDef[name] = Option(pi, description); 91 | AppendName(name); 92 | } 93 | void DefineProperty(const char *name, plcos ps, std::string description="") { 94 | nameToDef[name] = Option(ps, description); 95 | AppendName(name); 96 | } 97 | const char *PropertyNames() { 98 | return names.c_str(); 99 | } 100 | int PropertyType(const char *name) { 101 | typename OptionMap::iterator it = nameToDef.find(name); 102 | if (it != nameToDef.end()) { 103 | return it->second.opType; 104 | } 105 | return SC_TYPE_BOOLEAN; 106 | } 107 | const char *DescribeProperty(const char *name) { 108 | typename OptionMap::iterator it = nameToDef.find(name); 109 | if (it != nameToDef.end()) { 110 | return it->second.description.c_str(); 111 | } 112 | return ""; 113 | } 114 | 115 | bool PropertySet(T *base, const char *name, const char *val) { 116 | typename OptionMap::iterator it = nameToDef.find(name); 117 | if (it != nameToDef.end()) { 118 | return it->second.Set(base, val); 119 | } 120 | return false; 121 | } 122 | 123 | void DefineWordListSets(const char * const wordListDescriptions[]) { 124 | if (wordListDescriptions) { 125 | for (size_t wl = 0; wordListDescriptions[wl]; wl++) { 126 | if (!wordLists.empty()) 127 | wordLists += "\n"; 128 | wordLists += wordListDescriptions[wl]; 129 | } 130 | } 131 | } 132 | 133 | const char *DescribeWordListSets() { 134 | return wordLists.c_str(); 135 | } 136 | }; 137 | 138 | #ifdef SCI_NAMESPACE 139 | } 140 | #endif 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /lc3edit/src/LC3EditFrame.cpp: -------------------------------------------------------------------------------- 1 | #include "LC3EditFrame.hpp" 2 | #include "EditorView.hpp" 3 | #include "resources.hpp" 4 | #include 5 | #include 6 | 7 | LC3EditFrame::LC3EditFrame(wxDocManager* m, const wxArrayString& files) : LC3EditFrameDecl(m, NULL), manager(m) 8 | { 9 | SetupToolbar(); 10 | 11 | for (const auto& file : files) 12 | DoLoadFile(file); 13 | } 14 | 15 | LC3EditFrame::~LC3EditFrame() 16 | { 17 | Disconnect(ID_SAVE_ALL, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnSaveAll)); 18 | Disconnect(ID_CUT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnCut)); 19 | Disconnect(ID_COPY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnCopy)); 20 | Disconnect(ID_PASTE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnPaste)); 21 | Disconnect(ID_FIND, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnFind)); 22 | Disconnect(ID_REPLACE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnReplace)); 23 | Disconnect(ID_ASSEMBLE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnAssemble)); 24 | Disconnect(ID_RUN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnRun)); 25 | } 26 | 27 | void LC3EditFrame::DoLoadFile(const wxString& file) 28 | { 29 | wxFileName filename(file); 30 | printf("%s\n", file.c_str().AsChar()); 31 | wxDocument* doc = manager->CreateDocument(filename.GetFullPath()); 32 | EditorView* view = new EditorView(); 33 | doc->AddView(view); 34 | view->OnInit(fileNotebook); 35 | wxPanel* panel = new EditorPanel(fileNotebook); 36 | fileNotebook->AddPage(panel, filename.GetFullName(), false); 37 | } 38 | 39 | void LC3EditFrame::SetupToolbar() 40 | { 41 | toolbar = CreateToolBar(wxTB_HORIZONTAL, wxID_ANY); 42 | toolbar->AddTool(wxID_NEW, "New File", wxBitmap(new_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 43 | toolbar->AddTool(wxID_OPEN, "Open File", wxBitmap(open_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 44 | toolbar->AddTool(wxID_SAVE, "Save", wxBitmap(save_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 45 | toolbar->AddTool(ID_SAVE_ALL, "Save All", wxBitmap(saveall_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 46 | toolbar->AddSeparator(); 47 | toolbar->AddTool(wxID_UNDO, "Undo", wxBitmap(undo_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 48 | toolbar->AddTool(wxID_REDO, "Redo", wxBitmap(redo_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 49 | toolbar->AddSeparator(); 50 | toolbar->AddTool(ID_CUT, "Cut", wxBitmap(cut_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 51 | toolbar->AddTool(ID_COPY, "Copy", wxBitmap(copy_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 52 | toolbar->AddTool(ID_PASTE, "Paste", wxBitmap(paste_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 53 | toolbar->AddTool(ID_FIND, "Find", wxBitmap(find_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 54 | toolbar->AddTool(ID_REPLACE, "Replace", wxBitmap(replace_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 55 | toolbar->AddSeparator(); 56 | toolbar->AddTool(ID_ASSEMBLE, "Assemble", wxBitmap(assemble_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 57 | toolbar->AddTool(ID_RUN, "Run", wxBitmap(run_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL); 58 | toolbar->Realize(); 59 | 60 | Connect(ID_SAVE_ALL, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnSaveAll)); 61 | Connect(ID_CUT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnCut)); 62 | Connect(ID_COPY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnCopy)); 63 | Connect(ID_PASTE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnPaste)); 64 | Connect(ID_FIND, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnFind)); 65 | Connect(ID_REPLACE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnReplace)); 66 | Connect(ID_ASSEMBLE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnAssemble)); 67 | Connect(ID_RUN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(LC3EditFrame::OnRun)); 68 | } 69 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/Style.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Style.cxx 3 | ** Defines the font and colour style for a class of text. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | 10 | #include "Platform.h" 11 | 12 | #include "Scintilla.h" 13 | #include "Style.h" 14 | 15 | #ifdef SCI_NAMESPACE 16 | using namespace Scintilla; 17 | #endif 18 | 19 | FontAlias::FontAlias() { 20 | } 21 | 22 | FontAlias::~FontAlias() { 23 | SetID(0); 24 | // ~Font will not release the actual font resource sine it is now 0 25 | } 26 | 27 | void FontAlias::MakeAlias(Font &fontOrigin) { 28 | SetID(fontOrigin.GetID()); 29 | } 30 | 31 | void FontAlias::ClearFont() { 32 | SetID(0); 33 | } 34 | 35 | bool FontSpecification::EqualTo(const FontSpecification &other) const { 36 | return weight == other.weight && 37 | italic == other.italic && 38 | size == other.size && 39 | characterSet == other.characterSet && 40 | fontName == other.fontName; 41 | } 42 | 43 | FontMeasurements::FontMeasurements() { 44 | Clear(); 45 | } 46 | 47 | void FontMeasurements::Clear() { 48 | ascent = 1; 49 | descent = 1; 50 | aveCharWidth = 1; 51 | spaceWidth = 1; 52 | sizeZoomed = 2; 53 | } 54 | 55 | Style::Style() : FontSpecification() { 56 | Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), 57 | Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, 0, SC_CHARSET_DEFAULT, 58 | SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); 59 | } 60 | 61 | Style::Style(const Style &source) : FontSpecification(), FontMeasurements() { 62 | Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), 63 | 0, 0, 0, 64 | SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); 65 | fore = source.fore; 66 | back = source.back; 67 | characterSet = source.characterSet; 68 | weight = source.weight; 69 | italic = source.italic; 70 | size = source.size; 71 | eolFilled = source.eolFilled; 72 | underline = source.underline; 73 | caseForce = source.caseForce; 74 | visible = source.visible; 75 | changeable = source.changeable; 76 | hotspot = source.hotspot; 77 | } 78 | 79 | Style::~Style() { 80 | } 81 | 82 | Style &Style::operator=(const Style &source) { 83 | if (this == &source) 84 | return * this; 85 | Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), 86 | 0, 0, SC_CHARSET_DEFAULT, 87 | SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); 88 | fore = source.fore; 89 | back = source.back; 90 | characterSet = source.characterSet; 91 | weight = source.weight; 92 | italic = source.italic; 93 | size = source.size; 94 | eolFilled = source.eolFilled; 95 | underline = source.underline; 96 | caseForce = source.caseForce; 97 | visible = source.visible; 98 | changeable = source.changeable; 99 | return *this; 100 | } 101 | 102 | void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_, 103 | const char *fontName_, int characterSet_, 104 | int weight_, bool italic_, bool eolFilled_, 105 | bool underline_, ecaseForced caseForce_, 106 | bool visible_, bool changeable_, bool hotspot_) { 107 | fore = fore_; 108 | back = back_; 109 | characterSet = characterSet_; 110 | weight = weight_; 111 | italic = italic_; 112 | size = size_; 113 | fontName = fontName_; 114 | eolFilled = eolFilled_; 115 | underline = underline_; 116 | caseForce = caseForce_; 117 | visible = visible_; 118 | changeable = changeable_; 119 | hotspot = hotspot_; 120 | font.ClearFont(); 121 | FontMeasurements::Clear(); 122 | } 123 | 124 | void Style::ClearTo(const Style &source) { 125 | Clear( 126 | source.fore, 127 | source.back, 128 | source.size, 129 | source.fontName, 130 | source.characterSet, 131 | source.weight, 132 | source.italic, 133 | source.eolFilled, 134 | source.underline, 135 | source.caseForce, 136 | source.visible, 137 | source.changeable, 138 | source.hotspot); 139 | } 140 | 141 | void Style::Copy(Font &font_, const FontMeasurements &fm_) { 142 | font.MakeAlias(font_); 143 | #if PLAT_WX 144 | font.SetAscent(fm_.ascent); 145 | #endif 146 | (FontMeasurements &)(*this) = fm_; 147 | } 148 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/doc/ScintillaToDo.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Scintilla and SciTE To Do 11 | 12 | 13 | 14 | 15 | 16 | 19 | 23 | 24 |
17 | Scintilla icon 18 | 20 | Scintilla 21 | and SciTE 22 |
25 |

26 | Bugs and To Do List 27 |

28 |

29 | Feedback 30 |

31 |

32 | Issues can be reported on the Bug Tracker 33 | and features requested on the Feature Request Tracker. 34 |

35 |

36 | Scintilla Bugs 37 |

38 |

39 | Automatic scrolling when text dragged near edge of window. 40 |

41 |

42 | Scintilla To Do 43 |

44 |

45 | Folding for languages that don't have it yet and good folding for languages 46 | that inherited poor folding from another languages folding code. 47 |

48 |

49 | Simple pattern based styling. 50 |

51 |

52 | Different height lines based upon tallest text on the line rather than on the tallest style 53 | possible. 54 |

55 |

56 | Composition of lexing for mixed languages (such as ASP+ over COBOL) by 57 | combining lexers. 58 |

59 |

60 | Stream folding which could be used to fold up the contents of HTML elements. 61 |

62 |

63 | Printing of highlight lines and folding margin. 64 |

65 |

66 | Flow diagrams inside editor similar to 67 | GRASP. 68 |

69 |

70 | More lexers for other languages. 71 |

72 |

73 | SciTE To Do 74 |

75 |

76 | Good regular expression support through a plugin. 77 |

78 |

79 | Allow file name based selection on all properties rather than just a chosen few. 80 |

81 |

82 | Opening from and saving to FTP servers. 83 |

84 |

85 | Setting to fold away comments upon opening. 86 |

87 |

88 | User defined fold ranges. 89 |

90 |

91 | Silent mode that does not display any message boxes. 92 |

93 |

94 | Features I am unlikely to do 95 |

96 |

97 | These are features I don't like or don't think are important enough to work on. 98 | Implementations are welcome from others though. 99 |

100 |

101 | Mouse wheel panning (press the mouse wheel and then move the mouse) on 102 | Windows. 103 |

104 |

105 | Adding options to the save dialog to save in a particular encoding or with a 106 | chosen line ending. 107 |

108 |

109 | Directions 110 |

111 |

112 | The main point of this development is Scintilla, and this is where most effort will 113 | go. SciTE will get new features, but only when they make my life easier - I am 114 | not intending to make it grow up to be a huge full-function IDE like Visual 115 | Cafe. The lines I've currently decided not to step over in SciTE are any sort of 116 | project facility and any configuration dialogs. SciTE for Windows now has a 117 | Director interface for communicating with a separate project manager 118 | application. 119 |

120 |

121 | If you are interested in contributing code, do not feel any need to make it cross 122 | platform. 123 | Just code it for your platform and I'll either reimplement for the other platform or 124 | ensure that there is no effect on the other platform. 125 |

126 | 127 | 128 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/xh_fnb.cpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: xh_fnb.cpp 3 | // Purpose: XRC resource for wxFlatNotebook 4 | // Author: Armel Asselin 5 | // Created: 2006/10/30 6 | // RCS-ID: $Id: $ 7 | // Copyright: (c) 2006 Armel Asselin (copied from Vaclav Slavik xh_notbk) 8 | // Licence: wxWindows licence 9 | ///////////////////////////////////////////////////////////////////////////// 10 | 11 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 12 | #pragma implementation "xh_notbk.h" 13 | #endif 14 | 15 | // For compilers that support precompilation, includes "wx.h". 16 | #include "wx/wxprec.h" 17 | 18 | #ifdef __BORLANDC__ 19 | #pragma hdrstop 20 | #endif 21 | 22 | #if wxUSE_XRC 23 | 24 | #include "wx/wxFlatNotebook/xh_fnb.h" 25 | 26 | #include "wx/log.h" 27 | #include "wx/notebook.h" 28 | #include "wx/imaglist.h" 29 | #include "wx/sizer.h" 30 | 31 | IMPLEMENT_DYNAMIC_CLASS(wxFlatNotebookXmlHandler, wxXmlResourceHandler) 32 | 33 | wxFlatNotebookXmlHandler::wxFlatNotebookXmlHandler() 34 | : wxXmlResourceHandler(), m_isInside(false), m_notebook(NULL) 35 | { 36 | XRC_ADD_STYLE(wxFNB_DEFAULT_STYLE); 37 | XRC_ADD_STYLE(wxFNB_VC71); 38 | XRC_ADD_STYLE(wxFNB_FANCY_TABS); 39 | XRC_ADD_STYLE(wxFNB_TABS_BORDER_SIMPLE); 40 | XRC_ADD_STYLE(wxFNB_NO_X_BUTTON); 41 | XRC_ADD_STYLE(wxFNB_NO_NAV_BUTTONS); 42 | XRC_ADD_STYLE(wxFNB_MOUSE_MIDDLE_CLOSES_TABS); 43 | XRC_ADD_STYLE(wxFNB_BOTTOM); 44 | XRC_ADD_STYLE(wxFNB_NODRAG); 45 | XRC_ADD_STYLE(wxFNB_VC8); 46 | XRC_ADD_STYLE(wxFNB_X_ON_TAB); 47 | XRC_ADD_STYLE(wxFNB_BACKGROUND_GRADIENT); 48 | XRC_ADD_STYLE(wxFNB_COLORFUL_TABS); 49 | XRC_ADD_STYLE(wxFNB_DCLICK_CLOSES_TABS); 50 | XRC_ADD_STYLE(wxFNB_SMART_TABS); 51 | XRC_ADD_STYLE(wxFNB_DROPDOWN_TABS_LIST); 52 | XRC_ADD_STYLE(wxFNB_ALLOW_FOREIGN_DND); 53 | 54 | AddWindowStyles(); 55 | } 56 | 57 | wxObject *wxFlatNotebookXmlHandler::DoCreateResource() 58 | { 59 | if (m_class == wxT("notebookpage")) 60 | { 61 | wxXmlNode *n = GetParamNode(wxT("object")); 62 | 63 | if ( !n ) 64 | n = GetParamNode(wxT("object_ref")); 65 | 66 | if (n) 67 | { 68 | bool old_ins = m_isInside; 69 | m_isInside = false; 70 | wxObject *item = CreateResFromNode(n, m_notebook, NULL); 71 | m_isInside = old_ins; 72 | wxWindow *wnd = wxDynamicCast(item, wxWindow); 73 | 74 | if (wnd) 75 | { 76 | m_notebook->AddPage(wnd, GetText(wxT("label")), 77 | GetBool(wxT("selected"))); 78 | if ( HasParam(wxT("bitmap")) ) 79 | { 80 | wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); 81 | wxFlatNotebookImageList *imgList = m_notebook->GetImageList(); 82 | if ( imgList == NULL ) 83 | { 84 | imgList = new wxFlatNotebookImageList ( ); 85 | m_notebook->SetImageList( imgList ); 86 | } 87 | imgList->Add(bmp); 88 | m_notebook->SetPageImageIndex(m_notebook->GetPageCount()-1, (int)imgList->Count()-1 ); 89 | } 90 | } 91 | else 92 | wxLogError(wxT("Error in resource.")); 93 | return wnd; 94 | } 95 | else 96 | { 97 | wxLogError(wxT("Error in resource: no control within notebook's tag.")); 98 | return NULL; 99 | } 100 | } 101 | 102 | else 103 | { 104 | XRC_MAKE_INSTANCE(nb, wxFlatNotebook) 105 | 106 | nb->Create(m_parentAsWindow, 107 | GetID(), 108 | GetPosition(), GetSize(), 109 | GetStyle(wxT("style")), 110 | GetName()); 111 | 112 | SetupWindow(nb); 113 | 114 | wxFlatNotebook *old_par = m_notebook; 115 | m_notebook = nb; 116 | bool old_ins = m_isInside; 117 | m_isInside = true; 118 | CreateChildren(m_notebook, true/*only this handler*/); 119 | m_isInside = old_ins; 120 | m_notebook = old_par; 121 | 122 | return nb; 123 | } 124 | } 125 | 126 | bool wxFlatNotebookXmlHandler::CanHandle(wxXmlNode *node) 127 | { 128 | return ((!m_isInside && IsOfClass(node, wxT("wxFlatNotebook"))) || 129 | (m_isInside && IsOfClass(node, wxT("notebookpage")))); 130 | } 131 | 132 | #endif // wxUSE_XRC && wxUSE_NOTEBOOK 133 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/build/Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | ## File: Makefile 3 | ## Purpose: wxScintilla 4 | ## Maintainer: Otto Wyss 5 | ## Created: 2004-09-19 6 | ## RCS-ID: $Id: Makefile 4946 2008-03-13 09:14:30Z mortenmacfly $ 7 | ## Copyright: (c) 2004 wxCode 8 | ## Licence: wxWindows 9 | ############################################################################## 10 | 11 | # list of source files 12 | SRC = PlatWX.cpp \ 13 | ScintillaWX.cpp \ 14 | wxscintilla.cpp \ 15 | AutoComplete.cxx \ 16 | CallTip.cxx \ 17 | CellBuffer.cxx \ 18 | CharClassify.cxx \ 19 | ContractionState.cxx \ 20 | Document.cxx \ 21 | DocumentAccessor.cxx \ 22 | Editor.cxx \ 23 | Indicator.cxx \ 24 | KeyMap.cxx \ 25 | KeyWords.cxx \ 26 | LexAda.cxx \ 27 | LexAPDL.cxx \ 28 | LexAsm.cxx \ 29 | LexAsn1.cxx \ 30 | LexAU3.cxx \ 31 | LexAVE.cxx \ 32 | LexBaan.cxx \ 33 | LexBash.cxx \ 34 | LexBasic.cxx \ 35 | LexBullant.cxx \ 36 | LexCaml.cxx \ 37 | LexCLW.cxx \ 38 | LexConf.cxx \ 39 | LexCPP.cxx \ 40 | LexCrontab.cxx \ 41 | LexCsound.cxx \ 42 | LexCSS.cxx \ 43 | LexEiffel.cxx \ 44 | LexErlang.cxx \ 45 | LexEScript.cxx \ 46 | LexFlagship.cxx \ 47 | LexForth.cxx \ 48 | LexFortran.cxx \ 49 | LexGui4Cli.cxx \ 50 | LexHaskell.cxx \ 51 | LexHTML.cxx \ 52 | LexInno.cxx \ 53 | LexKix.cxx \ 54 | LexLisp.cxx \ 55 | LexLout.cxx \ 56 | LexLua.cxx \ 57 | LexMatlab.cxx \ 58 | LexMetapost.cxx \ 59 | LexMMIXAL.cxx \ 60 | LexMPT.cxx \ 61 | LexMSSQL.cxx \ 62 | LexOpal.cxx \ 63 | LexNsis.cxx \ 64 | LexOthers.cxx \ 65 | LexPascal.cxx \ 66 | LexPB.cxx \ 67 | LexPerl.cxx \ 68 | LexPOV.cxx \ 69 | LexPS.cxx \ 70 | LexPython.cxx \ 71 | LexRebol.cxx \ 72 | LexRuby.cxx \ 73 | LexScriptol.cxx \ 74 | LexSmalltalk.cxx \ 75 | LexSpecman.cxx \ 76 | LexSpice.cxx \ 77 | LexSQL.cxx \ 78 | LexTADS3.cxx \ 79 | LexTCL.cxx \ 80 | LexTeX.cxx \ 81 | LexVB.cxx \ 82 | LexVerilog.cxx \ 83 | LexVHDL.cxx \ 84 | LexYAML.cxx \ 85 | LineMarker.cxx \ 86 | PropSet.cxx \ 87 | RESearch.cxx \ 88 | ScintillaBase.cxx \ 89 | Style.cxx \ 90 | StyleContext.cxx \ 91 | UniConversion.cxx \ 92 | ViewStyle.cxx \ 93 | WindowAccessor.cxx \ 94 | XPM.cxx 95 | 96 | # source directories 97 | vpath %.cpp ../src 98 | vpath %.cxx ../src/scintilla/src 99 | 100 | # additional header directories 101 | INC = -I../include \ 102 | -I../src/scintilla/include \ 103 | -I../src/scintilla/src 104 | 105 | DEF = -D__WX__=1 -DSCI_LEXER -DLINK_LEXERS 106 | 107 | # objects 108 | OBJ = $(patsubst %.cxx,%.o,$(SRC:.cpp=.o)) 109 | 110 | # library 111 | LIB = libwxscintilla 112 | 113 | 114 | ############################################################################## 115 | # implementation, change only if other settings or other targets are needed 116 | 117 | ifneq ($(WXDEVEL),) 118 | WXDEVEL_Release = $(WXDEVEL)/Release/ 119 | WXDEVEL_Debug = $(WXDEVEL)/Debug/ 120 | WXDEVEL_Univ = $(WXDEVEL)/Univ/ 121 | endif 122 | 123 | ifeq ($(MAKECMDGOALS),) 124 | WXCONFIG=wx-config 125 | GTKCONFIG=gtk-config 126 | endif 127 | ifeq ($(MAKECMDGOALS),release) 128 | WXCONFIG=wx-config 129 | GTKCONFIG=gtk-config 130 | endif 131 | ifeq ($(MAKECMDGOALS),debug) 132 | WXCONFIG=wxgtkd-2.4-config 133 | GTKCONFIG=gtk-config 134 | endif 135 | ifeq ($(MAKECMDGOALS),develdebug) 136 | WXCONFIG=$(WXDEVEL_Debug)wx-config --inplace 137 | GTKCONFIG=pkg-config gtk+-2.0 138 | endif 139 | ifeq ($(MAKECMDGOALS),univdebug) 140 | WXCONFIG=$(WXDEVEL_Univ)wx-config --inplace 141 | GTKCONFIG=pkg-config gtk+-2.0 142 | endif 143 | 144 | %.o: %.cpp 145 | g++ -fpic -c $(DEF) $(INC) `$(WXCONFIG) --cxxflags` -g -o $@ $< 146 | 147 | %.o: %.cxx 148 | g++ -fpic -c $(DEF) $(INC) `$(WXCONFIG) --cxxflags` -g -o $@ $< 149 | 150 | all: $(LIB).so 151 | $(LIB).so: $(OBJ) 152 | g++ -fpic --share -o ../lib/$@ $^ `$(WXCONFIG) --libs` 153 | 154 | release: $(LIB).a 155 | $(LIB).a: $(OBJ) 156 | ar crs ../lib/$@ $^ 157 | 158 | debug: $(LIB).so.d 159 | $(LIB).so.d: $(OBJ) 160 | g++ -fpic --share -o ../lib/$@ $^ `$(WXCONFIG) --libs` 161 | 162 | develdebug: $(LIB).so.dd 163 | $(LIB).so.dd: $(OBJ) 164 | g++ -fpic --share -o ../lib/$@ $^ `$(WXCONFIG) --libs` 165 | 166 | univdebug: $(LIB).so.ud 167 | $(LIB).so.ud: $(OBJ) 168 | g++ -fpic --share -o ../lib/$@ $^ `$(WXCONFIG) --libs` 169 | 170 | clean: 171 | rm -f *.o 172 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/ViewStyle.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ViewStyle.h 3 | ** Store information on how the document is to be viewed. 4 | **/ 5 | // Copyright 1998-2001 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef VIEWSTYLE_H 9 | #define VIEWSTYLE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class MarginStyle { 18 | public: 19 | int style; 20 | int width; 21 | int mask; 22 | bool sensitive; 23 | int cursor; 24 | MarginStyle(); 25 | }; 26 | 27 | /** 28 | */ 29 | class FontNames { 30 | private: 31 | char **names; 32 | int size; 33 | int max; 34 | 35 | public: 36 | FontNames(); 37 | ~FontNames(); 38 | void Clear(); 39 | const char *Save(const char *name); 40 | }; 41 | 42 | class FontRealised : public FontSpecification, public FontMeasurements { 43 | // Private so FontRealised objects can not be copied 44 | FontRealised(const FontRealised &); 45 | FontRealised &operator=(const FontRealised &); 46 | public: 47 | Font font; 48 | FontRealised *frNext; 49 | FontRealised(const FontSpecification &fs); 50 | virtual ~FontRealised(); 51 | void Realise(Surface &surface, int zoomLevel, int technology); 52 | FontRealised *Find(const FontSpecification &fs); 53 | void FindMaxAscentDescent(unsigned int &maxAscent, unsigned int &maxDescent); 54 | }; 55 | 56 | enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth}; 57 | 58 | enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2}; 59 | 60 | /** 61 | */ 62 | class ViewStyle { 63 | public: 64 | FontNames fontNames; 65 | FontRealised *frFirst; 66 | size_t stylesSize; 67 | Style *styles; 68 | LineMarker markers[MARKER_MAX + 1]; 69 | int largestMarkerHeight; 70 | Indicator indicators[INDIC_MAX + 1]; 71 | int technology; 72 | int lineHeight; 73 | unsigned int maxAscent; 74 | unsigned int maxDescent; 75 | XYPOSITION aveCharWidth; 76 | XYPOSITION spaceWidth; 77 | bool selforeset; 78 | ColourDesired selforeground; 79 | ColourDesired selAdditionalForeground; 80 | bool selbackset; 81 | ColourDesired selbackground; 82 | ColourDesired selAdditionalBackground; 83 | ColourDesired selbackground2; 84 | int selAlpha; 85 | int selAdditionalAlpha; 86 | bool selEOLFilled; 87 | bool whitespaceForegroundSet; 88 | ColourDesired whitespaceForeground; 89 | bool whitespaceBackgroundSet; 90 | ColourDesired whitespaceBackground; 91 | ColourDesired selbar; 92 | ColourDesired selbarlight; 93 | bool foldmarginColourSet; 94 | ColourDesired foldmarginColour; 95 | bool foldmarginHighlightColourSet; 96 | ColourDesired foldmarginHighlightColour; 97 | bool hotspotForegroundSet; 98 | ColourDesired hotspotForeground; 99 | bool hotspotBackgroundSet; 100 | ColourDesired hotspotBackground; 101 | bool hotspotUnderline; 102 | bool hotspotSingleLine; 103 | /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin 104 | enum { margins=5 }; 105 | int leftMarginWidth; ///< Spacing margin on left of text 106 | int rightMarginWidth; ///< Spacing margin on right of text 107 | int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin 108 | MarginStyle ms[margins]; 109 | int fixedColumnWidth; 110 | int zoomLevel; 111 | WhiteSpaceVisibility viewWhitespace; 112 | int whitespaceSize; 113 | IndentView viewIndentationGuides; 114 | bool viewEOL; 115 | ColourDesired caretcolour; 116 | ColourDesired additionalCaretColour; 117 | bool showCaretLineBackground; 118 | bool alwaysShowCaretLineBackground; 119 | ColourDesired caretLineBackground; 120 | int caretLineAlpha; 121 | ColourDesired edgecolour; 122 | int edgeState; 123 | int caretStyle; 124 | int caretWidth; 125 | bool someStylesProtected; 126 | bool someStylesForceCase; 127 | int extraFontFlag; 128 | int extraAscent; 129 | int extraDescent; 130 | int marginStyleOffset; 131 | int annotationVisible; 132 | int annotationStyleOffset; 133 | bool braceHighlightIndicatorSet; 134 | int braceHighlightIndicator; 135 | bool braceBadLightIndicatorSet; 136 | int braceBadLightIndicator; 137 | 138 | ViewStyle(); 139 | ViewStyle(const ViewStyle &source); 140 | ~ViewStyle(); 141 | void Init(size_t stylesSize_=64); 142 | void CreateFont(const FontSpecification &fs); 143 | void Refresh(Surface &surface); 144 | void AllocStyles(size_t sizeNew); 145 | void EnsureStyle(size_t index); 146 | void ResetDefaultStyle(); 147 | void ClearStyles(); 148 | void SetStyleFontName(int styleIndex, const char *name); 149 | bool ProtectionActive() const; 150 | bool ValidStyle(size_t styleIndex) const; 151 | void CalcLargestMarkerHeight(); 152 | }; 153 | 154 | #ifdef SCI_NAMESPACE 155 | } 156 | #endif 157 | 158 | #endif 159 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/wxFNBDropTarget.h: -------------------------------------------------------------------------------- 1 | #ifndef _WX_FNB_DROP_TARGET_H 2 | #define _WX_FNB_DROP_TARGET_H 3 | 4 | #include 5 | #include 6 | 7 | /** 8 | \brief Contains the information about dragged page (page index and container). 9 | */ 10 | class wxFNBDragInfo 11 | { 12 | wxWindow * m_Container; 13 | int m_PageIndex; 14 | public: 15 | /** 16 | Constructor 17 | \param container - pointer to wxPageContainer object which contains dragged page 18 | \param pageindex - index of dragged page 19 | */ 20 | wxFNBDragInfo(wxWindow * container, int pageindex) : m_Container(container), m_PageIndex(pageindex){} 21 | 22 | /** 23 | * \brief default constructor 24 | */ 25 | wxFNBDragInfo() : m_Container(0), m_PageIndex(0){} 26 | 27 | /** 28 | Returns wxPageContainer object which contains dragged page 29 | */ 30 | wxWindow * GetContainer() {return m_Container;} 31 | 32 | /** 33 | Returns the index of dragged page 34 | */ 35 | int GetPageIndex() {return m_PageIndex;} 36 | }; 37 | 38 | class wxFNBDragInfoDataObject : public wxDataObjectSimple 39 | { 40 | public: 41 | wxFNBDragInfoDataObject(const wxDataFormat& format):wxDataObjectSimple(format) 42 | {} 43 | 44 | wxFNBDragInfo DragInfo; 45 | 46 | wxFNBDragInfo *GetData() 47 | { 48 | return &DragInfo; 49 | } 50 | 51 | // get the size of our data 52 | virtual size_t GetDataSize() const 53 | { return sizeof(wxFNBDragInfo); } 54 | 55 | // copy our data to the buffer 56 | virtual bool GetDataHere(void *buf) const 57 | { 58 | memcpy(buf, &DragInfo, sizeof(wxFNBDragInfo)); 59 | return true; 60 | } 61 | 62 | // copy data from buffer to our data 63 | virtual bool SetData(size_t WXUNUSED(len), const void *buf) 64 | { 65 | // don't check the len. Under Win98 the value of 'len' == 0 66 | memcpy(&DragInfo, buf, sizeof(wxFNBDragInfo)); 67 | return true; 68 | } 69 | }; 70 | 71 | /** 72 | \brief Used for processing drag-n-drop opeartions 73 | */ 74 | template 75 | class wxFNBDropTarget : public wxDropTarget 76 | { 77 | private: 78 | typedef wxDragResult (T::*pt2Func)(wxCoord, wxCoord, int, wxWindow *); 79 | T* m_pParent; 80 | pt2Func m_pt2CallbackFunc; 81 | wxFNBDragInfoDataObject * m_DataObject; 82 | public: 83 | /** 84 | \brief Constructor 85 | \param pParent - Object that will handle drag-n-drop operation 86 | \param pt2CallbackFunc - Pointer to callback method which should be called after dragging the notebook page 87 | */ 88 | wxFNBDropTarget(T* pParent, pt2Func pt2CallbackFunc) 89 | : m_pParent(pParent) 90 | , m_pt2CallbackFunc(pt2CallbackFunc) 91 | , m_DataObject(NULL) 92 | { 93 | m_DataObject = new wxFNBDragInfoDataObject(wxDataFormat(wxT("wxFNB"))); 94 | SetDataObject(m_DataObject); 95 | } 96 | /** 97 | \brief Virtual Destructor 98 | */ 99 | virtual ~wxFNBDropTarget(void) {} 100 | /** 101 | \brief Used for processing drop operation 102 | \param x - X-coordinate 103 | \param y - Y-coordinate 104 | \param def - Result of drag-n-drop operation 105 | */ 106 | virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult WXUNUSED(def)) 107 | { 108 | GetData(); 109 | wxFNBDragInfo * draginfo = (wxFNBDragInfo *)m_DataObject->GetData(); 110 | if(!draginfo) 111 | { 112 | return wxDragNone; 113 | } 114 | return (m_pParent->*m_pt2CallbackFunc)(x, y, draginfo->GetPageIndex(), (T *)draginfo->GetContainer()); 115 | } 116 | }; 117 | 118 | /** 119 | * \ingroup wxFlatNotebook 120 | * This class represents a source for a drag and drop operation 121 | * We override wxDropSource class to provide user with a feedback 122 | * 123 | * \version 1.0 124 | * first version 125 | * 126 | * \date 10-11-2006 127 | * 128 | * \author Eran 129 | */ 130 | class wxFNBDropSource : public wxDropSource 131 | { 132 | wxWindow* m_win; 133 | public: 134 | /** 135 | * Parameterized constructor 136 | * \param win 137 | * \param iconCopy 138 | * \param iconMove 139 | * \param iconNone 140 | */ 141 | wxFNBDropSource(wxWindow* win = NULL) 142 | : wxDropSource(win) 143 | , m_win( win ) 144 | { 145 | } 146 | 147 | /** 148 | * Destructor 149 | */ 150 | virtual ~wxFNBDropSource() 151 | { 152 | } 153 | 154 | /** 155 | * give some custom UI feedback during the drag and drop operation in this function. It is called on each mouse move, so your implementation must not be too slow 156 | * \param effect The effect to implement. One of wxDragCopy, wxDragMove, wxDragLink and wxDragNone 157 | * \return 158 | */ 159 | virtual bool GiveFeedback(wxDragResult effect); 160 | }; 161 | #endif 162 | -------------------------------------------------------------------------------- /lc3edit/wxFlatNotebook/wx/wxFlatNotebook/fnb_smart_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef FNB_SMART_PTR_H 2 | #define FNB_SMART_PTR_H 3 | 4 | 5 | /** 6 | * A smart pointer class that provides a reference counting and auto delete memory. 7 | * 8 | * This class is similar to std::auto_ptr, with 2 exceptions: 9 | * - This class uses reference counting 10 | * - We dont provide a release() function (because of the reference counting) 11 | * It is recommended to use this class instead of using raw pointer wherever possible. 12 | * 13 | * \note smart pointer to NULL is valid. 14 | * 15 | * \ingroup CodeLite 16 | * \version 1.0 17 | * first version 18 | * \date 09-17-2006 19 | * \author Eran 20 | */ 21 | template 22 | class wxFNBSmartPtr 23 | { 24 | typedef T* type_ptr; 25 | 26 | /** 27 | * The reference counting class 28 | * 29 | * \ingroup CodeLite 30 | * \version 1.0 31 | * first version 32 | * 33 | * \date 09-17-2006 34 | * \author Eran 35 | */ 36 | class SmartPtrRef 37 | { 38 | type_ptr m_data; 39 | int m_refCount; 40 | 41 | public: 42 | /** 43 | * Construct a reference counting class for row pointer data 44 | * \param data pointer 45 | */ 46 | SmartPtrRef(type_ptr data) 47 | : m_data( data ) 48 | , m_refCount( 1 ) 49 | { 50 | } 51 | 52 | /** 53 | * Destructor 54 | */ 55 | virtual ~SmartPtrRef() 56 | { 57 | delete m_data; 58 | } 59 | 60 | /** 61 | * \return Pointer to the row data 62 | */ 63 | type_ptr GetData() { return m_data; } 64 | 65 | /** 66 | * Increase reference counting by 1 67 | */ 68 | void IncRef() { m_refCount ++ ; } 69 | 70 | 71 | /** 72 | * Decrease reference counting by 1 73 | */ 74 | void DecRef() { m_refCount -- ; } 75 | /** 76 | * Return the current reference counting 77 | * \return current reference counting 78 | */ 79 | int GetRefCount() { return m_refCount; } 80 | }; 81 | 82 | SmartPtrRef *m_ref; 83 | 84 | public: 85 | /** 86 | * Construct smart pointer from ptr 87 | * \param ptr pointer 88 | */ 89 | wxFNBSmartPtr(type_ptr ptr) 90 | { 91 | // create a fresh copy 92 | CreateFresh( ptr ); 93 | } 94 | 95 | /** 96 | * Default constructor 97 | */ 98 | wxFNBSmartPtr() 99 | : m_ref(NULL) 100 | { 101 | } 102 | 103 | /** 104 | * Copy constructor 105 | * \param rhs right hand side 106 | */ 107 | wxFNBSmartPtr(const wxFNBSmartPtr& rhs) 108 | : m_ref(NULL) 109 | { 110 | *this = rhs; 111 | } 112 | 113 | /** 114 | * Assignment operator 115 | * \param rhs right hand side 116 | * \return reference to this 117 | */ 118 | wxFNBSmartPtr& operator=(const wxFNBSmartPtr& rhs) 119 | { 120 | // increase the reference count 121 | if( m_ref == rhs.m_ref ) 122 | return *this; 123 | 124 | // Delete previous reference 125 | DeleteRefCount(); 126 | 127 | if( !rhs.m_ref ) 128 | return *this; 129 | 130 | m_ref = rhs.m_ref; 131 | m_ref->IncRef(); 132 | return *this; 133 | } 134 | 135 | /** 136 | * Destructor 137 | */ 138 | virtual ~wxFNBSmartPtr() 139 | { 140 | DeleteRefCount(); 141 | } 142 | 143 | /** 144 | * Replace the current pointer with ptr 145 | * if the current ptr is not NULL, it will be freed (reference counting free) before assingning the new ptr 146 | * \param ptr new pointer 147 | */ 148 | void Reset(type_ptr ptr) 149 | { 150 | DeleteRefCount(); 151 | CreateFresh( ptr ); 152 | } 153 | 154 | /** 155 | * Return pointer the row data pointer 156 | * \return pointer to the row data pointer 157 | */ 158 | type_ptr Get() 159 | { 160 | return m_ref->GetData(); 161 | } 162 | 163 | /** 164 | * Overload the '->' operator 165 | * \return pointer to the row data pointer 166 | */ 167 | type_ptr operator->() const 168 | { 169 | return m_ref->GetData(); 170 | } 171 | 172 | /** 173 | * Dereference operator 174 | * \return dereference the row data 175 | */ 176 | T& operator*() const 177 | { 178 | return *(m_ref->GetData()); 179 | } 180 | 181 | /** 182 | * Test for NULL operator 183 | * \return true if the internal row data or the reference counting class are NULL false otherwise 184 | */ 185 | bool operator!() const 186 | { 187 | if( !m_ref ) 188 | return true; 189 | 190 | return m_ref->GetData() == NULL; 191 | } 192 | 193 | private: 194 | void DeleteRefCount() 195 | { 196 | // decrease the ref count (or delete pointer if it is 1) 197 | if( m_ref ) 198 | { 199 | if( m_ref->GetRefCount() == 1 ) 200 | { 201 | delete m_ref; 202 | m_ref = NULL; 203 | } 204 | else 205 | m_ref->DecRef(); 206 | } 207 | }; 208 | 209 | void CreateFresh(type_ptr ptr) 210 | { 211 | m_ref = new SmartPtrRef( ptr ); 212 | } 213 | }; 214 | 215 | #endif // FNB_SMART_PTR_H 216 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/CharacterSet.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CharacterSet.h 3 | ** Encapsulates a set of characters. Used to test if a character is within a set. 4 | **/ 5 | // Copyright 2007 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CHARACTERSET_H 9 | #define CHARACTERSET_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class CharacterSet { 16 | int size; 17 | bool valueAfter; 18 | bool *bset; 19 | public: 20 | enum setBase { 21 | setNone=0, 22 | setLower=1, 23 | setUpper=2, 24 | setDigits=4, 25 | setAlpha=setLower|setUpper, 26 | setAlphaNum=setAlpha|setDigits 27 | }; 28 | CharacterSet(setBase base=setNone, const char *initialSet="", int size_=0x80, bool valueAfter_=false) { 29 | size = size_; 30 | valueAfter = valueAfter_; 31 | bset = new bool[size]; 32 | for (int i=0; i < size; i++) { 33 | bset[i] = false; 34 | } 35 | AddString(initialSet); 36 | if (base & setLower) 37 | AddString("abcdefghijklmnopqrstuvwxyz"); 38 | if (base & setUpper) 39 | AddString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); 40 | if (base & setDigits) 41 | AddString("0123456789"); 42 | } 43 | CharacterSet(const CharacterSet &other) { 44 | size = other.size; 45 | valueAfter = other.valueAfter; 46 | bset = new bool[size]; 47 | for (int i=0; i < size; i++) { 48 | bset[i] = other.bset[i]; 49 | } 50 | } 51 | ~CharacterSet() { 52 | delete []bset; 53 | bset = 0; 54 | size = 0; 55 | } 56 | CharacterSet &operator=(const CharacterSet &other) { 57 | if (this != &other) { 58 | bool *bsetNew = new bool[other.size]; 59 | for (int i=0; i < other.size; i++) { 60 | bsetNew[i] = other.bset[i]; 61 | } 62 | delete []bset; 63 | size = other.size; 64 | valueAfter = other.valueAfter; 65 | bset = bsetNew; 66 | } 67 | return *this; 68 | } 69 | void Add(int val) { 70 | assert(val >= 0); 71 | assert(val < size); 72 | bset[val] = true; 73 | } 74 | void AddString(const char *setToAdd) { 75 | for (const char *cp=setToAdd; *cp; cp++) { 76 | int val = static_cast(*cp); 77 | assert(val >= 0); 78 | assert(val < size); 79 | bset[val] = true; 80 | } 81 | } 82 | bool Contains(int val) const { 83 | assert(val >= 0); 84 | if (val < 0) return false; 85 | return (val < size) ? bset[val] : valueAfter; 86 | } 87 | }; 88 | 89 | // Functions for classifying characters 90 | 91 | inline bool IsASpace(int ch) { 92 | return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); 93 | } 94 | 95 | inline bool IsASpaceOrTab(int ch) { 96 | return (ch == ' ') || (ch == '\t'); 97 | } 98 | 99 | inline bool IsADigit(int ch) { 100 | return (ch >= '0') && (ch <= '9'); 101 | } 102 | 103 | inline bool IsADigit(int ch, int base) { 104 | if (base <= 10) { 105 | return (ch >= '0') && (ch < '0' + base); 106 | } else { 107 | return ((ch >= '0') && (ch <= '9')) || 108 | ((ch >= 'A') && (ch < 'A' + base - 10)) || 109 | ((ch >= 'a') && (ch < 'a' + base - 10)); 110 | } 111 | } 112 | 113 | inline bool IsASCII(int ch) { 114 | return (ch >= 0) && (ch < 0x80); 115 | } 116 | 117 | inline bool IsLowerCase(int ch) { 118 | return (ch >= 'a') && (ch <= 'z'); 119 | } 120 | 121 | inline bool IsUpperCase(int ch) { 122 | return (ch >= 'A') && (ch <= 'Z'); 123 | } 124 | 125 | inline bool IsAlphaNumeric(int ch) { 126 | return 127 | ((ch >= '0') && (ch <= '9')) || 128 | ((ch >= 'a') && (ch <= 'z')) || 129 | ((ch >= 'A') && (ch <= 'Z')); 130 | } 131 | 132 | /** 133 | * Check if a character is a space. 134 | * This is ASCII specific but is safe with chars >= 0x80. 135 | */ 136 | inline bool isspacechar(int ch) { 137 | return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); 138 | } 139 | 140 | inline bool iswordchar(int ch) { 141 | return IsAlphaNumeric(ch) || ch == '.' || ch == '_'; 142 | } 143 | 144 | inline bool iswordstart(int ch) { 145 | return IsAlphaNumeric(ch) || ch == '_'; 146 | } 147 | 148 | inline bool isoperator(int ch) { 149 | if (IsAlphaNumeric(ch)) 150 | return false; 151 | if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || 152 | ch == '(' || ch == ')' || ch == '-' || ch == '+' || 153 | ch == '=' || ch == '|' || ch == '{' || ch == '}' || 154 | ch == '[' || ch == ']' || ch == ':' || ch == ';' || 155 | ch == '<' || ch == '>' || ch == ',' || ch == '/' || 156 | ch == '?' || ch == '!' || ch == '.' || ch == '~') 157 | return true; 158 | return false; 159 | } 160 | 161 | // Simple case functions for ASCII. 162 | 163 | inline char MakeUpperCase(char ch) { 164 | if (ch < 'a' || ch > 'z') 165 | return ch; 166 | else 167 | return static_cast(ch - 'a' + 'A'); 168 | } 169 | 170 | int CompareCaseInsensitive(const char *a, const char *b); 171 | int CompareNCaseInsensitive(const char *a, const char *b, size_t len); 172 | 173 | #ifdef SCI_NAMESPACE 174 | } 175 | #endif 176 | 177 | #endif 178 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/lexlib/StyleContext.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file StyleContext.cxx 3 | ** Lexer infrastructure. 4 | **/ 5 | // Copyright 1998-2004 by Neil Hodgson 6 | // This file is in the public domain. 7 | 8 | #ifndef STYLECONTEXT_H 9 | #define STYLECONTEXT_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | static inline int MakeLowerCase(int ch) { 16 | if (ch < 'A' || ch > 'Z') 17 | return ch; 18 | else 19 | return ch - 'A' + 'a'; 20 | } 21 | 22 | // All languages handled so far can treat all characters >= 0x80 as one class 23 | // which just continues the current token or starts an identifier if in default. 24 | // DBCS treated specially as the second character can be < 0x80 and hence 25 | // syntactically significant. UTF-8 avoids this as all trail bytes are >= 0x80 26 | class StyleContext { 27 | LexAccessor &styler; 28 | unsigned int endPos; 29 | StyleContext &operator=(const StyleContext &); 30 | void GetNextChar(unsigned int pos) { 31 | chNext = static_cast(styler.SafeGetCharAt(pos+1)); 32 | if (styler.IsLeadByte(static_cast(chNext))) { 33 | chNext = chNext << 8; 34 | chNext |= static_cast(styler.SafeGetCharAt(pos+2)); 35 | } 36 | // End of line? 37 | // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) 38 | // or on LF alone (Unix). Avoid triggering two times on Dos/Win. 39 | atLineEnd = (ch == '\r' && chNext != '\n') || 40 | (ch == '\n') || 41 | (currentPos >= endPos); 42 | } 43 | 44 | public: 45 | unsigned int currentPos; 46 | bool atLineStart; 47 | bool atLineEnd; 48 | int state; 49 | int chPrev; 50 | int ch; 51 | int chNext; 52 | 53 | StyleContext(unsigned int startPos, unsigned int length, 54 | int initStyle, LexAccessor &styler_, char chMask=31) : 55 | styler(styler_), 56 | endPos(startPos + length), 57 | currentPos(startPos), 58 | atLineEnd(false), 59 | state(initStyle & chMask), // Mask off all bits which aren't in the chMask. 60 | chPrev(0), 61 | ch(0), 62 | chNext(0) { 63 | styler.StartAt(startPos, chMask); 64 | styler.StartSegment(startPos); 65 | atLineStart = static_cast(styler.LineStart(styler.GetLine(startPos))) == startPos; 66 | unsigned int pos = currentPos; 67 | ch = static_cast(styler.SafeGetCharAt(pos)); 68 | if (styler.IsLeadByte(static_cast(ch))) { 69 | pos++; 70 | ch = ch << 8; 71 | ch |= static_cast(styler.SafeGetCharAt(pos)); 72 | } 73 | GetNextChar(pos); 74 | } 75 | void Complete() { 76 | styler.ColourTo(currentPos - 1, state); 77 | styler.Flush(); 78 | } 79 | bool More() const { 80 | return currentPos < endPos; 81 | } 82 | void Forward() { 83 | if (currentPos < endPos) { 84 | atLineStart = atLineEnd; 85 | chPrev = ch; 86 | currentPos++; 87 | if (ch >= 0x100) 88 | currentPos++; 89 | ch = chNext; 90 | GetNextChar(currentPos + ((ch >= 0x100) ? 1 : 0)); 91 | } else { 92 | atLineStart = false; 93 | chPrev = ' '; 94 | ch = ' '; 95 | chNext = ' '; 96 | atLineEnd = true; 97 | } 98 | } 99 | void Forward(int nb) { 100 | for (int i = 0; i < nb; i++) { 101 | Forward(); 102 | } 103 | } 104 | void ChangeState(int state_) { 105 | state = state_; 106 | } 107 | void SetState(int state_) { 108 | styler.ColourTo(currentPos - 1, state); 109 | state = state_; 110 | } 111 | void ForwardSetState(int state_) { 112 | Forward(); 113 | styler.ColourTo(currentPos - 1, state); 114 | state = state_; 115 | } 116 | int LengthCurrent() { 117 | return currentPos - styler.GetStartSegment(); 118 | } 119 | int GetRelative(int n) { 120 | return static_cast(styler.SafeGetCharAt(currentPos+n)); 121 | } 122 | bool Match(char ch0) const { 123 | return ch == static_cast(ch0); 124 | } 125 | bool Match(char ch0, char ch1) const { 126 | return (ch == static_cast(ch0)) && (chNext == static_cast(ch1)); 127 | } 128 | bool Match(const char *s) { 129 | if (ch != static_cast(*s)) 130 | return false; 131 | s++; 132 | if (!*s) 133 | return true; 134 | if (chNext != static_cast(*s)) 135 | return false; 136 | s++; 137 | for (int n=2; *s; n++) { 138 | if (*s != styler.SafeGetCharAt(currentPos+n)) 139 | return false; 140 | s++; 141 | } 142 | return true; 143 | } 144 | bool MatchIgnoreCase(const char *s) { 145 | if (MakeLowerCase(ch) != static_cast(*s)) 146 | return false; 147 | s++; 148 | if (MakeLowerCase(chNext) != static_cast(*s)) 149 | return false; 150 | s++; 151 | for (int n=2; *s; n++) { 152 | if (static_cast(*s) != 153 | MakeLowerCase(static_cast(styler.SafeGetCharAt(currentPos+n)))) 154 | return false; 155 | s++; 156 | } 157 | return true; 158 | } 159 | // Non-inline 160 | void GetCurrent(char *s, unsigned int len); 161 | void GetCurrentLowered(char *s, unsigned int len); 162 | }; 163 | 164 | #ifdef SCI_NAMESPACE 165 | } 166 | #endif 167 | 168 | #endif 169 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/ExternalLexer.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ExternalLexer.cxx 3 | ** Support external lexers in DLLs. 4 | **/ 5 | // Copyright 2001 Simon Steele , portions copyright Neil Hodgson. 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | /* C::B begin */ 15 | //#include 16 | /* C::B end */ 17 | 18 | #include "Platform.h" 19 | 20 | #include "ILexer.h" 21 | #include "Scintilla.h" 22 | #include "SciLexer.h" 23 | 24 | #include "LexerModule.h" 25 | #include "Catalogue.h" 26 | #include "ExternalLexer.h" 27 | 28 | #ifdef SCI_NAMESPACE 29 | using namespace Scintilla; 30 | #endif 31 | 32 | LexerManager *LexerManager::theInstance = NULL; 33 | 34 | //------------------------------------------ 35 | // 36 | // ExternalLexerModule 37 | // 38 | //------------------------------------------ 39 | 40 | void ExternalLexerModule::SetExternal(GetLexerFactoryFunction fFactory, int index) { 41 | fneFactory = fFactory; 42 | fnFactory = fFactory(index); 43 | } 44 | 45 | //------------------------------------------ 46 | // 47 | // LexerLibrary 48 | // 49 | //------------------------------------------ 50 | 51 | LexerLibrary::LexerLibrary(const char *ModuleName) { 52 | // Initialise some members... 53 | first = NULL; 54 | last = NULL; 55 | 56 | // Load the DLL 57 | lib = DynamicLibrary::Load(ModuleName); 58 | if (lib->IsValid()) { 59 | m_sModuleName = ModuleName; 60 | //Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects 61 | GetLexerCountFn GetLexerCount = (GetLexerCountFn)(sptr_t)lib->FindFunction("GetLexerCount"); 62 | 63 | if (GetLexerCount) { 64 | ExternalLexerModule *lex; 65 | LexerMinder *lm; 66 | 67 | // Find functions in the DLL 68 | GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName"); 69 | GetLexerFactoryFunction fnFactory = (GetLexerFactoryFunction)(sptr_t)lib->FindFunction("GetLexerFactory"); 70 | 71 | // Assign a buffer for the lexer name. 72 | char lexname[100]; 73 | strcpy(lexname, ""); 74 | 75 | int nl = GetLexerCount(); 76 | 77 | for (int i = 0; i < nl; i++) { 78 | GetLexerName(i, lexname, 100); 79 | lex = new ExternalLexerModule(SCLEX_AUTOMATIC, NULL, lexname, NULL); 80 | Catalogue::AddLexerModule(lex); 81 | 82 | // Create a LexerMinder so we don't leak the ExternalLexerModule... 83 | lm = new LexerMinder; 84 | lm->self = lex; 85 | lm->next = NULL; 86 | if (first != NULL) { 87 | last->next = lm; 88 | last = lm; 89 | } else { 90 | first = lm; 91 | last = lm; 92 | } 93 | 94 | // The external lexer needs to know how to call into its DLL to 95 | // do its lexing and folding, we tell it here. 96 | lex->SetExternal(fnFactory, i); 97 | } 98 | } 99 | } 100 | next = NULL; 101 | } 102 | 103 | LexerLibrary::~LexerLibrary() { 104 | Release(); 105 | delete lib; 106 | } 107 | 108 | void LexerLibrary::Release() { 109 | LexerMinder *lm; 110 | LexerMinder *lmNext; 111 | lm = first; 112 | while (NULL != lm) { 113 | lmNext = lm->next; 114 | delete lm->self; 115 | delete lm; 116 | lm = lmNext; 117 | } 118 | 119 | first = NULL; 120 | last = NULL; 121 | } 122 | 123 | //------------------------------------------ 124 | // 125 | // LexerManager 126 | // 127 | //------------------------------------------ 128 | 129 | /// Return the single LexerManager instance... 130 | LexerManager *LexerManager::GetInstance() { 131 | if (!theInstance) 132 | theInstance = new LexerManager; 133 | return theInstance; 134 | } 135 | 136 | /// Delete any LexerManager instance... 137 | void LexerManager::DeleteInstance() { 138 | delete theInstance; 139 | theInstance = NULL; 140 | } 141 | 142 | /// protected constructor - this is a singleton... 143 | LexerManager::LexerManager() { 144 | first = NULL; 145 | last = NULL; 146 | } 147 | 148 | LexerManager::~LexerManager() { 149 | Clear(); 150 | } 151 | 152 | void LexerManager::Load(const char *path) { 153 | LoadLexerLibrary(path); 154 | } 155 | 156 | void LexerManager::LoadLexerLibrary(const char *module) { 157 | for (LexerLibrary *ll = first; ll; ll= ll->next) { 158 | if (strcmp(ll->m_sModuleName.c_str(), module) == 0) 159 | return; 160 | } 161 | LexerLibrary *lib = new LexerLibrary(module); 162 | if (NULL != first) { 163 | last->next = lib; 164 | last = lib; 165 | } else { 166 | first = lib; 167 | last = lib; 168 | } 169 | } 170 | 171 | void LexerManager::Clear() { 172 | if (NULL != first) { 173 | LexerLibrary *cur = first; 174 | LexerLibrary *next; 175 | while (cur) { 176 | next = cur->next; 177 | delete cur; 178 | cur = next; 179 | } 180 | first = NULL; 181 | last = NULL; 182 | } 183 | } 184 | 185 | //------------------------------------------ 186 | // 187 | // LexerManager 188 | // 189 | //------------------------------------------ 190 | 191 | LMMinder::~LMMinder() { 192 | LexerManager::DeleteInstance(); 193 | } 194 | 195 | LMMinder minder; 196 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/Decoration.cxx: -------------------------------------------------------------------------------- 1 | /** @file Decoration.cxx 2 | ** Visual elements added over text. 3 | **/ 4 | // Copyright 1998-2007 by Neil Hodgson 5 | // The License.txt file describes the conditions under which this software may be distributed. 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "Platform.h" 13 | 14 | #include "Scintilla.h" 15 | #include "SplitVector.h" 16 | #include "Partitioning.h" 17 | #include "RunStyles.h" 18 | #include "Decoration.h" 19 | 20 | #ifdef SCI_NAMESPACE 21 | using namespace Scintilla; 22 | #endif 23 | 24 | Decoration::Decoration(int indicator_) : next(0), indicator(indicator_) { 25 | } 26 | 27 | Decoration::~Decoration() { 28 | } 29 | 30 | bool Decoration::Empty() { 31 | return (rs.Runs() == 1) && (rs.AllSameAs(0)); 32 | } 33 | 34 | DecorationList::DecorationList() : currentIndicator(0), currentValue(1), current(0), 35 | lengthDocument(0), root(0), clickNotified(false) { 36 | } 37 | 38 | DecorationList::~DecorationList() { 39 | Decoration *deco = root; 40 | while (deco) { 41 | Decoration *decoNext = deco->next; 42 | delete deco; 43 | deco = decoNext; 44 | } 45 | root = 0; 46 | current = 0; 47 | } 48 | 49 | Decoration *DecorationList::DecorationFromIndicator(int indicator) { 50 | for (Decoration *deco=root; deco; deco = deco->next) { 51 | if (deco->indicator == indicator) { 52 | return deco; 53 | } 54 | } 55 | return 0; 56 | } 57 | 58 | Decoration *DecorationList::Create(int indicator, int length) { 59 | currentIndicator = indicator; 60 | Decoration *decoNew = new Decoration(indicator); 61 | decoNew->rs.InsertSpace(0, length); 62 | 63 | Decoration *decoPrev = 0; 64 | Decoration *deco = root; 65 | 66 | while (deco && (deco->indicator < indicator)) { 67 | decoPrev = deco; 68 | deco = deco->next; 69 | } 70 | if (decoPrev == 0) { 71 | decoNew->next = root; 72 | root = decoNew; 73 | } else { 74 | decoNew->next = deco; 75 | decoPrev->next = decoNew; 76 | } 77 | return decoNew; 78 | } 79 | 80 | void DecorationList::Delete(int indicator) { 81 | Decoration *decoToDelete = 0; 82 | if (root) { 83 | if (root->indicator == indicator) { 84 | decoToDelete = root; 85 | root = root->next; 86 | } else { 87 | Decoration *deco=root; 88 | while (deco->next && !decoToDelete) { 89 | if (deco->next && deco->next->indicator == indicator) { 90 | decoToDelete = deco->next; 91 | deco->next = decoToDelete->next; 92 | } else { 93 | deco = deco->next; 94 | } 95 | } 96 | } 97 | } 98 | if (decoToDelete) { 99 | delete decoToDelete; 100 | current = 0; 101 | } 102 | } 103 | 104 | void DecorationList::SetCurrentIndicator(int indicator) { 105 | currentIndicator = indicator; 106 | current = DecorationFromIndicator(indicator); 107 | currentValue = 1; 108 | } 109 | 110 | void DecorationList::SetCurrentValue(int value) { 111 | currentValue = value ? value : 1; 112 | } 113 | 114 | bool DecorationList::FillRange(int &position, int value, int &fillLength) { 115 | if (!current) { 116 | current = DecorationFromIndicator(currentIndicator); 117 | if (!current) { 118 | current = Create(currentIndicator, lengthDocument); 119 | } 120 | } 121 | bool changed = current->rs.FillRange(position, value, fillLength); 122 | if (current->Empty()) { 123 | Delete(currentIndicator); 124 | } 125 | return changed; 126 | } 127 | 128 | void DecorationList::InsertSpace(int position, int insertLength) { 129 | const bool atEnd = position == lengthDocument; 130 | lengthDocument += insertLength; 131 | for (Decoration *deco=root; deco; deco = deco->next) { 132 | deco->rs.InsertSpace(position, insertLength); 133 | if (atEnd) { 134 | deco->rs.FillRange(position, 0, insertLength); 135 | } 136 | } 137 | } 138 | 139 | void DecorationList::DeleteRange(int position, int deleteLength) { 140 | lengthDocument -= deleteLength; 141 | Decoration *deco; 142 | for (deco=root; deco; deco = deco->next) { 143 | deco->rs.DeleteRange(position, deleteLength); 144 | } 145 | DeleteAnyEmpty(); 146 | } 147 | 148 | void DecorationList::DeleteAnyEmpty() { 149 | Decoration *deco = root; 150 | while (deco) { 151 | if ((lengthDocument == 0) || deco->Empty()) { 152 | Delete(deco->indicator); 153 | deco = root; 154 | } else { 155 | deco = deco->next; 156 | } 157 | } 158 | } 159 | 160 | int DecorationList::AllOnFor(int position) { 161 | int mask = 0; 162 | for (Decoration *deco=root; deco; deco = deco->next) { 163 | if (deco->rs.ValueAt(position)) { 164 | mask |= 1 << deco->indicator; 165 | } 166 | } 167 | return mask; 168 | } 169 | 170 | int DecorationList::ValueAt(int indicator, int position) { 171 | Decoration *deco = DecorationFromIndicator(indicator); 172 | if (deco) { 173 | return deco->rs.ValueAt(position); 174 | } 175 | return 0; 176 | } 177 | 178 | int DecorationList::Start(int indicator, int position) { 179 | Decoration *deco = DecorationFromIndicator(indicator); 180 | if (deco) { 181 | return deco->rs.StartRun(position); 182 | } 183 | return 0; 184 | } 185 | 186 | int DecorationList::End(int indicator, int position) { 187 | Decoration *deco = DecorationFromIndicator(indicator); 188 | if (deco) { 189 | return deco->rs.EndRun(position); 190 | } 191 | return 0; 192 | } 193 | -------------------------------------------------------------------------------- /lc3edit/wxScintilla/src/scintilla/src/PositionCache.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file PositionCache.h 3 | ** Classes for caching layout information. 4 | **/ 5 | // Copyright 1998-2009 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef POSITIONCACHE_H 9 | #define POSITIONCACHE_H 10 | 11 | /* C::B begin */ 12 | #include "Selection.h" 13 | /* C::B end */ 14 | 15 | #ifdef SCI_NAMESPACE 16 | namespace Scintilla { 17 | #endif 18 | 19 | static inline bool IsEOLChar(char ch) { 20 | return (ch == '\r') || (ch == '\n'); 21 | } 22 | 23 | /** 24 | */ 25 | class LineLayout { 26 | private: 27 | friend class LineLayoutCache; 28 | int *lineStarts; 29 | int lenLineStarts; 30 | /// Drawing is only performed for @a maxLineLength characters on each line. 31 | int lineNumber; 32 | bool inCache; 33 | public: 34 | enum { wrapWidthInfinite = 0x7ffffff }; 35 | int maxLineLength; 36 | int numCharsInLine; 37 | int numCharsBeforeEOL; 38 | enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity; 39 | int xHighlightGuide; 40 | bool highlightColumn; 41 | Selection *psel; 42 | bool containsCaret; 43 | int edgeColumn; 44 | char *chars; 45 | unsigned char *styles; 46 | int styleBitsSet; 47 | char *indicators; 48 | XYPOSITION *positions; 49 | char bracePreviousStyles[2]; 50 | 51 | // Hotspot support 52 | int hsStart; 53 | int hsEnd; 54 | 55 | // Wrapped line support 56 | int widthLine; 57 | int lines; 58 | XYPOSITION wrapIndent; // In pixels 59 | 60 | LineLayout(int maxLineLength_); 61 | virtual ~LineLayout(); 62 | void Resize(int maxLineLength_); 63 | void Free(); 64 | void Invalidate(validLevel validity_); 65 | int LineStart(int line) const; 66 | int LineLastVisible(int line) const; 67 | bool InLine(int offset, int line) const; 68 | void SetLineStart(int line, int start); 69 | void SetBracesHighlight(Range rangeLine, Position braces[], 70 | char bracesMatchStyle, int xHighlight, bool ignoreStyle); 71 | void RestoreBracesHighlight(Range rangeLine, Position braces[], bool ignoreStyle); 72 | int FindBefore(XYPOSITION x, int lower, int upper) const; 73 | int EndLineStyle() const; 74 | }; 75 | 76 | /** 77 | */ 78 | class LineLayoutCache { 79 | int level; 80 | int length; 81 | int size; 82 | LineLayout **cache; 83 | bool allInvalidated; 84 | int styleClock; 85 | int useCount; 86 | void Allocate(int length_); 87 | void AllocateForLevel(int linesOnScreen, int linesInDoc); 88 | public: 89 | LineLayoutCache(); 90 | virtual ~LineLayoutCache(); 91 | void Deallocate(); 92 | enum { 93 | llcNone=SC_CACHE_NONE, 94 | llcCaret=SC_CACHE_CARET, 95 | llcPage=SC_CACHE_PAGE, 96 | llcDocument=SC_CACHE_DOCUMENT 97 | }; 98 | void Invalidate(LineLayout::validLevel validity_); 99 | void SetLevel(int level_); 100 | int GetLevel() const { return level; } 101 | LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, 102 | int linesOnScreen, int linesInDoc); 103 | void Dispose(LineLayout *ll); 104 | }; 105 | 106 | class PositionCacheEntry { 107 | unsigned int styleNumber:8; 108 | unsigned int len:8; 109 | unsigned int clock:16; 110 | XYPOSITION *positions; 111 | public: 112 | PositionCacheEntry(); 113 | ~PositionCacheEntry(); 114 | void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_, unsigned int clock); 115 | void Clear(); 116 | bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const; 117 | static int Hash(unsigned int styleNumber_, const char *s, unsigned int len); 118 | bool NewerThan(const PositionCacheEntry &other) const; 119 | void ResetClock(); 120 | }; 121 | 122 | // Class to break a line of text into shorter runs at sensible places. 123 | class BreakFinder { 124 | LineLayout *ll; 125 | int lineStart; 126 | int lineEnd; 127 | int posLineStart; 128 | int nextBreak; 129 | int *selAndEdge; 130 | unsigned int saeSize; 131 | unsigned int saeLen; 132 | unsigned int saeCurrentPos; 133 | int saeNext; 134 | int subBreak; 135 | Document *pdoc; 136 | void Insert(int val); 137 | public: 138 | // If a whole run is longer than lengthStartSubdivision then subdivide 139 | // into smaller runs at spaces or punctuation. 140 | enum { lengthStartSubdivision = 300 }; 141 | // Try to make each subdivided run lengthEachSubdivision or shorter. 142 | enum { lengthEachSubdivision = 100 }; 143 | BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_, 144 | int xStart, bool breakForSelection, Document *pdoc_); 145 | ~BreakFinder(); 146 | int First() const; 147 | int Next(); 148 | }; 149 | 150 | class PositionCache { 151 | PositionCacheEntry *pces; 152 | size_t size; 153 | unsigned int clock; 154 | bool allClear; 155 | public: 156 | PositionCache(); 157 | ~PositionCache(); 158 | void Clear(); 159 | void SetSize(size_t size_); 160 | size_t GetSize() const { return size; } 161 | void MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber, 162 | const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc); 163 | }; 164 | 165 | inline bool IsSpaceOrTab(int ch) { 166 | return ch == ' ' || ch == '\t'; 167 | } 168 | 169 | #ifdef SCI_NAMESPACE 170 | } 171 | #endif 172 | 173 | #endif 174 | --------------------------------------------------------------------------------