Release notes: Embedded Wizard 8.20

Version 8.20 contains the following changes and improvements:

Evaluation Edition

The complexity limitation of the Evaluation Edition has been increased. Now the user is allowed to create larger projects, containing more classes, resources, objects, languages...

Dongle Activation

The functionality of the separate 'Activate' tool has been integrated into Embedded Wizard Studio.

The menu EXTRAS contains a new menu item Activate license ... to activate your new license or to upgrade an existing license. When selecting this menu item, a File-Open-Dialog appears where you can select the provided *.rfp file. After closing the File-Open-Dialog with Open the activation starts. The progress, success or error messages appear in the Log window.

Documentation System

The Embedded Wizard documentation system has been enhanced to provide the documentation depending on the Embedded Wizard release version. The desired version can be controlled by using the drop-down list in the header in the Web-browser. Per default, always the latest version is presented. If you are using the context sensitive help within Embedded Wizard Studio, the resulting documents matches automatically to the version of your Embedded Wizard Studio.

Embedded Wizard Studio Improvements

Rename and delete operations are more restrictive now: the language member Default can neither be deleted nor renamed. Similarly the units belonging to the core of the Mosaic framework (Core, Views, Resources, Graphics, Effects) can't be deleted nor renamed. The additional Mosaic units (e.g. XFlat, Flat, ...) can be deleted but not renamed. Moreover, the last existing profile member can't be deleted, because every project has to contain at least one profile.

The global version of the Assistant window used in the Code Editor is enhanced. Now, the Assistant displays all instant constructors (e.g. string(...)), all instant data types (e.g. class) and all variants of Chora statements (e.g. postsignal). The Assistant appears when the user presses the keys CtrlSpace in the Code Editor window.

The Assistants for attributes VariantCond and Generator are changed from offering a simple selection list to permit multi-selection. Although the attributes allow the user to specify several operands as condition, the Assistants were limited to offer only one selection. Now the user can activate multiple individual profiles and styles by setting the check mark. If no selection is made, the default false is assumed - which is also correct.

The storage of session files have been reworked. No *.bak file is stored anymore. The session file is written only if it has been changed.

The number of entries in the recent project menu is increased from 4 to 9. The text length for every entry is increased from 30 to 96 characters and all entries in the recent files menu are displayed with their complete path.

With the version 8.20 the Mosaic framework has been protected agains eventual modifications. Since this framework contains the core functionality necessary in every Embedded Wizard created GUI application, it is important to not modify it. From now, if modifications are detected, a warning is displayed. The Mosaic modifications are not saved anymore.

Code Generator

The ANSI-C Code Generator is improved to generate additional code for every array access in order to check the array index boundary. If the index is invalid, an error message is printed referring to the affected location in the source code and the application enters the panic mode. The verification, however, is performed for indices which are calculated dynamically at the runtime. Constant values known at the code generation time are already verified by Chora compiler. This verification may eventually affect the performance of an application if it performs a lot of array accesses. Therefore the macro EW_DONT_CHECK_INDEX can be defined in the makefile or project, which deactivates the verification.

The ANSI-C Code Generator is adapted to generate additional #defines for every method with the attribute Generator set to true. This can be helpful for your device driver implementation, to determine whether a method is available within the corresponding device class.

The profile member has been enhanced by three new attributes OutputSrcDirectory, OutputIncDirectory and OutputResDirectory. These allow the user to specify precisely where the *.c, *.h and *.png files should be stored. If there is no value specified for one attribute, the directory resulting from the old attribute OutputDirectory is used implicitly. The availability of the new attributes depends on the Platform Package.

Additionally, the new attribute CleanOutputDirectories is added to the profile member. If this attribute is true then the Code Generator deletes all outdated files within the output directories. This is achieved by comparing the file names in the directories with the files collected during the code generation. Please be careful when using this feature and never store your manually written code within an output directory of Embedded Wizard - otherwise it will be deleted.

For all platforms using the Index8 color format, the used CLUT file is added to the *.lst and *.inc files. This simplifies build jobs and makefiles.

The ANSI-C code generator is adapted to add the following two defines to every generated ewfiles.inc file: EMWI_COLOR_FORMAT and EMWI_SURFACE_ROTATION These defines can be used in build jobs and makefiles.

The PostProcess function is enhanced to provide the child-process with plenty information about the actual Embedded Wizard code generation. The information is provided in environment variables, the child-process can evaluate easily. Please have a look to the section environment variables to get an overview of the provided information.

An additional warning is reported when the font specified in a font resource cannot be converted because the font is not installed on the Windows PC.

