Community Bonding Period
- Read OpenSCAD source and test files.
- Learnt some important Qt classes used in OpenSCAD.
- Explore different editors that can be integrated into OpenSCAD editor.
- Discussed with community about the editor and finalized QScintilla.
19th May Worked on Detachable rendering window.
20th May Read about QScintilla integration after discussion with community
21st May Completed the task of Detachable window and made a pull request in branch detatchrenderwindow of OpenSCAD.
- Submitted patch for detachable render window, which my mentor said, can be a good addition to https://github.com/openscad/openscad/pull/787.
- Discussed about the integration of editor.
- Added class Qscintilla and make two separate objects of QTextEditor and QScintilla classes in Editor class.
- Removed errors and Added some built in functions of QScintilla class so that its minimal functionality can be seen.
- Discussed about it with mentors and I got that two separate classes should be made say legacyEditor and ScintillaEditor which will inherit QTextEdit and QScintilla classes respectively and an Interface class Editor will be used to call the functions of both these classes.
- Refactored some code and made two separate classes as discussed.
- More code need to be refactored yet.
- Searched about how to change the color of rendered model.
- Checked rendersettings.cc renderer.cc preferences.cc. Preferences.cc has color scheme for preview but not for rendered model.
- The functions defined in legacyEditor.cc can be called in mainwin.cc by object of interface class i.e. Editor.
- Still not able to find the code that affects the color of rendered model. Struggling for it.
- Facing a segmentation fault because of toPlainText() function call in mainwin.cc at some places. Trying to solve it.
- Completed the editor class as interface and defined virtual functions into it using which the derived class functions can be called into the mainwin.cc
- The size of the editor is creating problem. It is not fitting into the DockWidget. Read about size hint, size policy and customizing Qt widgets.
- Cloned new openscad as a lot of changes are made by the developer and installed required libraries. Build OpenSCAD with Qt5 and remove errors caused to old libraries versions. My mentor suggested me to shift to Operating system Ubuntu 14.04 as 12.04 is not supporting new libraries required by OpenSCAD.
- Installed QScintilla editor API and read its example to understand how to it can be integrated into OpenSCAD.
- Made Scintilla class derived from Editor class.
- Install OS Ubuntu 14.04 lts.
- Cloned OpenSCAD and build required libraries
- Scintilla editor is not working. Trying to figure out the problem.
- As the editor is removed from MainWindow.ui file, the editor defined as object of legacyEditor is facing some size issues. Trying to figure out how to set its size equal to its parent editorDockContents.
- Integrated QScintilla editor into openscad with minimal functionality.
- Solved size problem of legacy and scintilla editors successfully. Now they are occupying the full editorDock widget space.
- Read and became familiar with QScintilla documentation to add new features into the scintilla Editor.
- Made a wiki page showing what features need to be implemented in editor
- Line numbers at the margin.
- Brace Matching.
- Auto Indentation
- Included line wrap and flags at wrapping to make the editor responsive to the window size.
- Add margin width to the line numbers so show the full line number, previously it was showing just the last digit.
- Discussed with mentors, how to add error indicators. This was bit confusing, as with scintilla editor we are not using the existing highlighter class which is used for highlighting and error indicating
- Understanding how to do error indicating using qscintilla functions provided in documentation.
- Error indicator is implemented
- Facing problem in unhighlighting when the user solve the error
- Finally implemented error indicators with marker at line number which will help to identify line having error in case there is no line wrapping
- Today's task was to work towards syntax highlighting. Qscintilla has different lexer classes such as QsciLexerCPP, QsciLexerJava etc for highlighting syntax of different languages. But all the keywords used in openscad are not supported in single language. Planning how to tackle this problem.
- A new class ScadLexer is made that is inherited from QsciLexerCPP class, which contain the enum having labels for different style IDs.
- A keyword method in QsciLexerCPP is overridden in ScadLexer to define Openscad set of keywords.
- DefaultColor function of QsciLexerCPP is overridden in ScadLexer which return colors for different sets of keywords defined in keyword method in the same class.
- Preference syntaxhighlight string is called to know the current value of Edit/Preference/Editor set by the user in the openscad window.
- Provide different colors to keywords according to dark, light or no background color.
- Unable to change the syntax color when the user changes the settings.
- The defaultColor method in ScadLexer and setHighlightScheme method in ScintillaEditor needs to be connected somehow. Tried some methods getting ideas from existing Highlighter class for legacyEditor.
- The idea of DefaultColor method is dropped because it is automatically called by the lexer and two such functions for different backgrounds can't be defined.
- The inbuilt lexer function setColor is used in setHighlightScheme function to provide colors to different keyword sets, operators, numbers etc according to their style IDs mentioned in qscilexercpp.h.
- Appropriate colors to the keyword sets are given using to monokai color pallete.
- Set editor utf8 for supporting unicodes.
- provided inconsolata font.
- Committed my changes for the mentor's review.
- Explored about adding custom toolbar having most usable actions.
- Downloaded and edited required Icons.
- Made toolbar at the top of the MainWindow
- Reviewd toolbar from mentor but due to a Qt bug, toolbar styles were not supported at every platform.
- Explored for different option how to get user's desktop settings.
- Regenerate all the icons in black color.
- The icons will be black if the default desktop setting as light gray color and white if it has dark color as default settings.