Simkin on Symbian


Symbian preprocessor directives

Since version 2.18 Simkin has been available for Symbian OS - which runs on many popular mobile phones, as well as Psion organizers.

The porting effort was generously supported by Symbian Ltd.

There are various issues with the support for C++ on Symbian:

  1. Symbian has its own kind of exception called a leave - this may never occur within a C++ class constructor
  2. Symbian uses a special construct called a CleanupStack to keep track of allocated memory in case a leave occurs
  3. C++ Exceptions are not supported
  4. C++ Streams are not supported
  5. Unicode characters are used

Simkin contains preprocessor directives to provide a special version of the library to address these issues:

  1. __SYMBIAN32__
    if defined, any class constructors which could leave are not available. This directive also enables various functions which make integration with Symbian descriptors easier

  2. SAVE_POINTER/RELEASE_POINTER SAVE_VARIABLE/RELEASE_VARIABLE
    These macros add and remove object pointers, and stack-based values (such as skString and skRValue) to the Cleanup Stack. For other platforms, these macros do nothing.

  3. EXCEPTIONS_DEFINED
    if undefined, code using C++ exceptions is disabled.
    An skExecutableContext object is passed to method calls which uses an skScriptError object to catch any errors that would normally be thrown as a C++ exception.

  4. STREAMS_ENABLED
    if undefined this disables all the code within Simkin which relies on C++ streams

  5. UNICODE_STRINGS
    if defined, this enables code which uses unicode wide character strings rather than standard 8-bit characters

Building Simkin/C++ for Symbian

Simkin should be built as a static DLL on the Symbian platform.

You can do this using the bld.inf SimkinSym.mmp files in the Simkin source directory, in conjunction with the Symbian command line tools.

This generates a DLL called Simkin.dll and a library called Simkin.lib

The current version only supports the TreeNode format. We are investigating XML support and hope to release this soon.

Examples

We have provided two specific examples for the Symbian platform:
  1. ScriptLoader - this is a command line application which loads a script called "test.dat" from the root of the C: drive.
  2. SimkinDemo - this GUI app shows a simple calculator whose layout and behaviour is defined in a script called "SimkinDemo.dat". The application uses the Quartz SDK, but could be modified to use earlier versions.