The font converters are adapted to detect and report warnings in case of overlapping glyph-ranges specified in one and the same font resource.

Improvement in the generated C code. Locally declared arrays are now preinitialized with 0 (zero) if they are intended to store references to other objects, strings, slots, handles, ... This is an important modification to avoid crashes when accessing and using non initialized array elements.

Platform Packages (RTE/GFX)

The string management is improved to detect errors caused by incorrectly created strings. In the previous versions it was possible for the native C code to pass to the GUI application a string created with functions other than the officially intended for this purpose (e.g. malloc() or string located on the stack). Doing this could cause the memory heap or stack to become corrupted. See also Be careful when exchanging strings. This verification can be suppressed by adding the define EW_DONT_CHECK_STRINGS to the makefile or to the project settings.

Additional error handling to detect when the usage counter of a string is about to overflow or underflow. Trying to retain a string more than 65520 times or to release a not retained string will raise the error message and enter the application in a panic mode.

The minimum possible glyph cache size is reduced from 128 to 64 pixel width and height. In this manner the smallest possible cache occupies 4kB. The glyph cache size can be configured with the defines EW_MAX_GLYPH_SURFACE_WIDTH and EW_MAX_GLYPH_SURFACE_HEIGHT within your makefile or project.

Memory profiling is now always active. RTE and GFX are adapted to not depend on the define EW_PRINT_MEMORY_USAGE. In order to print the memory statistics, just add the function EwPrintProfilerStatistic( 0 ) within your main loop. The mode detailed in the function EwPrintProfilerStatistics() is changed to display the number of instances only. No file/line location is displayed anymore.

New function EwEnableGfxTaskTracing() added. With this function the user can enable/disable the Graphics Engine tracing mode. Prerequisite is, that the Graphics Engine is compiled with the define EW_SUPPORT_GFX_TASK_TRACING. Per default this feature is deactivated.

Mosaic Improvements

Trying to connect a Slide Touch Handler with more than one view will throw an exception now. Slide Touch Handler can work in 1:1 relation only.

The user defined handler attached to the properties OnSlide and OnEnd of the Slide Touch Handler are now notified after notifying the view connected with the Slide Touch Handler. In this manner the user defined handler can calculate with the previously modified status of the associated view.

The Rotate Touch Handler and the Wipe Touch Handler are corrected to not be limited to single tap events. Now the user can tap quickly within the handler area and the handler will react.

Improvement when passing an effect object in a parameter to a method e.g. EnsureVisible() in order to use the object for an animation. The previous version has overwritten the effect's property OnFinished. The new version uses for this purpose an internal variable. In this manner the creator of the animation effect can associate a slot method to its OnFinished property and then pass the effect object to e.g. EnsureVisible() without the relation to the slot method being dissolved.

Keyboard Handling: The actual implementation of how keyboard events are dispatched is modified to conform with the concept of grab cycle. Now, when the user presses a key DOWN Mosaic searches for a view or Key Press Handler that is willing to react to this event. This found object will become the target for all following DOWN and the final UP events. This is even true if the affected target object has become disabled or the view has been removed from the focus path. In other words, the object, which has received the DOWN event will also receive the UP event.

The Key Press Handler is extended by the property OnHold and the variable RepetitionCount. Now similarly to the touch handlers, when the user presses a key, the handler sends a signal to the OnPress slot method. If the user continues pressing the key, the slot method associated with the property OnHold is signaled. When the user receives the key, the slot method in property OnRelease receives a signal. While the presses the key, the repetition events are counted and can be evaluated in the new variable RepetitionCount.

IMPORTANT

This modification may affect existing projects if these depend on repetition events being processed by the slot method connected with OnPress. To adapt existing projects, assign the slot method to the OnHold property.

Trying to use the Key Press Handler within an object other than a component will throw an error now. In the past nothing happened so the user wondered why the handler does't receive keyboard events

The components Outline Box, Vertical List and Horizontal List are extended by two new methods to allow the user to control the running scroll effects more conveniently. In the previous version no control was possible. Activating an operation while an effect was running has simply stopped it. Now the user can query the current animation status of the component and stop it explicitly. The method IsScrollEffectActivate() returns true if the outline or list is currently performing a scroll animation initiated by a preceding invocation of the EnsureVisible() or AdjustList() method. The method StopScrollEffect() stops the actually active scroll animation effect initiated by the preceding invocation of the method EnsureVisible() or AdjustList(). If the parameter aSetEndValue is true the scroll position of the list is set to the end value of the actually active animation effect as if the effect had reached its end position. If this parameter is false the latest scroll position remains unchanged. If the parameter aSignalOnDoneScroll is true a signal is sent to the slot method passed in the parameter aOnDoneScroll in the invocation of EnsureVisible() or AdjustList() as if the animation had been finished regularly. If this parameter is false the actual animation is stopped without notifying the slot method.

