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.

XML version

The SimkinSym_XML.mmp project builds generates a DLL called SimkinXML.dll and a library called SimkinXML.lib. The XML support is provided by a special version of the Expat XML parser, and the Simkin DOM classes.

You can download the special version of Expat from the Simkin site. You will need to use the bld.inf file in the Symbian subdirectory to build expat.dll and expat.lib.

We have provided two specific examples for the XML version:

  1. ScriptLoaderXML (directory scriptloader_xml_sym) - this is a command line application which loads a script called "test.xml" from the root of the C: drive.
  2. SimkinDemoXML (directory demo_xml_sym)- this GUI app shows a simple calculator whose layout and behaviour is defined in a script called "SimkinDemo.xml". The application uses the Quartz SDK, but could be modified to use earlier versions.

TreeNode version

The SimkinSym.mmp project builds generates a DLL called Simkin.dll and a library called Simkin.lib. This includes the skTreeNode classes for storing scripts.

We have provided two specific examples for the Treenode version:

  1. ScriptLoader (directory scriptloader_sym) - this is a command line application which loads a script called "test.dat" from the root of the C: drive.
  2. SimkinDemo (directory demo_sym)- 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.