Issue 60 * November 7 2008

NativeSpeak New Release
Version 1.1 brings greater GUI compliance

Damien Girard interviewed by Heather Nagey

I hear you have a new release of NativeSpeak available. What new features are included?

The main improvement is the MacOS X rendering of applications using NativeSpeak that is far better than previous version of NativeSpeak.

Cross Platform

Do you have an example of a project you or a customer are working on with NativeSpeak?

There are multiple projects using NativeSpeak now, and we hope that there will be more in the future :) A typical example of project using NativeSpeak is our next generation installer.

What does it do?

Our next generation installer provides a unique method on Windows/Linux to install/uninstall and update Dam-pro applications.

How does NativeSpeak make it easier to do this?

NativeSpeak is used everywhere inside this new set of applications. NativeSpeak makes it easy to create the application in multiple languages, it makes easier the development of the GUI (Graphical User Interface) with the easy to use NativeSpeak Geometry Manager, and it also helps with cross-platform development!

The NativeSpeak engine resizes by default all objects stored in its "translation database" to the default operating system GUI guidelines. So, we developed the application on Windows, and we did not need to touch anything in the stacks to have them running perfectly with the right GUI on all platforms. (Tahome font on Windows 2000/XP, Lucida Grande on Linux...).

We even have a customer who does not use the main localization feature of NativeSpeak and just uses the geometry manager to have their application running perfectly on Windows and Linux!

What was your most interesting challenge in programming NativeSpeak and how did you overcome it?

The biggest challenge was the initial creation of NativeSpeak. How should I create it? This is why NativeSpeak has been re-written twice before having the actual 1.0 version of NativeSpeak. The architecture of the actual NativeSpeak is not perfect and not the fatest, but it is very reliable. We focused most on reliability because the NativeSpeak library needs to be bundled inside customer applications.

The main challenge was the NativeSpeak library, but with the applications using it. NativeSpeak Translate is the perfect example. NativeSpeak Translate has an impressive Find and Replace through the entire localization database feature. Just writing this feature took more than 1000 lines of code and multiple diagrams in order to develop it! To make it, was a few days of diagram drawing then a week of programming and finally one month to test it.

What do you think is the most useful/interesting feature of NativeSpeak?

The Geometry manager.

How does it work?

The NativeSpeak Geometry Manager combines two things:
- The ease of use of the Revolution Geometry Manager
- The reliability and the flexibility of writing your own script inside the resizestack handler.

The geometry manager has been written because the NativeSpeak localization engine modifies the size of objects depending on the language and the platform used. Writing resizestack scripts bored me so I wrote the geometry manager.

Geometry Properties

It works easily, you add an object to the geometry database of a NativeSpeak Database, then you set its geometry properties with the easy to use geometry property wizard. Apply the modifications, and you will see your object at the position that you defined inside its geometry property window.

The main advantages of using the NativeSpeak Geometry Manager is that its special geometry properties are cross-platform. The main special properties that you will use are:
- %PaddingLeft, %PaddingTop, %PaddingRight, %PaddingBottom
- - Those properties will be replaced by the left, top, right or bottom padding of a window, on each platform.
- %btnSpacing
- - This property will add the required space between two objects in order to respect the GUI design rules. (These are different on Windows and MacOS X.)

Another advantage is that you can include "script" (10 lines maximum) as geometry property relations. And you can use scripting terms like "me", "this card" and "this stack".
Example:

<script> if the height of this stack < 10 then
   set the top of me to the bottom of btn "test" of this card + \
   %btnSpacing
else
   set the top of me to the bottom of btn "test2" of this card \
   + %btnSpacing
end if 

The tag <script> is telling the engine what it will have to do. There are a lot of tags. There is extensive NativeSpeak documentation to teach you how to efficiently use the NativeSpeak Geometry Manager.

NativeSpeak is "compiling" the geometry properties that the user defined. This compilation boosts the speed of the NativeSpeak Geometry manager.
For example: replacing "me", "this card", "this stack" by the object name, card name, stack name is done during the compilation and not during the interpretation of properties.

Also, the NativeSpeak Geometry engine is calculating the new rect of the object and then finally applies the new rect to the object. This enables NativeSpeak to reduce the number of operations it does and gives the NativeSpeak Geometry Manager the same speed as writing your own scripts.|

NativeSpeak can appear complicated the first time that you run it (like Microsoft Access), but is a really pleasant tool to use as it makes development of applications far easier with Revolution.

NativeSpeak means that you can easily localize your Revolution projects, and helps with Cross-Platform Geometry management.

We cannot live without NativeSpeak at Dam-pro anymore :)

The website has been updated to go with the new release, visit it here.

 

Main Menu What's New

Rev Mentor