The Slide Touch Handler is enhanced by the property RubberBandScrolling allowing the user to enable/disable the rubber band effect.

The list components Vertical List and Horizontal List are modified: The following methods inherited from the Core::Group class throw now an exception when using them in context of a list. The following methods don't make sense in case of lists: CountViews(), FindNextView(), FindPrevView(), FindSiblingView(), FindViewAtPosition(), FindViewInDirection(), FindViewWithinArea(), GetContentArea(), GetIndexOfView(), GetViewAtIndex().

The list components Vertical List and Horizontal List are enhanced by the new method GetViewForItem() permitting the user to access the list views directly through the item number. If the desired view is not available in the cache, the method returns null.

The list components Vertical List and Horizontal List are enhanced to allow endless lists by setting the property Endless to true.

The method Core::Group.BroadcastEvent() has been enhanced by an additional parameter aFilter. With it, the operation can be limited to views having particular view state (e.g. visible or able to handle touch event, etc.).

IMPORTANT

If the method is used in your projects, take care to add the Chora expression Core::ViewState[] as the new parameter in the method invocation. If the method is invoked from C or JavaScript, simple 0 (zero) should be passed in the last parameter to restore the original function of the method.

New event class Core::CursorGrabEvent has been added to Mosaic. With this class, the Mosaic can broadcast events to all handler just at the beginning and at the end of a touch interaction. This allows the handler to perform touch event operation although the affected handler are not targets of the cursor events.

Slide Touch Handler is adapted to process the new Core::CursorGrabEvent events. In this manner, when the user taps within the area of a Slide Touch Handler while the handler is running an animation, the handler will react and stop the animation even if the event has been handled by another touch handler lying in front of the Slide Touch Handler.

New unit Templates added to Mosaic. The unit is needed internally by Component Templates.

Templates

The templates Bitmap Resource, Font Resource and Extern Bitmap from the Gallery folder Components have been moved to the new folder Resources.

The template Attributed Set from the Gallery folder Views have been moved to the new folder Resources.

The component templates to create menus have been moved from the Panel Templates folder to the Components folder. These templates are reworked and enhanced by annotations. The folder Panel Templates is now obsolete and removed.

The component templates named Numeric keyboard, Alphanumeric Keyboard and Text Editor have been reworked and simplified. Additional annotations are added to instruct the user how to adapt these templates.

New component templates allowing the creation of Date and Time Pickers have been added to the Gallery folder Components.

All templates have been reviewed and adapted to the new Embedded Wizard features. The obsolete description This is a ... have been removed from all affected templates.

Chora Improvements

The behavior of idlesignal has been changed. Now idlesignal does not protect the target nor the sender object from being reclaimed by the garbage collection. This modifications prevents objects from being kept alive through pending signals. As long as there is no other reference to the affected target/sender objects, the signals are discarded and the objects can be reclaimed.

The string index-operator in the write mode has been reworked to handle correctly the copy-on-write operations. Now there is no possibility to corrupt a strings by using an index-operator if the string is referred by several variables. The function of the index-operator to modify strings in-place is restricted now. For optimization purpose, the modification with the index-operator is permitted on a local variable only. If the user intend to modify a string stored in another operand, it is obligatory to copy the operand first into a local variable, apply the desired modifications and to assign the local variable back to the original operand. This restriction was necessary due to very complex side-effects resulting from optimized string operations.

The string index operator [] in the read mode is modified to return \0 instead of entering panic mode if the specified character index addresses beyond the borders of the string.

New variants of the string() instant constructor intended to format strings from numbers are implemented which allow the user to specify an additional radix parameter. Depending on the radix, the constructor converts the integer number in a decimal (radix=10), hexadecimal (radix=16), octal (radix=8) or binary (radix=2) notation. Together with the other parameters the length of the resulting string can be controlled. If the number is negative, a minus sign is displayed and the number is format as an unsigned integer. For example, string( -13, 4, 16 ) will create a string "-00d". Additionally the limitation of the resulting strings to 32 characters have been increased to 128.

The Chora string data type has been enhanced by new instant methods parse_int32, parse_uint32 and parse_float permitting the user to convert a string in an int32, uint32 or float. In case of int32 or uint32 conversion the format of the string (binary, octal, decimal hex-decimal) can be specified.

