About me
Welcome to to my page. My name is Sigurd Lerstad. I am from Norway.
Contact support@lerstad.com
About the project
SLProject is sa program that has yet to be completely defined, it is meant to become a framework for developers and end-users alike to build on.
Keywords are:
- Experiment
- Visualize
- Effective
- Create
- Learn
- Information
- Standards
- 2D / 3D
Stage: very early
License
There are going to be two different licences, one open-source license for non-commercial use, and another for commercial use.
Community
Release History:
6. Feb 2009
- Many small changes to increase general robustness and usefullness
- x3d, started on 3d audio
- svg, minimal support
14 Dec 2009
Initial release
Current Requirements:
- Windows Vista
- 2 GB RAM (More recommended)
Known issues:
It leaks memory and the application will crash after a while.
Download:
You also need PhysX installed http://www.nvidia.com/
Short user guide
When you start Paint.exe, two windows will open, a console window, and a gui window.
In the console you can type commands in a not-yet completed ecmascript parser. You have access to all the typeinformation of all the.dlls that are loaded into the process,. You can also load new dlls with the function LoadModule(StringIn path)
For a quick intro, type the following in the console window:
>var win;
>win = new Window();
>win.Show();
true
>win.Width = 300;
>win.Height = 200;
>win.TitleText = "MyWin";
>Visual;
System::Gui::Visual
>Box;
System::Gui::Media3D::Box
System::x3d::Box
>GetNumberOfProcessors();
4
>GetNumberOfProcessors;
System::uint()() GetNumberOfProcessors
>GetNumberOfProcessors.GetAddress();
268694400
>x3d;
System::x3d
>printClass(Std.Out, Window, 0);
...
For Developers
SLProject is separated into modules.
Each module consists of a .dll file on windows, a .typeinfo and an .ad file.
- The .dll file is compiled from Visual Studio 2008.
- The .typeinfo file contains the type information compiled directly from the header files.
- The .ad file which contains the mapping of addresses in the .dll to the type information.
Test_gc processes c++ header files and creates a .typeinfo file containing all the c++ type information
ParseMap takes as input a .map file generated by the Visual Studio C++ linker and a .typeinfo file and generates an .ad file thats maps the typeinfo to addresses in the .dll file.
This allows you at runtime to access c++ typeinformation, including information on classes, typedefs, templates, methods, baseclasses, derived classes, enums, namespaces, and global functions.
The syntax to access this information in a C++ program is like this:
const Type_Info& ti = typeid(MyClass);
Type* pType = ti.GetType();
Type* pType = typeof(MyClass); // typeof is simply a #define for typeid(x).GetType()
ClassType* pType = MyObject->GetType(); /* if MyObject is derived from Object */
ClassType* pType = GetType(MyObject); /* if MyObject is not derived from Object, however it needs to have a vtable, i.e. have virtual methods */
void* pObject = DynamicCast(ClassType* fromType, ClassType* toType);
void* pObject = newobj(ClassType*);
NamedType* pType = pD->LookupNamedType(StringIn name);
FunctionObject* fun = pD->m_procs.find("funcname")->second;
int32 result = int32_invoke_function_cdecl(ULONG_PTR address, byte* args, uint argslen);
Declarator* decl;
int result = decl->invoke_function<int>(byte* args, uint argslen);
String result = decl->invoke_function<String>(byte* args, uint argslen);
Dispatch* pDispatch = GetDispatch(NamespaceType*); /* (e.g ClassType*) */
...
String types
There are two string types: String and StringVariant.
String holds a refcounted pointer to a StringObject.
StringObject is an abstract base class for the template classes ImmutableString and MutableString.
MutableString is refcounted, and uses CopyOnWrite (COW) to reduce memory. The string data is not nullterminated, but is implemented as a vector
These template classes can hold strings of
char8
char16
char32
You can pass pointers to these as char* (char8*) or wchar_t* (currently char16*)
You can mix char and wchar_t strings with comparison, append and insert methods.
StringVariant can hold either a StringObject, a char* nullterminated C string or wchar_t* nullterminated C string
StringVariant is usually used for in parameters, and for this reason there's a convenient typedef
typedef StringVariant StringIn;
This makes it possible to pass e.g
void func(StringIn str)
{
//...
}
func("Hello World");
without making a any memory allocations for a string object. Ideally, there should have been a way to do write something like:
func(S("Hello World"));
Which would make a static ImmutableString. I tried this with C++ templates using a char* as a template parameter, but constant strings have local storage instead of global, so it didn't work.
Modules:
LFC (TODO Rename to Core ...?)
- String / List / Map / Hash...
- Threads, Modules, Processes
- File/Streams IO
Draw (TODO Rename to Graphics)
- 2D/3D Hardware accelerated primitive Graphics with Direct3D / OpenGL
Imaging (TODO Rename to BitmapC.. ?)
- Loading/Saving of bitmap formats
Expressive
GUI
- Stylable controls
- Layout engine
Network (TODO)
X3D
XML
XPath (XQuery)
XSLT
LXML (TODO, rename to Web)HTML
SVG
Media
MPEG4
ZIP
SQL
EcmaScript
Java VM
Debugging
How to setup Visual Studio
todo...
C++ code samples
Hello world example:
int main()
{
Gui::Button* button = new Gui::Button("Hello world");
Gui::Window* window = new Gui::Window(button);
window->Show();
Application::get_Current()->MessageLoop();
return 0;
}
TODO
(short list... and currently hard to understand..)
View x3d scene from different views
PhysX loaded as lazy so it is not absolutely required
BeginLog / SaveLogAsHtml()Direct3D 9 support as well as Direct3D 10 to support XP
Look into ActionScript 2 VM spec
#defines are available as well as typeinfo
Locale
Support Linux
XML/CSS/SVG works again
GUI/SVG effects works
GetSourceFiles() / GetFileParts()
cpp AddType dynamically
XMLHttpRequest
NNTP
UUDecode
Xml Schema include
XPath shortcuts
SQL works again
Web Service / XML RPC / SOAP / WDSSL
Compile as java bytecode
ParseCOFFPE
Debug
MPEG4 BIFS/Java
XFORM
RDF/OWL
...
Donate
Donations will be very much appreciated, and will be a motivational factor for me to work on this project.