Hi folks,
i finally managed to finalize the “pre alpha” release of the codeblocks port of sqrat.
With “pre alpha” I mean: it should be usable, and all scripts that worked with the old implementation should also work with this one (with some work, see more down).
The code can be found here:
https://github.com/bluehazzard/codeblocks_sfWhat is new:* Use sqrat instead of sqplus
why?Sqplus isn't maintained since a wile now. My initial intention was to port some more wxWidgets stuff to c::b, but the lack of features from sqplus (different ctors etc.) obstruct this. So I decided to try to port c::b to sqrat.
Advantages?- Maintained and developed in the future
- Different Ctors for classes (no copy, copy only etc.)
- Easy parameter specialization
- Relative easy interface
* Use squirrel 3.X.X
What is the difference from the user site:Script:1) Squirrel scripts can now use native strings and wxStrings. No need of _T() or wxT
2) Squirrel scripts use now UTF8 and have a “full” unicode support
3) Constants are now really constants and not some obscure get functions
4) Many new functions (and more will follow)
5) The API is broken
. This is a consequence of squirrel 3.X.X and 3) but not as serious as it might appear, because it exists a convert plugin that (hopefully) can resolve all breaks.
Main GUI site1) Error handling is now centralized and has a uniform layout
2) Errors are way more informative
3) The sdk interface to the script is more intuitive
4) It is prepared to use multiple vm
5) A test suite for the squirrel binding
More about the API break and how to resolve it:In squirrel 3.X “base” is a new keyword, so it can't be used as variable name anymore.
The constants (ex. PLATFORM, PLUGIN_SDK_VERSION_MAJOR) are now real constants and not get functions from the RootTable. So thy can't be accessed anymore with “::PLATFORM”. The “::” isn't necessary anymore. So now you have to use “PLATFORM”. Why does I broke this? In the old binding you could change this const values (ex “EXECUTABLE_EXT = _(“blabla”) ”). this is not intended. Now constants are real squirrel strings and replaced at compile time.
How do use my old scripts? Simply:1) open the scripting console
2) open the src/scripts/ConvertOldToNewScript.script
3) run Plugins/Convert Scripts
4) select the scripts you want to convert (multiple files should work)
5) the plugin should now convert all constants to the right name and replace “base” with “_base”
The main work should be done. But I need some help for a few things:1) Code style and naming conventions: I have added new classes and files and don't know if the names are acceptable.
2) Testing!!! I don't have many scripts available, so I could not test the full interface.
3) Some look over sq_wx_type_handler.h. Im not fully happy with the Var<const wxString&> implementation
4) Memory leaks. I hope I don't have introduced some leaks .
5) wx3.0 and x64 support ( I will upload the project files later).
6) Documentation: I have tried to implement some documentation with doxygen, but it isn't pretty nor complete. Has someone an idea how to improve it, or make it more readable.
7) Git. The branche is not in sync with the main branch. From quite a long time now. Can someone tell me how I can easily resync with the main branch, without 1000 conflicts...
greetings