Examples

The set of provided examples, that are installed with Embedded Wizard Studio, has been reworked and enhanced. You can load the examples by using the Open example project dialog.

The following examples are reworked and well documented by using annotations:

AviationDemo

ChartsDemo

Oscilloscope

PowerSupply

ScreenSaver

SolarDemo

StringTable

Watches

WaveformGenerator

The following examples are now added to the set of installed examples:

AnimatedList - This demo shows the implementation of some fancy scrollable list widgets to set a time and a day of the week. The speciality of this sample application is the magnification effect of the centered list items and the soft fade-in/fade-out effects. The lists are using the new feature Endless.

CoffeeMachine - This sample application shows the implementation of a GUI application to choose and to configure a product like Espresso, Cappuccino, Coffee or Hot Water. The product selection is done by a slide gesture. An animated brewing progress screen and a welcome screen completes the sample.

ClimateCabinet - The ClimateCabinet demo shows the implementation of a control panel for a climatic exposure test cabinet. The user can define a heating time, a nominal temperature and humidity, a dwell time and the final cooling time.

PaperCutter - This demo shows the implementation of a paper cutting machine, where the user can define the pagination and format of the paper as well as the cutting speed and the amount of papers. The application contains many rect effects and fade-in/fade-out effects to change dynamically the layout of the screen.

WashingMachine - This demo shows the implementation of a washing machine with a couple of fancy scrollable list widgets to choose the washing program and parameters. The speciality of this sample application is the magnification effect of the centered list items and the soft fade-in/fade-out effects.

Bug-fixes

The following bugs have been solved:

Chora: Unary prefix operators + and - are corrected to not promote unnecessarily the data type of the operand to int32 or uint32. The type management of integer literals has been reworked to better distinguish between int8, int16, int32 ... uint32. Unary minus operator applied to uint32 does not change it in int32 anymore. A warning is displayed and the operand remains uint32 similarly to C++.

Chora: Fix for the binary operator used with an integer literals as operand. In such case, the depending on the type of the other operand, Embedded Wizard reported warnings about mixing signed/unsigned operators although the literal could be converted in the correct version without sign/precision lose. From this arised the problem, that comparing intX operands with a literal > 65535 was considered as unsigned compare operation resulting in wrong if/else conditions.

Graphics Engine: Using the function EwTileBitmap() with a negative aSrcPos value caused the offset calculation within the source bitmap to result in wrong values. The module division with negative values was the problem. In worst case, the operation displayed the preceding bitmap frame.

Font Converter: Fix for a bug in the font conversion with fonts (e.g. Roboto Condensed) having the space 0x0020 glyphs equal to the default glyph. In such case, the font converter has eliminated the space glyph. The resulting text output worked well except justified text, which instead of the 0x0020 code for the space glyph sees the code of the default glyph. The justified mode does not work anymore with such a font. Also glyph 0x00A0 is not disposed even if it is equal to the default glyph.

Code Editor: The Code Editor is improved to handle the Text-Indent-Left operation correctly. Now the user can indent a line without selecting it previously. If a line is selected, the indent operation affects only this line and not the following one.

Code Editor: Correct restoring of focus within Code Editor, when user switches between Embedded Wizard Studio and other applications.

Win32 Platform Package: Fix for Windows 7 problem with message queues. The Windows function GetQueueStatus() does not work as expected causing the application to block in an endless loop if there are pending idle signals!

Mosaic: Fix for endless iteration when using Views::Text view with an associated OnUpdate slot method and the text view is configured with no text (empty string) and the OnUpdate slot method tries to query the content area (by calling the method GetContentArea()).

Win32 Platform Package: Fix for mouse coordinates overflow with the Win32 Platform Package when the user moves the mouse pointer above the upper edge of the window or left to the window.

WebGL Code Generator: WebGL Code Generator adapted to not obfuscate the function GetAutoObject(), which is necessary for user own native code when accessing Chora generated objects.

Font Converter: Fix for imprecise font metrics resulting from the font conversion by using the Microsoft font engine. Depending on the desired font height (the attribute Height of the font resource) the following condition was not always true ( Height == Ascent + Descent ). Accordingly multi-line text was displayed with minimally incorrect distance between the text rows. The fix adjusts the Ascent and Descent values so the above equation is true again. The size of the glyphs, however, remains unchanged.

Graphics Engine: Fix for drawing a border with width > 1 pixel and color gradient. In the previous version the edges of the border were displayed with wrong colors. The Graphics Engines are adapted to support the DrawBorder() operation natively instead of executing it in Mosaic. Mosaic modified to use the new DrawBorder() function of the Graphics Engine.

