codeblocks_sf
codeblocks_sf copied to clipboard
Port Sqplus to sqrat
This is the port from sqplus to sqrat The [NOT COMPILE] marked commits do not compiler, because the project files are not updated until 77c1e3e52a74324117e36a52eb3bb70936133db5 . I have split up the commits to make the changes more clear.
Motivation for the port
- Sqplus is not maintained any more (at least there was no update for the last 3 years), sqrat has active development with fast bugfixes
- Sqrat is header only
- With sqrat it is possible to automate parameter fetching to easier bind a native function without writing specialized wrapper functions
Changes
SDK Api
All changes to the api affect only scripting related things... So if a plugin does not use scripting no changes to the code are needed.
- SqPlus provided a vm wrapper. This has to be replaced: Add a wrapper for the squirrel VM (Virtual Machine) (63d2f5dfda9d1bce673f065e8d674b047d5826df). Prepared to handle multiple VM so it is possible to sandbox vms, or give every plugin a separate vm
- Add a stack handler class (StackHandler) for easily work with the squirrel stack. It provides function for getting, pushing variables from and to the vm stack and error handling.
- Add versioning for the script API (SCRIPT_BINDING_VERSION_MAJOR...)
- Change ReplaceMacros to give the possibility to give the context name for error reporting to the scripting engine
Scripting changes
General
- Update squirrel from 2.2.5 to 3.0.4 stable. This adds changes to the squirrel syntax (for ex. "base" is now a keyword)
wxWidgets related
- The most important change is that it is possible to use wxStrings as native squirrel strings in any direction.
- add "_tostring" methods for all wx types
- add unicode support for wxString class (only UTF8)
- add ToInt and ToDouble to wxString
- add "wxT()"
- add wxColour(int,int,int) constructor
- add wxPoint::Cmp()
- add wxSize::Cmp()
- add wxStopWatch
- move all wxWidgets const to the const table
cb binding related
- move all constants to the const table
User experience
- All script related errors (compiler, runtime) are displayed in a uniform way: separate dialogue and in the logging output
- If the error occurs in some other parts then a script file (ex. prebuild steps) the location is reported
Help needed
- [] The makefiles need to be updated
- [] Header handling (ex. PCH)
Todo
old bugs
The "bugs" listed here are present in the sqplus AND in the sqrat implementation.
- [] Improve error Handling during MacrosManager::ReplaceMacros(). The current implementation is not usable, because on an script error the compilation does not get aborted. (Test case: implement error in the build script of the codeblocks project and build the target "all")
- [] The whole menu handling part has bugs
- [] In the right click handling is no possibility to distinguish where the right click happened (Editor, log window, project tree)
improvements in the pipeline
- [] Add the possibility to handle CB Events
- [] Add debug support for scripts
- [] Add wxWidgets dialogues and events
- [] Handle script plugins like binary plugins ...