The homepage of SLProject

 

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:

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

Forums

Wiki

Release History:

6. Feb 2009

14 Dec 2009

Initial release

 

Current Requirements:

 

Known issues:

It leaks memory and the application will crash after a while.

 

Download:

 

SLProjectSetup

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.

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 ...?)

Draw (TODO Rename to Graphics)

Imaging (TODO Rename to BitmapC.. ?)

Expressive

GUI

Network (TODO)

X3D

XML

XPath (XQuery)

XSLT

LXML (TODO, rename to Web)

HTML

SVG

Media

MPEG4

PDF

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.