Chora: array bug is fixed. In the previous versions it was possible by using the Inspector to configure an array with initialization values and then to shrink the array size. The values, however, has been retained and (!!!) were generated. Only during prototyping the incorrect values were reported. The new version contains various improvements to handle the arrays better. Primarily, incorrect initialization values in Inspector are reported now during prototyping and during code generation. Additionally the affected values are highlighted with red color in Inspector. Moreover the Chora compiler verifies the array index values (if these are constant) already during the compilation time and reports errors about the possible access out of array boundary.

Assistants: Assistants corrected to handle bitmap resources in the right way. Especially Alpha-Only bitmaps are displayed now as expected with gray colors corresponding to the opacity instead of as white rectangles. Bitmap resources configured with two bitmap files (for color and opacity information) are also handled correctly now.

Mosaic: Fix for arithmetic overflow bug when using FindViewInDirection() and the coordinates of the views are very-very large.

Inspector Assistant: Bug with Inspector Assistant fixed. When the Assistant was opened and the user clicked on another property or attribute within the Inspector window, the Assistant disappeared leaving the previously selected property or attribute empty. This, in turn, caused Chora errors. Moreover, when while the Assistant was visible the user drags any of the splitters in the Inspector window, the Assistant remained visible without adapting its position/size. Now, the Assistant disappears regardless where the user clicks outside the Assistant area.

Graphics Engine: Bug-fix for WarpBitmap operation not working correctly when using fractions .5 .. .62 in the coordinates. In such case one pixel wide row/column was missing in the resulting output leading to gaps when two objects are arranged side by side.

Mosaic: Bug-fix in animation effects. When the playback direction of the animation is changed (by setting its property Reversed) while the animation is active, the animation skipped sometimes to the start or end position before continue with the new playback direction.

Mosaic: Attributed Text view corrected to allow the user to call methods like GetContentArea() at any time.

Code Generator: Fix for the crash in target system when using an application generated without Optimization (or with optimization low). In such case the order of variables within a class was not optimized resulting in DWORD variables being arranged at accessed at non-DWORD boundaries. Now, the optimization step to re-arrange the variables is applied regardless of the selected optimization level.

Mosaic: Bug-fix for incorrectly displayed text if the original string was terminated with a special sign ~ , ^ or \xAD. In such case the last text row or the entire text was not displayed!

JavaScript Code Generator: Local arrays declared with the handle data type were generated erroneously.

Code Editor: Bug-fix for Code Editor Assistant when just before it has been activated the user has selected text in the editor. In the corrected version the selected text is deleted after the user has made the selection in the Assistant window. When the Assistant is closed without any selection, the original editor selection is restored.

Composer: The automatic scrolling after selecting a member in Composer window is avoided now if the member is already partially visible.

Mosaic: Bug-fix to prevent cursor deflection when trying to do this after the user has released the finger. This could cause the new cursor target to receive a DOWN event without the corresponding UP even and endless recursions in event delivery. Now cursor deflection works only as long as the user continues touching the screen.

Prototyper: Bug-fix for an error when the switch-statement is used with an selection-expression consisting of an integer to enum conversion. In such case the conversion failed in the prototyping environment. Generated code, in turn, worked properly.

Mosaic: Bug-fix for incorrectly right aligned text with italic fonts. Affects normal Text view and the Attributed Text view.

Graphics Engine: Bug-fix in software emulated WarpBitmap routine to allow the calculation with large coordinates > 4000 pixel. With the original implementation the large coordinates might cause integer overflows resulting in invalid indices into the texture bitmap.

Runtime Environment: The declaration of the RTE function EwGetLanguage() and EwSetLanguage() adapted to use the correct XLangId data type instead of int.

Studio: Bug-Fix for fatal error caused by an ignored exception. When the user has selected the command Restore Value and previously the actual class has been modified without being reloaded, the Restore Value operation forced the class to be reloaded. With this operation existing objects have been released. The implementation, however, continued to use one of the released objects to send update-notifications. Evaluation the object in an notification-handler caused access violation

Studio: Workaround for potential problem with auto-save starting while code generation. Now auto-save is suppressed during code generation.

Compiler Warnings: Elimination of several C warnings reported from different C compiles within Graphics Engine, Runtime Environment and generated C code.

Charts Widgets: Bug-fix in GetRecord() and GetCoord() to return the desired entry.

Flat Widgets: Bug-fix in all formatValueString() methods to support negative values.