WebVM

Greetings from a gloriously sunny Guildford,

We are happy to announce a new WebVM SDK 0.6.3499 release, which includes several bugfixes and new features.

This release only includes WebVM versions for ActiveX based browsers (IE7/IE Mobile). We expect to synchronize the NPAPI versions of WebVM very soon with the new features.

Most of the work related to this release is a result of issues and feedback from the 1st BONDI Codefest in (cold, but sunny) Huesca (Spain), last week. We thank all developers who gave valuable feedback regarding the WebVM SDK.

webvm.h news

WVMFieldSpec

In order to support reference objects with fields, the WVMFieldSpec type has been extended with 2 new function pointers which need to be implemented to supply get- and set-access to fields:

typedef struct {
    WVMVariantType  type;
    WVMClassSpec   *classSpec; /* added in 0.5 */
    const char     *name;
    /* added in 0.6 */
    WVMFieldGetPtr  get;
    WVMFieldSetPtr  set;
} WVMFieldSpec;

The JIDL version included in this SDK supports this change already. We kindly ask you to regenerate your C stub declarations in order to support field accesses.

To demonstrate field access, we extended the simple example in the SDK and at http://example.webvm.net/simple.

WVMClassSpec

We extended the WVMClassSpec to differentiate between reference objects and value type objects:

struct _WVMClassSpec {
    const char      *name;
    UInt16           fieldCount;
    WVMFieldSpec   **fields;
    UInt16           methodCount;
    WVMMethodSpec  **methods;
    /* added in 0.6 */
    WVMCallType      type;
};

The WVMCallType field can either be CallType_ByReference or CallType_ByValue. The updated version of JIDL fills in these fields already. If a Java class is defined without the abstract modifier and without any methods, it will be generated as value type, otherwise it will be generated as reference object.

STRING_TO_WVMVARIANT

The STRING_TO_WVMVARIANT convenience macro has been extended with a release argument to a release function. If your string resource has been allocated on the heap, you should set the release argument to a function which is able to release the allocated memory. Otherwise set it to 0 or NULL.

WVMCallbackFuncs

The WVMCallbackFuncs have been extended with a new getClassSpecForName function which is intended to be used to query for WVMClassSpec’s defined by foreign modules, subject to that a foreign module has been loaded prior to this call. To make this working you need to load the actual modules in the right order from JavaScript.

‘Jiddle’

JIDL has been extended to support fields in classes or final fields in interfaces. The test example of JIDL has been extended to demonstrate the different behaviour of the kind of class specification JIDL supports.

The web interface of JIDL at http://jidl.webvm.net has been updated accordingly. It is supposed that you upload all (dependent) interfaces first, before you select all interfaces in one go to generate the C stubs.

Note that it is important to select all dependent interfaces in one JIDL run when you are generating/updating the C stubs.

Bugfixes

Example

As mentioned above, the simple example has been updated, also the web-based example. You will need WebVM SDK 0.6 from now on in order to use all functionality demonstrated in the example.

TODOs

Besides the upcoming SDK for ?NPAPI based browsers we also work on a new JIDL based example which will focus on all basic features and on extended features such as invocations on foreign interfaces until the next SDK.

We will also update the tutorial regarding your feedback and issues in this version.

Known issues

Please note that nearly each method call from pocket JScript into native code needs to be assigned to a return value due to a bug in IE Mobiles JScript engine. This is even necessary for void functions:

yourmodule.someMethod(); // might not work on IE Mobile 
var foo = yourmodule.someMethod(); // will work

This issue seems to be fixed in future versions of IE Mobile which are IE6 based.

You can re-use your WebVM SDK download URL from your mail Inbox or re-register at sdk.webvm.net.