WebRadioApp  0.1
ewrte.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * E M B E D D E D W I Z A R D P R O J E C T
4  *
5  * Copyright (c) TARA Systems
6  *GmbH written by Paul Banach and Manfred Schweyer
7  *
8  ********************************************************************************
9  *
10  * This software and related documentation ("Software") are intellectual
11  * property owned by TARA Systems and are copyright of TARA Systems.
12  * Any modification, copying, reproduction or redistribution of the Software in
13  * whole or in part by any means not in accordance with the End-User License
14  * Agreement for Embedded Wizard is expressly prohibited. The removal of this
15  * preamble is expressly prohibited.
16  *
17  ********************************************************************************
18  *
19  * DESCRIPTION:
20  * This is the main header file of the Embedded Wizard Runtime Environment
21  * EWRTE. This environment consists of functions, type definitions and 'C'
22  * macros used inside the automatic generated 'C' code. It allows the user
23  * to compile and run the automatic generated 'C' code.
24  *
25  *******************************************************************************/
26 
27 #ifndef EWRTE_H
28 #define EWRTE_H
29 
30 /* Include platform specific configuration file */
31 #include <ewconfig.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /* The current version of the Runtime Environment. */
38 #define EW_RTE_VERSION 0x000A0000
39 
40 /* Assigning zero (0) to the EW_PRINT_MEMORY_USAGE macro should turn it off
41  as if the macro had not been defined. Otherwise if the macro is defined
42  without any value, the option is enabled per default. */
43 #if defined EW_PRINT_MEMORY_USAGE && ((1 - EW_PRINT_MEMORY_USAGE - 1) == 0)
44 #undef EW_PRINT_MEMORY_USAGE
45 #endif
46 
47 /* Assigning zero (0) to the EW_PRINT_GFX_TASKS macro should turn it off as
48  if the macro had not been defined. Otherwise if the macro is defined without
49  any value, the option is enabled per default. */
50 #if defined EW_PRINT_GFX_TASKS && ((1 - EW_PRINT_GFX_TASKS - 1) == 0)
51 #undef EW_PRINT_GFX_TASKS
52 #endif
53 
54 /* For compatibility with older version: re-building the Graphics engine with
55  the EW_PRINT_GFX_TASKS macro defined should activate the mode
56  EW_SUPPORT_GFX_TASK_TRACING */
57 #if defined EW_PRINT_GFX_TASKS && !defined EW_SUPPORT_GFX_TASK_TRACING
58 #define EW_SUPPORT_GFX_TASK_TRACING
59 #endif
60 
61 /* Assigning zero (0) to the EW_PRINT_PERF_COUNTERS macro should turn it off as
62  if the macro had not been defined. Otherwise if the macro is defined without
63  any value, the option is enabled per default. */
64 #if defined EW_PRINT_PERF_COUNTERS && ((1 - EW_PRINT_PERF_COUNTERS - 1) == 0)
65 #undef EW_PRINT_PERF_COUNTERS
66 #endif
67 
68 /* Assigning zero (0) to the EW_RUN_BENCHMARK_SHORT macro should turn it off as
69  if the macro had not been defined. Otherwise if the macro is defined without
70  any value, the option is enabled per default. */
71 #if defined EW_RUN_BENCHMARK_SHORT && ((1 - EW_RUN_BENCHMARK_SHORT - 1) == 0)
72 #undef EW_RUN_BENCHMARK_SHORT
73 #endif
74 
75 /* Assigning zero (0) to the EW_RUN_BENCHMARK_FULL macro should turn it off as
76  if the macro had not been defined. Otherwise if the macro is defined without
77  any value, the option is enabled per default. */
78 #if defined EW_RUN_BENCHMARK_FULL && ((1 - EW_RUN_BENCHMARK_FULL - 1) == 0)
79 #undef EW_RUN_BENCHMARK_FULL
80 #endif
81 
82 /* Assigning zero (0) to the EW_RUN_VERIFICATION macro should turn it off as
83  if the macro had not been defined. Otherwise if the macro is defined without
84  any value, the option is enabled per default. */
85 #if defined EW_RUN_VERIFICATION && ((1 - EW_RUN_VERIFICATION - 1) == 0)
86 #undef EW_RUN_VERIFICATION
87 #endif
88 
89 /* Following EW_ENABLE_PROFILER macro exists for compatibility only */
90 #if defined EW_ENABLE_PROFILER && !defined EW_PRINT_MEMORY_USAGE
91 #define EW_PRINT_MEMORY_USAGE
92 #endif
93 
94 /* The Runtime Environment and the Graphics Engine allow creation of 64-Bit
95  applications - this however only for the LP64 model (used by UNIX systems or
96  Apple iOS / macOS). Other models are currently not supported. */
97 #if defined __ILP64__ || defined __LLP64__ || defined _WIN64 || \
98  defined _ILP64 || defined _LLP64
99 #error "The 64-bit model of your compiler is not supported. Use LP64 model."
100 #endif
101 
102 /******************************************************************************
103  * CONFIG MACRO:
104  * EW_MAX_STRING_CACHE_SIZE
105  *
106  * DESCRIPTION:
107  * The following macro exists for configuration purpose of the size of the
108  * string cache. As soon as cache has reached the specified size, the cache is
109  * cleaned. The macro should be configured in the ewconfig.h file or in the
110  * Make file.
111  *
112  ******************************************************************************/
113 
114 /* If not explicitly specified, assume following default value for the maximum
115  string constant cache size (in bytes) */
116 #ifndef EW_MAX_STRING_CACHE_SIZE
117 #define EW_MAX_STRING_CACHE_SIZE 0x00008000
118 #endif
119 
120 /* Validate the maximum string cache size */
121 #if ((EW_MAX_STRING_CACHE_SIZE < 0x00000000) || \
122  (EW_MAX_STRING_CACHE_SIZE > 0x00100000))
123 #error "The maximum string constant cache size out of range."
124 #endif
125 
126 /******************************************************************************
127  * CONFIG VARIABLE:
128  * EwMaxStringCacheSize
129  *
130  * DESCRIPTION:
131  * The following variable exists for configuration purpose of the size of the
132  * string cache. As soon as cache has reached the specified size, the cache is
133  * cleaned. The variable should be modified just before the application is
134  * initialized.
135  *
136  ******************************************************************************/
137 extern int EwMaxStringCacheSize; /* = EW_MAX_STRING_CACHE_SIZE macro */
138 
139 /*******************************************************************************
140  * MACRO:
141  * EW_WARNING
142  * EW_ERROR
143  * EW_PANIC
144  *
145  * DESCRIPTION:
146  * The following macros serve for error handling in the Runtime Environment
147  * and the Graphics Engine. The macros print out error messages with the file
148  * name and the line number, where the problem has occurred. The last macro
149  * EW_PANIC also causes the application to terminate immediately.
150  *
151  * All macros support arguments, which can be referred from the message by
152  * using the standard printf() escape sequence.
153  *
154  * ARGUMENTS:
155  * aMsg - Zero-terminated string containing the message and optional printf()
156  * escape sequences for the parameters aArg1, aArg2 and aArg3.
157  * aArg1,
158  * aArg2,
159  * aArg3 - Optional arguments for the message to print out.
160  *
161  * RETURN VALUE:
162  * None. EW_PANIC never returns!
163  *
164  *******************************************************************************/
165 #define EW_WARNING(aMsg) \
166  EwPrint("[WARNING in %s:%d] ", __FILE__, __LINE__), EwPrint(aMsg), \
167  EwPrint("\n")
168 
169 #define EW_WARNING_1(aMsg, aArg1) \
170  EwPrint("[WARNING in %s:%d] ", __FILE__, __LINE__), EwPrint(aMsg, aArg1), \
171  EwPrint("\n")
172 
173 #define EW_WARNING_2(aMsg, aArg1, aArg2) \
174  EwPrint("[WARNING in %s:%d] ", __FILE__, __LINE__), \
175  EwPrint(aMsg, aArg1, aArg2), EwPrint("\n")
176 
177 #define EW_WARNING_3(aMsg, aArg1, aArg2, aArg3) \
178  EwPrint("[WARNING in %s:%d] ", __FILE__, __LINE__), \
179  EwPrint(aMsg, aArg1, aArg2, aArg3), EwPrint("\n")
180 
181 #define EW_ERROR(aMsg) \
182  EwPrint("[ERROR in %s:%d] ", __FILE__, __LINE__), EwPrint(aMsg), \
183  EwPrint("\n")
184 
185 #define EW_ERROR_1(aMsg, aArg1) \
186  EwPrint("[ERROR in %s:%d] ", __FILE__, __LINE__), EwPrint(aMsg, aArg1), \
187  EwPrint("\n")
188 
189 #define EW_ERROR_2(aMsg, aArg1, aArg2) \
190  EwPrint("[ERROR in %s:%d] ", __FILE__, __LINE__), \
191  EwPrint(aMsg, aArg1, aArg2), EwPrint("\n")
192 
193 #define EW_ERROR_3(aMsg, aArg1, aArg2, aArg3) \
194  EwPrint("[ERROR in %s:%d] ", __FILE__, __LINE__), \
195  EwPrint(aMsg, aArg1, aArg2, aArg3), EwPrint("\n")
196 
197 #define EW_PANIC(aMsg) \
198  EwPrint("[FATAL ERROR in %s:%d] ", __FILE__, __LINE__), EwPrint(aMsg), \
199  EwPrint("\n"), EwPanic()
200 
201 #define EW_PANIC_1(aMsg, aArg1) \
202  EwPrint("[FATAL ERROR in %s:%d] ", __FILE__, __LINE__), \
203  EwPrint(aMsg, aArg1), EwPrint("\n"), EwPanic()
204 
205 #define EW_PANIC_2(aMsg, aArg1, aArg2) \
206  EwPrint("[FATAL ERROR in %s:%d] ", __FILE__, __LINE__), \
207  EwPrint(aMsg, aArg1, aArg2), EwPrint("\n"), EwPanic()
208 
209 #define EW_PANIC_3(aMsg, aArg1, aArg2, aArg3) \
210  EwPrint("[FATAL ERROR in %s:%d] ", __FILE__, __LINE__), \
211  EwPrint(aMsg, aArg1, aArg2, aArg3), EwPrint("\n"), EwPanic()
212 
213 /*******************************************************************************
214  * MACRO:
215  * EW_SHIFT
216  * EW_ROTATE
217  *
218  * DESCRIPTION:
219  * The both EW_SHIFT and EW_ROTATE macros provide a kind of universal bit
220  *shift and rotation operations. The macros are intended to calculate with
221  *constant number of sift/rotation steps. In this case the 'C' preprocessor can
222  *apply the best possible mode to perform the operation.
223  *
224  * ARGUMENTS:
225  * aValue - Value to shift or rotate.
226  * aSteps - Number of bits to shift/rotate. If aSteps < 0, the value is shifed
227  * or rotated to the left. If aSteps > 0, the value is rotated to the right.
228  *
229  * RETURN VALUE:
230  * Returns the shifted or rotated value.
231  *
232  *******************************************************************************/
233 #define EW_SHIFT(aValue, aBits) \
234  (((aBits) < 0) ? ((aValue) << -(aBits)) : ((aValue) >> (aBits)))
235 
236 #define EW_ROTATE(aValue, aBits) \
237  ((aBits) ? (((aValue) >> (aBits)) | ((aValue) << ((32 - (aBits)) % 32))) \
238  : (aValue))
239 
240 /*******************************************************************************
241  * TYPE:
242  * XObject
243  * XClass
244  * XHandle
245  *
246  * DESCRIPTION:
247  * The type XObject defines the fundamental set of data fields necessary to
248  * keep an object alive and to manage it. All Embedded Wizard objects use
249  * XObject internally. XObject can be compared to the root of all Embedded
250  * Wizard objects.
251  *
252  * The second type XClass does represent a Chora class definition. It contains
253  * a pointer to the data structure, where the class and its VMT is described.
254  *
255  * The third type XHandle represents an abstract pointer or handle within the
256  * target system.
257  *
258  * ELEMENTS:
259  * _VMT - Pointer to a virtual method table (VMT) associated to the object.
260  * The _VMT contains a list of methods supported by the object and an
261  * additional description of the class the objects belongs to:
262  * class name, objects size in bytes and a reference to the next base class
263  * in the inheritance tree.
264  * _Mark - _Mark is used internally by the Garbage Collector. During the mark
265  * phase, the Garbage Collector collects all objects within a global mark
266  * list. Thereupon all objects not belonging to this list all considered as
267  * garbage.
268  * _Link - Pointer to the higher object in which this object is aggregated in
269  * (embedded). Aggregated objects will be stored (embedded) in the memory
270  * block of the higher object together with its other data fields. _Link is
271  * important to recognize relationships between aggregated objects and will
272  * be used by the Garbage Collector. If this object has not been aggregated
273  * in an other object _Link is NULL.
274  * _GCT - Pointer to a table associated to the object and used during the
275  * mark phase of the Garbage Collection. The table is really a VMT. See the
276  * definition of the structure _vmt_XObject and its field _GCInfo for more
277  * details.
278  *
279  *******************************************************************************/
280 struct _vmt_XObject;
281 struct _obj_XObject {
282  struct {
283  const struct _vmt_XObject *VMT;
286  const struct _vmt_XObject *GCT;
287  } _;
288 };
289 typedef struct _obj_XObject *XObject;
290 typedef const void *XClass;
291 typedef unsigned long XHandle;
292 
293 /*******************************************************************************
294  * TYPE:
295  * _vmt_XObject
296  *
297  * DESCRIPTION:
298  * The type _vmt_XObject defines the fundamental structure of a virtual method
299  * table VMT and will be used to describe a class. All Embedded Wizard objects
300  * uses _vmt_XObject internally. _vmt_XObject can be compared to the VMT of
301  * the root class of all Embedded Wizard classes.
302  *
303  * ELEMENTS:
304  * _MagicNo - Number identifying the kind of the VMT: class or class variant.
305  * _Name - The name of the class as a zero terminated string (for debugging
306  * purpose and test only).
307  * _Ancestor - Reference to the next base class (the super class) of this
308  *class in the inheritance tree. If there is no further super classes, _Ancestor
309  * will point to the global __vmt_XObject data structure. This global data
310  * structure is the root of all Embedded Wizard objects.
311  * _SubVariants - Pointer to the null terminated list of variants derived from
312  * this class. During the creation of an object, this list is evaluated in
313  * order to find and use the appropriate variant.
314  * _Size - The size of an object instance in bytes. _Size will be used by the
315  * EwNewObject() function to determine the number of bytes to reserve for
316  * a new object instance of this class.
317  * _GCInfo - An array with offsets to allow the Garbage Collector to access
318  * and evaluate data fields containing references to other objects. For
319  * optimization purpose the data fields are grouped together starting with
320  * all members containing ordinary pointers to other objects. Then follow
321  * members where slots are stored. Then follow all data members containing
322  * property references followed then by embedded objects. Finally members
323  * containing references to strings are found. The array thus consist of 6
324  * entries:
325  * #0 : Offset to the first variable/array/property containing a pointer
326  * to another object.
327  * #1 : Offset to the first variable/array/property containing a slot.
328  * #2 : Offset to the first variable/array/property containing a property
329  * reference.
330  * #3 : Offset to first embedded object.
331  * #4 : Offset to first string.
332  * #5 : Offset to the first data field not containing any references to
333  * other objects nor strings.
334  * _Init - Pointer to the _Init() method. The _Init() method will be invoked
335  * to initialize a new object instance. (see below for details).
336  * _ReInit - Pointer to the _ReInit() method. The _ReInit() method will be
337  * invoked to re-initialize an object instance after the language has been
338  * changed. (see below for details).
339  * _Done - Pointer to the _Done() method. The _Done() method will be invoked
340  * to deinitialize an object if the object is not used anymore. (see below
341  * for details).
342  *
343  *******************************************************************************/
344 struct _XClassVariant;
345 struct _vmt_XObject {
346  unsigned int _MagicNo;
347  const char *_Name;
348  const struct _vmt_XObject *_Ancestor;
350  int _Size;
351  int _GCInfo[6];
352  void (*_Init)(XObject _this, XObject aLink, XHandle aArg);
353  void (*_ReInit)(XObject _this);
354  void (*_Done)(XObject _this);
355 };
356 extern const struct _vmt_XObject __vmt_XObject;
357 
358 /*******************************************************************************
359  * TYPE:
360  * XClassVariant
361  *
362  * DESCRIPTION:
363  * The structure XClassVariant is used to describe a multivariant class. A
364  *list of such structures store links to derived sub variants of the origin
365  *class. The end of the list should be signed with a zero entry.
366  *
367  * ELEMENTS:
368  * Style - The style, the class variant 'Variant' is used for. Style == 0
369  * does terminate the list. Style == 0 also signs a static class variant. A
370  * static class variant overrides the origin class permanently.
371  * Variant - The pointer to the affected class variant.
372  *
373  *******************************************************************************/
375  int Style;
376  const struct _vmt_XObject *Variant;
377 };
379 
380 /*******************************************************************************
381  * MACRO:
382  * EW_DECLARE_CLASS
383  *
384  * DESCRIPTION:
385  * The macro EW_DECLARE_CLASS allows a forward declaration of the class aClass
386  * so the name of this class can be used in the definition of data fields and
387  * methods in an other class.
388  *
389  * ARGUMENTS:
390  * aClass - The name of the class to be declared.
391  *
392  *******************************************************************************/
393 #define EW_DECLARE_CLASS(aClass) \
394  struct _obj_##aClass; \
395  typedef struct _obj_##aClass *aClass;
396 
397 /*******************************************************************************
398  * MACRO:
399  * EW_DEFINE_FIELDS
400  * EW_END_OF_FIELDS
401  * EW_VARIABLE
402  * EW_PROPERTY
403  * EW_OBJECT
404  * EW_ARRAY
405  * EW_VTHISPTR
406  *
407  * DESCRIPTION:
408  * These macros have been defined to hide the complexity of the internal
409  * structure of an Embedded Wizard object. The usage of these macros makes
410  * the generatated 'C' code more independent from the used 'C' compiler and
411  * makes it readable for the human.
412  *
413  * The macro EW_DEFINE_FIELDS starts the definition of data fields contained
414  * in objects of the class aClass. The data fields defined in the base class
415  * aSuperClass will be taken over automatically and stored in the field
416  *_Super.
417  *
418  * EW_DEFINE_FIELDS defines an object template only. Using this template it is
419  * possible to access data fields of the object similary to access a member of
420  * a 'C' structure. The names and types of the data fields will be specified
421  * by the macros EW_VARIABLE, EW_PROPERTY, EW_OBJECT and EW_ARRAY.
422  *
423  * The macro EW_VTHISPTR is used by multivariant classes only, to define the
424  * pointer to the used object variant.
425  *
426  * See the example below:
427  *
428  * EW_DEFINE_FIELDS( MyClass, XObject )
429  * EW_VARIABLE( Next, MyClass )
430  * EW_VARIABLE( Prev, MyClass )
431  * EW_PROPERTY( Visible, int )
432  * EW_ARRAY ( Matrix, char, [8][6])
433  * EW_END_OF_FIELDS( MyClass )
434  *
435  * At the end of the data fields definition the macro EW_END_OF_FIELDS has to
436  * occure.
437  *
438  * ARGUMENTS:
439  * aClass - The name of the class the data fields will be defined for.
440  * aSuperClass - The name of the next base class (the super class) of this
441  * class in the inheritance tree. If there is no further super classes,
442  * aSuperClass will get the name XObject (the root class of all Embedded
443  * Wizard objects).
444  * aName - The name of the data field (the name of a variable,
445  *property, array or an aggregated (embedded) object). aType - The type
446  *of the data field (int, long, float,..., etc.) aObjectClass - The class name
447  *of an aggregated object. aArraySize - The number of entries to stora in an
448  *array.
449  *
450  *******************************************************************************/
451 #define EW_DEFINE_FIELDS(aClass, aSuperClass) \
452  struct _vmt_##aClass; \
453  struct _obj_##aClass { \
454  union { \
455  const struct _vmt_##aClass *VMT; \
456  struct _obj_XObject XObject; \
457  struct _obj_##aSuperClass Super; \
458  } _;
459 
460 #define EW_END_OF_FIELDS(aClass) \
461  } \
462  ;
463 
464 #define EW_VARIABLE(aName, aType) aType aName;
465 
466 #define EW_PROPERTY(aName, aType) aType aName;
467 
468 #define EW_OBJECT(aName, aObjectClass) struct _obj_##aObjectClass aName;
469 
470 #define EW_ARRAY(aName, aType, aArraySize) aType aName aArraySize;
471 
472 #define EW_VTHISPTR() XObject _vthis;
473 
474 #define _Super _.Super
475 #define _VMT _.VMT
476 #define _XObject _.XObject
477 #define _Link _.Link
478 #define _Mark _.Mark
479 #define _GCT _XObject._.GCT
480 
481 /*******************************************************************************
482  * MACRO:
483  * EW_DEFINE_METHODS
484  * EW_END_OF_METHODS
485  * EW_METHOD
486  * EW_USE_METHOD
487  *
488  * DESCRIPTION:
489  * These macros have been defined to hide the complexity of the internal
490  * structure of a virtual method table (VMT). The usage of these macros makes
491  * the generatated 'C' code more independent from the used 'C' compiler and
492  * makes it readable for the human.
493  *
494  * The macro EW_DEFINE_METHODS starts the list of method names supported by
495  * the class aClass. Each entry of the method list should be defined using
496  * the macro EW_METHOD. Because of the macro EW_DEFINE_METHODS takes care
497  * about the definition of the three fundamental methods _Init(), _Done() and
498  * _ReInit() it is no necessary to define them explicitly.
499  *
500  * EW_DEFINE_METHODS defines a template only. Using this template it is
501  * possible to invoke methods similary to calling functions via a function
502  * pointers in 'C'. The names of the methods will be specified by the macro
503  * EW_METHOD. See the example below:
504  *
505  * EW_DEFINE_METHODS( MyClass, XObject )
506  * EW_METHOD( IsVisible, int )( void )
507  * EW_METHOD( Draw, void )( int aX, int aY )
508  * EW_METHOD( HandleEvent, void )( CoreEvent aEvent )
509  * EW_END_OF_METHODS( MyClass )
510  *
511  * At the end of the methods definition the macro EW_END_OF_METHODS has to
512  * occure.
513  *
514  * ARGUMENTS:
515  * aClass - The name of the class the method list will be defined for.
516  * aSuperClass - The name of the next base class (the super class) of this
517  * class in the inheritance tree. If there is no further super classes,
518  * aSuperClass will get the name XObject (the root class of all Embedded
519  * Wizard objects).
520  * aName - The name of the method to be defined in EW_METHOD macro.
521  * aType - The return type of the method.
522  *
523  *******************************************************************************/
524 #define EW_DEFINE_METHODS(aClass, aSuperClass) \
525  void aClass##__Init(aClass _this, XObject aLink, XHandle aArg); \
526  void aClass##__ReInit(aClass _this); \
527  void aClass##__Done(aClass _this); \
528  struct _vmt_##aClass { \
529  unsigned int _MagicNo; \
530  const char *_Name; \
531  const struct _vmt_##aSuperClass *_Ancestor; \
532  const struct _XClassVariant *_SubVariants; \
533  int _Size; \
534  int _GCInfo[6]; \
535  void (*_Init)(aClass _this, XObject aLink, XHandle aArg); \
536  void (*_ReInit)(aClass _this); \
537  void (*_Done)(aClass _this)
538 
539 #define EW_END_OF_METHODS(aClass) \
540  ; \
541  int _Reserved; \
542  } \
543  ; \
544  extern const struct _vmt_##aClass __vmt_##aClass; \
545  extern const int __vthis_##aClass;
546 
547 #define EW_METHOD(aName, aType) \
548  ; \
549  aType(*aName)
550 
551 #define EW_USE_METHOD(aName) (void *)aName,
552 
553 /*******************************************************************************
554  * MACRO:
555  * EW_DEFINE_CLASS
556  * EW_END_OF_CLASS
557  *
558  * DESCRIPTION:
559  * These macros have been defined to hide the complexity of the internal
560  * structure of a virtual method table (VMT). The usage of these macros makes
561  * the generatated 'C' code more independent from the used 'C' compiler and
562  * makes it readable for the human.
563  *
564  * By using these macros the global VMT associated to the class aClass will be
565  * initialized. Every class will be described by its own global VMT. This VMT
566  * contains a set of pointers to methods supported by the class and a pointer
567  * to the VMT of its next base class in the inheritance tree. Using the
568  * pointers it is possible to invoke the methods similary to calling functions
569  * in 'C'. See the example below:
570  *
571  * EW_DEFINE_CLASS( MyDerivedClass, MyClass )
572  * MyClass_IsVisible,
573  * MyClass_Draw,
574  * MyDerivedClass_HandleEvent,
575  * EW_END_OF_CLASS( MyDerivedClass )
576  *
577  * The macro EW_DEFINE_CLASS initializes a data structure only. The necessary
578  * structure template has to be defined previously using the macros
579  * EW_DEFINE_METHODS, EW_END_OF_METHODS, etc.
580  *
581  * ARGUMENTS:
582  * aClass - The name of the class the VMT will be defined for.
583  * aSuperClass - The name of the next base class (the super class) of this
584  * class in the inheritance tree. If there is no further super classes,
585  * aSuperClass will get the name XObject (the root class of all Embedded
586  * Wizard objects).
587  * aGCInfo0 ..
588  * aGCInfo5 - Names of data members enclosing fields where references to
589  * other objects are stored. This information is used by Garbage Collector
590  * to evaluate dependencies between objects.
591  * aName - The name of the class in the Chora notation with :: signs.
592  *
593  *******************************************************************************/
594 #define EW_DEFINE_CLASS(aClass, aSuperClass, aGCInfo0, aGCInfo1, aGCInfo2, \
595  aGCInfo3, aGCInfo4, aGCInfo5, aName) \
596  const int __vthis_##aClass = sizeof(struct _obj_##aSuperClass); \
597  const struct _vmt_##aClass __vmt_##aClass = { \
598  0x434C4153, aName, &__vmt_##aSuperClass, _vof_##aClass, \
599  sizeof(struct _obj_##aClass), \
600  {(int)(unsigned long)&((aClass)0)->aGCInfo0, \
601  (int)(unsigned long)&((aClass)0)->aGCInfo1, \
602  (int)(unsigned long)&((aClass)0)->aGCInfo2, \
603  (int)(unsigned long)&((aClass)0)->aGCInfo3, \
604  (int)(unsigned long)&((aClass)0)->aGCInfo4, \
605  (int)(unsigned long)&((aClass)0)->aGCInfo5}, \
606  aClass##__Init, aClass##__ReInit, aClass##__Done,
607 
608 #define EW_END_OF_CLASS(aClass) \
609  0 \
610  } \
611  ;
612 
613 #define _None _.VMT
614 
615 /*******************************************************************************
616  * MACRO:
617  * EW_DEFINE_VFIELDS
618  * EW_END_OF_VFIELDS
619  *
620  * DESCRIPTION:
621  * These macros have been defined to hide the complexity of the internal
622  * structure of an Embedded Wizard object variant. The usage of these macros
623  * makes the generatated 'C' code more independent from the used 'C' compiler
624  * and makes it readable for the human.
625  *
626  * The macro EW_DEFINE_VFIELDS starts the definition of data fields contained
627  * in instances of the class variant aClass. The data fields defined in the
628  * base class aSuperClass will be taken over automatically and stored in the
629  * field _Super.
630  *
631  * EW_DEFINE_VFIELDS defines an object template only. Using this template it
632  *is possible to access data fields of the object similary to access a member of
633  * a 'C' structure. The names and types of the data fields will be specified
634  * by the macros EW_VARIABLE, EW_PROPERTY, EW_OBJECT and EW_ARRAY (See above).
635  *
636  * At the end of the data fields definition the macro EW_END_OF_VFIELDS has to
637  * occure.
638  *
639  * ARGUMENTS:
640  * aClass - The name of the class variant, the data fields will be
641  * defined for.
642  * aSuperClass - The name of the next base class variant (the super class) of
643  * this class variant in the inheritance tree. If there is no further super
644  * classes, aSuperClass will get the name XObject (the root class of all
645  * objects).
646  * aOriginClass - The name of the origin class. This is the class, the variant
647  * is derived from (not the immediate base class).
648  *
649  *******************************************************************************/
650 #define EW_DEFINE_VFIELDS(aClass, aSuperClass, aOriginClass) \
651  struct _vmt_##aClass; \
652  struct _obj_##aClass { \
653  union { \
654  const struct _vmt_##aClass *VMT; \
655  struct _obj_XObject XObject; \
656  struct _obj_##aSuperClass Super; \
657  } _;
658 
659 #define EW_END_OF_VFIELDS(aClass) \
660  } \
661  ; \
662  typedef struct _obj_##aClass *aClass;
663 
664 /*******************************************************************************
665  * MACRO:
666  * EW_DEFINE_VMETHODS
667  * EW_END_OF_VMETHODS
668  *
669  * DESCRIPTION:
670  * These macros have been defined to hide the complexity of the internal
671  * structure of a virtual method table (VMT). The usage of these macros makes
672  * the generatated 'C' code more independent from the used 'C' compiler and
673  * makes it readable for the human.
674  *
675  * The macro EW_DEFINE_VMETHODS starts the list of method names supported by
676  * the class variant aClass. Each entry of the method list should be defined
677  * using the macro EW_METHOD. Because of the macro EW_DEFINE_VMETHODS takes
678  * care about the definition of the three fundamental methods _Init(), _Done()
679  * and _ReInit() it is no necessary to define them explicitly.
680  *
681  * EW_DEFINE_VMETHODS defines a template only. Using this template it is
682  * possible to invoke methods similary to calling functions via a function
683  * pointers in 'C'. The names of the methods will be specified by the macro
684  * EW_METHOD (See above).
685  *
686  * At the end of the methods definition the macro EW_END_OF_VMETHODS has to
687  * occure.
688  *
689  * ARGUMENTS:
690  * aClass - The name of the class variants the method list will be
691  * defined for.
692  * aSuperClass - The name of the next base class variant (the super class) of
693  * this class variant in the inheritance tree. If there is no further super
694  * classes, aSuperClass will get the name XObject (the root class of all
695  * object variants).
696  * aOriginClass - The name of the origin class. This is the class, the variant
697  * is derived from (not the immediate base class).
698  *
699  *******************************************************************************/
700 #define EW_DEFINE_VMETHODS(aClass, aSuperClass, aOriginClass) \
701  void aClass##__Init(aOriginClass _this, XObject aLink, XHandle aArg); \
702  void aClass##__ReInit(aOriginClass _this); \
703  void aClass##__Done(aOriginClass _this); \
704  struct _vmt_##aClass { \
705  unsigned int _MagicNo; \
706  const char *_Name; \
707  const struct _vmt_##aSuperClass *_Ancestor; \
708  const XClassVariant *_SubVariants; \
709  int _Size; \
710  int _GCInfo[6]; \
711  void (*_Init)(aOriginClass _this, XObject aLink, XHandle aArg); \
712  void (*_ReInit)(aOriginClass _this); \
713  void (*_Done)(aOriginClass _this)
714 
715 #define EW_END_OF_VMETHODS(aClass) \
716  ; \
717  int _Reserved; \
718  } \
719  ; \
720  extern const struct _vmt_##aClass __vmt_##aClass;
721 
722 /*******************************************************************************
723  * MACRO:
724  * EW_DEFINE_VCLASS
725  * EW_END_OF_VCLASS
726  *
727  * DESCRIPTION:
728  * These macros have been defined to hide the complexity of the internal
729  * structure of a virtual method table (VMT). The usage of these macros makes
730  * the generatated 'C' code more independent from the used 'C' compiler and
731  * makes it readable for the human.
732  *
733  * By using these macros the global VMT associated to the class variant aClass
734  * will be initialized. Every class variant will be described by its own
735  *global VMT. This VMT contains a set of pointers to methods supported by the
736  *class variant and a pointer to the VMT of its origin class. Using the pointers
737  *it is possible to invoke the methods similary to calling functions in 'C'.
738  *
739  * The macro EW_DEFINE_VCLASS initializes a data structure only. The necessary
740  * structure template has to be defined previously using the macros
741  * EW_DEFINE_VMETHODS, EW_END_OF_VMETHODS, etc.
742  *
743  * ARGUMENTS:
744  * aClass - The name of the class variant, the VMT will be defined for.
745  * aSuperClass - The name of the next base class variant (the super class) of
746  * this class variant in the inheritance tree. If there is no further super
747  * classes, aSuperClass will get the name XObject (the root class of all
748  * object variants).
749  * aOriginClass - The name of the origin class. This is the class, the variant
750  * is derived from (not the immediate base class).
751  * aGCInfo0 ..
752  * aGCInfo5 - Names of data members enclosing fields where references to
753  * other objects are stored. This information is used by Garbage Collector
754  * to evaluate dependencies between objects.
755  * aName - The name of the class variant in the Chora notation with ::
756  * signs.
757  *
758  *******************************************************************************/
759 #define EW_DEFINE_VCLASS(aClass, aSuperClass, aOriginClass, aGCInfo0, \
760  aGCInfo1, aGCInfo2, aGCInfo3, aGCInfo4, aGCInfo5, \
761  aName) \
762  const struct _vmt_##aClass __vmt_##aClass = { \
763  0x56434C41, aName, &__vmt_##aSuperClass, _vof_##aClass, \
764  sizeof(struct _obj_##aClass), \
765  {(int)&((aClass)0)->aGCInfo0, (int)&((aClass)0)->aGCInfo1, \
766  (int)&((aClass)0)->aGCInfo2, (int)&((aClass)0)->aGCInfo3, \
767  (int)&((aClass)0)->aGCInfo4, (int)&((aClass)0)->aGCInfo5}, \
768  aClass##__Init, aClass##__ReInit, aClass##__Done,
769 
770 #define EW_END_OF_VCLASS(aClass) \
771  0 \
772  } \
773  ;
774 
775 /*******************************************************************************
776  * MACRO:
777  * EW_DEFINE_CLASS_VARIANTS
778  * EW_END_OF_CLASS_VARIANTS
779  * EW_CLASS_VARIANT
780  * EW_STATIC_CLASS_VARIANT
781  *
782  * DESCRIPTION:
783  * These macros initialize a global list of variants, which are derived from a
784  * class. When during the runtime an object of this class is created, Embedded
785  * Wizard RTE evaluates the associated list in order to find the class
786  *variant, which fits to the currently active styles. Then an object variant of
787  *this class variant is created and attached to the origin object. In this
788  *manner the origin object can be extended by an additional behaviour, without
789  *any modifications of its origin class. The so called 'styles set' can be read
790  * and changed by calling the function EwGetStyles() and EwSetStyles().
791  *
792  * The macro EW_DEFINE_CLASS_VARIANTS starts the list of class variants
793  *derived from the class aClass. The entries of the list are definied by the
794  *macros EW_CLASS_VARIANT and EW_STATIC_CLASS_VARIANT. The last of these both
795  *macros specifies a static class variant. In this case the origin class aClass
796  *is overriden by the static class variant permanently.
797  *
798  * See the example below:
799  *
800  * EW_DEFINE_CLASS_VARIANTS( MyUnitMyClass )
801  * EW_CLASS_VARIANT( Style1, TheNameOfTheVariant1 )
802  * EW_CLASS_VARIANT( Style2, TheNameOfTheVariant2 )
803  * EW_STATIC_CLASS_VARIANT( TheNameOfTheVariant3 )
804  * EW_END_OF_CLASS_VARIANTS( MyUnitMyConst )
805  *
806  * ARGUMENTS:
807  * aClass - The name of the class itself.
808  * aStyle - The name of the style, for which the class variant should be
809  * used during the runtime.
810  * aVariant - The name of the class variant to use, when the specified
811  * aStyle is currently activated in the styles set.
812  *
813  *******************************************************************************/
814 #define EW_DEFINE_CLASS_VARIANTS(aClass) \
815  static const XClassVariant _vof_##aClass[] = {
816 #define EW_END_OF_CLASS_VARIANTS(aClass) \
817  { \
818  0, 0 \
819  } \
820  } \
821  ;
822 
823 #define EW_CLASS_VARIANT(aStyle, aVariant) \
824  { \
825  aStyle, (const struct _vmt_XObject *)(const void *)&__vmt_##aVariant \
826  }
827 
828 #define EW_STATIC_CLASS_VARIANT(aVariant) \
829  { \
830  0, (const struct _vmt_XObject *)(const void *)&__vmt_##aVariant \
831  }
832 
833 /*******************************************************************************
834  * MACRO:
835  * EW_DEFINE_DISPATCHER
836  * EW_END_OF_DISPATCHER
837  *
838  * DESCRIPTION:
839  * These macros define so called variant dispatcher table. This table is used
840  * as a switch between the methods implemented in a class and overriden in the
841  * class variants. The origin implementation of the affected methods uses this
842  * definition in order to pass method invokations to the appropriate variants.
843  * Usually, this table contains methods overriden in derived class variants
844  * only.
845  *
846  * ARGUMENTS:
847  * aClass - The name of the class, which has been overriden by variants.
848  * aSuperClass - The name of the next base class (the super class) of this
849  * class in the inheritance tree. If there is no further super classes,
850  * aSuperClass will get the name XObject (the root class of all objects).
851  *
852  *******************************************************************************/
853 #define EW_DEFINE_DISPATCHER(aClass, aSuperClass) \
854  struct _dmt_##aClass { \
855  unsigned int _MagicNo; \
856  const char *_Name; \
857  const struct _vmt_##aClass *_Ancestor; \
858  const XClassVariant *_SubVariants; \
859  int _Size; \
860  int _GCInfo[6]; \
861  void (*_Init)(aClass _this, XObject aLink, XHandle aArg); \
862  void (*_ReInit)(aClass _this); \
863  void (*_Done)(aClass _this)
864 
865 #define EW_END_OF_DISPATCHER(aClass) \
866  ; \
867  int _Reserved; \
868  } \
869  ;
870 
871 /*******************************************************************************
872  * MACRO:
873  * EW_CLASS
874  * EW_VCLASS
875  * EW_CLASS_GCT
876  * EW_VCLASS_GCT
877  * Super1
878  * Super2
879  * Super3
880  * ...
881  * Super24
882  *
883  * DESCRIPTION:
884  * The following macros are useful to access internal data structures of an
885  * object. The macros hides the complexity of some 'C' expressions so the code
886  * generation can be simplified and the generated 'C' code is less dependent
887  * on the used 'C' compiler.
888  *
889  * The macro EW_CLASS returns a pointer to the class description of the
890  * requiered class aClass. The class description will be stored in the virtual
891  * method table (VMT), so EW_CLASS has to return a pointer to the requiered
892  * global VMT data structure. In the same manner the macro EW_VCLASS returns
893  * the pointer to the global VMT data structure of a class variant.
894  *
895  * The macros EW_CLASS_GCT and EW_VCLASS_GCT return similarly to EW_CLASS and
896  * EW_VCLASS a pointer to the VMT of the respective class or class variant.
897  * They are used exclusively to obtain the right version of VMT to be used
898  * during Garbage Collection mark phase.
899  *
900  * The macros Super1 .. Super24 simplify the access to inherited data fields
901  * of an object. Inherited data fields can be accessed in the context of the
902  * inherited class only. For this reason every object stores inherited data
903  * fields in its _Super structure. The macro Super1 is used to access data
904  * fields of the direct next base class. Super2 allows to access data fields
905  * of the base class the direct next base class inherites from, and so far.
906  * For example:
907  *
908  * obj->Super3.Width = 0;
909  *
910  * will be evaluated to:
911  *
912  * obj->_Super._Super._Super.Width = 0;
913  *
914  * ARGUMENTS:
915  * aObject - Pointer to the object to get the base version or the root class
916  * version.
917  * aClass - The name of the class to return the class description (pointer
918  * to the global VMT of aClass).
919  *
920  *******************************************************************************/
921 #define EW_CLASS(aClass) (&__vmt_##aClass)
922 #define EW_VCLASS(aClass) (&__vmt_##aClass)
923 #define EW_CLASS_GCT(aClass) ((const struct _vmt_XObject *)EW_CLASS(aClass))
924 #define EW_VCLASS_GCT(aClass) ((const struct _vmt_XObject *)EW_VCLASS(aClass))
925 #define Super1 _Super
926 #define Super2 Super1._Super
927 #define Super3 Super2._Super
928 #define Super4 Super3._Super
929 #define Super5 Super4._Super
930 #define Super6 Super5._Super
931 #define Super7 Super6._Super
932 #define Super8 Super7._Super
933 #define Super9 Super8._Super
934 #define Super10 Super9._Super
935 #define Super11 Super10._Super
936 #define Super12 Super11._Super
937 #define Super13 Super12._Super
938 #define Super14 Super13._Super
939 #define Super15 Super14._Super
940 #define Super16 Super15._Super
941 #define Super17 Super16._Super
942 #define Super18 Super17._Super
943 #define Super19 Super18._Super
944 #define Super20 Super19._Super
945 #define Super21 Super20._Super
946 #define Super22 Super21._Super
947 #define Super23 Super22._Super
948 #define Super24 Super23._Super
949 
950 /*******************************************************************************
951  * MACRO:
952  * EW_UNUSED_ARG
953  *
954  * DESCRIPTION:
955  * The macro EW_UNUSED_ARG() encapsulates a dummy expression to avoid compiler
956  * warning due to unused function parameters. The implementation of this macro
957  * may be adapted to the apropriate 'C' compiler.
958  *
959  * ARGUMENTS:
960  * aArg - The name of the affected parameter.
961  *
962  * RETURN VALUE:
963  * None
964  *
965  *******************************************************************************/
966 #define EW_UNUSED_ARG(aArg) (void)(aArg)
967 
968 /*******************************************************************************
969  * METHOD:
970  * XObject._Init
971  *
972  * DESCRIPTION:
973  * The method _Init() will be invoked by to initialize the newly created
974  *object instance this. The invoking of the method gets the object a chance to
975  * initialize all user defined data fields and to prepare internal structures
976  * necessary to keep the object alive.
977  *
978  * Because of the inheritance of classes it is necessary to invoke all _Init()
979  * methods of all inherited classes to complete the initialization. For this
980  * reason the _Init() method has to take care to invoke the inherited _Init()
981  * method before it can begin with the initialization.
982  *
983  * If the object this does aggregate other object instances, _Init() has to
984  * take care to initialize these aggregate objects properly before _Init()
985  * returns to the caller. In the same way _Init() has to reserve memory the
986  * object needs temporary (for example to store a string).
987  *
988  * ARGUMENTS:
989  * _this - Pointer to the object needs the initialization.
990  * aLink - Pointer to an object which aggregates (embed) 'this' object.
991  * If 'this' object is not aggregated: aLink == NULL.
992  * aArg - An optional 32 bit argument. The _Init() method passes aArg to the
993  * constructor of the class and allows the programmer to access any data in
994  * the body of the constructor.
995  *
996  * RETURN VALUE:
997  * None
998  *
999  *******************************************************************************/
1000 void XObject__Init(XObject _this, XObject aLink, XHandle aArg);
1001 
1002 /*******************************************************************************
1003  * METHOD:
1004  * XObject._ReInit
1005  *
1006  * DESCRIPTION:
1007  * The method _ReInit() will be invoked to re-initialize the object instance
1008  * this. The invoking of the method gets the object a chance to re-evaluate
1009  * all multilingual initialization expressions after the language has been
1010  * changed.
1011  *
1012  * Because of the inheritance of classes it is necessary to invoke all
1013  * _ReInit() methods of all inherited classes to complete the
1014  *re-initialization For this reason the _ReInit() method has to take care to
1015  *invoke the inherited _ReInit() method before it can begin with the
1016  *re-initialization.
1017  *
1018  * If the object this does aggregate other object instances, _ReInit() has to
1019  * take care to re-initialize these aggregated objects properly before
1020  * _ReInit() returns to the caller.
1021  *
1022  * ARGUMENTS:
1023  * _this - Pointer to the object needs the re-initialization.
1024  *
1025  * RETURN VALUE:
1026  * None
1027  *
1028  *******************************************************************************/
1029 void XObject__ReInit(XObject _this);
1030 
1031 /*******************************************************************************
1032  * METHOD:
1033  * XObject._Done
1034  *
1035  * DESCRIPTION:
1036  * The method _Done() will be invoked by the Garbage Collector to give the
1037  * object 'this' a chance to deinitialize itself before the Garbage Collector
1038  * frees the memory occuped by the object.
1039  *
1040  * If the object 'this' does aggregate other object instances, _Done() has to
1041  * take care to deinitialize these aggregate objects properly before _Done()
1042  * returns to the caller. In the same way _Done() has to free all the memory
1043  * the object has reserved temporary (for example to store a buffer).
1044  *
1045  * Because of the inheritance of classes it is necessary to invoke all _Done()
1046  * methods of all inherited classes to complete the deinitialization. For this
1047  * reason the _Done() method has to take care to invoke the inherited _Done()
1048  * method.
1049  *
1050  * The Garbage Collector guarantees to deinitialize only objects not in use
1051  * anymore (garbage).
1052  *
1053  * ARGUMENTS:
1054  * _this - Pointer to the object to deinitialize.
1055  *
1056  * RETURN VALUE:
1057  * None
1058  *
1059  *******************************************************************************/
1060 void XObject__Done(XObject _this);
1061 
1062 /*******************************************************************************
1063  * FUNCTION:
1064  * EwConfigRuntimeEnvironment
1065  *
1066  * DESCRIPTION:
1067  * The pseudo function EwConfigRuntimeEnvironment() setups configuration
1068  * variables of the Runtime Environment according to macros found in the file
1069  * 'ewconfig.h' file or in the Make file.
1070  *
1071  * This function has to be executed before using the functions from the
1072  *Runtime Environment.
1073  *
1074  * ARGUMENTS:
1075  * None
1076  *
1077  * RETURN VALUE:
1078  * None
1079  *
1080  *******************************************************************************/
1081 #define EwConfigRuntimeEnvironment() \
1082  do { \
1083  EwMaxStringCacheSize = EW_MAX_STRING_CACHE_SIZE; \
1084  } while (0)
1085 
1086 /*******************************************************************************
1087  * FUNCTION:
1088  * EwSetStackBaseAddress
1089  *
1090  * DESCRIPTION:
1091  * The function EwSetStackBaseAddress() remembers the given value as start
1092  * address of the CPU stack used by Embedded Wizard application. Knowing this
1093  * the Garbage Collector can be started while the application is executed and
1094  * can evaluate stack contents in order to mark objects/strings stored on it
1095  * actually.
1096  *
1097  * ARGUMENTS:
1098  * aStackBaseAddress - Base address of the CPU stack used by Embedded Wizard
1099  * application.
1100  *
1101  * RETURN VALUE:
1102  * None
1103  *
1104  *******************************************************************************/
1105 void EwSetStackBaseAddress(void *aStackBaseAddress);
1106 
1107 /*******************************************************************************
1108  * FUNCTION:
1109  * EwNewObject
1110  *
1111  * DESCRIPTION:
1112  * The function EwNewObject() implements a feature similar to the 'new'
1113  * operator known from the programming language C++ and JAVA. EwNewObject()
1114  * determines the size of an object of the given class aClass, reserves the
1115  * memory for the object and initializes the object properly.
1116  *
1117  * The memory reservation will be done by the function EwAlloc(). If there is
1118  * no memory available to create a new object of the desired aClass
1119  * EwNewObject() will cause an error by calling the EwPanic() function.
1120  *
1121  * After the memory could be reserved EwNewObject() invokes the _Init()
1122  * method of the new object, so the object will get a chance to initialize
1123  * itself.
1124  *
1125  * Note, that if there is no relationships between the newly created object
1126  * and other objects stored in the root set, the object will be disposed by
1127  * the next garbage colection. See EwReclaimMemory() for more details about
1128  * the Garbage Collector and the root set.
1129  *
1130  * ARGUMENTS:
1131  * aClass - The name of the desired class to create a new object instance.
1132  * aArg - An optional 32 bit argument. The EwNewObject() method passes aArg
1133  * to the constructor of the class and allows the programmer to access any
1134  * data in the body of the constructor.
1135  *
1136  * RETURN VALUE:
1137  * EwNewObject() returns a pointer to the newly created object.
1138  *
1139  *******************************************************************************/
1140 XObject EwNewObjectIndirect(const void *aClass, XHandle aArg);
1141 
1142 #define EwNewObject(aClass, aArg) \
1143  ((aClass)EwNewObjectIndirect(EW_CLASS(aClass), aArg))
1144 
1145 /*******************************************************************************
1146  * FUNCTION:
1147  * EwAttachObjectVariant
1148  *
1149  * DESCRIPTION:
1150  * The function EwAttachObjectVariant() creates an object variant and attaches
1151  * it to the origin object aThis. At first the function verifies, whether the
1152  * class of the origin object has been overriden by a class variant. Depending
1153  * on the found class variant, a new object variant is created and
1154  *initialized. At the end, the pointer to the created object variant is assigned
1155  *to the
1156  * '_vthis' field of the origin object -> the object variant is attached to
1157  *it.
1158  *
1159  * For this purpose the function evaluates the list of variants defined by the
1160  * macros EW_DEFINE_CLASS_VARIANTS (see above). If the affected class has not
1161  * been overriden by a class variant, or no variants in the list do correspond
1162  * to the currently active styles - the function returns to the caller and no
1163  * object variant is created.
1164  *
1165  * The memory reservation will be done by the function EwAlloc(). If there is
1166  * no memory available to create a new object variant, EwAttachObjectVariant()
1167  * will cause an error by calling the EwPanic() function.
1168  *
1169  * After the memory could be reserved, the _Init() method of the new object
1170  * variant is called in order to give the object a chance to initialize itself
1171  * properly. The both argument aLink and aArg are then passed to the _Init()
1172  * method.
1173  *
1174  * If the origin object is disposed, the attached object variants are also
1175  * destroyed by calling the function EwDetachObjectVariant().
1176  *
1177  * ARGUMENTS:
1178  * aThis - Pointer to the object to attach an object variant.
1179  * aLink - Pointer to an object which aggregates (embed) aThis object. If
1180  * aThis object is not aggregated: aLink == NULL.
1181  * aArg - An optional 32 bit argument passed from the _Init() method of aThis
1182  * object.
1183  *
1184  * RETURN VALUE:
1185  * None
1186  *
1187  *******************************************************************************/
1188 void EwAttachObjectVariant(XObject aThis, XObject aLink, XHandle aArg);
1189 
1190 /*******************************************************************************
1191  * FUNCTION:
1192  * EwDetachObjectVariant
1193  *
1194  * DESCRIPTION:
1195  * The function EwDetachObjectVariant() detaches and destroys the object
1196  * variant, which was previously attached to the origin object aThis by the
1197  * function EwAttachObjectVariant().
1198  *
1199  * The origin object aThis stores its object variant in the field '_vthis'.
1200  *The attached object variant is deinitialized by calling its _Done() Methode.
1201  * After this, the memory occupied by the object variant is freed by EwFree().
1202  *
1203  * ARGUMENTS:
1204  * aThis - Pointer to the object to detach its object variant.
1205  *
1206  * RETURN VALUE:
1207  * None
1208  *
1209  *******************************************************************************/
1210 void EwDetachObjectVariant(XObject aThis);
1211 
1212 /*******************************************************************************
1213  * FUNCTION:
1214  * EwCastObject
1215  *
1216  * DESCRIPTION:
1217  * The function EwCastObject() implements the feature knows from the
1218  * programming language C++ and called 'dynamic_cast<>()'. EwCastObject()
1219  * verifies whether it is possible to cast the given object aObject to class
1220  * aClass and returns the unchanged pointer aObject if the cast is allowed.
1221  * In the case the cast is not legal EwCastObject() returns NULL.
1222  *
1223  * The legal cast assumes that the class of the given object is derived from
1224  * aClass or it is aClass itself. To determine whether one class is derived
1225  * from another EwCastObject() evaluates the inheritance tree starting at the
1226  * class of aObject. During the evaluation EwCastObject() will compare each
1227  * found base class with aClass until the classes are the same or no other
1228  * base classes exist.
1229  *
1230  * ARGUMENTS:
1231  * aObject - Pointer to the object which should be casted to aClass.
1232  * aClass - The name of the desired class the object should be cast to.
1233  *
1234  * RETURN VALUE:
1235  * EwCastObject() returns aObject if there is a possibility to cast aObject to
1236  * aClass. If not, or if aObject is already NULL EwCastObject() returns NULL.
1237  *
1238  *******************************************************************************/
1239 void *EwCastObject(register XObject aObject, register const void *aClass);
1240 
1241 #define EwCastObject(aObject, aClass) \
1242  ((aClass)EwCastObject((XObject)(aObject), EW_CLASS(aClass)))
1243 
1244 /*******************************************************************************
1245  * FUNCTION:
1246  * EwCastClass
1247  *
1248  * DESCRIPTION:
1249  * The function EwCastClass() works similar to the function EwCastObject()
1250  * with the difference, that EwCastClass() is always applied to Chora classes
1251  * whereas EwCastObject() to instances of the classes.
1252  *
1253  * EwCastClass() verifies whether it is possible to cast the given class
1254  *aClass to the class aDesiredClass and returns the unchanged pointer aClass if
1255  *the cast is allowed. In the case the cast is not legal EwCastClass() returns
1256  * NULL.
1257  *
1258  * The legal cast assumes that the class aClass is derived from aDesiredClass
1259  * or it is aDesiredClass itself. To determine whether one class is derived
1260  * from another EwCastClass() evaluates the inheritance tree starting at the
1261  * class aClass. During the evaluation EwCastClass() will compare each found
1262  * base class with aDesiredClass until the classes are the same or the root of
1263  * the inheritance tree has been reached.
1264  *
1265  * ARGUMENTS:
1266  * aClass - Pointer to the class which should be casted to
1267  * aDesiredClass.
1268  * aDesiredClass - The name of the desired class the object should be cast to.
1269  *
1270  * RETURN VALUE:
1271  * EwCastClass() returns aClass if there is a possibility to cast aClass to
1272  * aDesiredClass. If not, or if aClass is already NULL EwCastClass() returns
1273  * NULL.
1274  *
1275  *******************************************************************************/
1276 XClass EwCastClass(register XClass aClass, register const void *aDesiredClass);
1277 
1278 #define EwCastClass(aClass, aDesiredClass) \
1279  EwCastClass(aClass, EW_CLASS(aDesiredClass))
1280 
1281 /*******************************************************************************
1282  * FUNCTION:
1283  * EwClassOf
1284  *
1285  * DESCRIPTION:
1286  * The function EwClassOf() determinates the class of an object given in the
1287  * argument aObject. The function returns a pointer to a global data structure
1288  * with the description of the class. If aObject == NULL, the function returns
1289  * NULL.
1290  *
1291  * ARGUMENTS:
1292  * aObject - Pointer to the object to determinate the class.
1293  *
1294  * RETURN VALUE:
1295  * EwClassOf() returns a pointer to the class structure or NULL, if aObject
1296  * is NULL.
1297  *
1298  *******************************************************************************/
1299 XClass EwClassOf(register XObject aObject);
1300 
1301 /*******************************************************************************
1302  * FUNCTION:
1303  * EwLockObject
1304  *
1305  * DESCRIPTION:
1306  * The function EwLockObject() adds the given object aObject to the global
1307  * root set. Objects which are stored in the root set will still keep alive
1308  * together with other objects depending from them.
1309  *
1310  * Objects which are not stored in the root set and which are not in a
1311  * relationships to an other object stored in the root set are garbage and
1312  *will be disposed by the next garbage collection.
1313  *
1314  * The size of the root set is limited to 16 entries. A try to lock 17 objects
1315  * will cause EwPanic() call.
1316  *
1317  * If the passed argument aObject is NULL, EwLockObject() returns
1318  *immediatelly.
1319  *
1320  * ARGUMENTS:
1321  * aObject - Pointer to the object which should be added to the root set.
1322  *
1323  * RETURN VALUE:
1324  * None
1325  *
1326  *******************************************************************************/
1327 void EwLockObject(register XObject aObject);
1328 
1329 #define EwLockObject(aObject) EwLockObject((XObject)(aObject))
1330 
1331 /*******************************************************************************
1332  * FUNCTION:
1333  * EwUnlockObject
1334  *
1335  * DESCRIPTION:
1336  * The function EwUnlockObject() removes the object aObject from the root set.
1337  * The object should be added previously to the root set by calling the
1338  * function EwLockObject(). If it's not, EwUnlockObject() will cause EwPanic()
1339  * call.
1340  *
1341  * After the object has been removed from the root set and if there is no
1342  *other relationships between the object and other objects still stored in the
1343  *root set, the object will be disposed by the next garbage collection.
1344  *
1345  * If the passed argument aObject is NULL, EwUnlockObject() returns
1346  * immediatelly.
1347  *
1348  * ARGUMENTS:
1349  * aObject - Pointer to the object which should be removed from the root set.
1350  *
1351  * RETURN VALUE:
1352  * None
1353  *
1354  *******************************************************************************/
1355 void EwUnlockObject(register XObject aObject);
1356 
1357 #define EwUnlockObject(aObject) EwUnlockObject((XObject)(aObject))
1358 
1359 /*******************************************************************************
1360  * FUNCTION:
1361  * EwReclaimMemory
1362  *
1363  * DESCRIPTION:
1364  * The function EwReclaimMemory() invokes the Garbage Collector in order to
1365  * dispose memory occuped by objects which are not used any more. The Garbage
1366  * Collector implements the two phases algorithmus 'Mark and Sweep'.
1367  *
1368  * In the first phase EwReclaimMemory() distinguishes between live objects and
1369  * the garbage. This is done by traversing the graph of object relationships.
1370  * All reached objects will be marked. The traversing starts at the root set.
1371  * The user can add and remove objects to or from the root set by calling the
1372  * function EwLockObject() and EwUnlockObject(). As long as an object still
1373  * keeps in the root set, the Garbage Collector can not dispose the objects
1374  * and all other objects standing in the relationship to the object.
1375  *
1376  * In the second phase EwReclaimMemory() deinitializes and frees objects which
1377  * have not been marked during the first phase. The _Done() method of every
1378  * affected object will be called, so the object will get a chance to shut
1379  *down properly. In the second step the EwFree() function will be called, so the
1380  * memory occuped by the object will be released.
1381  *
1382  * ARGUMENTS:
1383  * None
1384  *
1385  * RETURN VALUE:
1386  * The function returns != 0 if at least one Chora object or string has been
1387  * released.
1388  *
1389  *******************************************************************************/
1390 int EwReclaimMemory(void);
1391 
1392 /*******************************************************************************
1393  * FUNCTION:
1394  * EwImmediateReclaimMemory
1395  *
1396  * DESCRIPTION:
1397  * The function EwImmediateReclaimMemory() implements a second version of the
1398  * above EwReclaimMemory() function. While EwReclaimMemory() function can be
1399  * used when the GUI application is not executing any code only, this second
1400  * version may be called even during the execution of the GUI application.
1401  *
1402  * This is so-called immediate grabage collection.
1403  *
1404  * In order to not oversee any Chora objects nor strings stored actually in
1405  * local variables of the just interrupted GUI application, the function
1406  * EwImmediateReclaimMemory() evaluates the contents of the CPU stack as well
1407  * as the values of CPU register. As such the function needs to know the base
1408  * address of the CPU stack. This has to be provided at the start of the GUI
1409  * application via an invocation of the function EwSetStackBaseAddress().
1410  *
1411  * ARGUMENTS:
1412  * aErrorCode - Error code identifying the orginal memory alloc operation
1413  * which is failed causing the application to start the immediate garbage
1414  * collection. The number is used only to print a debug message.
1415  *
1416  * RETURN VALUE:
1417  * The function returns != 0 if at least one Chora object or string has been
1418  * released.
1419  *
1420  *******************************************************************************/
1421 int EwImmediateReclaimMemory(int aErrorCode);
1422 
1423 /*******************************************************************************
1424  * FUNCTION:
1425  * EwTestImmediateReclaimMemory
1426  *
1427  * DESCRIPTION:
1428  * The function EwTestImmediateReclaimMemory() implements a simple routine to
1429  * verify the function of immediate garbage collection. The implementation
1430  * creates few string objects and stores some of them in local variables. Then
1431  * the garbage collection is started via EwImmediateReclaimMemory(). After the
1432  * operation the function verifies whether the objects referenced by local
1433  * variable still exist and the object not referenced anymore are released.
1434  *
1435  * ARGUMENTS:
1436  * None
1437  *
1438  * RETURN VALUE:
1439  * If the test is working the function returns 1. If some of needed objects
1440  * have been unexpectedly released, the function return 0 (bad error). If
1441  * some unused objects have not been released the function returns 2 (this
1442  * may occur).
1443  *
1444  *******************************************************************************/
1446 
1447 /*******************************************************************************
1448  * FUNCTION:
1449  * EwReconstructObjects
1450  *
1451  * DESCRIPTION:
1452  * The function EwReconstructObjects() forces all currently existing objects
1453  * to execute their _ReInit() methods. The re-construction allows the objects
1454  * to update themselfe after the language has been changed.
1455  *
1456  * ARGUMENTS:
1457  * None
1458  *
1459  * RETURN VALUE:
1460  * None
1461  *
1462  *******************************************************************************/
1463 void EwReconstructObjects(void);
1464 
1465 /*******************************************************************************
1466  * FUNCTION:
1467  * EwAlloc
1468  *
1469  * DESCRIPTION:
1470  * The function EwAlloc() will be called by the EWRTE each time a new memory
1471  * block should be reserved. For example, the function EwNewObject() calls
1472  * EwAlloc() to reserve memory for new objects.
1473  *
1474  * EwAlloc() has to reserve a new memory block with the given size aSize. The
1475  * function has to return a pointer to the memory block or NULL if there is no
1476  * memory available.
1477  *
1478  * ARGUMENTS:
1479  * aSize - Desired size of the new memory block in bytes.
1480  *
1481  * RETURN VALUE:
1482  * EwAlloc() has to return a pointer to the reserved memory block or NULL if
1483  * there is no memory available.
1484  *
1485  *******************************************************************************/
1486 void *EwAlloc(int aSize);
1487 
1488 /*******************************************************************************
1489  * FUNCTION:
1490  * EwFree
1491  *
1492  * DESCRIPTION:
1493  * The function EwFree() should be implemented by the programer. The function
1494  * will be called by the EWRTE each time a memory block should be released.
1495  * The function EwFree() will be called from the Garbage Collector if garbage
1496  * has been found.
1497  *
1498  * ARGUMENTS:
1499  * aMemory - Address of the memory block to release.
1500  *
1501  * RETURN VALUE:
1502  * None
1503  *
1504  *******************************************************************************/
1505 void EwFree(void *aMemory);
1506 
1507 /*******************************************************************************
1508  * FUNCTION:
1509  * EwIsMemory
1510  *
1511  * DESCRIPTION:
1512  * The function EwIsMemory() should be implemented together with the both
1513  * above functions EwAlloc() and EwFree(). EwIsMemory() will be called by
1514  * the EWRTE in order to test whether the given pointer does address within
1515  * the memory area used by the heap (used for EwAlloc() operations).
1516  *
1517  * ARGUMENTS:
1518  * aPtr - Address to test.
1519  *
1520  * RETURN VALUE:
1521  * EwIsMemory() has to return != 0 if the given pointer aPtr addresses within
1522  * the memory area used by the heap manager. Otherwise 0 should be returned.
1523  *
1524  *******************************************************************************/
1525 int EwIsMemory(void *aPtr);
1526 
1527 /******************************************************************************
1528  * TYPE:
1529  * XInt8, XInt16, XInt16, XUInt8, XUInt16, XUInt32, XBool, XEnum, XSet,
1530  * XFloat, XChar, XColor, XLangId, XStylesSet
1531  *
1532  * DESCRIPTION:
1533  * The following set of type definitions is necessary to cover the simplest
1534  * instant datatypes implemented and used in the Embedded Wizards programming
1535  * language 'Chora'. Chora defines following simple instant datatypes:
1536  *
1537  * int8, int16, int32, uint8, uint16, uint32,
1538  * bool, enum, set, float, char, language
1539  *
1540  * DEFINITIONS:
1541  * XInt8 - 8 bit signed integer. Stores values in range -128 .. +127.
1542  * XInt16 - 16 bit signed integer. Stores values in range -32768 .. +32767.
1543  * XInt32 - 32 bit signed integer. Stores values in range -2^31..
1544  * (+2^31 - 1).
1545  * XInt64 - 64 bit signed integer. Stores values in range -2^63..
1546  * (+2^63 - 1).
1547  * XUInt8 - 8 bit unsigned integer. Stores values in range 0 .. +255.
1548  * XUInt16 - 16 bit unsigned integer. Stores values in range 0 .. +65535.
1549  * XUInt32 - 32 bit unsigned integer. Stores values in range 0 ..
1550  * (+2^32 - 1).
1551  * XUInt64 - 64 bit unsigned integer. Stores values in range 0 ..
1552  * (+2^64 - 1).
1553  * XBool - 8 bit Boolean. Stores 0 (zero) if the boolean value is 'false'
1554  * or not 0 if the value is 'true'.
1555  * XEnum - 32 bit enumeration. An enumeration can store an 'one of...'
1556  * value.
1557  * XSet - 32 bit set. A set can store a combination of up to 32 values.
1558  * An empty set (without any values) is possible.
1559  * XFloat - Floating point value necessary for the floating point
1560  * arithmetic.
1561  * XChar - 16 bit wide character. This is the standard character used in
1562  * Chora. A character can store an UNICODE sign.
1563  * XLangId - ID of the language variant.
1564  * XStylesSet - A set of style variants as a 32 bit pattern.
1565  *
1566  ******************************************************************************/
1567 #if defined __LP64__ || defined _LP64
1568 typedef signed char XInt8;
1569 typedef signed short XInt16;
1570 typedef signed int XInt32;
1571 typedef signed long XInt64;
1572 typedef unsigned char XUInt8;
1573 typedef unsigned short XUInt16;
1574 typedef unsigned int XUInt32;
1575 typedef unsigned long XUInt64;
1576 typedef char XBool;
1577 typedef unsigned int XEnum;
1578 typedef unsigned int XSet;
1579 typedef float XFloat;
1580 typedef unsigned short XChar;
1581 typedef int XLangId;
1582 typedef unsigned int XStylesSet;
1583 #else
1584 typedef signed char XInt8;
1585 typedef signed short XInt16;
1586 typedef signed long XInt32;
1587 typedef signed long long XInt64;
1588 typedef unsigned char XUInt8;
1589 typedef unsigned short XUInt16;
1590 typedef unsigned long XUInt32;
1591 typedef unsigned long long XUInt64;
1592 typedef char XBool;
1593 typedef unsigned long XEnum;
1594 typedef unsigned long XSet;
1595 typedef float XFloat;
1596 typedef unsigned short XChar;
1597 typedef int XLangId;
1598 typedef unsigned long XStylesSet;
1599 #endif
1600 
1601 /******************************************************************************
1602  * TYPE:
1603  * XPoint
1604  *
1605  * DESCRIPTION:
1606  * The type definition XPoint is necessary to cover the instant datatype
1607  * 'point' implemented in the Embedded Wizards programming language 'Chora'.
1608  * XPoint can store a position of a point in a 2D coordinate system.
1609  * The position of the point can be negative.
1610  *
1611  * ELEMENTS:
1612  * X - Specifies the x-coordinate of the point.
1613  * Y - Specifies the y-coordinate of the point.
1614  *
1615  ******************************************************************************/
1616 typedef struct {
1617  XInt32 X;
1618  XInt32 Y;
1619 } XPoint;
1620 
1621 /******************************************************************************
1622  * TYPE:
1623  * XRect
1624  *
1625  * DESCRIPTION:
1626  * The type definition XRect is necessary to cover the instant datatype
1627  * 'rect' implemented in the Embedded Wizards programming language 'Chora'.
1628  * XRect can store a position and the expansion of an rectangle in a 2D
1629  * coordinate system.
1630  * The position and the size of the point can be negative.
1631  *
1632  * ELEMENTS:
1633  * Point1- Specifies the x, y coordinates of the upper-left corner of the
1634  * rectangle.
1635  * Point2- Specifies the x, y coordinates of the bottom-right corner of the
1636  * rectangle.
1637  *
1638  ******************************************************************************/
1639 typedef struct {
1640  XPoint Point1;
1641  XPoint Point2;
1642 } XRect;
1643 
1644 /******************************************************************************
1645  * TYPE:
1646  * XString
1647  *
1648  * DESCRIPTION:
1649  * The type definition XString represents a 'string' instant datatype used in
1650  * the Embedded Wizard owns programming language Chora. A string can store
1651  * up to 65535 wide characters, so UNICODE strings are possible. The end of
1652  * each string will be terminated with a zero (\x0000) sign, similary to the
1653  * ANSI 'C' strings.
1654  *
1655  ******************************************************************************/
1656 typedef XChar *XString;
1658 /******************************************************************************
1659  * TYPE:
1660  * XStringRes
1661  *
1662  * DESCRIPTION:
1663  * The type definition XStringRes is used to describe a single 'string'
1664  * constant as it stored in the code memory. Because of 'string' constants
1665  * are stored in blocks, XStringRes contains a reference to the code block
1666  * where the data are stored and an offset to the first character of the
1667  * affected constant within the block.
1668  *
1669  * ELEMENTS:
1670  * Block - The address of the block where the data of the string is stored.
1671  * Depending on the configuration, the data can be compressed. If not, the
1672  * Runtime Environment is able to use the string constants directly.
1673  * Please note, a single block can contain multiple 'string' constants.
1674  * Offset - The offset to the first character of the 'string' constant
1675  * relative to the begin of the block - This offset is valid after the block
1676  * is decompressed only.
1677  *
1678  ******************************************************************************/
1679 typedef struct {
1680  const void *Block;
1681  XUInt16 Offset;
1682 } XStringRes;
1683 
1684 /******************************************************************************
1685  * TYPE:
1686  * XColor
1687  *
1688  * DESCRIPTION:
1689  * The type definition XColor is necessary to cover the instant datatype
1690  * 'color' implemented in the Embedded Wizards programming language 'Chora'.
1691  * XColor can store a 32 bit RGBA color value.
1692  *
1693  * ELEMENTS:
1694  * Red - The Red component of the color.
1695  * Green - The Green component of the color.
1696  * Blue - The Blue component of the color.
1697  * Alpha - The Alpha component of the color.
1698  *
1699  ******************************************************************************/
1700 typedef struct {
1701  XUInt8 Red;
1702  XUInt8 Green;
1703  XUInt8 Blue;
1704  XUInt8 Alpha;
1705 } XColor;
1706 
1707 /******************************************************************************
1708  * TYPE:
1709  * XVariantOfInt8, XVariantOfInt16, XVariantOfInt32, XVariantOfUInt8,
1710  * XVariantOfUInt16, XVariantOfUInt32, XVariantOfInt64, XVariantOfUInt64,
1711  * XVariantOfBool, XVariantOfEnum, XVariantOfSet, XVariantOfFloat,
1712  * XVariantOfChar, XVariantOfColor, XVariantOfPoint, XVariantOfRect,
1713  * XVariantOfString, XVariantOfLanguage, XVariantOfStylesSet
1714  *
1715  * DESCRIPTION:
1716  * The XVariantOfXXX type definitions support the multilanguage constants.
1717  * Multilanguage constants allow to store 2 or more variants of a constant.
1718  * For example a multilanguage string constant can contain strings in English,
1719  * German, Greek, etc. language.
1720  * The evaluation of a multilanguage constant causes a search for the variant
1721  * which fits to the currently selected language. Each variant consists of a
1722  * LangId and the original constant value. The variants will be stored in
1723  * arrays. The last entry in such array should belong to the default language
1724  * (LangId == 0) unless this is variant derived from other constant, which
1725  * already contains the default value.
1726  *
1727  * ELEMENTS:
1728  * LangId - The unique number of the language the variant belongs to. The
1729  * default language uses 0 (zero) LangId == 0.
1730  * Value - The language dependent value of the constant.
1731  *
1732  ******************************************************************************/
1733 typedef struct {
1734  int LangId;
1735  XInt8 Value;
1736 } XVariantOfInt8;
1737 
1738 typedef struct {
1739  int LangId;
1741 } XVariantOfInt16;
1742 
1743 typedef struct {
1744  int LangId;
1746 } XVariantOfInt32;
1747 
1748 typedef struct {
1749  int LangId;
1751 } XVariantOfInt64;
1752 
1753 typedef struct {
1754  int LangId;
1756 } XVariantOfUInt8;
1757 
1758 typedef struct {
1759  int LangId;
1762 
1763 typedef struct {
1764  int LangId;
1767 
1768 typedef struct {
1769  int LangId;
1772 
1773 typedef struct {
1774  int LangId;
1776 } XVariantOfBool;
1777 
1778 typedef struct {
1779  int LangId;
1781 } XVariantOfEnum;
1782 
1783 typedef struct {
1784  int LangId;
1786 } XVariantOfSet;
1787 
1788 typedef struct {
1789  int LangId;
1791 } XVariantOfFloat;
1792 
1793 typedef struct {
1794  int LangId;
1796 } XVariantOfChar;
1797 
1798 typedef struct {
1799  int LangId;
1801 } XVariantOfColor;
1802 
1803 typedef struct {
1804  int LangId;
1806 } XVariantOfPoint;
1807 
1808 typedef struct {
1809  int LangId;
1811 } XVariantOfRect;
1812 
1813 typedef struct {
1814  int LangId;
1817 
1818 typedef struct {
1819  int LangId;
1822 
1823 typedef struct {
1824  int LangId;
1827 
1828 /******************************************************************************
1829  * TYPE:
1830  * XResource
1831  *
1832  * DESCRIPTION:
1833  * The XResource type definition supports the multilingual resources.
1834  * Multilingual resources allow to store several language dependent variants
1835  * of a single resource. The evaluation of a multilingual resource causes a
1836  * search for the language variant which fits to the currently selected
1837  * language. The variants will be stored in arrays. The last entry in such
1838  * array should belong to the default language (LangId == 0) unless the
1839  * resource is derived from an other resource, which already defines the
1840  * default variant.
1841  *
1842  * ELEMENTS:
1843  * LangId - The unique number of the language the resource belongs to. The
1844  * default language uses 0 (zero) LangId == 0.
1845  * Resource - The pointer to the ROM code where the resource ist stored in.
1846  *
1847  ******************************************************************************/
1848 typedef struct {
1849  int LangId;
1850  const void *Resource;
1851 } XResource;
1852 
1853 /*******************************************************************************
1854  * TYPE:
1855  * XVariant
1856  * XSubVariant
1857  *
1858  * DESCRIPTION:
1859  * The structures XVariant and XSubVariant are used to describe a multilingual
1860  * and multivariant constant or resource definition. These structures do store
1861  * links to the content of the definition and to the sub variants, which are
1862  * derived from it.
1863  *
1864  * The first structure XVariant serves as the descriptor of a such
1865  *multilingual multivariant definition. The second structure XSubVariant is used
1866  *to define a link to one of the derived sub variants.
1867  *
1868  * ELEMENTS:
1869  * Content - The pointer to the multilingual content of the definition.
1870  * If this pointer is null, the definition does not have its own content. In
1871  * this case, the entire content is inherited from its base variant. The
1872  * meaning of the 'Content' depends on the kind of the definition.
1873  * NoOfLanguages - How many language variants does the definition consists
1874  *of? SubVariants - The pointer to the table, with links to derived variants.
1875  * If this pointer is null, the definition does not own any derived
1876  *variants. The table is zero terminated. Style - The style, the sub
1877  *variant 'Variant' is used for. Variant - The pointer to the sub variant
1878  *derived from this variant.
1879  *
1880  *******************************************************************************/
1881 struct _XSubVariant;
1882 typedef struct {
1883  const void *Content;
1885  const struct _XSubVariant *SubVariants;
1886 } XVariant;
1887 
1888 typedef struct _XSubVariant {
1889  int Style;
1891 } XSubVariant;
1892 
1893 /*******************************************************************************
1894  * MACRO:
1895  * EW_DEFINE_CONST_WITH_VARIANTS
1896  * EW_END_OF_CONST_WITH_VARIANTS
1897  * EW_DEFINE_CONST_VARIANTS_ONLY
1898  * EW_END_OF_CONST_VARIANTS_ONLY
1899  * EW_CONST_WITHOUT_VARIANTS
1900  * EW_CONST_VARIANT
1901  * EW_STATIC_CONST_VARIANT
1902  *
1903  * DESCRIPTION:
1904  * These macros have been defined to hide the complexity of the internal
1905  * structure of a constant. The usage of these macros makes the generatated
1906  * 'C' code more independent from the used 'C' compiler and makes it readable
1907  * for the human. These macros are needed for multilingual / multivariant
1908  * constants only.
1909  *
1910  * These macros initialize a global list of variants, which are derived from
1911  * a constant. When the constant is accessed during the runtime, the list is
1912  * evaluated in order to find the variant, which fits to the currently active
1913  * styles. The so called 'styles set' can be read and changed by calling the
1914  * function EwGetStyles() and EwSetStyles(). See the example below:
1915  *
1916  * EW_DEFINE_CONST_WITH_VARIANTS( MyUnitMyConst )
1917  * EW_CONST_VARIANT( Style1, TheNameOfTheVariant1 )
1918  * EW_CONST_VARIANT( Style2, TheNameOfTheVariant2 )
1919  * EW_END_OF_CONST_WITH_VARIANTS( MyUnitMyConst )
1920  *
1921  * The CONST_WITH_VARIANTS version of the macros is used to define a constant,
1922  * which has its own content and a set of derived variants.
1923  *
1924  * The CONST_VARIANTS_ONLY version provides the definition of a constant,
1925  *which derives all values from its base variant. In this case, the constant
1926  *itself does not occupy any space in the ROM. The macros define the list with
1927  * derived variants only.
1928  *
1929  * The CONST_WITHOUT_VARIANTS version of these macros defines a constant with
1930  * its own content, but without any derived variants.
1931  *
1932  * ARGUMENTS:
1933  * aConstant - The name of the constant itself.
1934  * aStyle - The name of the style, for which the constant variant should be
1935  * used during the runtime.
1936  * aVariant - The name of the constant variant to use, when the specified
1937  * aStyle is currently activated in the styles set.
1938  *
1939  *******************************************************************************/
1940 #define EW_DECLARE_CONST(aConstant) extern const XVariant aConstant;
1941 
1942 #define EW_DEFINE_CONST_WITH_VARIANTS(aConstant) \
1943  static const XSubVariant _v_##aConstant[] = {
1944 #define EW_END_OF_CONST_WITH_VARIANTS(aConstant) \
1945  { \
1946  0, 0 \
1947  } \
1948  } \
1949  ; \
1950  const XVariant aConstant = {_##aConstant, \
1951  sizeof(_##aConstant) / sizeof(*_##aConstant), \
1952  _v_##aConstant};
1953 
1954 #define EW_DEFINE_CONST_VARIANTS_ONLY(aConstant) \
1955  static const XSubVariant _v_##aConstant[] = {
1956 #define EW_END_OF_CONST_VARIANTS_ONLY(aConstant) \
1957  { \
1958  0, 0 \
1959  } \
1960  } \
1961  ; \
1962  const XVariant aConstant = {0, 0, _v_##aConstant};
1963 
1964 #define EW_CONST_WITHOUT_VARIANTS(aConstant) \
1965  const XVariant aConstant = { \
1966  _##aConstant, sizeof(_##aConstant) / sizeof(*_##aConstant), 0};
1967 
1968 #define EW_CONST_VARIANT(aStyle, aVariant) \
1969  { \
1970  aStyle, &aVariant \
1971  }
1972 
1973 #define EW_STATIC_CONST_VARIANT(aVariant) \
1974  { \
1975  0, &aVariant \
1976  }
1977 
1978 /*******************************************************************************
1979  * MACRO:
1980  * EW_DEFINE_RES_WITH_VARIANTS
1981  * EW_END_OF_RES_WITH_VARIANTS
1982  * EW_DEFINE_RES_VARIANTS_ONLY
1983  * EW_END_OF_RES_VARIANTS_ONLY
1984  * EW_RES_WITHOUT_VARIANTS
1985  * EW_RES_VARIANT
1986  * EW_STATIC_RES_VARIANT
1987  *
1988  * DESCRIPTION:
1989  * These macros have been defined to hide the complexity of the internal
1990  * structure of a resources. The usage of these macros makes the generatated
1991  * 'C' code more independent from the used 'C' compiler and makes it readable
1992  * for the human. These macros are needed for multilingual / multivariant
1993  * resources only.
1994  *
1995  * These macros initialize a global list of variants, which are derived from
1996  * a resource. When the resource is accessed during the runtime, the list is
1997  * evaluated in order to find the variant, which fits to the currently active
1998  * styles. The so called 'styles set' can be read and changed by calling the
1999  * function EwGetStyles() and EwSetStyles(). See the example below:
2000  *
2001  * EW_DEFINE_RES_WITH_VARIANTS( MyUnitMyRes )
2002  * EW_RES_VARIANT( Style1, TheNameOfTheVariant1 )
2003  * EW_RES_VARIANT( Style2, TheNameOfTheVariant2 )
2004  * EW_END_OF_RES_WITH_VARIANTS( MyUnitMyRes )
2005  *
2006  * The RES_WITH_VARIANTS version of the macros is used to define a resource,
2007  * which has its own content and a set of derived variants.
2008  *
2009  * The RES_VARIANTS_ONLY version provides the definition of a resource, which
2010  * derives all values from its base variant. In this case, the resource itself
2011  * does not occupy any space in the ROM. The macros define the list with
2012  * derived variants only.
2013  *
2014  * The RES_WITHOUT_VARIANTS version of these macros defines a resource with
2015  * its own content, but without any derived variants.
2016  *
2017  * ARGUMENTS:
2018  * aResource - The name of the resource itself.
2019  * aStyle - The name of the style, for which the resource variant should be
2020  * used during the runtime.
2021  * aVariant - The name of the resource variant to use, when the specified
2022  * aStyle is currently activated in the styles set.
2023  *
2024  *******************************************************************************/
2025 #define EW_DEFINE_RES_WITH_VARIANTS(aResource) \
2026  static const XSubVariant _v_##aResource[] = {
2027 #define EW_END_OF_RES_WITH_VARIANTS(aResource) \
2028  { \
2029  0, 0 \
2030  } \
2031  } \
2032  ; \
2033  const XVariant aResource = {_##aResource, \
2034  sizeof(_##aResource) / sizeof(*_##aResource), \
2035  _v_##aResource};
2036 
2037 #define EW_DEFINE_RES_VARIANTS_ONLY(aResource) \
2038  static const XSubVariant _v_##aResource[] = {
2039 #define EW_END_OF_RES_VARIANTS_ONLY(aResource) \
2040  { \
2041  0, 0 \
2042  } \
2043  } \
2044  ; \
2045  const XVariant aResource = {0, 0, _v_##aResource};
2046 
2047 #define EW_RES_WITHOUT_VARIANTS(aResource) \
2048  const XVariant aResource = { \
2049  _##aResource, sizeof(_##aResource) / sizeof(*_##aResource), 0};
2050 
2051 #define EW_RES_VARIANT(aStyle, aVariant) \
2052  { \
2053  aStyle, &aVariant \
2054  }
2055 
2056 #define EW_STATIC_RES_VARIANT(aVariant) \
2057  { \
2058  0, &aVariant \
2059  }
2060 
2061 /******************************************************************************
2062  * TYPE:
2063  * XRef
2064  *
2065  * DESCRIPTION:
2066  * The XRef type definition is necessary to store a reference to a property.
2067  *
2068  * ELEMENTS:
2069  * Object - Pointer to an object which contains the referenced property.
2070  * OnGet - Pointer to the properties own OnGet() method.
2071  * OnSet - Pointer to the properties own OnSet() method.
2072  *
2073  ******************************************************************************/
2075 typedef struct {
2076  void *Object;
2079 } XRef;
2080 
2081 /* EwNullRef stores a constant 'null' reference, so it is possible to use it
2082  immediatelly in assignments or comparations */
2083 extern const XRef EwNullRef;
2084 
2085 /******************************************************************************
2086  * TYPE:
2087  * XSlotProc
2088  *
2089  * DESCRIPTION:
2090  * The XSlotProc type defines the prototype for all slot methods.
2091  *
2092  * ARGUMENTS:
2093  * aObject - Pointer to the object which contains the slot.
2094  * aSender - Pointer to the signal sender.
2095  *
2096  * RETURN VALUE:
2097  * None
2098  *
2099  ******************************************************************************/
2100 typedef void (*XSlotProc)(void *aObject, XObject aSender);
2101 
2102 /******************************************************************************
2103  * TYPE:
2104  * XSlot
2105  *
2106  * DESCRIPTION:
2107  * The XSlot type definition is necessary to store a slot.
2108  *
2109  * ELEMENTS:
2110  * Object - Pointer to an object which contains the slot.
2111  * SlotProc - Pointer to the slots own method.
2112  *
2113  ******************************************************************************/
2114 typedef struct {
2115  void *Object;
2116  XSlotProc SlotProc;
2117 } XSlot;
2118 
2119 /* EwNullSlot stores a constant 'null' slot, so it is possible to use it
2120  immediatelly in assignments or comparations */
2121 extern const XSlot EwNullSlot;
2122 
2123 /******************************************************************************
2124  * TYPE:
2125  * XAutoObject
2126  *
2127  * DESCRIPTION:
2128  * The XAutoObject type definition describes an auto object within the ROM
2129  * code.
2130  *
2131  * ELEMENTS:
2132  * Init - Pointer to a function containing the initialization code of the
2133  * object.
2134  *
2135  ******************************************************************************/
2137 
2138 typedef struct {
2140 } XAutoObject;
2141 
2142 /*******************************************************************************
2143  * MACRO:
2144  * EW_DECLARE_AUTOOBJECT
2145  * EW_DEFINE_AUTOOBJECT
2146  * EW_DEFINE_AUTOOBJECT_VARIANTS
2147  * EW_END_OF_AUTOOBJECT_VARIANTS
2148  * EW_AUTOOBJECT_VARIANT
2149  * EW_STATIC_AUTOOBJECT_VARIANT
2150  *
2151  * DESCRIPTION:
2152  * These macros have been defined to hide the complexity of the internal
2153  * structure of an auto object. The usage of these macros makes the
2154  *generatated 'C' code more independent from the used 'C' compiler and makes it
2155  *readable for the human. These macros are needed for auto objects only.
2156  *
2157  * The both macros EW_DECLARE_AUTOOBJECT and EW_DEFINE_AUTOOBJECT are used n
2158  * order to declare and implement an auto object. The remaining macros do
2159  * initialize a global list of variants, which are derived from the affected
2160  * auto object. When the auto object is accessed during the runtime, the list
2161  * is evaluated in order to find the variant, which fits to the active style.
2162  * The so called 'styles set' can be read and changed by calling the function
2163  * EwGetStyles() and EwSetStyles(). See the example below:
2164  *
2165  * EW_DEFINE_AUTOOBJECT_VARIANTS( MyUnitMyAutoObject )
2166  * EW_AUTOOBJECT_VARIANT( Style1, TheNameOfTheVariant1 )
2167  * EW_AUTOOBJECT_VARIANT( Style2, TheNameOfTheVariant2 )
2168  * EW_STATIC_AUTOOBJECT_VARIANT( TheNameOfTheVariant2 )
2169  * EW_END_OF_AUTOOBJECT_VARIANTS( MyUnitMyAutoObject )
2170  *
2171  * The entries of the list are definied by the macros EW_AUTOOBJECT_VARIANT
2172  * and EW_STATIC_AUTOOBJECT_VARIANT. The last of these both macros specifies
2173  * a static, style independent auto object sub-variant.
2174  *
2175  * ARGUMENTS:
2176  * aAutoObject - The name of the auto object itself.
2177  * aStyle - The name of the style, for which the auto object variant
2178  * should be used during the runtime.
2179  * aVariant - The name of the auto object variant to use, when aStyle is
2180  * currently activated in the styles set.
2181  *
2182  *******************************************************************************/
2183 #define EW_DECLARE_AUTOOBJECT(aAutoObject, aClass) \
2184  extern const XVariant aAutoObject; \
2185  \
2186  void aAutoObject##__Init(aClass _this);
2187 
2188 #define EW_DEFINE_AUTOOBJECT(aAutoObject, aClass) \
2189  static const XAutoObject _##aAutoObject = { \
2190  (XAutoObjectInitProc)aAutoObject##__Init};
2191 
2192 #define EW_DEFINE_AUTOOBJECT_VARIANTS(aAutoObject) \
2193  static const XSubVariant _v_##aAutoObject[] = {
2194 #define EW_END_OF_AUTOOBJECT_VARIANTS(aAutoObject) \
2195  { \
2196  0, 0 \
2197  } \
2198  } \
2199  ; \
2200  \
2201  const XVariant aAutoObject = {&_##aAutoObject, 1, _v_##aAutoObject};
2202 
2203 #define EW_AUTOOBJECT_VARIANT(aStyle, aVariant) \
2204  { \
2205  aStyle, &aVariant \
2206  }
2207 
2208 #define EW_STATIC_AUTOOBJECT_VARIANT(aVariant) \
2209  { \
2210  0, &aVariant \
2211  }
2212 
2213 /*******************************************************************************
2214  * FUNCTION:
2215  * EwMathSin
2216  *
2217  * DESCRIPTION:
2218  * The function EwMathSin() implements the Chora math_sin() function.
2219  *
2220  * ARGUMENTS:
2221  * aAngle - An angle in degree.
2222  *
2223  * RETURN VALUE:
2224  * Returns the determinated sine value.
2225  *
2226  *******************************************************************************/
2227 XFloat EwMathSin(XFloat aAngle);
2228 
2229 /*******************************************************************************
2230  * FUNCTION:
2231  * EwMathCos
2232  *
2233  * DESCRIPTION:
2234  * The function EwMathCos() implements the Chora math_cos() function.
2235  *
2236  * ARGUMENTS:
2237  * aAngle - An angle in degree.
2238  *
2239  * RETURN VALUE:
2240  * Returns the determinated cosine value.
2241  *
2242  *******************************************************************************/
2243 XFloat EwMathCos(XFloat aAngle);
2244 
2245 /*******************************************************************************
2246  * FUNCTION:
2247  * EwMathTan
2248  *
2249  * DESCRIPTION:
2250  * The function EwMathTan() implements the Chora math_tan() function.
2251  *
2252  * ARGUMENTS:
2253  * aAngle - An angle in degree.
2254  *
2255  * RETURN VALUE:
2256  * Returns the determinated tangent value.
2257  *
2258  *******************************************************************************/
2259 XFloat EwMathTan(XFloat aAngle);
2260 
2261 /*******************************************************************************
2262  * FUNCTION:
2263  * EwMathArcSin
2264  *
2265  * DESCRIPTION:
2266  * The function EwMathArcSin() implements the Chora math_asin() function.
2267  *
2268  * ARGUMENTS:
2269  * aValue - Value to calculate the arc sine angle. Only values in the range
2270  * -1.0 .. +1.0 are valid.
2271  *
2272  * RETURN VALUE:
2273  * Returns the determinated angle in the range -90 .. +90 degress.
2274  *
2275  *******************************************************************************/
2276 XFloat EwMathArcSin(XFloat aValue);
2277 
2278 /*******************************************************************************
2279  * FUNCTION:
2280  * EwMathArcCos
2281  *
2282  * DESCRIPTION:
2283  * The function EwMathArcCos() implements the Chora math_acos() function.
2284  *
2285  * ARGUMENTS:
2286  * aValue - Value to calculate the arc cosine. Only values in the range
2287  * -1.0 .. +1.0 are valid.
2288  *
2289  * RETURN VALUE:
2290  * Returns the determinated angle in the range 0 .. +180 degress.
2291  *
2292  *******************************************************************************/
2293 XFloat EwMathArcCos(XFloat aValue);
2294 
2295 /*******************************************************************************
2296  * FUNCTION:
2297  * EwMathArcTan
2298  *
2299  * DESCRIPTION:
2300  * The function EwMathArcTan() implements the Chora math_atan() function.
2301  *
2302  * ARGUMENTS:
2303  * aValue - Value to calculate the arc tangent.
2304  *
2305  * RETURN VALUE:
2306  * Returns the determinated angle in the range -90 .. +90 degress.
2307  *
2308  *******************************************************************************/
2309 XFloat EwMathArcTan(XFloat aValue);
2310 
2311 /*******************************************************************************
2312  * FUNCTION:
2313  * EwMathArcTan2
2314  *
2315  * DESCRIPTION:
2316  * The function EwMathArcTan2() implements the Chora math_atan2() function.
2317  *
2318  * ARGUMENTS:
2319  * aY, aX - Values representing the y- and x-coordinates.
2320  *
2321  * RETURN VALUE:
2322  * Returns the determinated angle in the range -180 .. +180 degress.
2323  *
2324  *******************************************************************************/
2326 
2327 /*******************************************************************************
2328  * FUNCTION:
2329  * EwMathSqrt
2330  *
2331  * DESCRIPTION:
2332  * The function EwMathSqrt() implements the Chora math_sqrt() function. It
2333  * calculates the square root value.
2334  *
2335  * ARGUMENTS:
2336  * aValue - The value to calculate square root.
2337  *
2338  * RETURN VALUE:
2339  * Returns the determinated square root value.
2340  *
2341  *******************************************************************************/
2342 XFloat EwMathSqrt(XFloat aValue);
2343 
2344 /*******************************************************************************
2345  * FUNCTION:
2346  * EwMathPow
2347  *
2348  * DESCRIPTION:
2349  * The function EwMathPow() implements the Chora math_pow() function. It
2350  * calculates the power a ^ b function.
2351  *
2352  * ARGUMENTS:
2353  * aA - The value to calculate the pow()
2354  * aB - The value to calculate the pow()
2355  *
2356  * RETURN VALUE:
2357  * Returns the determinated power value.
2358  *
2359  *******************************************************************************/
2360 XFloat EwMathPow(XFloat aA, XFloat aB);
2361 
2362 /*******************************************************************************
2363  * FUNCTION:
2364  * EwMathExp
2365  *
2366  * DESCRIPTION:
2367  * The function EwMathExp() implements the Chora math_exp() function. It
2368  * calculates the base 'e' exponential function of the given value aValue.
2369  *
2370  * ARGUMENTS:
2371  * aValue - The value to calculate the e ^ aValue
2372  *
2373  * RETURN VALUE:
2374  * Returns the determinated exponential value of aValue.
2375  *
2376  *******************************************************************************/
2377 XFloat EwMathExp(XFloat aValue);
2378 
2379 /*******************************************************************************
2380  * FUNCTION:
2381  * EwMathLog
2382  *
2383  * DESCRIPTION:
2384  * The function EwMathLog() implements the Chora math_log() function. It
2385  * calculates the natural (base 'e') logarithm of the given value aValue.
2386  *
2387  * ARGUMENTS:
2388  * aValue - The value to calculate the base 'e' logarithm.
2389  *
2390  * RETURN VALUE:
2391  * Returns the determinated logarithm value of aValue.
2392  *
2393  *******************************************************************************/
2394 XFloat EwMathLog(XFloat aValue);
2395 
2396 /*******************************************************************************
2397  * FUNCTION:
2398  * EwMathLog10
2399  *
2400  * DESCRIPTION:
2401  * The function EwMathLog10() implements the Chora math_log10() function. It
2402  * calculates the common (base 10) logarithm of the given value aValue.
2403  *
2404  * ARGUMENTS:
2405  * aValue - The value to calculate the base 10 logarithm.
2406  *
2407  * RETURN VALUE:
2408  * Returns the determinated logarithm value of aValue.
2409  *
2410  *******************************************************************************/
2411 XFloat EwMathLog10(XFloat aValue);
2412 
2413 /*******************************************************************************
2414  * FUNCTION:
2415  * EwMathRandInt32
2416  *
2417  * DESCRIPTION:
2418  * The function EwMathRandInt32() implements the Chora math_rand() function
2419  * for int32 operands. It calculates the random value in the range aValue1 ..
2420  * aValue2.
2421  *
2422  * ARGUMENTS:
2423  * aValue1,
2424  * aValue2 - Range for the value.
2425  *
2426  * RETURN VALUE:
2427  * Returns the determinated random value.
2428  *
2429  *******************************************************************************/
2430 XInt32 EwMathRandInt32(XInt32 aValue1, XInt32 aValue2);
2431 
2432 /*******************************************************************************
2433  * FUNCTION:
2434  * EwMathRandFloat
2435  *
2436  * DESCRIPTION:
2437  * The function EwMathRandFloat() implements the Chora math_rand() function
2438  * for float operands. It calculates the random value in the range aValue1 ..
2439  * aValue2.
2440  *
2441  * ARGUMENTS:
2442  * aValue1,
2443  * aValue2 - Range for the value.
2444  *
2445  * RETURN VALUE:
2446  * Returns the determinated random value.
2447  *
2448  *******************************************************************************/
2449 XFloat EwMathRandFloat(XFloat aValue1, XFloat aValue2);
2450 
2451 /*******************************************************************************
2452  * FUNCTION:
2453  * EwMathRound
2454  *
2455  * DESCRIPTION:
2456  * The function EwMathRound() implements the Chora math_round() function.
2457  *
2458  * ARGUMENTS:
2459  * aValue - A value to round.
2460  *
2461  * RETURN VALUE:
2462  * Returns the correctly rounded value.
2463  *
2464  *******************************************************************************/
2465 XFloat EwMathRound(XFloat aValue);
2466 
2467 /*******************************************************************************
2468  * FUNCTION:
2469  * EwMathFloor
2470  *
2471  * DESCRIPTION:
2472  * The function EwMathFloor() implements the Chora math_floor() function.
2473  *
2474  * ARGUMENTS:
2475  * aValue - A value to round.
2476  *
2477  * RETURN VALUE:
2478  * Returns the floor rounded value.
2479  *
2480  *******************************************************************************/
2481 XFloat EwMathFloor(XFloat aValue);
2482 
2483 /*******************************************************************************
2484  * FUNCTION:
2485  * EwMathCeil
2486  *
2487  * DESCRIPTION:
2488  * The function EwMathCeil() implements the Chora math_ceil() function.
2489  *
2490  * ARGUMENTS:
2491  * aValue - A value to round.
2492  *
2493  * RETURN VALUE:
2494  * Returns the ceil rounded value.
2495  *
2496  *******************************************************************************/
2497 XFloat EwMathCeil(XFloat aValue);
2498 
2499 /*******************************************************************************
2500  * FUNCTION:
2501  * EwGetInt32Min
2502  *
2503  * DESCRIPTION:
2504  * The function EwGetInt32Min() implements the Chora math_min() function.
2505  *
2506  * ARGUMENTS:
2507  * aCount - Number of values to estimate the minimum.
2508  *
2509  * RETURN VALUE:
2510  * Returns the minimum of the given aCount XInt32 values.
2511  *
2512  *******************************************************************************/
2513 XInt32 EwGetInt32Min(int aCount, ...);
2514 
2515 /*******************************************************************************
2516  * FUNCTION:
2517  * EwGetUInt32Min
2518  *
2519  * DESCRIPTION:
2520  * The function EwGetUInt32Min() implements the Chora math_min() function.
2521  *
2522  * ARGUMENTS:
2523  * aCount - Number of values to estimate the minimum.
2524  *
2525  * RETURN VALUE:
2526  * Returns the minimum of the given aCount XUInt32 values.
2527  *
2528  *******************************************************************************/
2529 XUInt32 EwGetUInt32Min(int aCount, ...);
2530 
2531 /*******************************************************************************
2532  * FUNCTION:
2533  * EwGetInt64Min
2534  *
2535  * DESCRIPTION:
2536  * The function EwGetInt64Min() implements the Chora math_min() function.
2537  *
2538  * ARGUMENTS:
2539  * aCount - Number of values to estimate the minimum.
2540  *
2541  * RETURN VALUE:
2542  * Returns the minimum of the given aCount XInt64 values.
2543  *
2544  *******************************************************************************/
2545 XInt64 EwGetInt64Min(int aCount, ...);
2546 
2547 /*******************************************************************************
2548  * FUNCTION:
2549  * EwGetUInt64Min
2550  *
2551  * DESCRIPTION:
2552  * The function EwGetUInt64Min() implements the Chora math_min() function.
2553  *
2554  * ARGUMENTS:
2555  * aCount - Number of values to estimate the minimum.
2556  *
2557  * RETURN VALUE:
2558  * Returns the minimum of the given aCount XUInt64 values.
2559  *
2560  *******************************************************************************/
2561 XUInt64 EwGetUInt64Min(int aCount, ...);
2562 
2563 /*******************************************************************************
2564  * FUNCTION:
2565  * EwGetFloatMin
2566  *
2567  * DESCRIPTION:
2568  * The function EwGetFloatMin() implements the Chora math_min() function.
2569  *
2570  * ARGUMENTS:
2571  * aCount - Number of values to estimate the minimum.
2572  *
2573  * RETURN VALUE:
2574  * Returns the minimum of the given aCount XFloat values.
2575  *
2576  *******************************************************************************/
2577 XFloat EwGetFloatMin(int aCount, ...);
2578 
2579 /*******************************************************************************
2580  * FUNCTION:
2581  * EwGetColorMin
2582  *
2583  * DESCRIPTION:
2584  * The function EwGetColorMin() implements the Chora math_min() function.
2585  *
2586  * ARGUMENTS:
2587  * aCount - Number of values to estimate the minimum.
2588  *
2589  * RETURN VALUE:
2590  * Returns the minimum of the given aCount XColor values.
2591  *
2592  *******************************************************************************/
2593 XColor EwGetColorMin(int aCount, ...);
2594 
2595 /*******************************************************************************
2596  * FUNCTION:
2597  * EwGetPointMin
2598  *
2599  * DESCRIPTION:
2600  * The function EwGetPointMin() implements the Chora math_min() function.
2601  *
2602  * ARGUMENTS:
2603  * aCount - Number of values to estimate the minimum.
2604  *
2605  * RETURN VALUE:
2606  * Returns the minimum of the given aCount XPoint values.
2607  *
2608  *******************************************************************************/
2609 XPoint EwGetPointMin(int aCount, ...);
2610 
2611 /*******************************************************************************
2612  * FUNCTION:
2613  * EwGetRectMin
2614  *
2615  * DESCRIPTION:
2616  * The function EwGetRectMin() implements the Chora math_min() function.
2617  *
2618  * ARGUMENTS:
2619  * aCount - Number of values to estimate the minimum.
2620  *
2621  * RETURN VALUE:
2622  * Returns the minimum of the given aCount XRect values.
2623  *
2624  *******************************************************************************/
2625 XRect EwGetRectMin(int aCount, ...);
2626 
2627 /*******************************************************************************
2628  * FUNCTION:
2629  * EwGetInt32Max
2630  *
2631  * DESCRIPTION:
2632  * The function EwGetInt32Max() implements the Chora math_min() function.
2633  *
2634  * ARGUMENTS:
2635  * aCount - Number of values to estimate the minimum.
2636  *
2637  * RETURN VALUE:
2638  * Returns the minimum of the given aCount XInt32 values.
2639  *
2640  *******************************************************************************/
2641 XInt32 EwGetInt32Max(int aCount, ...);
2642 
2643 /*******************************************************************************
2644  * FUNCTION:
2645  * EwGetUInt32Max
2646  *
2647  * DESCRIPTION:
2648  * The function EwGetUInt32Max() implements the Chora math_min() function.
2649  *
2650  * ARGUMENTS:
2651  * aCount - Number of values to estimate the minimum.
2652  *
2653  * RETURN VALUE:
2654  * Returns the minimum of the given aCount XUInt32 values.
2655  *
2656  *******************************************************************************/
2657 XUInt32 EwGetUInt32Max(int aCount, ...);
2658 
2659 /*******************************************************************************
2660  * FUNCTION:
2661  * EwGetInt64Max
2662  *
2663  * DESCRIPTION:
2664  * The function EwGetInt64Max() implements the Chora math_min() function.
2665  *
2666  * ARGUMENTS:
2667  * aCount - Number of values to estimate the minimum.
2668  *
2669  * RETURN VALUE:
2670  * Returns the minimum of the given aCount XInt64 values.
2671  *
2672  *******************************************************************************/
2673 XInt64 EwGetInt64Max(int aCount, ...);
2674 
2675 /*******************************************************************************
2676  * FUNCTION:
2677  * EwGetUInt64Max
2678  *
2679  * DESCRIPTION:
2680  * The function EwGetUInt64Max() implements the Chora math_min() function.
2681  *
2682  * ARGUMENTS:
2683  * aCount - Number of values to estimate the minimum.
2684  *
2685  * RETURN VALUE:
2686  * Returns the minimum of the given aCount XUInt64 values.
2687  *
2688  *******************************************************************************/
2689 XUInt64 EwGetUInt64Max(int aCount, ...);
2690 
2691 /*******************************************************************************
2692  * FUNCTION:
2693  * EwGetFloatMax
2694  *
2695  * DESCRIPTION:
2696  * The function EwGetFloatMax() implements the Chora math_min() function.
2697  *
2698  * ARGUMENTS:
2699  * aCount - Number of values to estimate the minimum.
2700  *
2701  * RETURN VALUE:
2702  * Returns the minimum of the given aCount XFloat values.
2703  *
2704  *******************************************************************************/
2705 XFloat EwGetFloatMax(int aCount, ...);
2706 
2707 /*******************************************************************************
2708  * FUNCTION:
2709  * EwGetColorMax
2710  *
2711  * DESCRIPTION:
2712  * The function EwGetColorMax() implements the Chora math_max() function.
2713  *
2714  * ARGUMENTS:
2715  * aCount - Number of values to estimate the maximum.
2716  *
2717  * RETURN VALUE:
2718  * Returns the maximum of the given aCount XColor values.
2719  *
2720  *******************************************************************************/
2721 XColor EwGetColorMax(int aCount, ...);
2722 
2723 /*******************************************************************************
2724  * FUNCTION:
2725  * EwGetPointMax
2726  *
2727  * DESCRIPTION:
2728  * The function EwGetPointMax() implements the Chora math_max() function.
2729  *
2730  * ARGUMENTS:
2731  * aCount - Number of values to estimate the maximum.
2732  *
2733  * RETURN VALUE:
2734  * Returns the maximum of the given aCount XPoint values.
2735  *
2736  *******************************************************************************/
2737 XPoint EwGetPointMax(int aCount, ...);
2738 
2739 /*******************************************************************************
2740  * FUNCTION:
2741  * EwGetRectMax
2742  *
2743  * DESCRIPTION:
2744  * The function EwGetRectMax() implements the Chora math_max() function.
2745  *
2746  * ARGUMENTS:
2747  * aCount - Number of values to estimate the maximum.
2748  *
2749  * RETURN VALUE:
2750  * Returns the maximum of the given aCount XRect values.
2751  *
2752  *******************************************************************************/
2753 XRect EwGetRectMax(int aCount, ...);
2754 
2755 /*******************************************************************************
2756  * FUNCTION:
2757  * EwGetInt32Abs
2758  *
2759  * DESCRIPTION:
2760  * The function EwGetInt32Abs() implements the Chora int8.abs, int16.abs,
2761  * int32.abs instant properties.
2762  *
2763  * ARGUMENTS:
2764  * aValue - A value to calculate its absolute value.
2765  *
2766  * RETURN VALUE:
2767  * Returns the absolute value of aValue.
2768  *
2769  *******************************************************************************/
2770 XInt32 EwGetInt32Abs(XInt32 aValue);
2771 
2772 /*******************************************************************************
2773  * FUNCTION:
2774  * EwGetInt64Abs
2775  *
2776  * DESCRIPTION:
2777  * The function EwGetInt64Abs() implements the Chora int8.abs, int16.abs,
2778  * int64.abs instant properties.
2779  *
2780  * ARGUMENTS:
2781  * aValue - A value to calculate its absolute value.
2782  *
2783  * RETURN VALUE:
2784  * Returns the absolute value of aValue.
2785  *
2786  *******************************************************************************/
2787 XInt64 EwGetInt64Abs(XInt64 aValue);
2788 
2789 /*******************************************************************************
2790  * FUNCTION:
2791  * EwGetFloatAbs
2792  *
2793  * DESCRIPTION:
2794  * The function EwGetFloatAbs() implements the Chora float.abs instant
2795  *property.
2796  *
2797  * ARGUMENTS:
2798  * aValue - A value to calculate its absolute value.
2799  *
2800  * RETURN VALUE:
2801  * Returns the absolute value of aValue.
2802  *
2803  *******************************************************************************/
2804 XFloat EwGetFloatAbs(XFloat aValue);
2805 
2806 /*******************************************************************************
2807  * FUNCTION:
2808  * EwGetPointAbs
2809  *
2810  * DESCRIPTION:
2811  * The function EwGetPointAbs() implements the Chora point.abs instant
2812  * property.
2813  *
2814  * ARGUMENTS:
2815  * aValue - A value to calculate its absolute value.
2816  *
2817  * RETURN VALUE:
2818  * Returns the absolute value of aValue.
2819  *
2820  *******************************************************************************/
2821 XPoint EwGetPointAbs(XPoint aValue);
2822 
2823 /*******************************************************************************
2824  * FUNCTION:
2825  * EwGetRectAbs
2826  *
2827  * DESCRIPTION:
2828  * The function EwGetRectAbs() implements the Chora rect.abs instant
2829  * property.
2830  *
2831  * ARGUMENTS:
2832  * aValue - A value to calculate its absolute value.
2833  *
2834  * RETURN VALUE:
2835  * Returns the absolute value of aValue.
2836  *
2837  *******************************************************************************/
2838 XRect EwGetRectAbs(XRect aValue);
2839 
2840 /*******************************************************************************
2841  * FUNCTION:
2842  * EwGetInt32UAbs
2843  *
2844  * DESCRIPTION:
2845  * The function EwGetInt32UAbs() implements the Chora int8.uabs, int16.uabs,
2846  * int32.uabs instant properties.
2847  *
2848  * ARGUMENTS:
2849  * aValue - A value to calculate its absolute value.
2850  *
2851  * RETURN VALUE:
2852  * Returns the absolute value of aValue.
2853  *
2854  *******************************************************************************/
2855 XUInt32 EwGetInt32UAbs(XInt32 aValue);
2856 
2857 /*******************************************************************************
2858  * FUNCTION:
2859  * EwGetInt64UAbs
2860  *
2861  * DESCRIPTION:
2862  * The function EwGetInt64UAbs() implements the Chora int8.uabs, int16.uabs,
2863  * int64.uabs instant properties.
2864  *
2865  * ARGUMENTS:
2866  * aValue - A value to calculate its absolute value.
2867  *
2868  * RETURN VALUE:
2869  * Returns the absolute value of aValue.
2870  *
2871  *******************************************************************************/
2872 XUInt64 EwGetInt64UAbs(XInt64 aValue);
2873 
2874 /*******************************************************************************
2875  * FUNCTION:
2876  * EwNewFloatNaN
2877  *
2878  * DESCRIPTION:
2879  * The function EwNewFloatNaN() return the value corresponding to float NAN.
2880  *
2881  * EwNewFloatNaN() implements the Chora instant constructor:
2882  * 'float_nan()'.
2883  *
2884  * ARGUMENTS:
2885  * None
2886  *
2887  * RETURN VALUE:
2888  * Returns the initialized float value.
2889  *
2890  *******************************************************************************/
2891 XFloat EwNewFloatNaN(void);
2892 
2893 /*******************************************************************************
2894  * FUNCTION:
2895  * EwNewFloatInfP
2896  *
2897  * DESCRIPTION:
2898  * The function EwNewFloatInfP() return the value corresponding to float +INF.
2899  *
2900  * EwNewFloatInfP() implements the Chora instant constructor:
2901  * 'float_infp()'.
2902  *
2903  * ARGUMENTS:
2904  * None
2905  *
2906  * RETURN VALUE:
2907  * Returns the initialized float value.
2908  *
2909  *******************************************************************************/
2910 XFloat EwNewFloatInfP(void);
2911 
2912 /*******************************************************************************
2913  * FUNCTION:
2914  * EwNewFloatInfN
2915  *
2916  * DESCRIPTION:
2917  * The function EwNewFloatInfN() return the value corresponding to float -INF.
2918  *
2919  * EwNewFloatInfN() implements the Chora instant constructor:
2920  * 'float_infn()'.
2921  *
2922  * ARGUMENTS:
2923  * None
2924  *
2925  * RETURN VALUE:
2926  * Returns the initialized float value.
2927  *
2928  *******************************************************************************/
2929 XFloat EwNewFloatInfN(void);
2930 
2931 /*******************************************************************************
2932  * FUNCTION:
2933  * EwIsFloatNaN
2934  *
2935  * DESCRIPTION:
2936  * The function EwIsFloatNaN() implements the Chora float.isnan instant
2937  * property.
2938  *
2939  * ARGUMENTS:
2940  * aValue - A value to test whether it is 'not a number'.
2941  *
2942  * RETURN VALUE:
2943  * Returns != 0 if the given value is not a number.
2944  *
2945  *******************************************************************************/
2946 XBool EwIsFloatNaN(XFloat aValue);
2947 
2948 /*******************************************************************************
2949  * FUNCTION:
2950  * EwIsFloatInf
2951  *
2952  * DESCRIPTION:
2953  * The function EwIsFloatInf() implements the Chora float.isinf instant
2954  * property.
2955  *
2956  * ARGUMENTS:
2957  * aValue - A value to test whether it is a positive/negative infinite value.
2958  *
2959  * RETURN VALUE:
2960  * Returns != 0 if the given value is +/- infinite.
2961  *
2962  *******************************************************************************/
2963 XBool EwIsFloatInf(XFloat aValue);
2964 
2965 /*******************************************************************************
2966  * FUNCTION:
2967  * EwIsFloatInfP
2968  *
2969  * DESCRIPTION:
2970  * The function EwIsFloatInfP() implements the Chora float.isinfp instant
2971  * property.
2972  *
2973  * ARGUMENTS:
2974  * aValue - A value to test whether it is a positive infinite value.
2975  *
2976  * RETURN VALUE:
2977  * Returns != 0 if the given value is + infinite.
2978  *
2979  *******************************************************************************/
2980 XBool EwIsFloatInfP(XFloat aValue);
2981 
2982 /*******************************************************************************
2983  * FUNCTION:
2984  * EwIsFloatInfN
2985  *
2986  * DESCRIPTION:
2987  * The function EwIsFloatInfN() implements the Chora float.isinfn instant
2988  * property.
2989  *
2990  * ARGUMENTS:
2991  * aValue - A value to test whether it is a negative infinite value.
2992  *
2993  * RETURN VALUE:
2994  * Returns != 0 if the given value is - infinite.
2995  *
2996  *******************************************************************************/
2997 XBool EwIsFloatInfN(XFloat aValue);
2998 
2999 /*******************************************************************************
3000  * FUNCTION:
3001  * EwMathLength
3002  *
3003  * DESCRIPTION:
3004  * The function EwMathLength() implements the Chora math_length() built-in
3005  * function intended to calculate the length of a given vector.
3006  *
3007  * ARGUMENTS:
3008  * aX, aY : The size of the vector in X and Y direction.
3009  *
3010  * RETURN VALUE:
3011  * Returns the length of the vector.
3012  *
3013  *******************************************************************************/
3015 
3016 /*******************************************************************************
3017  * FUNCTION:
3018  * EwMathLengthPoint
3019  *
3020  * DESCRIPTION:
3021  * The function EwMathLengthPoint() implements the Chora math_length() built-
3022  * in function intended to calculate the length of a given vector.
3023  *
3024  * ARGUMENTS:
3025  * aPoint : The size of the vector in X and Y direction.
3026  *
3027  * RETURN VALUE:
3028  * Returns the length of the vector.
3029  *
3030  *******************************************************************************/
3032 
3033 /*******************************************************************************
3034  * FUNCTION:
3035  * EwMathTrunc
3036  *
3037  * DESCRIPTION:
3038  * The function EwMathTrunc() implements the Chora math_trunc() built-in
3039  * function intended to calculate the integer part of a given number by
3040  * removing the fractional digits.
3041  *
3042  * ARGUMENTS:
3043  * aValue : The value to calculate the integer part.
3044  *
3045  * RETURN VALUE:
3046  * Returns the integer part of the number.
3047  *
3048  *******************************************************************************/
3049 XFloat EwMathTrunc(XFloat aValue);
3050 
3051 /*******************************************************************************
3052  * FUNCTION:
3053  * EwMathFract
3054  *
3055  * DESCRIPTION:
3056  * The function EwMathFract() implements the Chora math_fract() built-in
3057  * function intended to calculate the fractional part of the given number.
3058  *
3059  * ARGUMENTS:
3060  * aValue : The value to calculate the fractional part.
3061  *
3062  * RETURN VALUE:
3063  * Returns the fractional part of the number.
3064  *
3065  *******************************************************************************/
3066 XFloat EwMathFract(XFloat aValue);
3067 
3068 /*******************************************************************************
3069  * FUNCTION:
3070  * EwSetContains
3071  *
3072  * DESCRIPTION:
3073  * The function EwSetContains() implements the Chora instant method
3074  * 'set.contains()'.
3075  *
3076  * ARGUMENTS:
3077  * aSet1 - The first set to verify its content.
3078  * aSet2 - The second set.
3079  *
3080  * RETURN VALUE:
3081  * The function returns != 0, if the second set aSet2 is contained in the
3082  * given aSet1.
3083  *
3084  *******************************************************************************/
3085 XBool EwSetContains(XSet aSet1, XSet aSet2);
3086 
3087 /*******************************************************************************
3088  * FUNCTION:
3089  * EwNewColor
3090  *
3091  * DESCRIPTION:
3092  * The function EwNewColor() initializes a new color with the given values
3093  * returns the initialized color.
3094  *
3095  * EwNewColor() implements the Chora instant constructor:
3096  * 'color(aRed,aGreen,aBlue)' and 'color(aRed,aGreen,aBlue,aAlpha)'.
3097  *
3098  * ARGUMENTS:
3099  * aRed - Red component of the color.
3100  * aGreen - Green component of the color.
3101  * aBlue - Blue component of the color.
3102  * aAlpha - Alpha component of the color.
3103  *
3104  * RETURN VALUE:
3105  * Returns the initialized color.
3106  *
3107  *******************************************************************************/
3108 XColor EwNewColor(XUInt8 aRed, XUInt8 aGreen, XUInt8 aBlue, XUInt8 aAlpha);
3109 
3110 /*******************************************************************************
3111  * FUNCTION:
3112  * EwMinusColor
3113  *
3114  * DESCRIPTION:
3115  * The function EwMinusColor() subtracts two colors aColor1 - aColor2. The
3116  * substraction will be done for each color component separately. In the case
3117  * the substraction results in a value < 0, EwMinusColor() adjusts the value
3118  * automatically to 0 (zero).
3119  *
3120  * EwMinusColor() implements the Chora instant operator: 'color - color'
3121  *
3122  * ARGUMENTS:
3123  * aColor1 - The color to substract.
3124  * aColor2 - The color to be substracted.
3125  *
3126  * RETURN VALUE:
3127  * Returns a new color containing the substraction of aColor1 and aColor2.
3128  *
3129  *******************************************************************************/
3130 XColor EwMinusColor(XColor aColor1, XColor aColor2);
3131 
3132 /*******************************************************************************
3133  * FUNCTION:
3134  * EwPlusColor
3135  *
3136  * DESCRIPTION:
3137  * The function EwPlusColor() adds two colors aColor1 + aColor2. The addition
3138  * will be done for each color component separately. In the case the addition
3139  * results in a value > 255, EwPlusColor() adjusts the value automatically
3140  * to 255.
3141  *
3142  * EwPlusColor() implements the Chora instant operator: 'color + color'
3143  *
3144  * ARGUMENTS:
3145  * aColor1 - The first color.
3146  * aColor2 - The second color.
3147  *
3148  * RETURN VALUE:
3149  * Returns a new color containing the addition of aColor1 and aColor2.
3150  *
3151  *******************************************************************************/
3152 XColor EwPlusColor(XColor aColor1, XColor aColor2);
3153 
3154 /*******************************************************************************
3155  * FUNCTION:
3156  * EwBlendColor
3157  *
3158  * DESCRIPTION:
3159  * The function EwBlendColor() implements an alphablending algorithm to blend
3160  * one color aColor1 with the second color aColor2. The Alpha component of
3161  * aColor1 decides about the intensity of the alpha blending. If the Alpha
3162  * component of aColor1 is 0 (zero), the function returns an unchanged value
3163  * aColor2. If the Alpha component of aColor1 == 255, the function returns the
3164  * value aColor1. In all other cases, the function returns a mix-color of the
3165  * both colors.
3166  *
3167  * EwBlendColor() implements the Chora instant operator: 'color * color'
3168  *
3169  * ARGUMENTS:
3170  * aColor1 - The first color.
3171  * aColor2 - The second color.
3172  *
3173  * RETURN VALUE:
3174  * Returns a mix-color of the both colors.
3175  *
3176  *******************************************************************************/
3177 XColor EwBlendColor(XColor aColor1, XColor aColor2);
3178 
3179 /*******************************************************************************
3180  * FUNCTION:
3181  * EwBlendColorInt
3182  *
3183  * DESCRIPTION:
3184  * The function EwBlendColorInt() implements an alphablending algorithm to
3185  * blend the color aColor with the value aAlpha. This function applies the
3186  * alpha blending algorithm on all 4 color components of the given color.
3187  *
3188  * EwBlendColorInt() implements the Chora instant operator: 'color * int32'
3189  * and 'int32 * color'.
3190  *
3191  * ARGUMENTS:
3192  * aColor - The color to alphablend with aAlpha.
3193  * aAlpha - The blending factor in range from 0 .. 255.
3194  *
3195  * RETURN VALUE:
3196  * Returns a mix-color of the color aColor and the value aAlpha.
3197  *
3198  *******************************************************************************/
3199 XColor EwBlendColorInt(XColor aColor, XInt32 aAlpha);
3200 
3201 /*******************************************************************************
3202  * FUNCTION:
3203  * EwBlendColorUInt
3204  *
3205  * DESCRIPTION:
3206  * The function EwBlendColorInt() implements an alphablending algorithm to
3207  * blend the color aColor with the value aAlpha. This function applies the
3208  * alpha blending algorithm on all 4 color components of the given color.
3209  *
3210  * EwBlendColorUInt() implements the Chora instant operator: 'color * uint32'
3211  * and 'uint32 * color'.
3212  *
3213  * ARGUMENTS:
3214  * aColor - The color to alphablend with aAlpha.
3215  * aAlpha - The blending factor in range from 0 .. 255.
3216  *
3217  * RETURN VALUE:
3218  * Returns a mix-color of the color aColor and the value aAlpha.
3219  *
3220  *******************************************************************************/
3221 XColor EwBlendColorUInt(XColor aColor, XUInt32 aAlpha);
3222 
3223 /*******************************************************************************
3224  * FUNCTION:
3225  * EwSetColorRed
3226  *
3227  * DESCRIPTION:
3228  * The function EwSetColorRed() changes the Red component of the given color
3229  * to a new value aRed.
3230  *
3231  * EwSetColorRed() implements the write access to the Chora instant property
3232  * 'color.red'.
3233  *
3234  * ARGUMENTS:
3235  * aColor - The color to change the Red component.
3236  * aRed - The new value for the Red component.
3237  *
3238  * RETURN VALUE:
3239  * Returns a new color with the changed Red component.
3240  *
3241  *******************************************************************************/
3242 XColor EwSetColorRed(XColor aColor, XUInt8 aRed);
3243 
3244 /*******************************************************************************
3245  * FUNCTION:
3246  * EwSetColorGreen
3247  *
3248  * DESCRIPTION:
3249  * The function EwSetColorGreen() changes the Green component of the given
3250  * color to a new value aGreen.
3251  *
3252  * EwSetColorGreen() implements the write access to the Chora instant property
3253  * 'color.green'.
3254  *
3255  * ARGUMENTS:
3256  * aColor - The color to change the Green component.
3257  * aGreen - The new value for the Green component.
3258  *
3259  * RETURN VALUE:
3260  * Returns a new color with the changed Green component.
3261  *
3262  *******************************************************************************/
3263 XColor EwSetColorGreen(XColor aColor, XUInt8 aGreen);
3264 
3265 /*******************************************************************************
3266  * FUNCTION:
3267  * EwSetColorBlue
3268  *
3269  * DESCRIPTION:
3270  * The function EwSetColorBlue() changes the Blue component of the given color
3271  * to a new value aBlue.
3272  *
3273  * EwSetColorBlue() implements the write access to the Chora instant property
3274  * 'color.blue'.
3275  *
3276  * ARGUMENTS:
3277  * aColor - The color to change the Blue component.
3278  * aBlue - The new value for the Blue component.
3279  *
3280  * RETURN VALUE:
3281  * Returns a new color with the changed Blue component.
3282  *
3283  *******************************************************************************/
3284 XColor EwSetColorBlue(XColor aColor, XUInt8 aBlue);
3285 
3286 /*******************************************************************************
3287  * FUNCTION:
3288  * EwSetColorAlpha
3289  *
3290  * DESCRIPTION:
3291  * The function EwSetColorAlpha() changes the Alpha component of the given
3292  * color to a new value aAlpha.
3293  *
3294  * EwSetColorAlpha() implements the write access to the Chora instant property
3295  * 'color.alpha'.
3296  *
3297  * ARGUMENTS:
3298  * aColor - The color to change the Alpha component.
3299  * aAlpha - The new value for the Alpha component.
3300  *
3301  * RETURN VALUE:
3302  * Returns a new color with the changed Alpha component.
3303  *
3304  *******************************************************************************/
3305 XColor EwSetColorAlpha(XColor aColor, XUInt8 aAlpha);
3306 
3307 /*******************************************************************************
3308  * FUNCTION:
3309  * EwCompColor
3310  *
3311  * DESCRIPTION:
3312  * The function EwCompColor() compares the both given colors aColor1 and
3313  * aColor2 and returns a value == 0 if the colors are identical. Otherwise
3314  * the function returns a value != 0.
3315  *
3316  * EwCompColor() implements the Chora instant operators: 'color == color' and
3317  * 'color != color'.
3318  *
3319  * ARGUMENTS:
3320  * aColor1 - The first color.
3321  * aColor2 - The second color.
3322  *
3323  * RETURN VALUE:
3324  * Returns zero if the both colors are equal.
3325  *
3326  *******************************************************************************/
3327 int EwCompColor(XColor aColor1, XColor aColor2);
3328 
3329 /*******************************************************************************
3330  * FUNCTION:
3331  * EwIsColorNull
3332  *
3333  * DESCRIPTION:
3334  * The function EwIsColorNull() returns != 0 if the given color aColor does
3335  * contain the value #00000000. Otherwise the function returns 0.
3336  *
3337  * ARGUMENTS:
3338  * aColor - Color to verify.
3339  *
3340  * RETURN VALUE:
3341  * Returns != 0 if the color is #00000000.
3342  *
3343  *******************************************************************************/
3344 XBool EwIsColorNull(XColor aColor);
3345 
3346 /*******************************************************************************
3347  * FUNCTION:
3348  * EwGetVariantOfColor
3349  *
3350  * DESCRIPTION:
3351  * The function EwGetVariantOfColor() will be called to determinate a value
3352  * of a multilingual/multivariant constant depending on the currently selected
3353  * language and the styles set.
3354  *
3355  * If the currently selected language could not be found in the multilingual
3356  * constant, the function returns the value corresponding to the default
3357  * language (LangId == 0). In case of a multivariant constant, the function
3358  * evaluates the variants in order to find one, which fits the styles
3359  *currently active in the styles set.
3360  *
3361  * ARGUMENTS:
3362  * aVariants - A pointer to the constant containing multiple color values.
3363  *
3364  * RETURN VALUE:
3365  * Returns the determinated color value.
3366  *
3367  *******************************************************************************/
3368 XColor EwGetVariantOfColor(const XVariant *aConstant);
3369 
3370 /*******************************************************************************
3371  * FUNCTION:
3372  * EwNewPoint
3373  *
3374  * DESCRIPTION:
3375  * The function EwNewPoint() initializes a new point with the given aX and aY
3376  * values and returns the initialized point.
3377  *
3378  * EwNewPoint() implements the Chora instant constructor: 'point(aX,aY)'.
3379  *
3380  * ARGUMENTS:
3381  * aX - The X-coordinate of the point.
3382  * aY - The Y-coordinate of the point.
3383  *
3384  * RETURN VALUE:
3385  * Returns the initialized point.
3386  *
3387  *******************************************************************************/
3388 XPoint EwNewPoint(XInt32 aX, XInt32 aY);
3389 
3390 /*******************************************************************************
3391  * FUNCTION:
3392  * EwCompPoint
3393  *
3394  * DESCRIPTION:
3395  * The function EwCompPoint() compares the both given points aPoint1 and
3396  * aPoint2 and returns a value == 0 if the points are identical. Otherwise
3397  * the function returns a value != 0.
3398  *
3399  * EwCompPoint() implements the Chora instant operators: 'point == point' and
3400  * 'point != point'.
3401  *
3402  * ARGUMENTS:
3403  * aPoint1 - The first point.
3404  * aPoint2 - The second point.
3405  *
3406  * RETURN VALUE:
3407  * Returns zero if the both points are equal.
3408  *
3409  *******************************************************************************/
3410 int EwCompPoint(XPoint aPoint1, XPoint aPoint2);
3411 
3412 /*******************************************************************************
3413  * FUNCTION:
3414  * EwIsPointNull
3415  *
3416  * DESCRIPTION:
3417  * The function EwIsPointNull() returns != 0 if the given point aPoint does
3418  * contain the value <0,0>. Otherwise the function returns 0.
3419  *
3420  * ARGUMENTS:
3421  * aPoint - Point to verify.
3422  *
3423  * RETURN VALUE:
3424  * Returns != 0 if the point is <0,0>.
3425  *
3426  *******************************************************************************/
3427 XBool EwIsPointNull(XPoint aPoint);
3428 
3429 /*******************************************************************************
3430  * FUNCTION:
3431  * EwMovePointNeg
3432  *
3433  * DESCRIPTION:
3434  * The function EwMovePointNeg() adjusts the position of the point aPoint by
3435  * the specified amount aOffset in the negative direction.
3436  *
3437  * EwMovePointNeg() implements the Chora instant operator: 'point - point'.
3438  *
3439  * ARGUMENTS:
3440  * aPoint - The point to be moved.
3441  * aOffset - The Offset that specifies the amount of vertical and horizontal
3442  * space to move aPoint.
3443  *
3444  * RETURN VALUE:
3445  * Returns a new point with the changed position.
3446  *
3447  *******************************************************************************/
3449 
3450 /*******************************************************************************
3451  * FUNCTION:
3452  * EwMovePointPos
3453  *
3454  * DESCRIPTION:
3455  * The function EwMovePointPos() adjusts the position of the point aPoint by
3456  * the specified amount aOffset in the negative direction.
3457  *
3458  * EwMovePointPos() implements the Chora instant operator: 'point + point'.
3459  *
3460  * ARGUMENTS:
3461  * aPoint - The point to be moved.
3462  * aOffset - The offset that specifies the amount of vertical and horizontal
3463  * space to move aPoint.
3464  *
3465  * RETURN VALUE:
3466  * Returns a new point with the changed position.
3467  *
3468  *******************************************************************************/
3470 
3471 /*******************************************************************************
3472  * FUNCTION:
3473  * EwNegPoint
3474  *
3475  * DESCRIPTION:
3476  * The function EwNegPoint() changes the sign of the point from '+' to '-',
3477  * or from '-' to '+'. The function negates the point position.
3478  *
3479  * ARGUMENTS:
3480  * aPoint - The point to negate.
3481  *
3482  * RETURN VALUE:
3483  * Returns a new point with the changed position.
3484  *
3485  *******************************************************************************/
3486 XPoint EwNegPoint(XPoint aPoint);
3487 
3488 /*******************************************************************************
3489  * FUNCTION:
3490  * EwSetPointX
3491  *
3492  * DESCRIPTION:
3493  * The function EwSetPointX() changes the X-coordinate of the given point to
3494  * a new value aX.
3495  *
3496  * EwSetPointX() implements the write access to the Chora instant property
3497  * 'point.x'.
3498  *
3499  * ARGUMENTS:
3500  * aPoint - The point to change the X-coordinate.
3501  * aX - The new value for the X-coordinate.
3502  *
3503  * RETURN VALUE:
3504  * Returns a new point with the changed position.
3505  *
3506  *******************************************************************************/
3507 XPoint EwSetPointX(XPoint aPoint, XInt32 aX);
3508 
3509 /*******************************************************************************
3510  * FUNCTION:
3511  * EwSetPointY
3512  *
3513  * DESCRIPTION:
3514  * The function EwSetPointY() changes the Y-coordinate of the given point to
3515  * a new value aY.
3516  *
3517  * EwSetPointY() implements the write access to the Chora instant property
3518  * 'point.y'.
3519  *
3520  * ARGUMENTS:
3521  * aPoint - The point to change the Y-coordinate.
3522  * aY - The new value for the Y-coordinate.
3523  *
3524  * RETURN VALUE:
3525  * Returns a new point with the changed position.
3526  *
3527  *******************************************************************************/
3528 XPoint EwSetPointY(XPoint aPoint, XInt32 aY);
3529 
3530 /*******************************************************************************
3531  * FUNCTION:
3532  * EwGetVariantOfPoint
3533  *
3534  * DESCRIPTION:
3535  * The function EwGetVariantOfPoint() will be called to determinate a value
3536  * of a multilingual/multivariant constant depending on the currently selected
3537  * language and the styles set.
3538  *
3539  * If the currently selected language could not be found in the multilingual
3540  * constant, the function returns the value corresponding to the default
3541  * language (LangId == 0). In case of a multivariant constant, the function
3542  * evaluates the variants in order to find one, which fits the styles
3543  *currently active in the styles set.
3544  *
3545  * ARGUMENTS:
3546  * aVariants - A pointer to the constant containing multiple point values.
3547  *
3548  * RETURN VALUE:
3549  * Returns the determinated point value.
3550  *
3551  *******************************************************************************/
3552 XPoint EwGetVariantOfPoint(const XVariant *aConstant);
3553 
3554 /*******************************************************************************
3555  * FUNCTION:
3556  * EwNewRect
3557  *
3558  * DESCRIPTION:
3559  * The function EwNewRect() initializes a new rectangle with the given aX1,
3560  * aY1, aX2, aY2 values and returns the initialized rect.
3561  *
3562  * EwNewRect() implements the Chora instant constructor:
3563  * 'rect(aX1,aY1,aX2,aY2)'.
3564  *
3565  * ARGUMENTS:
3566  * aX1 - x-coordinate of the first (top-left) point of the rectangle.
3567  * aY1 - y-coordinate of the first (top-left) point of the rectangle.
3568  * aX2 - x-coordinate of the second (bottom-right) point of the rectangle.
3569  * aY2 - y-coordinate of the second (bottom-right) point of the rectangle.
3570  *
3571  * RETURN VALUE:
3572  * Returns the initialized rectangle.
3573  *
3574  *******************************************************************************/
3575 XRect EwNewRect(XInt32 aX1, XInt32 aY1, XInt32 aX2, XInt32 aY2);
3576 
3577 /*******************************************************************************
3578  * FUNCTION:
3579  * EwNewRect2Point
3580  *
3581  * DESCRIPTION:
3582  * The function EwNewRect2Point() initializes a new rectangle with the given
3583  * points aPoint1 and aPoint2 and returns the initialized rect.
3584  *
3585  * EwNewRect2Point() implements the Chora instant constructor:
3586  * 'rect(aPoint1,aPoint2)'.
3587  *
3588  * ARGUMENTS:
3589  * aPoint1 - Coordinates of the first (top-left) point of the rectangle.
3590  * aPoint2 - Coordinates of the second (bottom-right) point of the rectangle.
3591  *
3592  * RETURN VALUE:
3593  * Returns the initialized rectangle.
3594  *
3595  *******************************************************************************/
3596 XRect EwNewRect2Point(XPoint aPoint1, XPoint aPoint2);
3597 
3598 /*******************************************************************************
3599  * FUNCTION:
3600  * EwCompRect
3601  *
3602  * DESCRIPTION:
3603  * The function EwCompRect() compares the both given rectangles aRect1 and
3604  * aRect2 and returns a value == 0 if the rectangles are identical. Otherwise
3605  * the function returns a value != 0.
3606  *
3607  * EwCompRect() implements the Chora instant operators: 'rect == rect' and
3608  * 'rect != rect'.
3609  *
3610  * ARGUMENTS:
3611  * aRect1 - The first rectangle.
3612  * aRect2 - The second rectangle.
3613  *
3614  * RETURN VALUE:
3615  * Returns zero if the both rectangles are equal or both rectangles are empty.
3616  *
3617  *******************************************************************************/
3618 int EwCompRect(XRect aRect1, XRect aRect2);
3619 
3620 /*******************************************************************************
3621  * FUNCTION:
3622  * EwIsRectNull
3623  *
3624  * DESCRIPTION:
3625  * The function EwIsRectNull() returns != 0 if the given rectangle aRect does
3626  * contain the value <0,0,0,0>. Otherwise the function returns 0.
3627  *
3628  * ARGUMENTS:
3629  * aRect - Rectangle to verify.
3630  *
3631  * RETURN VALUE:
3632  * Returns != 0 if the rectangle is <0,0,0,0>.
3633  *
3634  *******************************************************************************/
3635 XBool EwIsRectNull(XRect aRect);
3636 
3637 /*******************************************************************************
3638  * FUNCTION:
3639  * EwIsPointInRect
3640  *
3641  * DESCRIPTION:
3642  * The function EwIsPointInRect() determines whether the specified point lies
3643  * within a rectangle. A point is within a rectangle if it lies on the left or
3644  * top side or is within all four sides. A point on the right or bottom side
3645  * is outside a rectangle.
3646  *
3647  * EwIsPointInRect() implements the Chora instant operator: 'rect == point'.
3648  *
3649  * ARGUMENTS:
3650  * aRect - The rectangle to be tested.
3651  * aPoint - The coordinates of a point.
3652  *
3653  * RETURN VALUE:
3654  * Returns a value != 0 if the point aPoint lies within the rectangle aRect.
3655  * Otherwiese the function returns 0.
3656  *
3657  *******************************************************************************/
3658 XBool EwIsPointInRect(XRect aRect, XPoint aPoint);
3659 
3660 /*******************************************************************************
3661  * FUNCTION:
3662  * EwIsRectEmpty
3663  *
3664  * DESCRIPTION:
3665  * The function EwIsRectEmpty() determines whether the specified rectangle is
3666  * empty. An empty rectangle has negative or zero width or height.
3667  *
3668  * EwIsRectEmpty() implements the Chora instant property: 'rect.isempty'.
3669  *
3670  * ARGUMENTS:
3671  * aRect - The rectangle to be tested.
3672  *
3673  * RETURN VALUE:
3674  * Returns a value != 0 if the rectangle is empty.
3675  *
3676  *******************************************************************************/
3677 XBool EwIsRectEmpty(XRect aRect);
3678 
3679 /*******************************************************************************
3680  * FUNCTION:
3681  * EwInflateRect
3682  *
3683  * DESCRIPTION:
3684  * The function EwInflateRect() inflates the rectangle aRect by moving its
3685  * sides away from its center. To do this, EwInflateRect() subtracts units
3686  * from the top-left point and adds units to the bottom-right point of aRect.
3687  *
3688  * EwInflateRect() implements the Chora instant operator: 'rect * point'.
3689  *
3690  * ARGUMENTS:
3691  * aRect - The rectangle to be inflated.
3692  * aDelta - The number of units to inflate aRect.
3693  *
3694  * RETURN VALUE:
3695  * Returns a new rectangle with changed position and size.
3696  *
3697  *******************************************************************************/
3698 XRect EwInflateRect(XRect aRect, XPoint aDelta);
3699 
3700 /*******************************************************************************
3701  * FUNCTION:
3702  * EwIntersectRect
3703  *
3704  * DESCRIPTION:
3705  * The function EwIntersectRect() retrieves a rectangle that represents the
3706  * intersecting area of two specified rectangles aRect1 and aRect2.
3707  *
3708  * EwIntersectRect() implements the Chora instant operator: 'rect & rect'.
3709  *
3710  * ARGUMENTS:
3711  * aRect1 - The first rectangle to be intersect with aRect2.
3712  * aRect2 - The second rectangle to be intersect with aRect1.
3713  *
3714  * RETURN VALUE:
3715  * Returns a new rectangle that represents the intersecting area of aRect1
3716  * and aRect2. If the intersecting area is empty, the function returns an
3717  * empty rectangle.
3718  *
3719  *******************************************************************************/
3720 XRect EwIntersectRect(XRect aRect1, XRect aRect2);
3721 
3722 /*******************************************************************************
3723  * FUNCTION:
3724  * EwUnionRect
3725  *
3726  * DESCRIPTION:
3727  * The function EwUnionRect() retrieves a rectangle that represents the
3728  * smallest rectangle that contains two specified rectangular areas aRect1 and
3729  * aRect2.
3730  *
3731  * If one of the passed rectangles aRect1 or aRect2 is empty, no union is
3732  *build and the function returns the other rectangle immediately.
3733  *
3734  * EwUnionRect() implements the Chora instant operator: 'rect | rect'.
3735  *
3736  * ARGUMENTS:
3737  * aRect1 - The first rectangle in the union.
3738  * aRect2 - The second rectangle in the union.
3739  *
3740  * RETURN VALUE:
3741  * Returns a new rectangle that represents the union of the two specified
3742  * areas aRect1 and aRect2. If the union area is empty, the function returns
3743  * an empty rectangle.
3744  *
3745  *******************************************************************************/
3746 XRect EwUnionRect(XRect aRect1, XRect aRect2);
3747 
3748 /*******************************************************************************
3749  * FUNCTION:
3750  * EwIntersectRect2
3751  *
3752  * DESCRIPTION:
3753  * The function EwIntersectRect2() retrieves a rectangle that represents the
3754  * intersecting area of two specified rectangles aRect1 and aRect2.
3755  *
3756  * Unlike the function EwIntersectRect(), empty rectangles are ignored. If one
3757  * of the passed rectangles aRect1 or aRect2 is empty, no intersection is
3758  *build and the function returns the other rectangle immediately.
3759  *
3760  * EwIntersectRect2() implements the Chora instant operator: 'rect && rect'.
3761  *
3762  * ARGUMENTS:
3763  * aRect1 - The first rectangle to be intersect with aRect2.
3764  * aRect2 - The second rectangle to be intersect with aRect1.
3765  *
3766  * RETURN VALUE:
3767  * Returns a new rectangle that represents the intersecting area of aRect1
3768  * and aRect2. If the intersecting area is empty, the function returns an
3769  * empty rectangle.
3770  *
3771  *******************************************************************************/
3772 XRect EwIntersectRect2(XRect aRect1, XRect aRect2);
3773 
3774 /*******************************************************************************
3775  * FUNCTION:
3776  * EwMoveRectNeg
3777  *
3778  * DESCRIPTION:
3779  * The function EwMoveRectNeg() adjusts the position of the rectangle aRect by
3780  * the specified amount aOffset in the negative direction.
3781  *
3782  * EwMoveRectNeg() implements the Chora instant operator: 'rect - point'.
3783  *
3784  * ARGUMENTS:
3785  * aRect - The rectangle to be moved.
3786  * aOffset - The Offset that specifies the amount of vertical and horizontal
3787  * space to move aRect.
3788  *
3789  * RETURN VALUE:
3790  * Returns a new rectangle with the changed position.
3791  *
3792  *******************************************************************************/
3794 
3795 /*******************************************************************************
3796  * FUNCTION:
3797  * EwMoveRectPos
3798  *
3799  * DESCRIPTION:
3800  * The function EwMoveRectPos() adjusts the position of the rectangle aRect by
3801  * the specified amount aOffset in the positive direction.
3802  *
3803  * EwMoveRectPos() implements the Chora instant operator: 'rect + point'.
3804  *
3805  * ARGUMENTS:
3806  * aRect - The rectangle to be moved.
3807  * aOffset - The Offset that specifies the amount of vertical and horizontal
3808  * space to move aRect.
3809  *
3810  * RETURN VALUE:
3811  * Returns a new rectangle with the changed position.
3812  *
3813  *******************************************************************************/
3815 
3816 /*******************************************************************************
3817  * FUNCTION:
3818  * EwGetRectH
3819  *
3820  * DESCRIPTION:
3821  * The function EwGetRectH() returns the height of the rectangle. The function
3822  * calculates the height of the rectangle by subtracting the coordinate of the
3823  * top border from the bottom border.
3824  *
3825  * EwGetRectH() implements the read access to the Chora instant property:
3826  * 'rect.h'.
3827  *
3828  * ARGUMENTS:
3829  * aRect - The rectangle to get the height.
3830  *
3831  * RETURN VALUE:
3832  * Returns the height of the rectangle. The value can be negative.
3833  *
3834  *******************************************************************************/
3835 XInt32 EwGetRectH(XRect aRect);
3836 
3837 /*******************************************************************************
3838  * FUNCTION:
3839  * EwGetRectW
3840  *
3841  * DESCRIPTION:
3842  * The function EwGetRectW() returns the width of the rectangle. The function
3843  * calculates the width of the rectangle by subtracting the coordinate of the
3844  * left border from the right border.
3845  *
3846  * EwGetRectW() implements the read access to the Chora instant property:
3847  * 'rect.w'.
3848  *
3849  * ARGUMENTS:
3850  * aRect - The rectangle to get the width.
3851  *
3852  * RETURN VALUE:
3853  * Returns the width of the rectangle. The value can be negative.
3854  *
3855  *******************************************************************************/
3856 XInt32 EwGetRectW(XRect aRect);
3857 
3858 /*******************************************************************************
3859  * FUNCTION:
3860  * EwGetRectArea
3861  *
3862  * DESCRIPTION:
3863  * The function EwGetRectArea() calculates the area of the rectangle. The
3864  * multiplies the width with the height of the rectangle.
3865  *
3866  * EwGetRectArea() implements the read access to the Chora instant property:
3867  * 'rect.area'.
3868  *
3869  * ARGUMENTS:
3870  * aRect - The rectangle to get the area.
3871  *
3872  * RETURN VALUE:
3873  * Returns the area of the rectangle. The value can be negative.
3874  *
3875  *******************************************************************************/
3876 XInt32 EwGetRectArea(XRect aRect);
3877 
3878 /*******************************************************************************
3879  * FUNCTION:
3880  * EwGetRectSize
3881  *
3882  * DESCRIPTION:
3883  * The function EwGetRectSize() calculates the size of the rectangle.
3884  *
3885  * EwGetRectSize() implements the read access to the Chora instant property:
3886  * 'rect.size'.
3887  *
3888  * ARGUMENTS:
3889  * aRect - The rectangle to get the size.
3890  *
3891  * RETURN VALUE:
3892  * Returns the size of the rectangle.
3893  *
3894  *******************************************************************************/
3895 XPoint EwGetRectSize(XRect aRect);
3896 
3897 /*******************************************************************************
3898  * FUNCTION:
3899  * EwGetRectORect
3900  *
3901  * DESCRIPTION:
3902  * The function EwGetRectORect() calculates rectangle with the same size as
3903  * the given rectangle, but with the fixed origin point <0,0>.
3904  *
3905  * EwGetRectORect() implements the read access to the Chora instant property:
3906  * 'rect.orect'.
3907  *
3908  * ARGUMENTS:
3909  * aRect - The rectangle to get the zero fixed rectangle.
3910  *
3911  * RETURN VALUE:
3912  * Returns new rectangle.
3913  *
3914  *******************************************************************************/
3915 XRect EwGetRectORect(XRect aRect);
3916 
3917 /*******************************************************************************
3918  * FUNCTION:
3919  * EwGetRectCenter
3920  *
3921  * DESCRIPTION:
3922  * The function EwGetRectCenter() calculates the coordinates of the point in
3923  * the center of the given rectangle.
3924  *
3925  * EwGetRectCenter() implements the read access to the Chora instant property:
3926  * 'rect.center'.
3927  *
3928  * ARGUMENTS:
3929  * aRect - The rectangle to get the center of them.
3930  *
3931  * RETURN VALUE:
3932  * Returns coordinates of the rectangle's center.
3933  *
3934  *******************************************************************************/
3936 
3937 /*******************************************************************************
3938  * FUNCTION:
3939  * EwSetRectSize
3940  *
3941  * DESCRIPTION:
3942  * The function EwSetRectSize() changes the size of the given rectangle to a
3943  * new value aSize. The function changes the value of Point2.
3944  *
3945  * EwSetRectSize() implements the write access to the Chora instant property
3946  * 'rect.size'.
3947  *
3948  * ARGUMENTS:
3949  * aRect - The rectangle to change the size.
3950  * aSize - The new size of the rectangle.
3951  *
3952  * RETURN VALUE:
3953  * Returns a new rectangle with the changed size.
3954  *
3955  *******************************************************************************/
3956 XRect EwSetRectSize(XRect aRect, XPoint aSize);
3957 
3958 /*******************************************************************************
3959  * FUNCTION:
3960  * EwSetRectOrigin
3961  *
3962  * DESCRIPTION:
3963  * The function EwSetRectOrigin() changes the origin of the given rectangle to
3964  * a new value aOrigin. The function changes the value of Point1 and Point2.
3965  *
3966  * EwSetRectOrigin() implements the write access to the Chora instant property
3967  * 'rect.origin'.
3968  *
3969  * ARGUMENTS:
3970  * aRect - The rectangle to change the origin.
3971  * aOrigin - The new origin of the rectangle.
3972  *
3973  * RETURN VALUE:
3974  * Returns a new rectangle with the changed origin.
3975  *
3976  *******************************************************************************/
3977 XRect EwSetRectOrigin(XRect aRect, XPoint aOrigin);
3978 
3979 /*******************************************************************************
3980  * FUNCTION:
3981  * EwSetRectX1
3982  *
3983  * DESCRIPTION:
3984  * The function EwSetRectX1() changes the X-coordinate of the first (top-left)
3985  * point of the given rectangle to a new value aX1.
3986  *
3987  * EwSetRectX1() implements the write access to the Chora instant property
3988  * 'rect.x1'.
3989  *
3990  * ARGUMENTS:
3991  * aRect - The rectangle to change the X1-coordinate.
3992  * aX1 - The new value for the X1-coordinate.
3993  *
3994  * RETURN VALUE:
3995  * Returns a new rectangle with the changed coordinate.
3996  *
3997  *******************************************************************************/
3998 XRect EwSetRectX1(XRect aRect, XInt32 aX1);
3999 
4000 /*******************************************************************************
4001  * FUNCTION:
4002  * EwSetRectY1
4003  *
4004  * DESCRIPTION:
4005  * The function EwSetRectY1() changes the Y-coordinate of the first (top-left)
4006  * point of the given rectangle to a new value aY1.
4007  *
4008  * EwSetRectY1() implements the write access to the Chora instant property
4009  * 'rect.y1'.
4010  *
4011  * ARGUMENTS:
4012  * aRect - The rectangle to change the Y1-coordinate.
4013  * aY1 - The new value for the Y1-coordinate.
4014  *
4015  * RETURN VALUE:
4016  * Returns a new rectangle with the changed coordinate.
4017  *
4018  *******************************************************************************/
4019 XRect EwSetRectY1(XRect aRect, XInt32 aY1);
4020 
4021 /*******************************************************************************
4022  * FUNCTION:
4023  * EwSetRectX2
4024  *
4025  * DESCRIPTION:
4026  * The function EwSetRectX2() changes the X-coordinate of the second (bottom-
4027  * right) point of the given rectangle to a new value aX2.
4028  *
4029  * EwSetRectX2() implements the write access to the Chora instant property
4030  * 'rect.x2'.
4031  *
4032  * ARGUMENTS:
4033  * aRect - The rectangle to change the X2-coordinate.
4034  * aX2 - The new value for the X2-coordinate.
4035  *
4036  * RETURN VALUE:
4037  * Returns a new rectangle with the changed coordinate.
4038  *
4039  *******************************************************************************/
4040 XRect EwSetRectX2(XRect aRect, XInt32 aX2);
4041 
4042 /*******************************************************************************
4043  * FUNCTION:
4044  * EwSetRectY2
4045  *
4046  * DESCRIPTION:
4047  * The function EwSetRectY2() changes the Y-coordinate of the second (bottom-
4048  * right) point of the given rectangle to a new value aY2.
4049  *
4050  * EwSetRectY2() implements the write access to the Chora instant property
4051  * 'rect.y2'.
4052  *
4053  * ARGUMENTS:
4054  * aRect - The rectangle to change the Y2-coordinate.
4055  * aY2 - The new value for the Y2-coordinate.
4056  *
4057  * RETURN VALUE:
4058  * Returns a new rectangle with the changed coordinate.
4059  *
4060  *******************************************************************************/
4061 XRect EwSetRectY2(XRect aRect, XInt32 aY2);
4062 
4063 /*******************************************************************************
4064  * FUNCTION:
4065  * EwSetRectX
4066  *
4067  * DESCRIPTION:
4068  * The function EwSetRectX() changes the X origin of the given rectangle to
4069  * the value aX.
4070  *
4071  * EwSetRectX() implements the write access to the Chora instant property
4072  * 'rect.x'.
4073  *
4074  * ARGUMENTS:
4075  * aRect - The rectangle to change the origin.
4076  * aX - The new value for the rectangles origin X.
4077  *
4078  * RETURN VALUE:
4079  * Returns a new rectangle with the changed origin.
4080  *
4081  *******************************************************************************/
4082 XRect EwSetRectX(XRect aRect, XInt32 aX);
4083 
4084 /*******************************************************************************
4085  * FUNCTION:
4086  * EwSetRectY
4087  *
4088  * DESCRIPTION:
4089  * The function EwSetRectY() changes the Y origin of the given rectangle to
4090  * the value aY.
4091  *
4092  * EwSetRectY() implements the write access to the Chora instant property
4093  * 'rect.y'.
4094  *
4095  * ARGUMENTS:
4096  * aRect - The rectangle to change the origin.
4097  * aY - The new value for the rectangles origin Y.
4098  *
4099  * RETURN VALUE:
4100  * Returns a new rectangle with the changed origin.
4101  *
4102  *******************************************************************************/
4103 XRect EwSetRectY(XRect aRect, XInt32 aY);
4104 
4105 /*******************************************************************************
4106  * FUNCTION:
4107  * EwSetRectW
4108  *
4109  * DESCRIPTION:
4110  * The function EwSetRectW() changes the width of the given rectangle to a new
4111  * value aW.
4112  *
4113  * EwSetRectW() implements the write access to the Chora instant property
4114  * 'rect.w'.
4115  *
4116  * ARGUMENTS:
4117  * aRect - The rectangle to change the width.
4118  * aW - The new value for the rectangles width.
4119  *
4120  * RETURN VALUE:
4121  * Returns a new rectangle with the changed width.
4122  *
4123  *******************************************************************************/
4124 XRect EwSetRectW(XRect aRect, XInt32 aW);
4125 
4126 /*******************************************************************************
4127  * FUNCTION:
4128  * EwSetRectH
4129  *
4130  * DESCRIPTION:
4131  * The function EwSetRectH() changes the height of the given rectangle to a
4132  * new value aH.
4133  *
4134  * EwSetRectH() implements the write access to the Chora instant property
4135  * 'rect.h'.
4136  *
4137  * ARGUMENTS:
4138  * aRect - The rectangle to change the height.
4139  * aH - The new value for the rectangles height.
4140  *
4141  * RETURN VALUE:
4142  * Returns a new rectangle with the changed height.
4143  *
4144  *******************************************************************************/
4145 XRect EwSetRectH(XRect aRect, XInt32 aH);
4146 
4147 /*******************************************************************************
4148  * FUNCTION:
4149  * EwSetRectPoint1
4150  *
4151  * DESCRIPTION:
4152  * The function EwSetPoint1() changes the coordinates of the first (top-left)
4153  * point of the rectangle to a new value aPoint1.
4154  *
4155  * EwSetRectPoint1() implements the write access to the Chora instant property
4156  * 'rect.point1'.
4157  *
4158  * ARGUMENTS:
4159  * aRect - The rectangle to be changed.
4160  * aPoint1 - The new coordinates for the first (top-left) point.
4161  *
4162  * RETURN VALUE:
4163  * Returns a new rectangle with changed coordinates.
4164  *
4165  *******************************************************************************/
4166 XRect EwSetRectPoint1(XRect aRect, XPoint aPoint1);
4167 
4168 /*******************************************************************************
4169  * FUNCTION:
4170  * EwSetRectPoint2
4171  *
4172  * DESCRIPTION:
4173  * The function EwSetPoint2() changes the coordinates of the second (bottom-
4174  * right) point of the rectangle to a new value aPoint2.
4175  *
4176  * EwSetRectPoint2() implements the write access to the Chora instant property
4177  * 'rect.point2'.
4178  *
4179  * ARGUMENTS:
4180  * aRect - The rectangle to be changed.
4181  * aPoint2 - The new coordinates for the second (bottom-right) point.
4182  *
4183  * RETURN VALUE:
4184  * Returns a new rectangle with changed coordinates.
4185  *
4186  *******************************************************************************/
4187 XRect EwSetRectPoint2(XRect aRect, XPoint aPoint2);
4188 
4189 /*******************************************************************************
4190  * FUNCTION:
4191  * EwGetVariantOfRect
4192  *
4193  * DESCRIPTION:
4194  * The function EwGetVariantOfRect() will be called to determinate a value
4195  * of a multilingual/multivariant constant depending on the currently selected
4196  * language and the styles set.
4197  *
4198  * If the currently selected language could not be found in the multilingual
4199  * constant, the function returns the value corresponding to the default
4200  * language (LangId == 0). In case of a multivariant constant, the function
4201  * evaluates the variants in order to find one, which fits the styles
4202  *currently active in the styles set.
4203  *
4204  * ARGUMENTS:
4205  * aVariants - A pointer to the constant containing multiple rect values.
4206  *
4207  * RETURN VALUE:
4208  * Returns the determinated rect value.
4209  *
4210  *******************************************************************************/
4211 XRect EwGetVariantOfRect(const XVariant *aConstant);
4212 
4213 /*******************************************************************************
4214  * FUNCTION:
4215  * EwNewRef
4216  *
4217  * DESCRIPTION:
4218  * The function EwNewRef() initializes a new XRef structure with the given
4219  * arguments aObject, aOnGetProc, aOnSetProc and returns the structure.
4220  *
4221  * ARGUMENTS:
4222  * aObject - Pointer to an object which contains the referenced property.
4223  * aOnGetProc - Pointer to the properties own OnGet() method.
4224  * aOnSetProc - Pointer to the properties own OnSet() method.
4225  *
4226  * RETURN VALUE:
4227  * Returns an initialized XRef structure, describing a reference to a
4228  * property.
4229  *
4230  *******************************************************************************/
4231 XRef EwNewRef(void *aObject, XRefGetSetProc aOnGetProc,
4232  XRefGetSetProc aOnSetProc);
4233 
4234 #define EwNewRef(aObject, aOnGetProc, aOnSetProc) \
4235  EwNewRef(aObject, (XRefGetSetProc)aOnGetProc, (XRefGetSetProc)aOnSetProc)
4236 
4237 /*******************************************************************************
4238  * FUNCTION:
4239  * EwCompRef
4240  *
4241  * DESCRIPTION:
4242  * The function EwCompRef() compares the given references aRef1 and aRef2
4243  * and returns a value == 0 if the references are identical. Otherwise the
4244  * function returns a value != 0.
4245  *
4246  * EwCompRef() implements the Chora instant operators: 'ref == ref' and
4247  * 'ref != ref'.
4248  *
4249  * ARGUMENTS:
4250  * aRef1 - The first reference.
4251  * aRef2 - The second reference.
4252  *
4253  * RETURN VALUE:
4254  * Returns zero if both references are equal.
4255  *
4256  *******************************************************************************/
4257 int EwCompRef(XRef aRef1, XRef aRef2);
4258 
4259 /*******************************************************************************
4260  * FUNCTION:
4261  * EwIsRefNull
4262  *
4263  * DESCRIPTION:
4264  * The function EwIsRefNull() returns != 0 if the given reference aRef does
4265  * not refer any valid property (it is NULL). Otherwise the function returns
4266  * 0.
4267  *
4268  * ARGUMENTS:
4269  * aRef - Reference to verify.
4270  *
4271  * RETURN VALUE:
4272  * Returns != 0 if the reference is NULL.
4273  *
4274  *******************************************************************************/
4275 XBool EwIsRefNull(XRef aRef);
4276 
4277 /*******************************************************************************
4278  * FUNCTION:
4279  * EwOnGetInt8
4280  *
4281  * DESCRIPTION:
4282  * The function EwOnGetInt8() will be called in order to read an int8
4283  * property referenced by the aRef argument. The access to the property will
4284  * be done by calling the properties own OnGet() method. The value returned
4285  * from the OnGet() method will be passed back to the caller.
4286  *
4287  * ARGUMENTS:
4288  * aRef - Reference to an int8 property.
4289  *
4290  * RETURN VALUE:
4291  * Returns the value of the property referenced by aRef.
4292  *
4293  *******************************************************************************/
4294 XInt8 EwOnGetInt8(XRef aRef);
4295 
4296 /*******************************************************************************
4297  * FUNCTION:
4298  * EwOnGetInt16
4299  *
4300  * DESCRIPTION:
4301  * The function EwOnGetInt16() will be called in order to read an int16
4302  * property referenced by the aRef argument. The access to the property will
4303  * be done by calling the properties own OnGet() method. The value returned
4304  * from the OnGet() method will be passed back to the caller.
4305  *
4306  * ARGUMENTS:
4307  * aRef - Reference to an int16 property.
4308  *
4309  * RETURN VALUE:
4310  * Returns the value of the property referenced by aRef.
4311  *
4312  *******************************************************************************/
4313 XInt16 EwOnGetInt16(XRef aRef);
4314 
4315 /*******************************************************************************
4316  * FUNCTION:
4317  * EwOnGetInt32
4318  *
4319  * DESCRIPTION:
4320  * The function EwOnGetInt32() will be called in order to read an int32
4321  * property referenced by the aRef argument. The access to the property will
4322  * be done by calling the properties own OnGet() method. The value returned
4323  * from the OnGet() method will be passed back to the caller.
4324  *
4325  * ARGUMENTS:
4326  * aRef - Reference to an int32 property.
4327  *
4328  * RETURN VALUE:
4329  * Returns the value of the property referenced by aRef.
4330  *
4331  *******************************************************************************/
4332 XInt32 EwOnGetInt32(XRef aRef);
4333 
4334 /*******************************************************************************
4335  * FUNCTION:
4336  * EwOnGetInt64
4337  *
4338  * DESCRIPTION:
4339  * The function EwOnGetInt64() will be called in order to read an int64
4340  * property referenced by the aRef argument. The access to the property will
4341  * be done by calling the properties own OnGet() method. The value returned
4342  * from the OnGet() method will be passed back to the caller.
4343  *
4344  * ARGUMENTS:
4345  * aRef - Reference to an int64 property.
4346  *
4347  * RETURN VALUE:
4348  * Returns the value of the property referenced by aRef.
4349  *
4350  *******************************************************************************/
4351 XInt64 EwOnGetInt64(XRef aRef);
4352 
4353 /*******************************************************************************
4354  * FUNCTION:
4355  * EwOnGetUInt8
4356  *
4357  * DESCRIPTION:
4358  * The function EwOnGetUInt8() will be called in order to read an uint8
4359  * property referenced by the aRef argument. The access to the property will
4360  * be done by calling the properties own OnGet() method. The value returned
4361  * from the OnGet() method will be passed back to the caller.
4362  *
4363  * ARGUMENTS:
4364  * aRef - Reference to an uint8 property.
4365  *
4366  * RETURN VALUE:
4367  * Returns the value of the property referenced by aRef.
4368  *
4369  *******************************************************************************/
4370 XUInt8 EwOnGetUInt8(XRef aRef);
4371 
4372 /*******************************************************************************
4373  * FUNCTION:
4374  * EwOnGetUInt16
4375  *
4376  * DESCRIPTION:
4377  * The function EwOnGetUInt16() will be called in order to read an uint16
4378  * property referenced by the aRef argument. The access to the property will
4379  * be done by calling the properties own OnGet() method. The value returned
4380  * from the OnGet() method will be passed back to the caller.
4381  *
4382  * ARGUMENTS:
4383  * aRef - Reference to an uint16 property.
4384  *
4385  * RETURN VALUE:
4386  * Returns the value of the property referenced by aRef.
4387  *
4388  *******************************************************************************/
4389 XUInt16 EwOnGetUInt16(XRef aRef);
4390 
4391 /*******************************************************************************
4392  * FUNCTION:
4393  * EwOnGetUInt32
4394  *
4395  * DESCRIPTION:
4396  * The function EwOnGetUInt32() will be called in order to read an uint32
4397  * property referenced by the aRef argument. The access to the property will
4398  * be done by calling the properties own OnGet() method. The value returned
4399  * from the OnGet() method will be passed back to the caller.
4400  *
4401  * ARGUMENTS:
4402  * aRef - Reference to an uint32 property.
4403  *
4404  * RETURN VALUE:
4405  * Returns the value of the property referenced by aRef.
4406  *
4407  *******************************************************************************/
4408 XUInt32 EwOnGetUInt32(XRef aRef);
4409 
4410 /*******************************************************************************
4411  * FUNCTION:
4412  * EwOnGetUInt64
4413  *
4414  * DESCRIPTION:
4415  * The function EwOnGetUInt64() will be called in order to read an uint64
4416  * property referenced by the aRef argument. The access to the property will
4417  * be done by calling the properties own OnGet() method. The value returned
4418  * from the OnGet() method will be passed back to the caller.
4419  *
4420  * ARGUMENTS:
4421  * aRef - Reference to an uint64 property.
4422  *
4423  * RETURN VALUE:
4424  * Returns the value of the property referenced by aRef.
4425  *
4426  *******************************************************************************/
4427 XUInt64 EwOnGetUInt64(XRef aRef);
4428 
4429 /*******************************************************************************
4430  * FUNCTION:
4431  * EwOnGetBool
4432  *
4433  * DESCRIPTION:
4434  * The function EwOnGetBool() will be called in order to read a bool property
4435  * referenced by the aRef argument. The access to the property will be done
4436  * by calling the properties own OnGet() method. The value returned from the
4437  * OnGet() method will be passed back to the caller.
4438  *
4439  * ARGUMENTS:
4440  * aRef - Reference to a bool property.
4441  *
4442  * RETURN VALUE:
4443  * Returns the value of the property referenced by aRef.
4444  *
4445  *******************************************************************************/
4446 XBool EwOnGetBool(XRef aRef);
4447 
4448 /*******************************************************************************
4449  * FUNCTION:
4450  * EwOnGetFloat
4451  *
4452  * DESCRIPTION:
4453  * The function EwOnGetFloat() will be called in order to read a float
4454  * property referenced by the aRef argument. The access to the property will
4455  * be done by calling the properties own OnGet() method. The value returned
4456  * from the OnGet() method will be passed back to the caller.
4457  *
4458  * ARGUMENTS:
4459  * aRef - Reference to a float property.
4460  *
4461  * RETURN VALUE:
4462  * Returns the value of the property referenced by aRef.
4463  *
4464  *******************************************************************************/
4465 XFloat EwOnGetFloat(XRef aRef);
4466 
4467 /*******************************************************************************
4468  * FUNCTION:
4469  * EwOnGetChar
4470  *
4471  * DESCRIPTION:
4472  * The function EwOnGetChar() will be called in order to read a char
4473  * property referenced by the aRef argument. The access to the property will
4474  * be done by calling the properties own OnGet() method. The value returned
4475  * from the OnGet() method will be passed back to the caller.
4476  *
4477  * ARGUMENTS:
4478  * aRef - Reference to a char property.
4479  *
4480  * RETURN VALUE:
4481  * Returns the value of the property referenced by aRef.
4482  *
4483  *******************************************************************************/
4484 XChar EwOnGetChar(XRef aRef);
4485 
4486 /*******************************************************************************
4487  * FUNCTION:
4488  * EwOnGetString
4489  *
4490  * DESCRIPTION:
4491  * The function EwOnGetString() will be called in order to read a string
4492  * property referenced by the aRef argument. The access to the property will
4493  * be done by calling the properties own OnGet() method. The value returned
4494  * from the OnGet() method will be passed back to the caller.
4495  *
4496  * ARGUMENTS:
4497  * aRef - Reference to a string property.
4498  *
4499  * RETURN VALUE:
4500  * Returns the value of the property referenced by aRef.
4501  *
4502  *******************************************************************************/
4503 XString EwOnGetString(XRef aRef);
4504 
4505 /*******************************************************************************
4506  * FUNCTION:
4507  * EwOnGetPoint
4508  *
4509  * DESCRIPTION:
4510  * The function EwOnGetPoint() will be called in order to read a point
4511  * property referenced by the aRef argument. The access to the property will
4512  * be done by calling the properties own OnGet() method. The value returned
4513  * from the OnGet() method will be passed back to the caller.
4514  *
4515  * ARGUMENTS:
4516  * aRef - Reference to a point property.
4517  *
4518  * RETURN VALUE:
4519  * Returns the value of the property referenced by aRef.
4520  *
4521  *******************************************************************************/
4522 XPoint EwOnGetPoint(XRef aRef);
4523 
4524 /*******************************************************************************
4525  * FUNCTION:
4526  * EwOnGetRect
4527  *
4528  * DESCRIPTION:
4529  * The function EwOnGetRect() will be called in order to read a rect
4530  * property referenced by the aRef argument. The access to the property will
4531  * be done by calling the properties own OnGet() method. The value returned
4532  * from the OnGet() method will be passed back to the caller.
4533  *
4534  * ARGUMENTS:
4535  * aRef - Reference to a rect property.
4536  *
4537  * RETURN VALUE:
4538  * Returns the value of the property referenced by aRef.
4539  *
4540  *******************************************************************************/
4541 XRect EwOnGetRect(XRef aRef);
4542 
4543 /*******************************************************************************
4544  * FUNCTION:
4545  * EwOnGetColor
4546  *
4547  * DESCRIPTION:
4548  * The function EwOnGetColor() will be called in order to read a color
4549  * property referenced by the aRef argument. The access to the property will
4550  * be done by calling the properties own OnGet() method. The value returned
4551  * from the OnGet() method will be passed back to the caller.
4552  *
4553  * ARGUMENTS:
4554  * aRef - Reference to a color property.
4555  *
4556  * RETURN VALUE:
4557  * Returns the value of the property referenced by aRef.
4558  *
4559  *******************************************************************************/
4560 XColor EwOnGetColor(XRef aRef);
4561 
4562 /*******************************************************************************
4563  * FUNCTION:
4564  * EwOnGetEnum
4565  *
4566  * DESCRIPTION:
4567  * The function EwOnGetEnum() will be called in order to read an enum
4568  * property referenced by the aRef argument. The access to the property will
4569  * be done by calling the properties own OnGet() method. The value returned
4570  * from the OnGet() method will be passed back to the caller.
4571  *
4572  * ARGUMENTS:
4573  * aRef - Reference to an enum property.
4574  *
4575  * RETURN VALUE:
4576  * Returns the value of the property referenced by aRef.
4577  *
4578  *******************************************************************************/
4579 XEnum EwOnGetEnum(XRef aRef);
4580 
4581 /*******************************************************************************
4582  * FUNCTION:
4583  * EwOnGetSet
4584  *
4585  * DESCRIPTION:
4586  * The function EwOnGetSet() will be called in order to read a set
4587  * property referenced by the aRef argument. The access to the property will
4588  * be done by calling the properties own OnGet() method. The value returned
4589  * from the OnGet() method will be passed back to the caller.
4590  *
4591  * ARGUMENTS:
4592  * aRef - Reference to a set property.
4593  *
4594  * RETURN VALUE:
4595  * Returns the value of the property referenced by aRef.
4596  *
4597  *******************************************************************************/
4598 XSet EwOnGetSet(XRef aRef);
4599 
4600 /*******************************************************************************
4601  * FUNCTION:
4602  * EwOnGetObject
4603  *
4604  * DESCRIPTION:
4605  * The function EwOnGetObject() will be called in order to read a object
4606  * property referenced by the aRef argument. The access to the property
4607  * will be done by calling the properties own OnGet() method. The value
4608  * returned from the OnGet() method will be passed back to the caller.
4609  *
4610  * ARGUMENTS:
4611  * aRef - Reference to a property conating a pointer to an object.
4612  *
4613  * RETURN VALUE:
4614  * Returns the value of the property referenced by aRef.
4615  *
4616  *******************************************************************************/
4617 XObject EwOnGetObject(XRef aRef);
4618 
4619 /*******************************************************************************
4620  * FUNCTION:
4621  * EwOnGetSlot
4622  *
4623  * DESCRIPTION:
4624  * The function EwOnGetSlot() will be called in order to read a slot property
4625  * referenced by the aRef argument. The access to the property will be done by
4626  * calling the properties own OnGet() method. The value returned from the
4627  * OnGet() method will be passed back to the caller.
4628  *
4629  * ARGUMENTS:
4630  * aRef - Reference to a property containing the slot.
4631  *
4632  * RETURN VALUE:
4633  * Returns the value of the property referenced by aRef.
4634  *
4635  *******************************************************************************/
4636 XSlot EwOnGetSlot(XRef aRef);
4637 
4638 /*******************************************************************************
4639  * FUNCTION:
4640  * EwOnGetLangId
4641  *
4642  * DESCRIPTION:
4643  * The function EwOnGetLangId() will be called in order to read a language
4644  * property referenced by the aRef argument. The access to the property will
4645  * be done by calling the properties own OnGet() method. The value returned
4646  * from the OnGet() method will be passed back to the caller.
4647  *
4648  * ARGUMENTS:
4649  * aRef - Reference to a property containing the language.
4650  *
4651  * RETURN VALUE:
4652  * Returns the value of the property referenced by aRef.
4653  *
4654  *******************************************************************************/
4655 XLangId EwOnGetLangId(XRef aRef);
4656 
4657 /*******************************************************************************
4658  * FUNCTION:
4659  * EwOnGetStylesSet
4660  *
4661  * DESCRIPTION:
4662  * The function EwOnGetStylesSet() will be called in order to read a styles
4663  * property referenced by the aRef argument. The access to the property will
4664  * be done by calling the properties own OnGet() method. The value returned
4665  * from the OnGet() method will be passed back to the caller.
4666  *
4667  * ARGUMENTS:
4668  * aRef - Reference to a property containing the styles set.
4669  *
4670  * RETURN VALUE:
4671  * Returns the value of the property referenced by aRef.
4672  *
4673  *******************************************************************************/
4675 
4676 /*******************************************************************************
4677  * FUNCTION:
4678  * EwOnGetClass
4679  *
4680  * DESCRIPTION:
4681  * The function EwOnGetClass() will be called in order to read a class
4682  *property referenced by the aRef argument. The access to the property will be
4683  *done by calling the properties own OnGet() method. The value returned from the
4684  * OnGet() method will be passed back to the caller.
4685  *
4686  * ARGUMENTS:
4687  * aRef - Reference to a property containing the class.
4688  *
4689  * RETURN VALUE:
4690  * Returns the value of the property referenced by aRef.
4691  *
4692  *******************************************************************************/
4693 XClass EwOnGetClass(XRef aRef);
4694 
4695 /*******************************************************************************
4696  * FUNCTION:
4697  * EwOnGetHandle
4698  *
4699  * DESCRIPTION:
4700  * The function EwOnGetHandle() will be called in order to read a handle
4701  * property referenced by the aRef argument. The access to the property will
4702  * be done by calling the properties own OnGet() method. The value returned
4703  * from the OnGet() method will be passed back to the caller.
4704  *
4705  * ARGUMENTS:
4706  * aRef - Reference to a property containing the handle.
4707  *
4708  * RETURN VALUE:
4709  * Returns the value of the property referenced by aRef.
4710  *
4711  *******************************************************************************/
4712 XHandle EwOnGetHandle(XRef aRef);
4713 
4714 /*******************************************************************************
4715  * FUNCTION:
4716  * EwOnSetInt8
4717  *
4718  * DESCRIPTION:
4719  * The function EwOnSetInt8() will be called in order to assign a value to an
4720  * int8 property referenced by the aRef argument. The access to the property
4721  * will be done by calling the properties own OnSet() method.
4722  *
4723  * ARGUMENTS:
4724  * aRef - Reference to an int8 property.
4725  * aValue - The value to be assigned to the property.
4726  *
4727  * RETURN VALUE:
4728  * None
4729  *
4730  *******************************************************************************/
4731 void EwOnSetInt8(XRef aRef, XInt8 aValue);
4732 
4733 /*******************************************************************************
4734  * FUNCTION:
4735  * EwOnSetInt16
4736  *
4737  * DESCRIPTION:
4738  * The function EwOnSetInt16() will be called in order to assign a value to an
4739  * int16 property referenced by the aRef argument. The access to the property
4740  * will be done by calling the properties own OnSet() method.
4741  *
4742  * ARGUMENTS:
4743  * aRef - Reference to an int16 property.
4744  * aValue - The value to be assigned to the property.
4745  *
4746  * RETURN VALUE:
4747  * None
4748  *
4749  *******************************************************************************/
4750 void EwOnSetInt16(XRef aRef, XInt16 aValue);
4751 
4752 /*******************************************************************************
4753  * FUNCTION:
4754  * EwOnSetInt32
4755  *
4756  * DESCRIPTION:
4757  * The function EwOnSetInt32() will be called in order to assign a value to an
4758  * int32 property referenced by the aRef argument. The access to the property
4759  * will be done by calling the properties own OnSet() method.
4760  *
4761  * ARGUMENTS:
4762  * aRef - Reference to an int32 property.
4763  * aValue - The value to be assigned to the property.
4764  *
4765  * RETURN VALUE:
4766  * None
4767  *
4768  *******************************************************************************/
4769 void EwOnSetInt32(XRef aRef, XInt32 aValue);
4770 
4771 /*******************************************************************************
4772  * FUNCTION:
4773  * EwOnSetInt64
4774  *
4775  * DESCRIPTION:
4776  * The function EwOnSetInt64() will be called in order to assign a value to an
4777  * int64 property referenced by the aRef argument. The access to the property
4778  * will be done by calling the properties own OnSet() method.
4779  *
4780  * ARGUMENTS:
4781  * aRef - Reference to an int64 property.
4782  * aValue - The value to be assigned to the property.
4783  *
4784  * RETURN VALUE:
4785  * None
4786  *
4787  *******************************************************************************/
4788 void EwOnSetInt64(XRef aRef, XInt64 aValue);
4789 
4790 /*******************************************************************************
4791  * FUNCTION:
4792  * EwOnSetUInt8
4793  *
4794  * DESCRIPTION:
4795  * The function EwOnSetUInt8() will be called in order to assign a value to an
4796  * uint8 property referenced by the aRef argument. The access to the property
4797  * will be done by calling the properties own OnSet() method.
4798  *
4799  * ARGUMENTS:
4800  * aRef - Reference to an uint8 property.
4801  * aValue - The value to be assigned to the property.
4802  *
4803  * RETURN VALUE:
4804  * None
4805  *
4806  *******************************************************************************/
4807 void EwOnSetUInt8(XRef aRef, XUInt8 aValue);
4808 
4809 /*******************************************************************************
4810  * FUNCTION:
4811  * EwOnSetUInt16
4812  *
4813  * DESCRIPTION:
4814  * The function EwOnSetUInt16() will be called in order to assign a value to
4815  *an uint16 property referenced by the aRef argument. The access to the property
4816  * will be done by calling the properties own OnSet() method.
4817  *
4818  * ARGUMENTS:
4819  * aRef - Reference to an uint16 property.
4820  * aValue - The value to be assigned to the property.
4821  *
4822  * RETURN VALUE:
4823  * None
4824  *
4825  *******************************************************************************/
4826 void EwOnSetUInt16(XRef aRef, XUInt16 aValue);
4827 
4828 /*******************************************************************************
4829  * FUNCTION:
4830  * EwOnSetUInt32
4831  *
4832  * DESCRIPTION:
4833  * The function EwOnSetUInt32() will be called in order to assign a value to
4834  *an uint32 property referenced by the aRef argument. The access to the property
4835  * will be done by calling the properties own OnSet() method.
4836  *
4837  * ARGUMENTS:
4838  * aRef - Reference to an uint32 property.
4839  * aValue - The value to be assigned to the property.
4840  *
4841  * RETURN VALUE:
4842  * None
4843  *
4844  *******************************************************************************/
4845 void EwOnSetUInt32(XRef aRef, XUInt32 aValue);
4846 
4847 /*******************************************************************************
4848  * FUNCTION:
4849  * EwOnSetUInt64
4850  *
4851  * DESCRIPTION:
4852  * The function EwOnSetUInt64() will be called in order to assign a value to
4853  *an uint64 property referenced by the aRef argument. The access to the property
4854  * will be done by calling the properties own OnSet() method.
4855  *
4856  * ARGUMENTS:
4857  * aRef - Reference to an uint64 property.
4858  * aValue - The value to be assigned to the property.
4859  *
4860  * RETURN VALUE:
4861  * None
4862  *
4863  *******************************************************************************/
4864 void EwOnSetUInt64(XRef aRef, XUInt64 aValue);
4865 
4866 /*******************************************************************************
4867  * FUNCTION:
4868  * EwOnSetBool
4869  *
4870  * DESCRIPTION:
4871  * The function EwOnSetBool() will be called in order to assign a value to a
4872  * bool property referenced by the aRef argument. The access to the property
4873  * will be done by calling the properties own OnSet() method.
4874  *
4875  * ARGUMENTS:
4876  * aRef - Reference to a bool property.
4877  * aValue - The value to be assigned to the property.
4878  *
4879  * RETURN VALUE:
4880  * None
4881  *
4882  *******************************************************************************/
4883 void EwOnSetBool(XRef aRef, XBool aValue);
4884 
4885 /*******************************************************************************
4886  * FUNCTION:
4887  * EwOnSetFloat
4888  *
4889  * DESCRIPTION:
4890  * The function EwOnSetFloat() will be called in order to assign a value to a
4891  * float property referenced by the aRef argument. The access to the property
4892  * will be done by calling the properties own OnSet() method.
4893  *
4894  * ARGUMENTS:
4895  * aRef - Reference to a float property.
4896  * aValue - The value to be assigned to the property.
4897  *
4898  * RETURN VALUE:
4899  * None
4900  *
4901  *******************************************************************************/
4902 void EwOnSetFloat(XRef aRef, XFloat aValue);
4903 
4904 /*******************************************************************************
4905  * FUNCTION:
4906  * EwOnSetChar
4907  *
4908  * DESCRIPTION:
4909  * The function EwOnSetChar() will be called in order to assign a value to a
4910  * char property referenced by the aRef argument. The access to the property
4911  * will be done by calling the properties own OnSet() method.
4912  *
4913  * ARGUMENTS:
4914  * aRef - Reference to a char property.
4915  * aValue - The value to be assigned to the property.
4916  *
4917  * RETURN VALUE:
4918  * None
4919  *
4920  *******************************************************************************/
4921 void EwOnSetChar(XRef aRef, XChar aValue);
4922 
4923 /*******************************************************************************
4924  * FUNCTION:
4925  * EwOnSetString
4926  *
4927  * DESCRIPTION:
4928  * The function EwOnSetString() will be called in order to assign a value to
4929  * a string property referenced by the aRef argument. The access to the
4930  * property will be done by calling the properties own OnSet() method.
4931  *
4932  * ARGUMENTS:
4933  * aRef - Reference to a string property.
4934  * aValue - The value to be assigned to the property.
4935  *
4936  * RETURN VALUE:
4937  * None
4938  *
4939  *******************************************************************************/
4940 void EwOnSetString(XRef aRef, XString aValue);
4941 
4942 /*******************************************************************************
4943  * FUNCTION:
4944  * EwOnSetPoint
4945  *
4946  * DESCRIPTION:
4947  * The function EwOnSetPoint() will be called in order to assign a value to a
4948  * point property referenced by the aRef argument. The access to the property
4949  * will be done by calling the properties own OnSet() method.
4950  *
4951  * ARGUMENTS:
4952  * aRef - Reference to a point property.
4953  * aValue - The value to be assigned to the property.
4954  *
4955  * RETURN VALUE:
4956  * None
4957  *
4958  *******************************************************************************/
4959 void EwOnSetPoint(XRef aRef, XPoint aValue);
4960 
4961 /*******************************************************************************
4962  * FUNCTION:
4963  * EwOnSetRect
4964  *
4965  * DESCRIPTION:
4966  * The function EwOnSetRect() will be called in order to assign a value to a
4967  * rect property referenced by the aRef argument. The access to the property
4968  * will be done by calling the properties own OnSet() method.
4969  *
4970  * ARGUMENTS:
4971  * aRef - Reference to a rect property.
4972  * aValue - The value to be assigned to the property.
4973  *
4974  * RETURN VALUE:
4975  * None
4976  *
4977  *******************************************************************************/
4978 void EwOnSetRect(XRef aRef, XRect aValue);
4979 
4980 /*******************************************************************************
4981  * FUNCTION:
4982  * EwOnSetColor
4983  *
4984  * DESCRIPTION:
4985  * The function EwOnSetColor() will be called in order to assign a value to a
4986  * color property referenced by the aRef argument. The access to the property
4987  * will be done by calling the properties own OnSet() method.
4988  *
4989  * ARGUMENTS:
4990  * aRef - Reference to a color property.
4991  * aValue - The value to be assigned to the property.
4992  *
4993  * RETURN VALUE:
4994  * None
4995  *
4996  *******************************************************************************/
4997 void EwOnSetColor(XRef aRef, XColor aValue);
4998 
4999 /*******************************************************************************
5000  * FUNCTION:
5001  * EwOnSetEnum
5002  *
5003  * DESCRIPTION:
5004  * The function EwOnSetEnum() will be called in order to assign a value to an
5005  * enum property referenced by the aRef argument. The access to the property
5006  * will be done by calling the properties own OnSet() method.
5007  *
5008  * ARGUMENTS:
5009  * aRef - Reference to an enum property.
5010  * aValue - The value to be assigned to the property.
5011  *
5012  * RETURN VALUE:
5013  * None
5014  *
5015  *******************************************************************************/
5016 void EwOnSetEnum(XRef aRef, XEnum aValue);
5017 
5018 /*******************************************************************************
5019  * FUNCTION:
5020  * EwOnSetSet
5021  *
5022  * DESCRIPTION:
5023  * The function EwOnSetSet() will be called in order to assign a value to a
5024  * set property referenced by the aRef argument. The access to the property
5025  * will be done by calling the properties own OnSet() method.
5026  *
5027  * ARGUMENTS:
5028  * aRef - Reference to a set property.
5029  * aValue - The value to be assigned to the property.
5030  *
5031  * RETURN VALUE:
5032  * None
5033  *
5034  *******************************************************************************/
5035 void EwOnSetSet(XRef aRef, XSet aValue);
5036 
5037 /*******************************************************************************
5038  * FUNCTION:
5039  * EwOnSetObject
5040  *
5041  * DESCRIPTION:
5042  * The function EwOnSetObject() will be called in order to assign a value to
5043  * an object property referenced by the aRef argument. The access to the
5044  * property will be done by calling the properties own OnSet() method.
5045  *
5046  * ARGUMENTS:
5047  * aRef - Reference to a property containing a pointer to an object.
5048  * aValue - The value to be assigned to the property.
5049  *
5050  * RETURN VALUE:
5051  * None
5052  *
5053  *******************************************************************************/
5054 void EwOnSetObject(XRef aRef, XObject aValue);
5055 
5056 /*******************************************************************************
5057  * FUNCTION:
5058  * EwOnSetSlot
5059  *
5060  * DESCRIPTION:
5061  * The function EwOnSetSlot() will be called in order to assign a value to a
5062  * slot property referenced by the aRef argument. The access to the property
5063  * will be done by calling the properties own OnSet() method.
5064  *
5065  * ARGUMENTS:
5066  * aRef - Reference to a property containing the slot.
5067  * aValue - The value to be assigned to the property.
5068  *
5069  * RETURN VALUE:
5070  * None
5071  *
5072  *******************************************************************************/
5073 void EwOnSetSlot(XRef aRef, XSlot aValue);
5074 
5075 /*******************************************************************************
5076  * FUNCTION:
5077  * EwOnSetLangId
5078  *
5079  * DESCRIPTION:
5080  * The function EwOnSetLangId() will be called in order to assign a value to a
5081  * language property referenced by the aRef argument. The access to the
5082  * property will be done by calling the properties own OnSet() method.
5083  *
5084  * ARGUMENTS:
5085  * aRef - Reference to a property containing the language.
5086  * aValue - The value to be assigned to the property.
5087  *
5088  * RETURN VALUE:
5089  * None
5090  *
5091  *******************************************************************************/
5092 void EwOnSetLangId(XRef aRef, XLangId aValue);
5093 
5094 /*******************************************************************************
5095  * FUNCTION:
5096  * EwOnSetStylesSet
5097  *
5098  * DESCRIPTION:
5099  * The function EwOnSetStylesSet() will be called in order to assign a value
5100  * to a styles property referenced by the aRef argument. The access to the
5101  * property will be done by calling the properties own OnSet() method.
5102  *
5103  * ARGUMENTS:
5104  * aRef - Reference to a property containing the styles set.
5105  * aValue - The value to be assigned to the property.
5106  *
5107  * RETURN VALUE:
5108  * None
5109  *
5110  *******************************************************************************/
5111 void EwOnSetStylesSet(XRef aRef, XStylesSet aValue);
5112 
5113 /*******************************************************************************
5114  * FUNCTION:
5115  * EwOnSetClass
5116  *
5117  * DESCRIPTION:
5118  * The function EwOnSetClass() will be called in order to assign a value to a
5119  * class property referenced by the aRef argument. The access to the property
5120  * will be done by calling the properties own OnSet() method.
5121  *
5122  * ARGUMENTS:
5123  * aRef - Reference to a property containing the class.
5124  * aValue - The value to be assigned to the property.
5125  *
5126  * RETURN VALUE:
5127  * None
5128  *
5129  *******************************************************************************/
5130 void EwOnSetClass(XRef aRef, XClass aValue);
5131 
5132 /*******************************************************************************
5133  * FUNCTION:
5134  * EwOnSetHandle
5135  *
5136  * DESCRIPTION:
5137  * The function EwOnSetHandle() will be called in order to assign a value to a
5138  * handle property referenced by the aRef argument. The access to the property
5139  * will be done by calling the properties own OnSet() method.
5140  *
5141  * ARGUMENTS:
5142  * aRef - Reference to a property containing the handle.
5143  * aValue - The value to be assigned to the property.
5144  *
5145  * RETURN VALUE:
5146  * None
5147  *
5148  *******************************************************************************/
5149 void EwOnSetHandle(XRef aRef, XHandle aValue);
5150 
5151 /*******************************************************************************
5152  * FUNCTION:
5153  * EwNewSlot
5154  *
5155  * DESCRIPTION:
5156  * The function EwNewSlot() initializes a new XSlot structure with the given
5157  * arguments aObject, aSlotProc and returns the structure.
5158  *
5159  * ARGUMENTS:
5160  * aObject - Pointer to an object which contains the slot.
5161  * aSlotProc - Pointer to the slots own method.
5162  *
5163  * RETURN VALUE:
5164  * Returns an initialized XSlot structure, describing a reference to a slot.
5165  *
5166  *******************************************************************************/
5167 XSlot EwNewSlot(void *aObject, XSlotProc aSlotProc);
5168 
5169 #define EwNewSlot(aObject, aSlotProc) EwNewSlot(aObject, (XSlotProc)aSlotProc)
5170 
5171 /*******************************************************************************
5172  * FUNCTION:
5173  * EwCompSlot
5174  *
5175  * DESCRIPTION:
5176  * The function EwCompSlot() compares the given slots aSlot1 and aSlot2 and
5177  * returns a value == 0 if the slots are identical. Otherwise the function
5178  * returns a value != 0.
5179  *
5180  * EwCompSlot() implements the Chora instant operators: 'slot == slot' and
5181  * 'slot != slot'.
5182  *
5183  * ARGUMENTS:
5184  * aSlot1 - The first slot.
5185  * aSlot2 - The second slot.
5186  *
5187  * RETURN VALUE:
5188  * Returns zero if both slots are equal.
5189  *
5190  *******************************************************************************/
5191 int EwCompSlot(XSlot aSlot1, XSlot aSlot2);
5192 
5193 /*******************************************************************************
5194  * FUNCTION:
5195  * EwIsSlotNull
5196  *
5197  * DESCRIPTION:
5198  * The function EwIsSlotNull() returns != 0 if the given slot aSlot does not
5199  * refer any valid slot (it is NULL). Otherwise the function returns 0.
5200  *
5201  * ARGUMENTS:
5202  * aSlot - Slot to verify.
5203  *
5204  * RETURN VALUE:
5205  * Returns != 0 if the slot is NULL.
5206  *
5207  *******************************************************************************/
5208 XBool EwIsSlotNull(XSlot aSlot);
5209 
5210 /*******************************************************************************
5211  * FUNCTION:
5212  * EwSignal
5213  *
5214  * DESCRIPTION:
5215  * The function EwSignal() will be called in order to deliver a signal to a
5216  * slot aSlot. In response to the delivery the function EwSignal() calls slots
5217  * own method SlotProc.
5218  *
5219  * ARGUMENTS:
5220  * aSlot - Slot to send a signal.
5221  * aSender - Who is the sender of the signal?
5222  *
5223  * RETURN VALUE:
5224  * None
5225  *
5226  *******************************************************************************/
5227 void EwSignal(XSlot aSlot, XObject aSender);
5228 
5229 /*******************************************************************************
5230  * FUNCTION:
5231  * EwPostSignal
5232  *
5233  * DESCRIPTION:
5234  * The function EwPostSignal() will be called in order to store a signal for a
5235  * delayed delivery. The affected slot aSlot will receive the signal as soon
5236  *as possible, but always before the screen update is performed.
5237  *
5238  * ARGUMENTS:
5239  * aSlot - Slot to receive a signal.
5240  * aSender - Who is the sender of the signal?
5241  *
5242  * RETURN VALUE:
5243  * None
5244  *
5245  *******************************************************************************/
5246 void EwPostSignal(XSlot aSlot, XObject aSender);
5247 
5248 /*******************************************************************************
5249  * FUNCTION:
5250  * EwIdleSignal
5251  *
5252  * DESCRIPTION:
5253  * The function EwIdleSignal() will be called in order to store a signal for a
5254  * delayed delivery. The affected slot aSlot will receive the signal as soon
5255  *as possible, but always after the screen update is performed.
5256  *
5257  * ARGUMENTS:
5258  * aSlot - Slot to receive a signal.
5259  * aSender - Who is the sender of the signal?
5260  *
5261  * RETURN VALUE:
5262  * None
5263  *
5264  *******************************************************************************/
5265 void EwIdleSignal(XSlot aSlot, XObject aSender);
5266 
5267 /*******************************************************************************
5268  * FUNCTION:
5269  * EwProcessSignals
5270  *
5271  * DESCRIPTION:
5272  * The function EwProcessSignals() will be called in order to deliver the
5273  * signals, which are pending at the moment. The function returns a value,
5274  * which indicates whether signals have been delivered or not. If no signals
5275  * were pending, the function returns 0. In the case, at least one signal has
5276  * been delivered, != 0 is returned.
5277  *
5278  * ARGUMENTS:
5279  * None
5280  *
5281  * RETURN VALUE:
5282  * If no signals were delivered, the function returns 0. Otherwise != 0 is
5283  * returned.
5284  *
5285  *******************************************************************************/
5286 int EwProcessSignals(void);
5287 
5288 /*******************************************************************************
5289  * FUNCTION:
5290  * EwAnyPendingSignals
5291  *
5292  * DESCRIPTION:
5293  * The function EwAnyPendingSignals() returns a value != 0, if there are any
5294  * signals pending for the delivery.
5295  *
5296  * ARGUMENTS:
5297  * None
5298  *
5299  * RETURN VALUE:
5300  * The function returns a value != 0, if there are signals pending for the
5301  * delivery.
5302  *
5303  *******************************************************************************/
5304 int EwAnyPendingSignals(void);
5305 
5306 /*******************************************************************************
5307  * FUNCTION:
5308  * EwAttachObjObserver
5309  *
5310  * DESCRIPTION:
5311  * The function EwAttachObjObserver() implements the statement
5312  *'attachobserver' of the Chora language. The function registers a slot method
5313  *aSlot with the object aObject. As soon the object has been triggered by the
5314  *function EwNotifyObjObservers(), all registered slot methods will receive a
5315  *signal automatically.
5316  *
5317  * In order to deregister an observer, the function EwDetachObjObserver()
5318  * should be used. Please note, that the Garbage Collector will automatically
5319  * detach an observer from the object, if the affected object or the observer
5320  * itself is about to be disposed.
5321  *
5322  * ARGUMENTS:
5323  * aSlot - The slot method, which will be attached as an observer to the
5324  * object aObject. If aSlot is NULL, the function returns immediately.
5325  * aObject - The destination object for the registration. If this parameter
5326  * is NULL, the function returns immediately.
5327  * aId - This is an additional ID, which distinguish between different
5328  * groups of observers of one and the same object (aObject). This is a
5329  * kind of subdivision.
5330  *
5331  * RETURN VALUE:
5332  * The function returns a value != 0, if the observer could be registered.
5333  * If an identic registration already exists, the function simply returns 0.
5334  *
5335  *******************************************************************************/
5336 int EwAttachObjObserver(XSlot aSlot, XObject aObject, XUInt32 aId);
5337 
5338 /*******************************************************************************
5339  * FUNCTION:
5340  * EwAttachRefObserver
5341  *
5342  * DESCRIPTION:
5343  * The function EwAttachRefObserver() implements the statement
5344  *'attachobserver' of the Chora language. The function registers a slot method
5345  *aSlot with the property referred by aRef. As soon the property has been
5346  *triggered by the function EwNotifyRefObservers(), all registered slot methods
5347  *will receive a signal automatically.
5348  *
5349  * In order to deregister an observer, the function EwDetachRefObserver()
5350  * should be used. Please note, that the Garbage Collector will automatically
5351  * detach an observer from the property, if the object, the property belongs
5352  * to or the observer itself is about to be disposed.
5353  *
5354  * ARGUMENTS:
5355  * aSlot - The slot method, which will be attached as an observer to the
5356  * property referred by aRef. If aSlot is NULL, the function returns
5357  * immediately.
5358  * aRef - The reference to the destination property for the registration.
5359  * If this parameter is NULL, the function returns immediately.
5360  * aId - This is an additional ID, which distinguish between different
5361  * groups of observers of one and the same property referred by aRef. This
5362  * is a kind of subdivision.
5363  *
5364  * RETURN VALUE:
5365  * The function returns a value != 0, if the observer could be registered.
5366  * If an identic registration already exists, the function simply returns 0.
5367  *
5368  *******************************************************************************/
5369 int EwAttachRefObserver(XSlot aSlot, XRef aRef, XUInt32 aId);
5370 
5371 /*******************************************************************************
5372  * FUNCTION:
5373  * EwAttachObserver
5374  *
5375  * DESCRIPTION:
5376  * The function EwAttachObserver() implements the statement 'attachobserver'
5377  * of the Chora language. The function registers a slot method aSlot with the
5378  * global notifier. As soon the the global notifier has been triggered by the
5379  * function EwNotifyObservers(), all registered slot methods will receive a
5380  * signal automatically.
5381  *
5382  * In order to deregister an observer, the function EwDetachObserver() should
5383  * be used. Please note, that the Garbage Collector will automatically detach
5384  * an observer from the notifier, if the affected observer is about to be
5385  * disposed.
5386  *
5387  * ARGUMENTS:
5388  * aSlot - The slot method, which will be attached as an observer to the
5389  * global notifier. If aSlot is NULL, the function returns immediately.
5390  * aId - This is an additional ID, which distinguish between different
5391  * groups of observers. This is a kind of subdivision.
5392  *
5393  * RETURN VALUE:
5394  * The function returns a value != 0, if the observer could be registered.
5395  * If an identic registration already exists, the function simply returns 0.
5396  *
5397  *******************************************************************************/
5398 int EwAttachObserver(XSlot aSlot, XUInt32 aId);
5399 
5400 /*******************************************************************************
5401  * FUNCTION:
5402  * EwDetachObjObserver
5403  *
5404  * DESCRIPTION:
5405  * The function EwDetachObjObserver() implements the statement
5406  *'detachobserver' of the Chora language. The function deregisters a slot method
5407  *aSlot from the object aObject. This function is the counterpart of
5408  *EwAttachObjObserver().
5409  *
5410  * Please note, that the Garbage Collector will automatically detach an
5411  * observer from the object, if the affected object or the observer itself is
5412  * about to be disposed.
5413  *
5414  * ARGUMENTS:
5415  * aSlot - The slot method, which will be detached from the object aObject.
5416  * If aSlot is NULL, the function returns immediately.
5417  * aObject - The affected object for the deregistration. If aObject is NULL,
5418  * the function returns immediately.
5419  * aId - This is an additional ID, which distinguish between different
5420  * groups of observers of one and the same object (aObject). This is a
5421  * kind of subdivision.
5422  *
5423  * RETURN VALUE:
5424  * The function returns a value != 0, if the observer could be deregistered.
5425  * If no corresponding registration exists, the function simply returns 0.
5426  *
5427  *******************************************************************************/
5428 int EwDetachObjObserver(XSlot aSlot, XObject aObject, XUInt32 aId);
5429 
5430 /*******************************************************************************
5431  * FUNCTION:
5432  * EwDetachRefObserver
5433  *
5434  * DESCRIPTION:
5435  * The function EwDetachRefObserver() implements the statement
5436  *'detachobserver' of the Chora language. The function deregisters a slot method
5437  *aSlot from the property referred by aRef. This function is the counterpart of
5438  *the function EwAttachRefObserver().
5439  *
5440  * Please note, that the Garbage Collector will automatically detach an
5441  * observer from the property, if the object, the property belongs to or the
5442  * observer itself is about to be disposed.
5443  *
5444  * ARGUMENTS:
5445  * aSlot - The slot method, which will be detached from the property
5446  *referred by aRef. If aSlot is NULL, the function returns immediately. aRef -
5447  *The reference to the affected property for the deregistration. If aRef is
5448  *NULL, the function returns immediately. aId - This is an additional ID,
5449  *which distinguish between different groups of observers of one and the same
5450  *property. This is a kind of subdivision.
5451  *
5452  * RETURN VALUE:
5453  * The function returns a value != 0, if the observer could be deregistered.
5454  * If no corresponding registration exists, the function simply returns 0.
5455  *
5456  *******************************************************************************/
5457 int EwDetachRefObserver(XSlot aSlot, XRef aRef, XUInt32 aId);
5458 
5459 /*******************************************************************************
5460  * FUNCTION:
5461  * EwDetachObserver
5462  *
5463  * DESCRIPTION:
5464  * The function EwDetachObserver() implements the statement 'detachobserver'
5465  * of the Chora language. The function deregisters a slot method aSlot from
5466  *the global notifier. This function is the counterpart of EwAttachObserver().
5467  *
5468  * Please note, that the Garbage Collector will automatically detach an
5469  * observer from the notifier, if the affected observer itself is about to be
5470  * disposed.
5471  *
5472  * ARGUMENTS:
5473  * aSlot - The slot method, which will be detached from the object aObject.
5474  * If aSlot is NULL, the function returns immediately.
5475  * aId - This is an additional ID, which distinguish between different
5476  * groups of observers. This is a kind of subdivision.
5477  *
5478  * RETURN VALUE:
5479  * The function returns a value != 0, if the observer could be deregistered.
5480  * If no corresponding registration exists, the function simply returns 0.
5481  *
5482  *******************************************************************************/
5483 int EwDetachObserver(XSlot aSlot, XUInt32 aId);
5484 
5485 /*******************************************************************************
5486  * FUNCTION:
5487  * EwNotifyObjObservers
5488  *
5489  * DESCRIPTION:
5490  * The function EwNotifyObjObservers() implements the Chora statement
5491  * 'notifyobservers'. The function posts signals for each observer, which
5492  * has been previously registered with the given object aObject.
5493  *
5494  * In order to register an observer the function EwAttachObjObserver() should
5495  * be used.
5496  *
5497  * ARGUMENTS:
5498  * aObject - The object to trigger the observers. If aObject is NULL, the
5499  * function returns immediately.
5500  * aId - This is an additional ID, which distinguish between different
5501  * groups of observers of one and the same object (aObject). This is a
5502  * kind of subdivision.
5503  *
5504  * RETURN VALUE:
5505  * None
5506  *
5507  *******************************************************************************/
5508 void EwNotifyObjObservers(XObject aObject, XUInt32 aId);
5509 
5510 /*******************************************************************************
5511  * FUNCTION:
5512  * EwNotifyRefObservers
5513  *
5514  * DESCRIPTION:
5515  * The function EwNotifyRefObservers() implements the Chora statement
5516  * 'notifyobservers'. The function posts signals for each observer, which
5517  * has been previously registered with the property referred by aRef.
5518  *
5519  * In order to register an observer the function EwAttachRefObserver() should
5520  * be used.
5521  *
5522  * ARGUMENTS:
5523  * aRef - The reference to the property to trigger the observers. If Ref is
5524  * NULL, the function returns immediately.
5525  * aId - This is an additional ID, which distinguish between different
5526  * groups of observers of one and the same property. This is a kind of
5527  * subdivision.
5528  *
5529  * RETURN VALUE:
5530  * None
5531  *
5532  *******************************************************************************/
5533 void EwNotifyRefObservers(XRef aRef, XUInt32 aId);
5534 
5535 /*******************************************************************************
5536  * FUNCTION:
5537  * EwNotifyObservers
5538  *
5539  * DESCRIPTION:
5540  * The function EwNotifyObservers() implements the statement 'notifyobservers'
5541  * of the Chora language. The function posts signals for each observer, which
5542  * has been previously registered with the global notifier.
5543  *
5544  * In order to register an observer the function EwAttachObserver() should be
5545  * used.
5546  *
5547  * ARGUMENTS:
5548  * aId - This is an ID, which distinguish between different groups of
5549  * observers. This is a kind of subdivision.
5550  *
5551  * RETURN VALUE:
5552  * None
5553  *
5554  *******************************************************************************/
5555 void EwNotifyObservers(XUInt32 aId);
5556 
5557 /*******************************************************************************
5558  * FUNCTION:
5559  * EwGetAutoObject
5560  *
5561  * DESCRIPTION:
5562  * The function EwGetAutoObject() will be called from the automatic generated
5563  * 'C' code in order to access an auto object identified by aAutoObject. The
5564  * function verifies whether the required object is already instantiated and
5565  * if it's true, the existing instance is returned immediately. If no instance
5566  * of the desired auto object could be found, EwGetAutoObject() prepares a new
5567  * object of the class aClass and initializes it properly. The created object
5568  * will remains in memory as long as the object is in use. Objects, which are
5569  * not in use any more are automatically reclaimed by the Garbage Collector.
5570  *
5571  * ARGUMENTS:
5572  * aAutoObject - Pointer to the description of the auto object in the ROM
5573  *code. aClass - The class of the auto object. aFile - aFile stores
5574  *the module name, where the auto object has been created. aFile is for
5575  *debugging purpose only. aLine - aLine stores the line number, at this
5576  *the auto object has been created. aLine is for debugging purpose only.
5577  *
5578  * RETURN VALUE:
5579  * Returns a pointer to the auto object.
5580  *
5581  *******************************************************************************/
5582 XObject EwGetAutoObject(const XVariant *aAutoObject, const void *aClass);
5583 
5584 #define EwGetAutoObject(aAutoObject, aClass) \
5585  ((aClass)EwGetAutoObject(aAutoObject, EW_CLASS(aClass)))
5586 
5587 /*******************************************************************************
5588  * FUNCTION:
5589  * EwRegisterResource
5590  *
5591  * DESCRIPTION:
5592  * The function EwRegisterResource() registers a resource object aObject in
5593  *the global MapList, so the resource stored in the object can be shared between
5594  * different callers. EwRegisterResource() creates a new entry in the MapList
5595  * to store the pointer to the object and the pointer to the resource in the
5596  * ROM code.
5597  *
5598  * If the MapList is full, the function throws an error.
5599  *
5600  * ARGUMENTS:
5601  * aObject - Pointer to the object where the resource has been loaded.
5602  * aResource - Pointer to the resource in the ROM.
5603  *
5604  * RETURN VALUE:
5605  * None
5606  *
5607  *******************************************************************************/
5608 void EwRegisterResource(XObject aObject, const void *aResource);
5609 
5610 /*******************************************************************************
5611  * FUNCTION:
5612  * EwDeregisterResource
5613  *
5614  * DESCRIPTION:
5615  * The function EwDeregisterResource() removes the resource object aObject
5616  * from the global MapList. After the object has been removed, the resource
5617  * stored in the object can not be shared anymore.
5618  *
5619  * ARGUMENTS:
5620  * aObject - Pointer to the resource object to remove from the MapList.
5621  *
5622  * RETURN VALUE:
5623  * None
5624  *
5625  *******************************************************************************/
5626 void EwDeregisterResource(XObject aObject);
5627 
5628 /*******************************************************************************
5629  * FUNCTION:
5630  * EwLoadResource
5631  *
5632  * DESCRIPTION:
5633  * The function EwLoadResource() will be called from the automatic generated
5634  * 'C' code in order to load a resource. EwLoadResource() verifies whether the
5635  * required resource is already loaded and if it's true, the function returns
5636  * the pointer to the object where the resource is stored in.
5637  *
5638  * If the requested resource is not loaded yet, EwLoadResource() creates a new
5639  * object of the class aClass and invokes it in order to load the resource.
5640  *
5641  * ARGUMENTS:
5642  * aResource - Pointer to the resource in the ROM code.
5643  * aClass - The class of the resource.
5644  * aFile - aFile stores the module name, where the resource object has
5645  * been created. aFile is for debugging purpose only.
5646  * aLine - aLine stores the line number, at this the resource object has
5647  * been created. aLine is for debugging purpose only.
5648  *
5649  * RETURN VALUE:
5650  * Returns a pointer to the resource object wich stores the required resource.
5651  *
5652  *******************************************************************************/
5653 XObject EwLoadResource(const XVariant *aResource, const void *aClass);
5654 
5655 #define EwLoadResource(aResource, aClass) \
5656  ((aClass)EwLoadResource(aResource, EW_CLASS(aClass)))
5657 
5658 /*******************************************************************************
5659  * FUNCTION:
5660  * EwGetLanguage
5661  *
5662  * DESCRIPTION:
5663  * The function EwGetLanguage() returns the language ID corresponding to the
5664  * currently selected language. The function returns 0 if the 'default'
5665  * language is selected.
5666  *
5667  * ARGUMENTS:
5668  * None
5669  *
5670  * RETURN VALUE:
5671  * Returns the ID of the selected language.
5672  *
5673  *******************************************************************************/
5674 XLangId EwGetLanguage(void);
5675 
5676 /*******************************************************************************
5677  * FUNCTION:
5678  * EwSetLanguage
5679  *
5680  * DESCRIPTION:
5681  * The function EwSetLanguage() changes the selected language ID to aLangId.
5682  * To select the default language pass 0 (zero) in the argument to this
5683  * function.
5684  *
5685  * After the language has been selected, the Resource Manager tries to find
5686  * resource which fit the selected language.
5687  *
5688  * ARGUMENTS:
5689  * aLangId - The ID of the desired language.
5690  *
5691  * RETURN VALUE:
5692  * Returns the assigned aLangId value.
5693  *
5694  *******************************************************************************/
5695 XLangId EwSetLanguage(XLangId aLangId);
5696 
5697 /*******************************************************************************
5698  * FUNCTION:
5699  * EwGetStyles
5700  *
5701  * DESCRIPTION:
5702  * The function EwGetStyles() returns the set corresponding to the currently
5703  * active styles. The function returns 0 if no styles are active.
5704  *
5705  * ARGUMENTS:
5706  * None
5707  *
5708  * RETURN VALUE:
5709  * Returns the set containing the active styles.
5710  *
5711  *******************************************************************************/
5712 XStylesSet EwGetStyles(void);
5713 
5714 /*******************************************************************************
5715  * FUNCTION:
5716  * EwSetStyles
5717  *
5718  * DESCRIPTION:
5719  * The function EwSetStyles() changes the set of active styles to the new
5720  *value aStyles.
5721  *
5722  * ARGUMENTS:
5723  * aStylesSet - The new styles set.
5724  *
5725  * RETURN VALUE:
5726  * Returns the assigned aStylesSet value.
5727  *
5728  *******************************************************************************/
5729 XStylesSet EwSetStyles(XStylesSet aStylesSet);
5730 
5731 /*******************************************************************************
5732  * FUNCTION:
5733  * EwStylesContains
5734  *
5735  * DESCRIPTION:
5736  * The function EwStylesContains() implements the Chora instant method
5737  * 'styles.contains()'.
5738  *
5739  * ARGUMENTS:
5740  * aStylesSet1 - The first style to verify its content.
5741  * aStylesSet2 - The second style.
5742  *
5743  * RETURN VALUE:
5744  * The function returns != 0, if the second style aStylesSet2 is contained
5745  * in the given aStylesSet1.
5746  *
5747  *******************************************************************************/
5748 int EwStylesContains(XStylesSet aStylesSet1, XStylesSet aStylesSet2);
5749 
5750 /*******************************************************************************
5751  * FUNCTION:
5752  * EwGetVariantOf
5753  *
5754  * DESCRIPTION:
5755  * The function EwGetVariantOf() will be called to determinate a multilingual/
5756  * multivariant value of the constant or resource aVariant, depending on the
5757  * currently selected language and the styles set.
5758  *
5759  * If the currently selected language could not be found, the function returns
5760  * the value corresponding to the default language (LangId == 0). In case of a
5761  * multivariant definition, the function evaluates the variants in order to
5762  * find one, which fits the styles currently active in the styles set.
5763  *
5764  * ARGUMENTS:
5765  * aVariant - A pointer to the affected multilingual/multivariant definition.
5766  * aSize - The size to a single entry in the language table of the affected
5767  * definition.
5768  *
5769  * RETURN VALUE:
5770  * Returns the pointer to the found value of the definition.
5771  *
5772  *******************************************************************************/
5773 const void *EwGetVariantOf(register const XVariant *aVariant, int aSize);
5774 
5775 #define EwGetVariantOf(aVariant, aKind) \
5776  ((const aKind *)EwGetVariantOf(aVariant, sizeof(aKind)))
5777 
5778 /*******************************************************************************
5779  * FUNCTION:
5780  * EwGetVariantOfLangId
5781  *
5782  * DESCRIPTION:
5783  * The function EwGetVariantOfLangId() will be called to determinate a value
5784  * of a multilingual/multivariant constant depending on the currently selected
5785  * language and the styles set.
5786  *
5787  * If the currently selected language could not be found in the multilingual
5788  * constant, the function returns the value corresponding to the default
5789  * language (LangId == 0). In case of a multivariant constant, the function
5790  * evaluates the variants in order to find one, which fits the styles
5791  *currently active in the styles set.
5792  *
5793  * ARGUMENTS:
5794  * aVariants - A pointer to the constant containing multiple language id
5795  * values.
5796  *
5797  * RETURN VALUE:
5798  * Returns the determinated language id value.
5799  *
5800  *******************************************************************************/
5801 XLangId EwGetVariantOfLangId(const XVariant *aConstant);
5802 
5803 /*******************************************************************************
5804  * FUNCTION:
5805  * EwGetVariantOfStylesSet
5806  *
5807  * DESCRIPTION:
5808  * The function EwGetVariantOfStylesSet() will be called to determinate a
5809  *value of a multilingual/multivariant constant depending on the currently
5810  *selected language and the styles set.
5811  *
5812  * If the currently selected language could not be found in the multilingual
5813  * constant, the function returns the value corresponding to the default
5814  * language (LangId == 0). In case of a multivariant constant, the function
5815  * evaluates the variants in order to find one, which fits the styles
5816  *currently active in the styles set.
5817  *
5818  * ARGUMENTS:
5819  * aVariants - A pointer to the constant containing multiple styles set
5820  *values.
5821  *
5822  * RETURN VALUE:
5823  * Returns the determinated styles set value.
5824  *
5825  *******************************************************************************/
5826 XStylesSet EwGetVariantOfStylesSet(const XVariant *aConstant);
5827 
5828 /*******************************************************************************
5829  * FUNCTION:
5830  * EwGetVariantOfInt8
5831  *
5832  * DESCRIPTION:
5833  * The function EwGetVariantOfInt8() will be called to determinate a value
5834  * of a multilingual/multivariant constant depending on the currently selected
5835  * language and the styles set.
5836  *
5837  * If the currently selected language could not be found in the multilingual
5838  * constant, the function returns the value corresponding to the default
5839  * language (LangId == 0). In case of a multivariant constant, the function
5840  * evaluates the variants in order to find one, which fits the styles
5841  *currently active in the styles set.
5842  *
5843  * ARGUMENTS:
5844  * aVariants - A pointer to the constant containing multiple int8 values.
5845  *
5846  * RETURN VALUE:
5847  * Returns the determinated int8 value.
5848  *
5849  *******************************************************************************/
5850 XInt8 EwGetVariantOfInt8(const XVariant *aConstant);
5851 
5852 /*******************************************************************************
5853  * FUNCTION:
5854  * EwGetVariantOfInt16
5855  *
5856  * DESCRIPTION:
5857  * The function EwGetVariantOfInt16() will be called to determinate a value
5858  * of a multilingual/multivariant constant depending on the currently selected
5859  * language and the styles set.
5860  *
5861  * If the currently selected language could not be found in the multilingual
5862  * constant, the function returns the value corresponding to the default
5863  * language (LangId == 0). In case of a multivariant constant, the function
5864  * evaluates the variants in order to find one, which fits the styles
5865  *currently active in the styles set.
5866  *
5867  * ARGUMENTS:
5868  * aVariants - A pointer to the constant containing multiple int16 values.
5869  *
5870  * RETURN VALUE:
5871  * Returns the determinated int16 value.
5872  *
5873  *******************************************************************************/
5874 XInt16 EwGetVariantOfInt16(const XVariant *aConstant);
5875 
5876 /*******************************************************************************
5877  * FUNCTION:
5878  * EwGetVariantOfInt32
5879  *
5880  * DESCRIPTION:
5881  * The function EwGetVariantOfInt32() will be called to determinate a value
5882  * of a multilingual/multivariant constant depending on the currently selected
5883  * language and the styles set.
5884  *
5885  * If the currently selected language could not be found in the multilingual
5886  * constant, the function returns the value corresponding to the default
5887  * language (LangId == 0). In case of a multivariant constant, the function
5888  * evaluates the variants in order to find one, which fits the styles
5889  *currently active in the styles set.
5890  *
5891  * ARGUMENTS:
5892  * aVariants - A pointer to the constant containing multiple int32 values.
5893  *
5894  * RETURN VALUE:
5895  * Returns the determinated int32 value.
5896  *
5897  *******************************************************************************/
5898 XInt32 EwGetVariantOfInt32(const XVariant *aConstant);
5899 
5900 /*******************************************************************************
5901  * FUNCTION:
5902  * EwGetVariantOfInt64
5903  *
5904  * DESCRIPTION:
5905  * The function EwGetVariantOfInt64() will be called to determinate a value
5906  * of a multilingual/multivariant constant depending on the currently selected
5907  * language and the styles set.
5908  *
5909  * If the currently selected language could not be found in the multilingual
5910  * constant, the function returns the value corresponding to the default
5911  * language (LangId == 0). In case of a multivariant constant, the function
5912  * evaluates the variants in order to find one, which fits the styles
5913  *currently active in the styles set.
5914  *
5915  * ARGUMENTS:
5916  * aVariants - A pointer to the constant containing multiple int64 values.
5917  *
5918  * RETURN VALUE:
5919  * Returns the determinated int64 value.
5920  *
5921  *******************************************************************************/
5922 XInt64 EwGetVariantOfInt64(const XVariant *aConstant);
5923 
5924 /*******************************************************************************
5925  * FUNCTION:
5926  * EwGetVariantOfUInt8
5927  *
5928  * DESCRIPTION:
5929  * The function EwGetVariantOfUInt8() will be called to determinate a value
5930  * of a multilingual/multivariant constant depending on the currently selected
5931  * language and the styles set.
5932  *
5933  * If the currently selected language could not be found in the multilingual
5934  * constant, the function returns the value corresponding to the default
5935  * language (LangId == 0). In case of a multivariant constant, the function
5936  * evaluates the variants in order to find one, which fits the styles
5937  *currently active in the styles set.
5938  *
5939  * ARGUMENTS:
5940  * aVariants - A pointer to the constant containing multiple uint8 values.
5941  *
5942  * RETURN VALUE:
5943  * Returns the determinated uint8 value.
5944  *
5945  *******************************************************************************/
5946 XUInt8 EwGetVariantOfUInt8(const XVariant *aConstant);
5947 
5948 /*******************************************************************************
5949  * FUNCTION:
5950  * EwGetVariantOfUInt16
5951  *
5952  * DESCRIPTION:
5953  * The function EwGetVariantOfUInt16() will be called to determinate a value
5954  * of a multilingual/multivariant constant depending on the currently selected
5955  * language and the styles set.
5956  *
5957  * If the currently selected language could not be found in the multilingual
5958  * constant, the function returns the value corresponding to the default
5959  * language (LangId == 0). In case of a multivariant constant, the function
5960  * evaluates the variants in order to find one, which fits the styles
5961  *currently active in the styles set.
5962  *
5963  * ARGUMENTS:
5964  * aVariants - A pointer to the constant containing multiple uint16 values.
5965  *
5966  * RETURN VALUE:
5967  * Returns the determinated uint16 value.
5968  *
5969  *******************************************************************************/
5970 XUInt16 EwGetVariantOfUInt16(const XVariant *aConstant);
5971 
5972 /*******************************************************************************
5973  * FUNCTION:
5974  * EwGetVariantOfUInt32
5975  *
5976  * DESCRIPTION:
5977  * The function EwGetVariantOfUInt32() will be called to determinate a value
5978  * of a multilingual/multivariant constant depending on the currently selected
5979  * language and the styles set.
5980  *
5981  * If the currently selected language could not be found in the multilingual
5982  * constant, the function returns the value corresponding to the default
5983  * language (LangId == 0). In case of a multivariant constant, the function
5984  * evaluates the variants in order to find one, which fits the styles
5985  *currently active in the styles set.
5986  *
5987  * ARGUMENTS:
5988  * aVariants - A pointer to the constant containing multiple uint32 values.
5989  *
5990  * RETURN VALUE:
5991  * Returns the determinated uint32 value.
5992  *
5993  *******************************************************************************/
5994 XUInt32 EwGetVariantOfUInt32(const XVariant *aConstant);
5995 
5996 /*******************************************************************************
5997  * FUNCTION:
5998  * EwGetVariantOfUInt64
5999  *
6000  * DESCRIPTION:
6001  * The function EwGetVariantOfUInt64() will be called to determinate a value
6002  * of a multilingual/multivariant constant depending on the currently selected
6003  * language and the styles set.
6004  *
6005  * If the currently selected language could not be found in the multilingual
6006  * constant, the function returns the value corresponding to the default
6007  * language (LangId == 0). In case of a multivariant constant, the function
6008  * evaluates the variants in order to find one, which fits the styles
6009  *currently active in the styles set.
6010  *
6011  * ARGUMENTS:
6012  * aVariants - A pointer to the constant containing multiple uint64 values.
6013  *
6014  * RETURN VALUE:
6015  * Returns the determinated uint64 value.
6016  *
6017  *******************************************************************************/
6018 XUInt64 EwGetVariantOfUInt64(const XVariant *aConstant);
6019 
6020 /*******************************************************************************
6021  * FUNCTION:
6022  * EwGetVariantOfBool
6023  *
6024  * DESCRIPTION:
6025  * The function EwGetVariantOfBool() will be called to determinate a value
6026  * of a multilingual/multivariant constant depending on the currently selected
6027  * language and the styles set.
6028  *
6029  * If the currently selected language could not be found in the multilingual
6030  * constant, the function returns the value corresponding to the default
6031  * language (LangId == 0). In case of a multivariant constant, the function
6032  * evaluates the variants in order to find one, which fits the styles
6033  *currently active in the styles set.
6034  *
6035  * ARGUMENTS:
6036  * aVariants - A pointer to the constant containing multiple bool values.
6037  *
6038  * RETURN VALUE:
6039  * Returns the determinated bool value.
6040  *
6041  *******************************************************************************/
6042 XBool EwGetVariantOfBool(const XVariant *aConstant);
6043 
6044 /*******************************************************************************
6045  * FUNCTION:
6046  * EwGetVariantOfFloat
6047  *
6048  * DESCRIPTION:
6049  * The function EwGetVariantOfFloat() will be called to determinate a value
6050  * of a multilingual/multivariant constant depending on the currently selected
6051  * language and the styles set.
6052  *
6053  * If the currently selected language could not be found in the multilingual
6054  * constant, the function returns the value corresponding to the default
6055  * language (LangId == 0). In case of a multivariant constant, the function
6056  * evaluates the variants in order to find one, which fits the styles
6057  *currently active in the styles set.
6058  *
6059  * ARGUMENTS:
6060  * aVariants - A pointer to the constant containing multiple float values.
6061  *
6062  * RETURN VALUE:
6063  * Returns the determinated float value.
6064  *
6065  *******************************************************************************/
6066 XFloat EwGetVariantOfFloat(const XVariant *aConstant);
6067 
6068 /*******************************************************************************
6069  * FUNCTION:
6070  * EwGetVariantOfEnum
6071  *
6072  * DESCRIPTION:
6073  * The function EwGetVariantOfEnum() will be called to determinate a value
6074  * of a multilingual/multivariant constant depending on the currently selected
6075  * language and the styles set.
6076  *
6077  * If the currently selected language could not be found in the multilingual
6078  * constant, the function returns the value corresponding to the default
6079  * language (LangId == 0). In case of a multivariant constant, the function
6080  * evaluates the variants in order to find one, which fits the styles
6081  *currently active in the styles set.
6082  *
6083  * ARGUMENTS:
6084  * aVariants - A pointer to the constant containing multiple enum values.
6085  *
6086  * RETURN VALUE:
6087  * Returns the determinated enum value.
6088  *
6089  *******************************************************************************/
6090 XEnum EwGetVariantOfEnum(const XVariant *aConstant);
6091 
6092 /*******************************************************************************
6093  * FUNCTION:
6094  * EwGetVariantOfSet
6095  *
6096  * DESCRIPTION:
6097  * The function EwGetVariantOfSet() will be called to determinate a value
6098  * of a multilingual/multivariant constant depending on the currently selected
6099  * language and the styles set.
6100  *
6101  * If the currently selected language could not be found in the multilingual
6102  * constant, the function returns the value corresponding to the default
6103  * language (LangId == 0). In case of a multivariant constant, the function
6104  * evaluates the variants in order to find one, which fits the styles
6105  *currently active in the styles set.
6106  *
6107  * ARGUMENTS:
6108  * aVariants - A pointer to the constant containing multiple set values.
6109  *
6110  * RETURN VALUE:
6111  * Returns the determinated set value.
6112  *
6113  *******************************************************************************/
6114 XSet EwGetVariantOfSet(const XVariant *aConstant);
6115 
6116 /*******************************************************************************
6117  * FUNCTION:
6118  * EwNewString
6119  *
6120  * DESCRIPTION:
6121  * The function EwNewString() creates a new copy of the string aString. The
6122  * function reserves memory for the string and copies it there.
6123  *
6124  * EwNewString() implements the Chora instant constructor: 'string(aString)'.
6125  *
6126  * ARGUMENTS:
6127  * aString -
6128  *
6129  * RETURN VALUE:
6130  *
6131  *
6132  *******************************************************************************/
6133 XString EwNewString(const XChar *aString);
6134 
6135 /*******************************************************************************
6136  * FUNCTION:
6137  * EwNewStringAnsi
6138  *
6139  * DESCRIPTION:
6140  * The function EwNewStringAnsi() creates a wide-character copy of the given
6141  * ANSI string. The function reserves memory for the new string and copies all
6142  * characters from the aAnsi string into this reserved memory area. During the
6143  * operation the function extends all ANSI characters to 16 bit wide-char
6144  * properly.
6145  *
6146  * ARGUMENTS:
6147  * aAnsi - Pointer to the 8 bit ANSI string.
6148  *
6149  * RETURN VALUE:
6150  * Returns a pointer to the wide-character copy of the given ANSI string.
6151  *
6152  *******************************************************************************/
6153 XString EwNewStringAnsi(register const char *aAnsi);
6154 
6155 /*******************************************************************************
6156  * FUNCTION:
6157  * EwNewStringUtf8
6158  *
6159  * DESCRIPTION:
6160  * The function EwNewStringUtf8() creates a wide-character copy of the given
6161  * UTF-8 string. The function reserves memory for the new string and decodes
6162  * the input characters from the aUtf8 string into this reserved memory area.
6163  * During the operation the function decodes all UTF-8 characters to 16 bit
6164  * wide-char properly.
6165  *
6166  * ARGUMENTS:
6167  * aUtf8 - Pointer to the 8 bit UTF-8 string.
6168  * aCount - Number of characters (bytes) within the aUtf8 string without any
6169  * zero terminator signs.
6170  *
6171  * RETURN VALUE:
6172  * Returns a pointer to the wide-character copy of the decoded UTF-8 string.
6173  *
6174  *******************************************************************************/
6175 XString EwNewStringUtf8(const unsigned char *aUtf8, int aCount);
6176 
6177 /*******************************************************************************
6178  * FUNCTION:
6179  * EwNewStringUInt
6180  *
6181  * DESCRIPTION:
6182  * The function EwNewStringUInt() converts the given unsigned number aValue in
6183  * a string and returns the result. The function adds leading zeros '0' until
6184  * the resulted string has reached the length given in the aCount argument.
6185  *
6186  * EwNewStringUInt() implements the Chora instant constructor:
6187  * 'string(aValue,aNoOfDigits)'.
6188  *
6189  * ARGUMENTS:
6190  * aValue - Unsigned 32 bit value to be converted to string.
6191  * aCount - Desired length of the resulted string.
6192  * aRadix - Controls the format of the resulting string. This parameter can
6193  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
6194  * binary, octal, decimal or hexadecimal notation.
6195  *
6196  * RETURN VALUE:
6197  * Returns a string containing the given number aValue converted in notation
6198  * according to the parameter aRadix.
6199  *
6200  *******************************************************************************/
6201 XString EwNewStringUInt(XUInt32 aValue, XInt32 aCount, XInt32 aRadix);
6202 
6203 /*******************************************************************************
6204  * FUNCTION:
6205  * EwNewStringInt
6206  *
6207  * DESCRIPTION:
6208  * The function EwNewStringInt() converts the given signed number aValue in a
6209  * string and returns the result. The function adds leading zeros '0' until
6210  *the resulted string has reached the length given in the aCount argument. If
6211  *the number is negative, the function adds '-' minus sign.
6212  *
6213  * EwNewStringInt() implements the Chora instant constructor:
6214  * 'string(aValue,aNoOfDigits,aRadix)'.
6215  *
6216  * ARGUMENTS:
6217  * aValue - Signed 32 bit value to be converted to string.
6218  * aCount - Desired length of the resulted string.
6219  * aRadix - Controls the format of the resulting string. This parameter can
6220  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
6221  * binary, octal, decimal or hexadecimal notation.
6222  *
6223  * RETURN VALUE:
6224  * Returns a string containing the given number aValue converted in notation
6225  * according to the parameter aRadix.
6226  *
6227  *******************************************************************************/
6228 XString EwNewStringInt(XInt32 aValue, XInt32 aCount, XInt32 aRadix);
6229 
6230 /*******************************************************************************
6231  * FUNCTION:
6232  * EwNewStringUInt64
6233  *
6234  * DESCRIPTION:
6235  * The function EwNewStringUInt64() converts the given unsigned number aValue
6236  * in a string and returns the result. The function adds leading zeros '0'
6237  * until the resulted string has reached the length given in the aCount
6238  * argument.
6239  *
6240  * EwNewStringUInt64() implements the Chora instant constructor:
6241  * 'string(aValue,aNoOfDigits)'.
6242  *
6243  * ARGUMENTS:
6244  * aValue - Unsigned 64 bit value to be converted to string.
6245  * aCount - Desired length of the resulted string.
6246  * aRadix - Controls the format of the resulting string. This parameter can
6247  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
6248  * binary, octal, decimal or hexadecimal notation.
6249  *
6250  * RETURN VALUE:
6251  * Returns a string containing the given number aValue converted in notation
6252  * according to the parameter aRadix.
6253  *
6254  *******************************************************************************/
6255 XString EwNewStringUInt64(XUInt64 aValue, XInt32 aCount, XInt32 aRadix);
6256 
6257 /*******************************************************************************
6258  * FUNCTION:
6259  * EwNewStringInt64
6260  *
6261  * DESCRIPTION:
6262  * The function EwNewStringInt64() converts the given signed number aValue in
6263  *a string and returns the result. The function adds leading zeros '0' until the
6264  * resulted string has reached the length given in the aCount argument. If the
6265  * number is negative, the function adds '-' minus sign.
6266  *
6267  * EwNewStringInt() implements the Chora instant constructor:
6268  * 'string(aValue,aNoOfDigits,aRadix)'.
6269  *
6270  * ARGUMENTS:
6271  * aValue - Signed 64 bit value to be converted to string.
6272  * aCount - Desired length of the resulted string.
6273  * aRadix - Controls the format of the resulting string. This parameter can
6274  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
6275  * binary, octal, decimal or hexadecimal notation.
6276  *
6277  * RETURN VALUE:
6278  * Returns a string containing the given number aValue converted in notation
6279  * according to the parameter aRadix.
6280  *
6281  *******************************************************************************/
6282 XString EwNewStringInt64(XInt64 aValue, XInt32 aCount, XInt32 aRadix);
6283 
6284 /*******************************************************************************
6285  * FUNCTION:
6286  * EwNewStringFloat
6287  *
6288  * DESCRIPTION:
6289  * The function EwNewStringFloat() converts the given floating point number
6290  * aValue in a string and returns the result.
6291  *
6292  * EwNewStringFloat() implements the Chora instant constructor:
6293  * 'string(aValue,aNoOfDigits,aPrecision)'.
6294  *
6295  * ARGUMENTS:
6296  * aValue - The floating point value to be converted in a string.
6297  * aCount - Minimum number of characters to store in the resulted string
6298  * output.
6299  * aPrecision - The aPrecision argument specifies the exact number of digits
6300  * after the decimal point. If this parameter is < 0, the function will
6301  * automatically estimate the number of digits after the decimal point.
6302  *
6303  * RETURN VALUE:
6304  * Returns a string containing the given floating point number aValue.
6305  *
6306  *******************************************************************************/
6307 XString EwNewStringFloat(XFloat aValue, XInt32 aCount, XInt32 aPrecision);
6308 
6309 /*******************************************************************************
6310  * FUNCTION:
6311  * EwNewStringChar
6312  *
6313  * DESCRIPTION:
6314  * The function EwNewStringChar() creates a string with the given length
6315  *aCount and fills the whole string with the character aChar.
6316  *
6317  * EwNewStringChar() implements the Chora instant constructor:
6318  * 'string(aChar,aNoOfDigits)'.
6319  *
6320  * ARGUMENTS:
6321  * aChar - Character to fill the string.
6322  * aCount - Desired length of the resulted string.
6323  *
6324  * RETURN VALUE:
6325  * Returns a string containing aCount characters aChar.
6326  *
6327  *******************************************************************************/
6328 XString EwNewStringChar(XChar aChar, XInt32 aCount);
6329 
6330 /*******************************************************************************
6331  * FUNCTION:
6332  * EwCompString
6333  *
6334  * DESCRIPTION:
6335  * The function EwCompString() compares aString1 and aString2
6336  *lexicographically and returns a value indicating their relationship.
6337  *
6338  * EwCompString() implements the Chora instant operators: 'string == string'
6339  * 'string != string', 'string < string', ...
6340  *
6341  * ARGUMENTS:
6342  * aString1 - The first string to be compared.
6343  * aString2 - The second string to be compared.
6344  *
6345  * RETURN VALUE:
6346  * If aString1 is identical to aString2 the function returns 0 (zero).
6347  * If aString1 is less than aString2 the function returns -1.
6348  * If aString1 is greater than aString2 the function returns +1.
6349  *
6350  *******************************************************************************/
6351 int EwCompString(XString aString1, XString aString2);
6352 
6353 /*******************************************************************************
6354  * FUNCTION:
6355  * EwLoadString
6356  *
6357  * DESCRIPTION:
6358  * The function EwLoadString() returns the pointer to the 'string' constant
6359  * described by aStringConst. Depending on the configuration of the system,
6360  *the 'string' may need to be decompressed before it can be used. In such case
6361  *all decompressed strings are managed within a common string cache. If
6362  *possible, the function will reuse such already existing strings.
6363  *
6364  * The function returns the pointer to the first character of the decompressed
6365  * 'string' constant. If 'string' constants are not compressed, the function
6366  * returns the pointer to the ROM area where the 'string' is stored.
6367  *
6368  * ARGUMENTS:
6369  * aStringConst - Pointer to the descriptor of the constant.
6370  *
6371  * RETURN VALUE:
6372  * Returns a pointer to the string constant.
6373  *
6374  *******************************************************************************/
6375 XString EwLoadString(const XStringRes *aStringConst);
6376 
6377 /*******************************************************************************
6378  * FUNCTION:
6379  * EwShareString
6380  *
6381  * DESCRIPTION:
6382  * The function EwShareString() verifies whether the string passed in the
6383  * parameter aString is a private copy of the string and changes it to a
6384  * shared copy. Private string copies are created when a string is modified
6385  * by the string index operator []. In such case, the operator creates a copy
6386  * of the original string. Later the index operator can operate on the string
6387  * without the necessity to copy it again and again. As soon as the string is
6388  * assigned to a new variable, etc. the optimization will not work anymore.
6389  * To avoid any incoherence in the string contents, assigning private strings
6390  * to a variable changes their state to shared. Next time when such shared
6391  * string is modified with the index operator, a new copy of the string is
6392  * created. THis is a kind of optimization to perfmorm an efficient copy-on-
6393  * write string behavior.
6394  *
6395  * ARGUMENTS:
6396  * aString - Pointer to the string to be changed from private to shared.
6397  *
6398  * RETURN VALUE:
6399  * Returns the string passed in aString.
6400  *
6401  *******************************************************************************/
6402 XString EwShareString(XString aString);
6403 
6404 /* Following functions are obsolete with Embedded Wizard 9.30. To avoid compiler
6405  errors with customer own implementation empty defines of them are provided.
6406  */
6407 #define EwRetainString(aDest, aString) (*(aDest) = EwShareString(aString))
6408 #define EwReleaseString(aString)
6409 #define EwReleaseStrings(aStrings)
6410 
6411 /*******************************************************************************
6412  * FUNCTION:
6413  * EwConcatString
6414  *
6415  * DESCRIPTION:
6416  * The function EwConcatString() creates a new string large enought to store a
6417  * copy of aString1 and aString2. Then the function copies the content of
6418  * aString1 and appends the content of the second string aStrings2.
6419  *
6420  * EwConcatString() implements the Chora instant operator: 'string + string'.
6421  *
6422  * ARGUMENTS:
6423  * aString1 - The first string.
6424  * aString2 - The second string.
6425  *
6426  * RETURN VALUE:
6427  * Returns a string containing a copy of aString1 followed by a copy of
6428  * aString2.
6429  *
6430  *******************************************************************************/
6431 XString EwConcatString(XString aString1, XString aString2);
6432 
6433 /*******************************************************************************
6434  * FUNCTION:
6435  * EwConcatStringChar
6436  *
6437  * DESCRIPTION:
6438  * The function EwConcatStringChar() appends the character aChar at the end of
6439  * the string aString and returns the result.
6440  *
6441  * EwConcatStringChar() implements the Chora instant operator:
6442  * 'string + char'.
6443  *
6444  * ARGUMENTS:
6445  * aString - The string.
6446  * aChar - The character to be appended to the string.
6447  *
6448  * RETURN VALUE:
6449  * Returns a string containing a copy of aString followed by aChar.
6450  *
6451  *******************************************************************************/
6452 XString EwConcatStringChar(XString aString, XChar aChar);
6453 
6454 /*******************************************************************************
6455  * FUNCTION:
6456  * EwConcatCharString
6457  *
6458  * DESCRIPTION:
6459  * The function EwConcatCharString() appends aString to the character aChar
6460  * and returns the result.
6461  *
6462  * EwConcatCharString() implements the Chora instant operator:
6463  * 'char + string'.
6464  *
6465  * ARGUMENTS:
6466  * aChar - The character.
6467  * aString - The string to be apended.
6468  *
6469  * RETURN VALUE:
6470  * Returns a string containing aChar followed by a copy of aString.
6471  *
6472  *******************************************************************************/
6473 XString EwConcatCharString(XChar aChar, XString aString);
6474 
6475 /*******************************************************************************
6476  * FUNCTION:
6477  * EwGetStringChar
6478  *
6479  * DESCRIPTION:
6480  * The function EwGetStringChar() determinates the character stored at
6481  *position aIndex in the string aString. The function returns the zero character
6482  *if the specified aIndex addresses a character lying beyond the string
6483  *boundary.
6484  *
6485  * EwGetStringChar() implements the read access to Chora instant operator:
6486  * 'string[aIndex]'
6487  *
6488  * ARGUMENTS:
6489  * aString - The string to get the character.
6490  * aIndex - The position of the desired character in the string.
6491  *
6492  * RETURN VALUE:
6493  * Returns the character stored at position aIndex within the string aString.
6494  *
6495  *******************************************************************************/
6496 XChar EwGetStringChar(register XString aString, XInt32 aIndex);
6497 
6498 /*******************************************************************************
6499  * FUNCTION:
6500  * EwSetStringChar
6501  *
6502  * DESCRIPTION:
6503  * The function EwSetStringChar() changes the character stored at position
6504  * aIndex in the string passed in the parameter aString to a new value aChar.
6505  * The function throws an error if the desired character position aIndex is
6506  * not valid.
6507  *
6508  * If the originally passed string is a marked internally as being a private
6509  * string copy, the operation modifies the string in-place. In turn, if the
6510  * string is marked as being shared (e.g. stored in multiple variables), the
6511  * operation creates first a copy of the original string and uses it to
6512  * change the character.
6513  *
6514  * EwSetStringChar() implements the write access to Chora instant operator:
6515  * 'string[aIndex]'
6516  *
6517  * ARGUMENTS:
6518  * aString - The string to set the character.
6519  * aIndex - The position of the desired character in the string.
6520  *
6521  * RETURN VALUE:
6522  * Returns a string with the changed character. This can be the either the
6523  * string passed originally in the parameter aString if the string is marked
6524  * internally as being a private string copy or it can be a copy of the string
6525  * if it is marked as being shared between several variables. Therefore you
6526  * should always use the returned value.
6527  *
6528  *******************************************************************************/
6529 XString EwSetStringChar(register XString aString, XInt32 aIndex, XChar aChar);
6530 
6531 /*******************************************************************************
6532  * FUNCTION:
6533  * EwGetStringLength
6534  *
6535  * DESCRIPTION:
6536  * The function EwGetStringLength() returns the length of the string aString
6537  * in characters. If the string is empty, the function returns 0.
6538  *
6539  * EwGetStringLength() implements the Chora instant property: 'string.length'
6540  *
6541  * ARGUMENTS:
6542  * aString - The string to determinate the length of.
6543  *
6544  * RETURN VALUE:
6545  * Returns the length of the string in characters or 0 if the string is empty.
6546  *
6547  *******************************************************************************/
6549 
6550 /*******************************************************************************
6551  * FUNCTION:
6552  * EwIsStringEmpty
6553  *
6554  * DESCRIPTION:
6555  * The function EwIsStringEmpty() returns != 0 if the string aString does not
6556  * contain any characters. If the string is not empty, the function returns 0.
6557  *
6558  * ARGUMENTS:
6559  * aString - The string to verify.
6560  *
6561  * RETURN VALUE:
6562  * Returns != 0 if the string is empty.
6563  *
6564  *******************************************************************************/
6565 XBool EwIsStringEmpty(XString aString);
6566 
6567 /*******************************************************************************
6568  * FUNCTION:
6569  * EwGetStringUpper
6570  *
6571  * DESCRIPTION:
6572  * The function EwGetStringUpper() converts the string aString to uppercase
6573  * and returns an altered copy of the string.
6574  *
6575  * EwGetStringUpper() implements the Chora instant property: 'string.upper'
6576  *
6577  * ARGUMENTS:
6578  * aString - String to capitalize.
6579  *
6580  * RETURN VALUE:
6581  * Returns uppercase copy of the string.
6582  *
6583  *******************************************************************************/
6585 
6586 /*******************************************************************************
6587  * FUNCTION:
6588  * EwGetStringLower
6589  *
6590  * DESCRIPTION:
6591  * The function EwGetStringLower() converts the string aString to lowercase
6592  * and returns an altered copy of the string.
6593  *
6594  * EwGetStringLower() implements the Chora instant property: 'string.lower'
6595  *
6596  * ARGUMENTS:
6597  * aString - String to convert to lowercase.
6598  *
6599  * RETURN VALUE:
6600  * Returns lowercase copy of the string.
6601  *
6602  *******************************************************************************/
6604 
6605 /*******************************************************************************
6606  * FUNCTION:
6607  * EwStringLeft
6608  *
6609  * DESCRIPTION:
6610  * The function EwStringLeft() extracts the first (that is, leftmost) aCount
6611  * characters from the string aString and returns a copy of the extracted
6612  * substring. If aCount exceeds the string length, then the entire string is
6613  * extracted.
6614  *
6615  * EwStringLeft() implements the Chora instant method: 'string.left(aCount)'
6616  *
6617  * ARGUMENTS:
6618  * aString - The string to extract a substring.
6619  * aCount - The maximum number of characters to extract from aString.
6620  *
6621  * RETURN VALUE:
6622  * Returns the extracted substring or if aCount == 0 the function returns an
6623  * empty string.
6624  *
6625  *******************************************************************************/
6626 XString EwStringLeft(XString aString, XInt32 aCount);
6627 
6628 /*******************************************************************************
6629  * FUNCTION:
6630  * EwStringRight
6631  *
6632  * DESCRIPTION:
6633  * The function EwStringRight() extracts the last (that is, rightmost) aCount
6634  * characters from the string aString and returns a copy of the extracted
6635  * substring. If aCount exceeds the string length, then the entire string is
6636  * extracted.
6637  *
6638  * EwStringRight() implements the Chora instant method: 'string.right(aCount)'
6639  *
6640  * ARGUMENTS:
6641  * aString - The string to extract a substring.
6642  * aCount - The maximum number of characters to extract from aString.
6643  *
6644  * RETURN VALUE:
6645  * Returns the extracted substring or if aCount == 0 the function returns an
6646  * empty string.
6647  *
6648  *******************************************************************************/
6649 XString EwStringRight(XString aString, XInt32 aCount);
6650 
6651 /*******************************************************************************
6652  * FUNCTION:
6653  * EwStringMiddle
6654  *
6655  * DESCRIPTION:
6656  * The function EwStringMiddle() extracts a substring of length aCount
6657  * characters from the string aString, starting at position aIndex. The
6658  * function returns a copy of the extracted substring.
6659  *
6660  * EwStringMiddle() implements the Chora instant method:
6661  * 'string.middle(aIndex,aCount)'
6662  *
6663  * ARGUMENTS:
6664  * aString - The string to extract a substring.
6665  * aIndex - The index of the first character in the string where the
6666  *extracted substring begins. aCount - The maximum number of characters to
6667  *extract from aString.
6668  *
6669  * RETURN VALUE:
6670  * Returns the extracted substring or if aCount == 0 the function returns an
6671  * empty string.
6672  *
6673  *******************************************************************************/
6674 XString EwStringMiddle(XString aString, XInt32 aIndex, XInt32 aCount);
6675 
6676 /*******************************************************************************
6677  * FUNCTION:
6678  * EwStringInsert
6679  *
6680  * DESCRIPTION:
6681  * The function EwStringInsert() inserts the substring aString2 at the given
6682  * position aIndex within the string aString1. If aIndex is <= 0 zero, the
6683  * insertion will occur before the entire string. If aIndex is > than the
6684  * length of the string, the function will concatenate aString1 and aString2
6685  * together.
6686  *
6687  * EwStringInsert() implements the Chora instant method:
6688  * 'string.insert(aString,aIndex)'
6689  *
6690  * ARGUMENTS:
6691  * aString1 - The string to insert a substring.
6692  * aString2 - The substring to be inserted.
6693  * aIndex - The position in aString1 where the substring should be inserted.
6694  *
6695  * RETURN VALUE:
6696  * Returns a new string containing aString1 and aString2.
6697  *
6698  *******************************************************************************/
6699 XString EwStringInsert(XString aString1, XString aString2, XInt32 aIndex);
6700 
6701 /*******************************************************************************
6702  * FUNCTION:
6703  * EwStringRemove
6704  *
6705  * DESCRIPTION:
6706  * The function EwStringRemove() removes up to aCount characters from the
6707  * string aString starting with the character at position aIndex.
6708  *
6709  * EwStringRemove() implements the Chora instant method:
6710  * 'string.remove(aIndex,aCount)'
6711  *
6712  * ARGUMENTS:
6713  * aString - The string to remove characters.
6714  * aIndex - The index of the first character to remove.
6715  * aCount - The number of characters to be removed.
6716  *
6717  * RETURN VALUE:
6718  * Returns a new string containing altered aString.
6719  *
6720  *******************************************************************************/
6721 XString EwStringRemove(XString aString, XInt32 aIndex, XInt32 aCount);
6722 
6723 /*******************************************************************************
6724  * FUNCTION:
6725  * EwStringFindChar
6726  *
6727  * DESCRIPTION:
6728  * The function EwStringFindChar() searches the string aString for the first
6729  * occurence of a character aChar. EwStringFindChar() starts the search
6730  * operation at the position aStartIndex in the string. The function returns
6731  * the index of the first character in aString1 that matches the requested
6732  * character.
6733  *
6734  * EwStringFindChar() implements the Chora instant method:
6735  * 'string.find(aChar,aStartIndex)'
6736  *
6737  * ARGUMENTS:
6738  * aString - The string to serach with.
6739  * aChar - A character to search for.
6740  * aStartIndex - The position of the character to begin the search.
6741  *
6742  * RETURN VALUE:
6743  * Returns the position in the string aString where the character aChar has
6744  * been found or -1 if aChar has not been found.
6745  *
6746  *******************************************************************************/
6747 XInt32 EwStringFindChar(XString aString, XChar aChar, XInt32 aStartIndex);
6748 
6749 /*******************************************************************************
6750  * FUNCTION:
6751  * EwStringFind
6752  *
6753  * DESCRIPTION:
6754  * The function EwStringFind() searches the string aString for the first
6755  * occurence of a substring aString2. EwStringFind() starts the search
6756  * operation at the position aStartIndex in the string. The function returns
6757  * the index of the first character in aString1 that matches the requested
6758  * substring.
6759  *
6760  * EwStringFind() implements the Chora instant method:
6761  * 'string.find(aString,aStartIndex)'
6762  *
6763  * ARGUMENTS:
6764  * aString1 - The string to serach with.
6765  * aString2 - A substring to search for.
6766  * aStartIndex - The position of the character to begin the search.
6767  *
6768  * RETURN VALUE:
6769  * Returns the position in the string aString1 where the substring aString2
6770  * has been found or -1 if aString2 has not been found.
6771  *
6772  *******************************************************************************/
6773 XInt32 EwStringFind(XString aString1, XString aString2, XInt32 aStartIndex);
6774 
6775 /*******************************************************************************
6776  * FUNCTION:
6777  * EwStringParseInt32
6778  *
6779  * DESCRIPTION:
6780  * The function EwStringParseInt32() parses the string interpreting its
6781  *content as an integral number. The number can be prefixed by an optional +/-
6782  *sign. Whitespace signs lying at the begin of the string are skipped over.
6783  *
6784  * The function parses the numbers according to the notation resulting from
6785  *the parameter aRadix. In this manner strings with binary, octal, decimal or
6786  *even hexadecimal notation can be read.
6787  *
6788  * Generally the function tries to read as many signs as possible. If the end
6789  *of the string or an unexpected sign is found, the function stops and returns
6790  *the already read number as signed integer value. If the string is invalid (it
6791  * doesn't contain any expected digit or letter), the value passed in the
6792  * parameter aDefault is returned instead.
6793  *
6794  * EwStringParseInt32() implements the Chora instant method:
6795  * 'string.parse_int32(aDefault,aRadix)'
6796  *
6797  * ARGUMENTS:
6798  * aString - The string to parse its content.
6799  * aDefault - Value to return if the string doesn't contain a valid number.
6800  * aRadix - Determines the format of the number in the string. This
6801  *parameter can assume values 2, 8, 10 or 16. Accordingly the string content is
6802  *assumed as being a number with binary, octal, decimal or hexadecimal notation.
6803  *
6804  * RETURN VALUE:
6805  * Returns the parsed number value as signed integer or the value from the
6806  * parameter aDefault if the string doesn't contain a valid number.
6807  *
6808  *******************************************************************************/
6809 XInt32 EwStringParseInt32(XString aString, XInt32 aDefault, XInt32 aRadix);
6810 
6811 /*******************************************************************************
6812  * FUNCTION:
6813  * EwStringParseUInt32
6814  *
6815  * DESCRIPTION:
6816  * The function EwStringParseUInt32() parses the string interpreting its
6817  *content as an integral number. The number can be prefixed by an optional +/-
6818  *sign. Whitespace signs lying at the begin of the string are skipped over.
6819  *
6820  * The function parses the numbers according to the notation resulting from
6821  *the parameter aRadix. In this manner strings with binary, octal, decimal or
6822  *even hexadecimal notation can be read.
6823  *
6824  * Generally the function tries to read as many signs as possible. If the end
6825  *of the string or an unexpected sign is found, the function stops and returns
6826  *the already read number as unsigned integer value. If the string is invalid
6827  *(it doesn't contain any expected digit or letter), the value passed in the
6828  * parameter aDefault is returned instead.
6829  *
6830  * EwStringParseUInt32() implements the Chora instant method:
6831  * 'string.parse_uint32(aDefault,aRadix)'
6832  *
6833  * ARGUMENTS:
6834  * aString - The string to parse its content.
6835  * aDefault - Value to return if the string doesn't contain a valid number.
6836  * aRadix - Determines the format of the number in the string. This
6837  *parameter can assume values 2, 8, 10 or 16. Accordingly the string content is
6838  *assumed as being a number with binary, octal, decimal or hexadecimal notation.
6839  *
6840  * RETURN VALUE:
6841  * Returns the parsed number value as unsigned integer or the value from the
6842  * parameter aDefault if the string doesn't contain a valid number.
6843  *
6844  *******************************************************************************/
6845 XUInt32 EwStringParseUInt32(XString aString, XUInt32 aDefault, XInt32 aRadix);
6846 
6847 /*******************************************************************************
6848  * FUNCTION:
6849  * EwStringParseInt64
6850  *
6851  * DESCRIPTION:
6852  * The function EwStringParseInt64() parses the string interpreting its
6853  *content as an integral number. The number can be prefixed by an optional +/-
6854  *sign. Whitespace signs lying at the begin of the string are skipped over.
6855  *
6856  * The function parses the numbers according to the notation resulting from
6857  *the parameter aRadix. In this manner strings with binary, octal, decimal or
6858  *even hexadecimal notation can be read.
6859  *
6860  * Generally the function tries to read as many signs as possible. If the end
6861  *of the string or an unexpected sign is found, the function stops and returns
6862  *the already read number as signed integer value. If the string is invalid (it
6863  * doesn't contain any expected digit or letter), the value passed in the
6864  * parameter aDefault is returned instead.
6865  *
6866  * EwStringParseInt64() implements the Chora instant method:
6867  * 'string.parse_int64(aDefault,aRadix)'
6868  *
6869  * ARGUMENTS:
6870  * aString - The string to parse its content.
6871  * aDefault - Value to return if the string doesn't contain a valid number.
6872  * aRadix - Determines the format of the number in the string. This
6873  *parameter can assume values 2, 8, 10 or 16. Accordingly the string content is
6874  *assumed as being a number with binary, octal, decimal or hexadecimal notation.
6875  *
6876  * RETURN VALUE:
6877  * Returns the parsed number value as signed integer or the value from the
6878  * parameter aDefault if the string doesn't contain a valid number.
6879  *
6880  *******************************************************************************/
6881 XInt64 EwStringParseInt64(XString aString, XInt64 aDefault, XInt32 aRadix);
6882 
6883 /*******************************************************************************
6884  * FUNCTION:
6885  * EwStringParseUInt64
6886  *
6887  * DESCRIPTION:
6888  * The function EwStringParseUInt64() parses the string interpreting its
6889  *content as an integral number. The number can be prefixed by an optional +/-
6890  *sign. Whitespace signs lying at the begin of the string are skipped over.
6891  *
6892  * The function parses the numbers according to the notation resulting from
6893  *the parameter aRadix. In this manner strings with binary, octal, decimal or
6894  *even hexadecimal notation can be read.
6895  *
6896  * Generally the function tries to read as many signs as possible. If the end
6897  *of the string or an unexpected sign is found, the function stops and returns
6898  *the already read number as unsigned integer value. If the string is invalid
6899  *(it doesn't contain any expected digit or letter), the value passed in the
6900  * parameter aDefault is returned instead.
6901  *
6902  * EwStringParseUInt64() implements the Chora instant method:
6903  * 'string.parse_uint64(aDefault,aRadix)'
6904  *
6905  * ARGUMENTS:
6906  * aString - The string to parse its content.
6907  * aDefault - Value to return if the string doesn't contain a valid number.
6908  * aRadix - Determines the format of the number in the string. This
6909  *parameter can assume values 2, 8, 10 or 16. Accordingly the string content is
6910  *assumed as being a number with binary, octal, decimal or hexadecimal notation.
6911  *
6912  * RETURN VALUE:
6913  * Returns the parsed number value as unsigned integer or the value from the
6914  * parameter aDefault if the string doesn't contain a valid number.
6915  *
6916  *******************************************************************************/
6917 XUInt64 EwStringParseUInt64(XString aString, XUInt64 aDefault, XInt32 aRadix);
6918 
6919 /*******************************************************************************
6920  * FUNCTION:
6921  * EwStringParseFloat
6922  *
6923  * DESCRIPTION:
6924  * The function EwStringParseFloat() parses the string interpreting its
6925  *content as a floating point number. The number can be prefixed by an optional
6926  *+/- sign. Whitespace signs lying at the begin of the string are skipped over.
6927  *
6928  * In the floating point notation the number can consist of an integer and/or
6929  * a fractional portion. The fractional portion starts with a '.'. Optionally
6930  * the number can be followed by an exponent portion. The exponent portion
6931  * starts with the e or E sign followed by an optional +/- sign and an
6932  *integral number. The following example shows the complete number with all
6933  *portions:
6934  *
6935  * "123.456e-07"
6936  *
6937  * Generally the function tries to read as many signs as possible. If the end
6938  * of the string or an unexpected sign is found, the function stops and
6939  *returns the already read number as floating point value. If the string is
6940  *invalid (it doesn't contain any expected digit), the value passed in the
6941  *parameter aDefault is returned instead.
6942  *
6943  * EwStringParseFloat() implements the Chora instant method:
6944  * 'string.parse_float(aDefault)'
6945  *
6946  * ARGUMENTS:
6947  * aString - The string to parse its content.
6948  * aDefault - Value to return if the string doesn't contain a valid number.
6949  *
6950  * RETURN VALUE:
6951  * Returns the parsed number value as floating point or the value from the
6952  * parameter aDefault if the string doesn't contain a valid number.
6953  *
6954  *******************************************************************************/
6955 XFloat EwStringParseFloat(XString aString, XFloat aDefault);
6956 
6957 /*******************************************************************************
6958  * FUNCTION:
6959  * EwStringToAnsi
6960  *
6961  * DESCRIPTION:
6962  * The function EwStringToAnsi() converts up to aCount characters from the
6963  * given 16 bit wide char string aString to an 8 bit ANSI string and stores it
6964  * in the memory area aDest. The resulted string is terminated by the zero
6965  * 0x00.
6966  *
6967  * Character codes greater than 255 are replaced by the aDefChar value. This
6968  * is necessary, because the character codes in the source string can became
6969  * values in range 0 .. 65535. The destination string can accomodate codes
6970  * in the range 0 .. 255 only.
6971  *
6972  * The function returns the number of converted characters incl. the last zero
6973  * terminator 0x00.
6974  *
6975  * ARGUMENTS:
6976  * aString - The source 16 bit wide char string to convert.
6977  * aDest - Pointer to the destination memory, where the converted 8 bit
6978  * ANSI string should be stored in. This memory area has to be at least
6979  * aCount bytes large.
6980  * aCount - The number of characters incl. the zero terminator to convert.
6981  * aDefChar - Default character to replace all characters, which are > 255.
6982  *
6983  * RETURN VALUE:
6984  * Returns the number of bytes written into the aDest memory area.
6985  *
6986  *******************************************************************************/
6987 XInt32 EwStringToAnsi(XString aString, char *aDest, XInt32 aCount,
6988  char aDefChar);
6989 
6990 /*******************************************************************************
6991  * FUNCTION:
6992  * EwGetUtf8StringLength
6993  *
6994  * DESCRIPTION:
6995  * The function EwGetUtf8StringLength() analyzes the characters in the given
6996  * 16 bit wide char string aString and estimates the length in bytes for a
6997  * corresponding UTF8 string. This value can be used to reserve memory before
6998  * using the function EwStringToUtf8().
6999  *
7000  * ARGUMENTS:
7001  * aString - The source 16 bit wide char string to convert.
7002  *
7003  * RETURN VALUE:
7004  * Returns the number of bytes to store the corresponding string in UTF8
7005  * format without the zero terminator sign.
7006  *
7007  *******************************************************************************/
7009 
7010 /*******************************************************************************
7011  * FUNCTION:
7012  * EwStringToUtf8
7013  *
7014  * DESCRIPTION:
7015  * The function EwStringToUtf8() converts the characters from the given 16 bit
7016  * wide char string aString to an 8 bit UTF8 string and stores it in the
7017  *memory area aDest. The resulted string is terminated by the zero 0x00.
7018  *
7019  * The function returns the number of bytes written in aDest incl. the last
7020  * zero terminator 0x00.
7021  *
7022  * ARGUMENTS:
7023  * aString - The source 16 bit wide char string to convert.
7024  * aDest - Pointer to the destination memory, where the converted 8 bit
7025  * UTF8 string should be stored in. This memory area has to be at least
7026  * aCount bytes large.
7027  * aCount - The number of bytes within aDest available for the operation.
7028  *
7029  * RETURN VALUE:
7030  * Returns the number of bytes written into the aDest memory area incl. the
7031  * zero terminator sign.
7032  *
7033  *******************************************************************************/
7034 XInt32 EwStringToUtf8(XString aString, unsigned char *aDest, XInt32 aCount);
7035 
7036 /*******************************************************************************
7037  * FUNCTION:
7038  * EwGetVariantOfString
7039  *
7040  * DESCRIPTION:
7041  * The function EwGetVariantOfString() will be called to determinate a value
7042  * of a multilingual/multivariant constant depending on the currently selected
7043  * language and the styles set.
7044  *
7045  * If the currently selected language could not be found in the multilingual
7046  * constant, the function returns the value corresponding to the default
7047  * language (LangId == 0). In case of a multivariant constant, the function
7048  * evaluates the variants in order to find one, which fits the styles
7049  *currently active in the styles set.
7050  *
7051  * ARGUMENTS:
7052  * aVariants - A pointer to the constant containing multiple string values.
7053  *
7054  * RETURN VALUE:
7055  * Returns the determinated string value.
7056  *
7057  *******************************************************************************/
7058 XString EwGetVariantOfString(const XVariant *aConstant);
7059 
7060 /*******************************************************************************
7061  * FUNCTION:
7062  * EwGetVariantOfChar
7063  *
7064  * DESCRIPTION:
7065  * The function EwGetVariantOfChar() will be called to determinate a value
7066  * of a multilingual/multivariant constant depending on the currently selected
7067  * language and the styles set.
7068  *
7069  * If the currently selected language could not be found in the multilingual
7070  * constant, the function returns the value corresponding to the default
7071  * language (LangId == 0). In case of a multivariant constant, the function
7072  * evaluates the variants in order to find one, which fits the styles
7073  *currently active in the styles set.
7074  *
7075  * ARGUMENTS:
7076  * aVariants - A pointer to the constant containing multiple char values.
7077  *
7078  * RETURN VALUE:
7079  * Returns the determinated char value.
7080  *
7081  *******************************************************************************/
7082 XChar EwGetVariantOfChar(const XVariant *aConstant);
7083 
7084 /*******************************************************************************
7085  * FUNCTION:
7086  * EwGetCharUpper
7087  *
7088  * DESCRIPTION:
7089  * The function EwGetCharUpper() converts the character aChar to uppercase.
7090  *
7091  * EwGetCharUpper() implements the Chora instant property: 'char.upper'
7092  *
7093  * ARGUMENTS:
7094  * aChar - Character to convert to uppercase.
7095  *
7096  * RETURN VALUE:
7097  * Returns uppercase copy of the character.
7098  *
7099  *******************************************************************************/
7100 XChar EwGetCharUpper(XChar aChar);
7101 
7102 /*******************************************************************************
7103  * FUNCTION:
7104  * EwGetCharLower
7105  *
7106  * DESCRIPTION:
7107  * The function EwGetCharLower() converts the character aChar to lowercase.
7108  *
7109  * EwGetCharLower() implements the Chora instant property: 'char.lower'
7110  *
7111  * ARGUMENTS:
7112  * aChar - Character to convert to lowercase.
7113  *
7114  * RETURN VALUE:
7115  * Returns lowercase copy of the character.
7116  *
7117  *******************************************************************************/
7118 XChar EwGetCharLower(XChar aChar);
7119 
7120 /*******************************************************************************
7121  * TYPE:
7122  * XTicks
7123  *
7124  * DESCRIPTION:
7125  * XTicks is used to store the timer ticks as a 64 bit number. The usage of
7126  * 64 bit arithmetic allows very, very long timer expirations.
7127  *
7128  * ELEMENTS:
7129  * Lo - Lower 32 bit of the number.
7130  * Hi - Upper 32 bit of the number.
7131  *
7132  *******************************************************************************/
7133 typedef struct {
7134  XUInt32 Lo;
7135  XUInt32 Hi;
7136 } XTicks;
7137 
7138 /*******************************************************************************
7139  * TYPE:
7140  * XTimerProc
7141  *
7142  * DESCRIPTION:
7143  * XTimerProc is a prototype for an application routine to execute when the
7144  * timer expires.
7145  *
7146  * ARGUMENTS:
7147  * aArg - An optional argument to pass to the timer procedure.
7148  *
7149  * RETURN VALUE:
7150  * None
7151  *
7152  *******************************************************************************/
7154 
7155 /*******************************************************************************
7156  * TYPE:
7157  * XTimer
7158  *
7159  * DESCRIPTION:
7160  * The type XTimer defines a structure to store a timer. XTimer structures
7161  *will be stored within a global timers list.
7162  *
7163  * ELEMENTS:
7164  * Next - Points to the next timer within the global timers list.
7165  * Proc - Pointer to an user defined routine to execute when the timer
7166  * expires. These routines will be called in context of the function
7167  * EwProcessTimers() only. It avoids any race conditions.
7168  * Arg - An optional argument to pass to the timer procedure Proc.
7169  * Enabled - If not zero, the timer is running.
7170  * Ticks - 64 Bit delay to the next timer expiriation in milliseconds.
7171  * EwProcessTimers() compares this value with the internal clock and
7172  * decides whether the timer is expired or not.
7173  * InitialTime - The number of milliseconds for the first time expiration.
7174  * RepeatTime - The number of milliseconds between two timer expirations.
7175  *
7176  *******************************************************************************/
7177 typedef struct _XTimer {
7178  struct _XTimer *Next;
7179  XTimerProc Proc;
7180  XHandle Arg;
7181  XBool Enabled;
7182  XTicks Ticks;
7185 } XTimer;
7186 
7187 /*******************************************************************************
7188  * FUNCTION:
7189  * EwCreateTimer
7190  *
7191  * DESCRIPTION:
7192  * The function EwCreateTimer() initializes an new timer and inserts it into
7193  * the global timer list Timers.
7194  *
7195  * ARGUMENTS:
7196  * aProc - Entry point of an user defined function. The function will be each
7197  * time the timer is expired. The function will be called in context of the
7198  * function EwProcessTimers() only.
7199  * aArg - Optional 32 bit argument to pass in the timer procedure aProc.
7200  *
7201  * RETURN VALUE:
7202  * Returns a pointer to a new timer.
7203  *
7204  *******************************************************************************/
7206 
7207 /*******************************************************************************
7208  * FUNCTION:
7209  * EwDestroyTimer
7210  *
7211  * DESCRIPTION:
7212  * The function EwDestroyTimer() removes the timer from the timers list and
7213  * frees the memory reserved for the timer.
7214  *
7215  * ARGUMENTS:
7216  * aTimer - Pointer to the timer to destroy.
7217  *
7218  * RETURN VALUE:
7219  * None
7220  *
7221  *******************************************************************************/
7222 void EwDestroyTimer(XTimer *aTimer);
7223 
7224 /*******************************************************************************
7225  * FUNCTION:
7226  * EwStartTimer
7227  *
7228  * DESCRIPTION:
7229  * The function EwStartTimer() starts the timer aTimer with the given number
7230  * of milliseconds aDelay. If the timer is already started, the function
7231  * reinitializes the timer with a new expiration time.
7232  *
7233  * ARGUMENTS:
7234  * aTimer - Pointer to the timer to start.
7235  * aInitialTime - The number of milliseconds for the first time expiration.
7236  * aRepeatTime - The number of milliseconds between two timer expirations.
7237  *
7238  * RETURN VALUE:
7239  * None
7240  *
7241  *******************************************************************************/
7242 void EwStartTimer(XTimer *aTimer, XInt32 aInitialTime, XInt32 aRepeatTime);
7243 
7244 /*******************************************************************************
7245  * FUNCTION:
7246  * EwResetTimer
7247  *
7248  * DESCRIPTION:
7249  * The function EwResetTimer() stops the given timer aTimer.
7250  *
7251  * ARGUMENTS:
7252  * aTimer - Pointer to the timer to be stopped.
7253  *
7254  * RETURN VALUE:
7255  * None
7256  *
7257  *******************************************************************************/
7258 void EwResetTimer(XTimer *aTimer);
7259 
7260 /*******************************************************************************
7261  * FUNCTION:
7262  * EwProcessTimers
7263  *
7264  * DESCRIPTION:
7265  * The function EwProcessTimers() should be called in order to process all
7266  * pending timer events. EwProcessTimers() traverses the global timers list
7267  * and invokes all timer procedures assigned to timers which are expired.
7268  * After all pending timer events are evaluated, EwProcessTimers() clears
7269  * all pending flags.
7270  *
7271  * The function returns a value != 0, if at least one timer has expired.
7272  *
7273  * ARGUMENTS:
7274  * None
7275  *
7276  * RETURN VALUE:
7277  * If at least one timer is expired, the function returns a value != 0.
7278  * If no timers are expired, 0 is returned.
7279  *
7280  *******************************************************************************/
7281 int EwProcessTimers(void);
7282 
7283 /*******************************************************************************
7284  * FUNCTION:
7285  * EwNextTimerExpiration
7286  *
7287  * DESCRIPTION:
7288  * The function EwNextTimerExpiration() evaluates the list of pending timers
7289  * in order to find out the timer which should expire next time. The function
7290  * returns the number of miliseconds till the expiration of the found timer.
7291  *
7292  * Please note: Because of the multitasking environment, the returned delay
7293  * value can become very inprecise! For this reason you should never use the
7294  * determined number of miliseconds as a parameter for a 'sleep()' or similar
7295  * function. This can cause the timers to expire very unprecise.
7296  *
7297  * ARGUMENTS:
7298  * None
7299  *
7300  * RETURN VALUE:
7301  * Returns the delay in milliseconds for the next timer expiration.
7302  *
7303  *******************************************************************************/
7304 int EwNextTimerExpiration(void);
7305 
7306 /*******************************************************************************
7307  * FUNCTION:
7308  * EwDecompress
7309  *
7310  * DESCRIPTION:
7311  * The function EwDecompress() implements a simple algorithm used for the
7312  * decompression of resources, constants, etc. The function decompresses the
7313  * entire compressed data block aData and stores the result in aDest memory.
7314  *
7315  * When decompressing bitmap contents, the arguments aWidth and aPitch provide
7316  * the decompressor with the information about the memory layout of the
7317  *bitmap. This is also useful, when decompressing non continuous memory
7318  *contents.
7319  *
7320  * ARGUMENTS:
7321  * aData - Pointer to compressed data.
7322  * aDest - Pointer to the memory where the decompressed data should be
7323  *stored in. aWidth - In case of bitmap decompression, the width of a single
7324  *pixel row in bytes. If the destination is a continuous memory area, aWidth
7325  *should be 0. aPitch - In case of bitmap decompression, the distance between
7326  *two pixel rows. If the destination is a continuous memory area, aPitch should
7327  *be 0.
7328  *
7329  * RETURN VALUE:
7330  * None
7331  *
7332  *******************************************************************************/
7333 void EwDecompress(const unsigned int *aData, unsigned char *aDest, int aWidth,
7334  int aPitch);
7335 
7336 /*******************************************************************************
7337  * FUNCTION:
7338  * EwAdaptByteOrder2
7339  *
7340  * DESCRIPTION:
7341  * The function EwAdaptByteOrder2() provides a re-order function to convert
7342  * an array of short words from the default little-endian format to the target
7343  * CPU dependent endian format.
7344  *
7345  * If the endian format of the target CPU is already little, no modification
7346  * will take place here and the function returns immediatelly.
7347  *
7348  * ARGUMENTS:
7349  * aData - Pointer to the array containing short words.
7350  * aCount - Number of words within the array to convert.
7351  *
7352  * RETURN VALUE:
7353  * None
7354  *
7355  *******************************************************************************/
7356 void EwAdaptByteOrder2(unsigned short *aData, int aCount);
7357 
7358 /*******************************************************************************
7359  * FUNCTION:
7360  * EwAdaptByteOrder4
7361  *
7362  * DESCRIPTION:
7363  * The function EwAdaptByteOrder4() provides a re-order function to convert
7364  * an array of long words from the default little-endian format to the target
7365  * CPU dependent endian format.
7366  *
7367  * If the endian format of the target CPU is already little, no modification
7368  * will take place here and the function returns immediatelly.
7369  *
7370  * ARGUMENTS:
7371  * aData - Pointer to the array containing long words.
7372  * aCount - Number of words within the array to convert.
7373  *
7374  * RETURN VALUE:
7375  * None
7376  *
7377  *******************************************************************************/
7378 void EwAdaptByteOrder4(unsigned int *aData, int aCount);
7379 
7380 /*******************************************************************************
7381  * TYPE:
7382  * XFlashAreaReaderProc
7383  *
7384  * DESCRIPTION:
7385  * The XFlashAreaReaderProc type defines a prototype for user function to read
7386  * data stored in external Flash memory, not intended to be directly accessed
7387  * by the CPU. Embedded Wizard invokes this function during the decompression
7388  * of bitmap or font data automatically to 'map' the Flash contents into the
7389  * CPU address space. In this way, the not directly accessible Flash data can
7390  * be processed by Embedded Wizard.
7391  *
7392  * The implementation of this function should:
7393  *
7394  * 1. Calculate from the given address the corresponding page within the Flash
7395  * memory.
7396  *
7397  * 2. Load this complete page into an internal, static buffer. For
7398  *optimization purpose the function can read (or cache) several pages
7399  *simultanously.
7400  *
7401  * 3. Estimate the memory cell within the internal buffer corresponding to the
7402  * originally given address.
7403  *
7404  * 4. Return a pointer to the estimated memory cell so that the caller can use
7405  * it to read the data as if the Flash memory would be accessible by the
7406  *CPU.
7407  *
7408  * In order to be used, the user's own implemented reader function has to be
7409  * registered by Embedded Wizard Runtime Environment by invoking the function
7410  * EwRegisterFlashAreaReader().
7411  *
7412  * ARGUMENTS:
7413  * aAddress - The address to load the corresponding area from the Flash.
7414  *
7415  * RETURN VALUE:
7416  * Returns the address of the location in an internal buffer corresponding to
7417  * the original aAddress from the Flash. If the loading fails or aAddress does
7418  * not lie within the Flash memory, the function should return aAddress
7419  *without any changes on it.
7420  *
7421  *******************************************************************************/
7422 typedef const void *(*XFlashAreaReaderProc)(const void *aAddress);
7423 
7424 /*******************************************************************************
7425  * FUNCTION:
7426  * EwRegisterFlashAreaReader
7427  *
7428  * DESCRIPTION:
7429  * The function EwRegisterFlashAreaReader() registers a specified memory area
7430  * as belonging to Flash memory not intended to be directly addressed by the
7431  * CPU. In order to access this Flash memory, the respective Flash pages need
7432  * to be loaded first into internal buffer. This 'reading' operation has to be
7433  * handled by external function, specified in the first parameter aReaderProc.
7434  * The implementation of the function is up to the user.
7435  *
7436  * Embedded Wizard allows only one reader to be registered at the same time.
7437  * Invoking the function EwRegisterFlashAreaReader() twice with different
7438  * start/end addresses reports an error. In order to remove the previously
7439  * registered reader, invoke the function with the previously specified start
7440  * and end addresses and NULL in the aReaderProc parameter.
7441  *
7442  * This function should be invoked before invoking EwInitGraphicsEngine().
7443  *
7444  * ARGUMENTS:
7445  * aReaderProc - User implemented function to read Flash memory areas into
7446  * internal buffers. See the description for XFlashAreaReaderProc.
7447  * aStartAddress - Start address of the Flash area to take in account.
7448  * aEndAddress - End address of the Flash area to take in account.
7449  * aBlockSize - Size of of the page or block, the function will read from
7450  * the Flash memory. The value is expressed in bytes and it should by a
7451  * power of two value (e.g. 512, 1024, ... 4096, etc.)
7452  *
7453  * RETURN VALUE:
7454  * None
7455  *
7456  *******************************************************************************/
7458  void *aStartAddress, void *aEndAddress,
7459  int aBlockSize);
7460 
7461 /*******************************************************************************
7462  * FUNCTION:
7463  * EwFormatUIntToAnsiString
7464  *
7465  * DESCRIPTION:
7466  * The function EwFormatUIntToAnsiString() converts the given unsigned number
7467  * aValue in an Ansi string and stores the results in the buffer aBuf. The
7468  * function adds leading zeros '0' until the resulted string has reached the
7469  * length given in the aCount argument. If the paramneter aSign is != 0, an
7470  * additional '+' sign will prefix the formatted number.
7471  *
7472  * ARGUMENTS:
7473  * aBuf - Buffer to store the resulting string.
7474  * aValue - Unsigned value to be converted to string.
7475  * aCount - Desired length of the resulted string.
7476  * aRadix - Controls the format of the resulting string. This parameter can
7477  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
7478  * binary, octal, decimal or hexadecimal notation.
7479  * aUpper - If != 0, use upper case signs for hex digits.
7480  * aSign - If != 0, instructs the function to prefix the number with the
7481  * '+' sign.
7482  *
7483  * RETURN VALUE:
7484  * Returns the length of the resulting string. The string within aBuf is not
7485  * zero terminated.
7486  *
7487  *******************************************************************************/
7488 int EwFormatUIntToAnsiString(char *aBuf, unsigned long aValue, int aCount,
7489  int aRadix, int aUpper, int aSign);
7490 
7491 /*******************************************************************************
7492  * FUNCTION:
7493  * EwFormatIntToAnsiString
7494  *
7495  * DESCRIPTION:
7496  * The function EwFormatIntToAnsiString() converts the given signed number
7497  * aValue in an Ansi string and stores the results in the buffer aBuf. The
7498  * function adds leading zeros '0' until the resulted string has reached the
7499  * length given in the aCount argument. If the number is negative or aSign is
7500  * != 0, the function prefix the formatted number with the '+' or '-' minus
7501  * sign.
7502  *
7503  * ARGUMENTS:
7504  * aBuf - Buffer to store the resulting string.
7505  * aValue - Signed value to be converted to string.
7506  * aCount - Desired length of the resulted string.
7507  * aRadix - Controls the format of the resulting string. This parameter can
7508  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
7509  * binary, octal, decimal or hexadecimal notation.
7510  * aUpper - If != 0, use upper case signs for hex digits.
7511  * aSign - If != 0, instructs the function to prefix the number with the
7512  * '+' sign even if the number is positive.
7513  *
7514  * RETURN VALUE:
7515  * Returns the length of the resulting string. The string within aBuf is not
7516  * zero terminated.
7517  *
7518  *******************************************************************************/
7519 int EwFormatIntToAnsiString(char *aBuf, long aValue, int aCount, int aRadix,
7520  int aUpper, int aSign);
7521 
7522 /*******************************************************************************
7523  * FUNCTION:
7524  * EwFormatUInt64ToAnsiString
7525  *
7526  * DESCRIPTION:
7527  * The function EwFormatUInt64ToAnsiString() converts the given unsigned
7528  *number aValue in an Ansi string and stores the results in the buffer aBuf. The
7529  * function adds leading zeros '0' until the resulted string has reached the
7530  * length given in the aCount argument. If the paramneter aSign is != 0, an
7531  * additional '+' sign will prefix the formatted number.
7532  *
7533  * ARGUMENTS:
7534  * aBuf - Buffer to store the resulting string.
7535  * aValue - Unsigned 64 bit value to be converted to string.
7536  * aCount - Desired length of the resulted string.
7537  * aRadix - Controls the format of the resulting string. This parameter can
7538  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
7539  * binary, octal, decimal or hexadecimal notation.
7540  * aUpper - If != 0, use upper case signs for hex digits.
7541  * aSign - If != 0, instructs the function to prefix the number with the
7542  * '+' sign.
7543  *
7544  * RETURN VALUE:
7545  * Returns the length of the resulting string. The string within aBuf is not
7546  * zero terminated.
7547  *
7548  *******************************************************************************/
7549 int EwFormatUInt64ToAnsiString(char *aBuf, XUInt64 aValue, int aCount,
7550  int aRadix, int aUpper, int aSign);
7551 
7552 /*******************************************************************************
7553  * FUNCTION:
7554  * EwFormatInt64ToAnsiString
7555  *
7556  * DESCRIPTION:
7557  * The function EwFormatInt64ToAnsiString() converts the given signed number
7558  * aValue in an Ansi string and stores the results in the buffer aBuf. The
7559  * function adds leading zeros '0' until the resulted string has reached the
7560  * length given in the aCount argument. If the number is negative or aSign is
7561  * != 0, the function prefix the formatted number with the '+' or '-' minus
7562  * sign.
7563  *
7564  * ARGUMENTS:
7565  * aValue - Signed 64 bit value to be converted to string.
7566  * aCount - Desired length of the resulted string.
7567  * aRadix - Controls the format of the resulting string. This parameter can
7568  * assume values 2, 8, 10 or 16. Accordingly the number is converted in a
7569  * binary, octal, decimal or hexadecimal notation.
7570  * aUpper - If != 0, use upper case signs for hex digits.
7571  * aSign - If != 0, instructs the function to prefix the number with the
7572  * '+' sign even if the number is positive.
7573  *
7574  * RETURN VALUE:
7575  * Returns the length of the resulting string. The string within aBuf is not
7576  * zero terminated.
7577  *
7578  *******************************************************************************/
7579 int EwFormatInt64ToAnsiString(char *aBuf, XInt64 aValue, int aCount, int aRadix,
7580  int aUpper, int aSign);
7581 
7582 /*******************************************************************************
7583  * FUNCTION:
7584  * EwFormatFloatToAnsiString
7585  *
7586  * DESCRIPTION:
7587  * The function EwFormatFloatToAnsiString() converts the given floating point
7588  * number aValue in an Ansi string and stores the results in the buffer aBuf.
7589  * The function adds leading zeros '0' until the resulted string has reached
7590  * the length given in the aCount argument. If the number is negative or aSign
7591  * is != 0, the function prefixes the formatted number with the '+' or '-'
7592  * minus sign.
7593  *
7594  * ARGUMENTS:
7595  * aValue - The floating point value to be converted in a string.
7596  * aCount - Minimum number of characters to store in the resulted string
7597  * output.
7598  * aPrecision - The aPrecision argument specifies the exact number of digits
7599  * after the decimal point. If this parameter is < 0, the value specifies
7600  * the maximum number of digits. Any final '0' (zero) signs are removed
7601  * in this case.
7602  * aSign - If != 0, instructs the function to prefix the number with the
7603  * '+' sign even if the number is positive.
7604  *
7605  * RETURN VALUE:
7606  * Returns the length of the resulting string. The string within aBuf is not
7607  * zero terminated. If aValue does not contain a valid number, the function
7608  * returns 0 without storing any data in aBuf.
7609  *
7610  *******************************************************************************/
7611 int EwFormatFloatToAnsiString(char *aBuf, float aValue, int aCount,
7612  int aPrecision, int aSign);
7613 
7614 /*******************************************************************************
7615  * FUNCTION:
7616  * EwTrace
7617  *
7618  * DESCRIPTION:
7619  * The function EwTrace() works similary to the printf() function. EwTrace()
7620  * expects a format string and one or more additional arguments. The format
7621  * string contains escape sequences, one for each argument. These sequences
7622  * describe how the additional arguments should be interpreted and printed out
7623  * on the debug console.
7624  *
7625  * Every escape sequence starts with a '%' percent sign followed by a single
7626  * sign as a command.
7627  *
7628  * EwTrace() will be called from the automatic generated 'C' code in response
7629  * to Choras 'trace' statement.
7630  *
7631  * ARGUMENTS:
7632  * aFormat - Contains a zero-terminated string with escape sequences. The
7633  * following escape sequences are supported:
7634  * %i - print a signed integer value (int8, int16, int32)
7635  * %u - print an unsigned integer value (uint8, uint16, uint32)
7636  * %I - print a signed 64-bit integer value (int64)
7637  * %U - print an unsigned 64-bit integer value (uint64)
7638  * %b - print a boolean value (bool)
7639  * %c - print a character (char)
7640  * %s - print a string value (string)
7641  * %f - print a floating point value (float)
7642  * %o - print a color value (color)
7643  * %l - print a language id
7644  * %g - print a styles set value (styles)
7645  * %e - print an enumeration value (enum)
7646  * %t - print a set value (set)
7647  * %p - print a point value (point)
7648  * %r - print a rectangle value (rect)
7649  * %^ - print a value of a reference to a property (ref to)
7650  * %* - print a pointer to an object and the class of the object
7651  * %$ - print a class
7652  * %0 - print 'null'
7653  *
7654  * RETURN VALUE:
7655  * None
7656  *
7657  *******************************************************************************/
7658 void EwTrace(const char *aFormat, ...);
7659 
7660 /*******************************************************************************
7661  * FUNCTION:
7662  * EwThrow
7663  *
7664  * DESCRIPTION:
7665  * The function EwThrow() implements the Chora 'throw' statement. The function
7666  * will be called by the Run Time Environment if a Chora exception has been
7667  * thrown.
7668  *
7669  * Internally, the function prints the message and calls EwPanic() in order
7670  * to stop or restart the system.
7671  *
7672  * ARGUMENTS:
7673  * aMessage - Contains a failure description.
7674  *
7675  * RETURN VALUE:
7676  * EwThrow() never returns.
7677  *
7678  *******************************************************************************/
7679 void EwThrow(const XChar *aMessage);
7680 
7681 /*******************************************************************************
7682  * FUNCTION:
7683  * EwError
7684  * EwErrorS
7685  * EwErrorSD
7686  * EwErrorPD
7687  * EwErrorDD
7688  * EwErrorPDS
7689  *
7690  * DESCRIPTION:
7691  * These functions are intended to format and report fatal runtime error
7692  * messages. Depending on the version of the used function, the reported
7693  * message will additionally include following information:
7694  *
7695  * ErrorS() - ANSI C string enclosed between two ""
7696  * ErrorSD() - ANSI C string enclosed between two "" and signed decimal
7697  * number
7698  * ErrorPD() - pointer in hex-notation and signed decimal number
7699  * ErrorDD() - two signed decimal numbers
7700  * ErrorSD() - ANSI C string enclosed between two "" and one decimal number
7701  * ErrorPDS() - pointer in hex-notation, signed decimal number and ANSI C
7702  * string enclosed between two ""
7703  *
7704  * The functions report the message by calling the function EwPrint().
7705  *
7706  * ARGUMENTS:
7707  * aCode - Number identifying the error.
7708  * aString - Pointer to an ANSI C, zero terminated string.
7709  * aPointer - Pointer to display in hex notation.
7710  * aSignedDecimal,
7711  * aSignedDecimal1,
7712  * aSignedDecimal2 - Value to display in decimal notation.
7713  *
7714  * RETURN VALUE:
7715  * None
7716  *
7717  *******************************************************************************/
7718 void EwError(int aCode);
7719 
7720 void EwErrorS(int aCode, const char *aString);
7721 
7722 void EwErrorPD(int aCode, const void *aPointer, int aSignedDecimal);
7723 
7724 void EwErrorSD(int aCode, const char *aString, int aSignedDecimal);
7725 
7726 void EwErrorDD(int aCode, int aSignedDecimal1, int aSignedDecimal2);
7727 
7728 void EwErrorPDS(int aCode, const void *aPointer, int aSignedDecimal,
7729  const char *aString);
7730 
7731 /*******************************************************************************
7732  * FUNCTION:
7733  * EwPrint
7734  *
7735  * DESCRIPTION:
7736  * The function EwPrint() prints formatted output to the debug console. This
7737  * function works similary to the ANSI 'C' printf() function. However, only
7738  * following escape sequences are supported:
7739  *
7740  * %d, %u, %p, %f, %s, %X, %x, %c
7741  *
7742  * The escape sequences %d, %u, %X, %x can additionally be prefixed by the
7743  * double 'll' sign identifying a 64-bit operand:
7744  *
7745  * %lld, %llu, %llX, %llx
7746  *
7747  * The escape sequences %d, %u, %X, %x can additionally be prefixed by a sign
7748  * and number specifying the desired length of the resulting string:
7749  *
7750  * %[+][0][len]d
7751  * %[+][0][len]u
7752  * %[+][0][len]X
7753  * %[+][0][len]x
7754  *
7755  * The escape sequence %f can additionally be prefixed by a sign, the number
7756  * specifying the desired length of the resulting string and a second number
7757  * for the count of digits following the decomal sign:
7758  *
7759  * %[+][0][len][.prec]f
7760  *
7761  * For the escape sequence %s it is possible to specify the desired length to
7762  * fill with space signs as well as the max. width when to truncate the
7763  * string. If the sequence starts with '-' sign, the text is left aligned:
7764  *
7765  * %[len][.max-len]s
7766  * %-[len][.max-len]s
7767  *
7768  * Instead of specifying [len], [prec] and [max-len] as literals within the
7769  * string, it is possible the use the '*' (asterix) sign as instruction to
7770  * get the corresponding value from the argzments following aFormat. For
7771  * example:
7772  *
7773  * %+0*.*f
7774  *
7775  * Besides the above escape sequences known from printf(), following two are
7776  * also supported:
7777  *
7778  * %S - prints the content of a 16-bit zero terminated string.
7779  * %C - prints a 16-bit character.
7780  *
7781  * ARGUMENTS:
7782  * aFormat - Zero-terminated string containing the message and the above
7783  * explained escape sequences.
7784  *
7785  * RETURN VALUE:
7786  * None
7787  *
7788  *******************************************************************************/
7789 void EwPrint(const char *aFormat, ...);
7790 
7791 /*******************************************************************************
7792  * FUNCTION:
7793  * EwPrintProfilerStatistic
7794  *
7795  * DESCRIPTION:
7796  * The function EwPrintProfilerStatistic() evaluates the list of existing
7797  * objects and prints out a statistic information with the amount of memory
7798  * allocated by objects, strings and resources. Additionally, the current
7799  * total memory allocation and the maximum peak value is reported.
7800  * If the argument aDetailed is set to non-zero, a detailed object report is
7801  * printed with all existing objects and their classes.
7802  *
7803  * ARGUMENTS:
7804  * aDetailed - Flag to switch on the detailed report.
7805  *
7806  * RETURN VALUE:
7807  * None
7808  *
7809  *******************************************************************************/
7810 void EwPrintProfilerStatistic(int aDetailed);
7811 
7812 /******************************************************************************
7813  * TYPE:
7814  * XPerfCounter
7815  *
7816  * DESCRIPTION:
7817  * The type definition XPerfCounter represents an instance of the performance
7818  * counter. These counters exist for performance investigation and debugging
7819  * purpose only. In the real release application no performance counters are
7820  * used.
7821  *
7822  * To create an instance of the performance counter the macro
7823  *EW_PERF_COUNTER() is available.
7824  *
7825  * ELEMENTS:
7826  * Next - Pointer to the next performance counter within the global
7827  * table of performance counters.
7828  * Name - The identification name of the counter. This name will
7829  * appear in the outputs of the function EwPrintPerfCounters().
7830  * Group - The identification name of the group this counter belongs
7831  * to. This name will appear in the outputs of the function
7832  * EwPrintPerfCounters() and is used additionally to perform time
7833  * calculations for the entire group of counters this counter belongs to.
7834  * Recursions - Counts the recursive EwStartPerfCounter() invocations.
7835  * Calls - Counts each EwStartPerfCounter() invocation.
7836  * StartTime1 - Absolute time value at the beginning of the time
7837  *measuring expressed in seconds. StartTime2 - Absolute time value at the
7838  *beginning of the time measuring expressed in microseconds. TotalTime -
7839  *Total time collected by the performance counter expressed in microseconds.
7840  * MinTime - The minimum time value measured by the performance
7841  *counter expressed in microseconds. MaxTime - The maximum time value
7842  *measured by the performance counter expressed in microseconds. GroupFirst -
7843  *Pointer to the first counter of the corresponding group. GroupRecursions -
7844  *Recursions counter for the group. GroupCalls - Calls ounter for the
7845  *group. GroupTotalTime - Total time collected for the group expressed in
7846  * microseconds.
7847  *
7848  ******************************************************************************/
7849 typedef struct _XPerfCounter {
7850  struct _XPerfCounter *Next;
7851  const char *Name;
7852  const char *Group;
7853  unsigned long Recursions;
7854  unsigned long Calls;
7855  unsigned long StartTime1;
7856  unsigned long StartTime2;
7857  unsigned long TotalTime;
7858  unsigned long MinTime;
7859  unsigned long MaxTime;
7860  struct _XPerfCounter *GroupFirst;
7861  unsigned long GroupRecursions;
7862  unsigned long GroupCalls;
7863  unsigned long GroupTotalTime;
7864 } XPerfCounter;
7865 
7866 /*******************************************************************************
7867  * MACRO:
7868  * EW_PERF_COUNTER
7869  * EW_INSTRUMENT_FUNC
7870  * EW_INSTRUMENT_VOID_FUNC
7871  *
7872  * DESCRIPTION:
7873  * The following macros serve for the performance investigation and debugging
7874  * only. EW_PERF_COUNTER defines a new instance of a performance counter. This
7875  * counter can then be used to measure performance. See following functions:
7876  * EwAddPerfCounter(), EwStartPerfCounter() and EwStopPerfCounter().
7877  *
7878  * EW_INSTRUMENT_FUNC and EW_INSTRUMENT_VOID_FUNC implement wrapper functions
7879  * with their aim the performance of a function can be evaluated.
7880  *
7881  * ARGUMENTS:
7882  * aName - Unique name of the performance counter.
7883  * aGroup - The group name, the counter belongs to.
7884  * aFuncName - Origin name of the function to wrap.
7885  * aReturntype - The return type of the function to wrap.
7886  * aArgsDecl - The declarations list of function parameters.
7887  * aArgs - The list of parameters in the function invocation.
7888  *
7889  *******************************************************************************/
7890 #ifdef EW_PRINT_PERF_COUNTERS
7891 #define EW_PERF_COUNTER(aName, aGroup) \
7892  XPerfCounter _PC_##aName = {0, #aName, #aGroup, 0, 0, 0, 0, \
7893  0, 0xFFFFFFFF, 0, 0, 0, 0, 0};
7895 #define EW_INSTRUMENT_FUNC(aFuncName, aReturnType, aArgsDecl, aArgs) \
7896  aReturnType aFuncName aArgsDecl \
7897  { \
7898  aReturnType result; \
7899  EwStartPerfCounter(aFuncName); \
7900  result = aFuncName##_ aArgs; \
7901  EwStopPerfCounter(aFuncName); \
7902  return result; \
7903  }
7904 
7905 #define EW_INSTRUMENT_VOID_FUNC(aFuncName, aArgsDecl, aArgs) \
7906  void aFuncName aArgsDecl \
7907  { \
7908  EwStartPerfCounter(aFuncName); \
7909  aFuncName##_ aArgs; \
7910  EwStopPerfCounter(aFuncName); \
7911  }
7912 #else
7913 #define EW_PERF_COUNTER(aName, aGroup)
7914 #define EW_INSTRUMENT_FUNC(aFuncName, aReturnType, aArgsDecl, aArgs)
7915 #define EW_INSTRUMENT_VOID_FUNC(aFuncName, aArgsDecl, aArgs)
7916 #endif
7917 
7918 /*******************************************************************************
7919  * FUNCTION:
7920  * EwAddPerfCounter
7921  *
7922  * DESCRIPTION:
7923  * The function EwAddPerfCounter() adds the given performance counter to the
7924  * global list of counters. In this manner the values collected by the counter
7925  * can be printed out in the EwPrintPerfCounters() function.
7926  *
7927  * Once added there is no way to remove the counter from the list. This
7928  *feature exists for performance investigation and debugging purpose only. In
7929  *the real release application no performance counters should be used.
7930  *
7931  * ARGUMENTS:
7932  * aPerfCounter - Pointer to the structure describing the performance counter
7933  * to add.
7934  *
7935  * RETURN VALUE:
7936  * None
7937  *
7938  *******************************************************************************/
7939 #ifdef EW_PRINT_PERF_COUNTERS
7940 void EwAddPerfCounter(XPerfCounter *aPerfCounter);
7941 
7942 #define EwAddPerfCounter(aPerfCounter) EwAddPerfCounter(&_PC_##aPerfCounter)
7943 #else
7944 #define EwAddPerfCounter(aPerfCounter)
7945 #endif
7946 
7947 /*******************************************************************************
7948  * FUNCTION:
7949  * EwStartPerfCounter
7950  *
7951  * DESCRIPTION:
7952  * The function EwStartPerfCounter() starts the time measuring for the given
7953  * performance counter. Each call of this function is counted by the counter.
7954  *
7955  * The time measuring runs till the function EwStopPerfCounter() is called for
7956  * this performance counter. In case of recursive calls with the same counter
7957  * the measuring starts with the first EwStartPerfCounter() and ends with the
7958  * last EwStopPerfCounter().
7959  *
7960  * ARGUMENTS:
7961  * aPerfCounter - Pointer to the structure describing the performance counter
7962  * to start the time measuring.
7963  *
7964  * RETURN VALUE:
7965  * None
7966  *
7967  *******************************************************************************/
7968 #ifdef EW_PRINT_PERF_COUNTERS
7969 void EwStartPerfCounter(XPerfCounter *aPerfCounter);
7970 #define EwStartPerfCounter(aPerfCounter) EwStartPerfCounter(&_PC_##aPerfCounter)
7971 #else
7972 #define EwStartPerfCounter(aPerfCounter)
7973 #endif
7974 
7975 /*******************************************************************************
7976  * FUNCTION:
7977  * EwStopPerfCounter
7978  *
7979  * DESCRIPTION:
7980  * The function EwStopPerfCounter() stops the time measuring for the given
7981  * performance counter. From the measured time values the function stores the
7982  * minimum and the maximum as well as the total time the performance counter
7983  * has collected.
7984  *
7985  * The time measuring starts with the function call EwStopPerfCounter(). In
7986  * case of recursive calls with the same counter the measuring stops with the
7987  * last EwStopPerfCounter() invocation.
7988  *
7989  * ARGUMENTS:
7990  * aPerfCounter - Pointer to the structure describing the performance counter
7991  * to stop the time measuring.
7992  *
7993  * RETURN VALUE:
7994  * None.
7995  *
7996  *******************************************************************************/
7997 #ifdef EW_PRINT_PERF_COUNTERS
7998 void EwStopPerfCounter(XPerfCounter *aPerfCounter);
7999 #define EwStopPerfCounter(aPerfCounter) EwStopPerfCounter(&_PC_##aPerfCounter)
8000 #else
8001 #define EwStopPerfCounter(aPerfCounter)
8002 #endif
8003 
8004 /*******************************************************************************
8005  * FUNCTION:
8006  * EwResetPerfCounters
8007  *
8008  * DESCRIPTION:
8009  * The function EwResetPerfCounters() resets all performance counters so new
8010  * performance test can run. This function is usually called immediately
8011  *before a performance test begins.
8012  *
8013  * After this function call EwStartPerfCounter() and EwStopPerfCounter() are
8014  * used to measure and collect time values. The collected values can then be
8015  * printed to the console by using the function EwPrintPerfCounters().
8016  *
8017  * ARGUMENTS:
8018  * None
8019  *
8020  * RETURN VALUE:
8021  * None
8022  *
8023  *******************************************************************************/
8024 #ifdef EW_PRINT_PERF_COUNTERS
8025 void EwResetPerfCounters(void);
8026 #else
8027 #define EwResetPerfCounters()
8028 #endif
8029 
8030 /*******************************************************************************
8031  * FUNCTION:
8032  * EwPrintPerfCounters
8033  *
8034  * DESCRIPTION:
8035  * The function EwPrintPerfCounters() prints the time values measured and
8036  * collected in all performance counters.
8037  *
8038  * ARGUMENTS:
8039  * None
8040  *
8041  * RETURN VALUE:
8042  * None
8043  *
8044  *******************************************************************************/
8045 #ifdef EW_PRINT_PERF_COUNTERS
8046 void EwPrintPerfCounters(void);
8047 #else
8048 #define EwPrintPerfCounters()
8049 #endif
8050 
8051 /*******************************************************************************
8052  * FUNCTION:
8053  * EwConsoleOutput
8054  *
8055  * DESCRIPTION:
8056  * The function EwConsoleOutput() prints the message to the debug console.
8057  * This function should be implemented by the programer in order to output
8058  * trace messages on the debug console, etc.
8059  *
8060  * ARGUMENTS:
8061  * aMessage - Zero-terminated string containing the message to output.
8062  *
8063  * RETURN VALUE:
8064  * None
8065  *
8066  *******************************************************************************/
8067 void EwConsoleOutput(const char *aMessage);
8068 
8069 /*******************************************************************************
8070  * FUNCTION:
8071  * EwPanic
8072  *
8073  * DESCRIPTION:
8074  * The function EwPanic() will be called by the Run Time Environment if a
8075  *fatal system failure is detected.
8076  *
8077  * This function can be adapted to decide what to do when a system failure
8078  * is occured. Generally EwPanic() should log the system failure and restart
8079  * the system.
8080  *
8081  * For debugging purpose EwPanic() can run into a for-ever-loop or it can
8082  * cause a monitor breakpoint, etc.
8083  *
8084  * ARGUMENTS:
8085  * None
8086  *
8087  * RETURN VALUE:
8088  * EwPanic() will never return.
8089  *
8090  *******************************************************************************/
8091 void EwPanic(void);
8092 
8093 /*******************************************************************************
8094  * FUNCTION:
8095  * EwSaveRegister
8096  *
8097  * DESCRIPTION:
8098  * The function EwSaveRegister() has the job to copy all general purpose CPU
8099  * register to the memory area specified in the parameter aMemory.
8100  *
8101  * ARGUMENTS:
8102  * aBuffer - Pointer to a memory area where to save the register contents.
8103  * The capacity of the memory area is limited to 32 registers. This means
8104  * on a 32-bit CPU it is 128 bytes large. On a 64-bit CPU it is 256 bytes
8105  * large.
8106  *
8107  * RETURN VALUE:
8108  * None
8109  *
8110  *******************************************************************************/
8111 void EwSaveRegister(void *aBuffer);
8112 
8113 /*******************************************************************************
8114  * FUNCTION:
8115  * EwGetTicks
8116  *
8117  * DESCRIPTION:
8118  * The function EwGetTicks() should return the number of milliseconds that
8119  *have been elapsed since the system was started. It is limited to the
8120  *resolution of the system timer. The ticks are used as base for EmWi timers.
8121  *
8122  * ARGUMENTS:
8123  * None
8124  *
8125  * RETURN VALUE:
8126  * Number of milliseconds since the system was started.
8127  *
8128  *******************************************************************************/
8129 unsigned long EwGetTicks(void);
8130 
8131 /*******************************************************************************
8132  * FUNCTION:
8133  * EwGetTime
8134  *
8135  * DESCRIPTION:
8136  * The function EwGetTime() should return the current time as the number of
8137  * seconds elapsed since midnight 1.1.1970. If possible the real time clock
8138  * should be queried in order to determinate the current time. This function
8139  * is used by the Mosaic class Core::Time and should be adapted to the real
8140  * time clock or to the system timer.
8141  *
8142  * ARGUMENTS:
8143  * None
8144  *
8145  * RETURN VALUE:
8146  * Returns the number of seconds elapsed since midnight 1.1.1970.
8147  *
8148  *******************************************************************************/
8149 XInt64 EwGetTime(void);
8150 
8151 /*******************************************************************************
8152  * FUNCTION:
8153  * EwGetPerfCounter
8154  *
8155  * DESCRIPTION:
8156  * The function EwGetPerfCounter() should return the current time as number of
8157  * seconds and microseconds. The reference time point is nonrelevant.
8158  *
8159  * ARGUMENTS:
8160  * aSeconds - Pointer to a variable where the current time is stored.
8161  * aMicroseconds - Pointer to a variable where the current time is stored.
8162  * aCPUMicroseconds - Pointer to a variable where the real CPU usage is
8163  *stored.
8164  *
8165  * RETURN VALUE:
8166  * None
8167  *
8168  *******************************************************************************/
8169 #ifdef EW_PRINT_PERF_COUNTERS
8170 void EwGetPerfCounter(unsigned long *aSeconds, unsigned long *aMicroseconds,
8171  unsigned long *aCPUMicroseconds);
8172 #else
8173 #define EwGetPerfCounter(aSeconds, aMicroseconds, aCPUMicroseconds)
8174 #endif
8175 
8176 /*******************************************************************************
8177  * FUNCTION:
8178  * EwZero
8179  *
8180  * DESCRIPTION:
8181  * The function EwZero() provides a plattform independent version of the 'C'
8182  * standard library function memset( aDstPtr, 0, aCount ).
8183  *
8184  * This function fills the given memory area with the constant value zero.
8185  *
8186  * ARGUMENTS:
8187  * aDstPtr - Pointer to memory area to fill with zero.
8188  * aCount - Number of bytes to fill with zero.
8189  *
8190  * RETURN VALUE:
8191  * None
8192  *
8193  *******************************************************************************/
8194 void EwZero(void *aDstPtr, int aCount);
8195 
8196 /*******************************************************************************
8197  * FUNCTION:
8198  * EwFill
8199  *
8200  * DESCRIPTION:
8201  * The function EwFill() provides a plattform independent version of the 'C'
8202  * standard library function memset( aDstPtr, aValue, aCount ).
8203  *
8204  * This function fills the given memory area with the constant value aValue.
8205  *
8206  * ARGUMENTS:
8207  * aDstPtr - Pointer to memory area to fill with the value.
8208  * aValue - Byte value to fill the memory.
8209  * aCount - Number of bytes to fill with the value.
8210  *
8211  * RETURN VALUE:
8212  * None
8213  *
8214  *******************************************************************************/
8215 void EwFill(void *aDstPtr, unsigned char aValue, int aCount);
8216 
8217 /*******************************************************************************
8218  * FUNCTION:
8219  * EwMove
8220  *
8221  * DESCRIPTION:
8222  * The function EwMove() provides a plattform independent version of the 'C'
8223  * standard library function memove( aDstPtr, aSrcPtr, aCount ).
8224  *
8225  * This function copies the given source memory area into the destination
8226  *area.
8227  *
8228  * ARGUMENTS:
8229  * aDstPtr - Pointer to the destination memory area where to write the data.
8230  * aSrcPtr - Pointer to the source memory to read.
8231  * aCount - Number of bytes to copy from aSrcPtr to aDstPtr.
8232  *
8233  * RETURN VALUE:
8234  * None
8235  *
8236  *******************************************************************************/
8237 void EwMove(void *aDstPtr, const void *aSrcPtr, int aCount);
8238 
8239 /*******************************************************************************
8240  * FUNCTION:
8241  * EwCopy
8242  *
8243  * DESCRIPTION:
8244  * The function EwCopy() provides a plattform independent version of the 'C'
8245  * standard library function memcpy( aDstPtr, aSrcPtr, aCount ).
8246  *
8247  * This function copies the given source memory area into the destination
8248  *area.
8249  *
8250  * ARGUMENTS:
8251  * aDstPtr - Pointer to the destination memory area where to write the data.
8252  * aSrcPtr - Pointer to the source memory to read.
8253  * aCount - Number of bytes to copy from aSrcPtr to aDstPtr.
8254  *
8255  * RETURN VALUE:
8256  * None
8257  *
8258  *******************************************************************************/
8259 void EwCopy(void *aDstPtr, const void *aSrcPtr, int aCount);
8260 
8261 /*******************************************************************************
8262  * FUNCTION:
8263  * EwStrCpy
8264  *
8265  * DESCRIPTION:
8266  * The function EwStrCpy() provides a plattform independent version of the 'C'
8267  * standard library function strcpy( aDst, aSrc ).
8268  *
8269  * This function copies a zero terminated ASCII string from the source to the
8270  * destination memory.
8271  *
8272  * ARGUMENTS:
8273  * aDst - Pointer to the destination memory area where to write the string.
8274  * aSrc - Pointer to the source memory with the string to copy.
8275  *
8276  * RETURN VALUE:
8277  * None
8278  *
8279  *******************************************************************************/
8280 void EwStrCpy(char *aDst, const char *aSrc);
8281 
8282 /*******************************************************************************
8283  * FUNCTION:
8284  * EwStrCat
8285  *
8286  * DESCRIPTION:
8287  * The function EwStrCat() provides a plattform independent version of the 'C'
8288  * standard library function strcat( aDst, aSrc ).
8289  *
8290  * This function appends the zero terminated ASCII string from the source at
8291  * the end of the destination string.
8292  *
8293  * ARGUMENTS:
8294  * aDst - Pointer to the destination memory area where to write the string.
8295  * aSrc - Pointer to the source memory with the string to append.
8296  *
8297  * RETURN VALUE:
8298  * None
8299  *
8300  *******************************************************************************/
8301 void EwStrCat(char *aDst, const char *aSrc);
8302 
8303 /*******************************************************************************
8304  * FUNCTION:
8305  * EwStrCmp
8306  *
8307  * DESCRIPTION:
8308  * The function EwStrCmp() provides a plattform independent version of the 'C'
8309  * standard library function strcmp( aStr1, aStr2 ).
8310  *
8311  * This function compares the both strings and returns:
8312  * value < 0 if aStr1 is less than aStr2
8313  * value == 0 if aStr1 is equal aStr2
8314  * value > 0 if aStr1 is greater than aStr2
8315  *
8316  * ARGUMENTS:
8317  * aStr1,
8318  * aStr2 - Pointers to the both strings to compare.
8319  *
8320  * RETURN VALUE:
8321  * Returns a value indicating the lexicographic relation of the both strings.
8322  *
8323  *******************************************************************************/
8324 int EwStrCmp(const char *aStr1, const char *aStr2);
8325 
8326 /*******************************************************************************
8327  * FUNCTION:
8328  * EwStrLen
8329  *
8330  * DESCRIPTION:
8331  * The function EwStrLen() provides a plattform independent version of the 'C'
8332  * standard library function strlen( aStr ).
8333  *
8334  * This function returns the length of the string in bytes.
8335  *
8336  * ARGUMENTS:
8337  * aStr - Pointer to the string to obtain its length.
8338  *
8339  * RETURN VALUE:
8340  * Returns a length of the string.
8341  *
8342  *******************************************************************************/
8343 int EwStrLen(const char *aStr);
8344 
8345 /*******************************************************************************
8346  * FUNCTION:
8347  * EwInitHeap
8348  *
8349  * DESCRIPTION:
8350  * The function EwInitHeap() initializes the heap manager. Thereupon memory
8351  * pools can be added by using the function EwAddHeapMemoryPool(). If there
8352  * was heap manager initialized previously, the associated information is
8353  * discarded with this invocation.
8354  *
8355  * ARGUMENTS:
8356  * aLargeObjectSize - Determines the size of objects considered as large and
8357  * long-lasting. Such objects are allocated from the end of the list of free
8358  * memory blocks. All other objects are allocated from the begin of the
8359  *list. This reduces the probability for heap fragmentation. If this parameter
8360  *is
8361  * <= 0 a default value for the threshold setting is assumed.
8362  *
8363  * RETURN VALUE:
8364  * Returns != 0 if successful.
8365  *
8366  *******************************************************************************/
8367 int EwInitHeap(int aLargeObjectSize);
8368 
8369 /*******************************************************************************
8370  * FUNCTION:
8371  * EwDoneHeap
8372  *
8373  * DESCRIPTION:
8374  * The function EwDoneHeap() deinitializes the heap manager.
8375  *
8376  * ARGUMENTS:
8377  * None
8378  *
8379  * RETURN VALUE:
8380  * None
8381  *
8382  *******************************************************************************/
8383 void EwDoneHeap(void);
8384 
8385 /*******************************************************************************
8386  * FUNCTION:
8387  * EwAddHeapMemoryPool
8388  *
8389  * DESCRIPTION:
8390  * The function EwAddHeapMemoryPool() adds to the heap manager a new memory
8391  * area. From now the memory is used by subsequent EwAllocHeapBlock() function
8392  * invocations. Once added the memory area can't be removed again without
8393  * reinitialization of the entire heap manager (see EwInitHeap()).
8394  *
8395  * ARGUMENTS:
8396  * aAddress - The start address of the memory area.
8397  * aSize - The size of the memory area in bytes.
8398  *
8399  * RETURN VALUE:
8400  * None
8401  *
8402  *******************************************************************************/
8403 void EwAddHeapMemoryPool(void *aAddress, long aSize);
8404 
8405 /*******************************************************************************
8406  * FUNCTION:
8407  * EwGetHeapInfo
8408  *
8409  * DESCRIPTION:
8410  * The function EwGetHeapInfo() returns few information reflecting the actuall
8411  * state of the heap manager. As such it is useful for debugging purpose and
8412  * tests. The functions copies the values into variables referred by the
8413  * function parameters. If a parameter is 0 (zero), the value is ignored.
8414  *
8415  * ARGUMENTS:
8416  * aNoOfMemoryPools - Receives the number of managed memory pools. Memory
8417  * pools are added to the heap by using the function EwAddHeapMemoryPool().
8418  * aTotalSize - Receives the size in bytes of the entire memory (used
8419  * and free).
8420  * aFreeSize - Receives the size in bytes of the free memory.
8421  * aNoOfUsedBlocks - Receives the number of allocated memory blocks.
8422  * aNoOfFreeBlocks - Receives the number of free blocks.
8423  * aSmallestFreeBlock - Receives the size in bytes of the smallest free block.
8424  * aLargestFreeBlock - Receives the size in bytes of the largest free block.
8425  * aSmallAllocCounter - Receives the total number of performed alloc
8426  *operations with small blocks. aLargeAllocCounter - Receives the total number
8427  *of performed alloc operations with large blocks. aFreeCounter - Receives
8428  *the total number of performed free operations.
8429  *
8430  * RETURN VALUE:
8431  * None
8432  *
8433  *******************************************************************************/
8434 void EwGetHeapInfo(long *aNoOfMemoryPools, long *aTotalSize, long *aFreeSize,
8435  long *aNoOfUsedBlocks, long *aNoOfFreeBlocks,
8436  long *aSmallestFreeBlock, long *aLargestFreeBlock,
8437  unsigned long *aSmallAllocCounter,
8438  unsigned long *aLargeAllocCounter,
8439  unsigned long *aFreeCounter);
8440 
8441 /*******************************************************************************
8442  * FUNCTION:
8443  * EwDumpHeap
8444  *
8445  * DESCRIPTION:
8446  * The function EwDumpHeap() exists for debugging purpose. It evaluates the
8447  * contents of all memory pools managed actually be the heap manager and
8448  * prints the associated information as well as the existing blocks.
8449  *
8450  * ARGUMENTS:
8451  * aDetailed - If != 0, the functions prints a list of all memory blocks.
8452  * If == 0, only heap overview is printed.
8453  *
8454  * RETURN VALUE:
8455  * None
8456  *
8457  *******************************************************************************/
8458 void EwDumpHeap(int aDetailed);
8459 
8460 /*******************************************************************************
8461  * FUNCTION:
8462  * EwVerifyHeap
8463  *
8464  * DESCRIPTION:
8465  * The function EwVerifyHeap() exists for debugging purpose. It evaluates the
8466  * contents of all memory pools managed actually be the heap manager with the
8467  * aim to verify whether the heap is coherent. In case the verification were
8468  * successful, the function returns != 0. Otherwise an adequate messages is
8469  * reported and the function returns 0.
8470  *
8471  * ARGUMENTS:
8472  * None
8473  *
8474  * RETURN VALUE:
8475  * Returns != 0 if the heap is coherent. In case of an error, the value 0 is
8476  * returned.
8477  *
8478  *******************************************************************************/
8479 int EwVerifyHeap(void);
8480 
8481 /*******************************************************************************
8482  * FUNCTION:
8483  * EwAllocHeapBlock
8484  *
8485  * DESCRIPTION:
8486  * The function EwAllocHeapBlock() tries to allocate memory block with the
8487  * given number of bytes. Once not needed anymore, the memory should be
8488  * released by using the function EwFreeHeapBlock().
8489  *
8490  * ARGUMENTS:
8491  * aSize - Size of the memory to allocate in bytes.
8492  *
8493  * RETURN VALUE:
8494  * Returns a pointer to the allocated memory or 0 (zero) if there is not
8495  * enough free memory on the heap.
8496  *
8497  *******************************************************************************/
8498 void *EwAllocHeapBlock(int aSize);
8499 
8500 /*******************************************************************************
8501  * FUNCTION:
8502  * EwFreeHeapBlock
8503  *
8504  * DESCRIPTION:
8505  * The function EwFreeHeapBlock() releases the memory allocated by a preceding
8506  * call to the method EwAllocHeapBlock().
8507  *
8508  * ARGUMENTS:
8509  * aMemory - Pointer to the memory block to release.
8510  *
8511  * RETURN VALUE:
8512  * None
8513  *
8514  *******************************************************************************/
8515 void EwFreeHeapBlock(void *aMemory);
8516 
8517 /*******************************************************************************
8518  * FUNCTION:
8519  * EwIsHeapPtr
8520  *
8521  * DESCRIPTION:
8522  * The function EwIsHeapPtr() verifies whether the given pointer aPtr refers a
8523  * memory area controlled by the heap manager (see EwAllocHeapBlock(),
8524  * EwFreeHeapBlock()).
8525  *
8526  * ARGUMENTS:
8527  * aPtr - Address to test.
8528  *
8529  * RETURN VALUE:
8530  * EwIsHeapPtr() returns != 0 if the given pointer aPtr refers a memory area
8531  * used by the heap manager. Otherwise 0 is returned.
8532  *
8533  *******************************************************************************/
8534 int EwIsHeapPtr(void *aMemory);
8535 
8536 #ifdef __cplusplus
8537 }
8538 #endif
8539 
8540 #endif /* EWRTE_H */
8541 
8542 /* pba, msy */
EwNewRef
#define EwNewRef(aObject, aOnGetProc, aOnSetProc)
Definition: ewrte.h:4234
EwPanic
void EwPanic(void)
Definition: ewextrte.c:173
XLangId
int XLangId
Definition: ewrte.h:1597
EwGetStringLength
XInt32 EwGetStringLength(XString aString)
EwDecompress
void EwDecompress(const unsigned int *aData, unsigned char *aDest, int aWidth, int aPitch)
_XPerfCounter::GroupCalls
unsigned long GroupCalls
Definition: ewrte.h:7898
EwIsRectNull
XBool EwIsRectNull(XRect aRect)
EwMathExp
XFloat EwMathExp(XFloat aValue)
Definition: ewextrte.c:715
EwIsSlotNull
XBool EwIsSlotNull(XSlot aSlot)
EwMathCos
XFloat EwMathCos(XFloat aAngle)
Definition: ewextrte.c:545
_XPerfCounter::Calls
unsigned long Calls
Definition: ewrte.h:7890
EwGetStyles
XStylesSet EwGetStyles(void)
_XPerfCounter::GroupFirst
struct _XPerfCounter * GroupFirst
Definition: ewrte.h:7896
_XPerfCounter::Name
const char * Name
Definition: ewrte.h:7887
EwGetInt64Min
XInt64 EwGetInt64Min(int aCount,...)
EwDetachObserver
int EwDetachObserver(XSlot aSlot, XUInt32 aId)
EwNotifyObservers
void EwNotifyObservers(XUInt32 aId)
EwOnGetString
XString EwOnGetString(XRef aRef)
XRef
Definition: ewrte.h:2075
EwSetRectSize
XRect EwSetRectSize(XRect aRect, XPoint aSize)
EwNewFloatInfN
XFloat EwNewFloatInfN(void)
XVariantOfString::Value
XStringRes Value
Definition: ewrte.h:1815
EwGetRectArea
XInt32 EwGetRectArea(XRect aRect)
EwGetVariantOfEnum
XEnum EwGetVariantOfEnum(const XVariant *aConstant)
EwFormatUIntToAnsiString
int EwFormatUIntToAnsiString(char *aBuf, unsigned long aValue, int aCount, int aRadix, int aUpper, int aSign)
EwIsRectEmpty
XBool EwIsRectEmpty(XRect aRect)
EwDestroyTimer
void EwDestroyTimer(XTimer *aTimer)
EwOnSetRect
void EwOnSetRect(XRef aRef, XRect aValue)
EwOnSetHandle
void EwOnSetHandle(XRef aRef, XHandle aValue)
EwSetColorAlpha
XColor EwSetColorAlpha(XColor aColor, XUInt8 aAlpha)
EwGetVariantOfUInt8
XUInt8 EwGetVariantOfUInt8(const XVariant *aConstant)
EwMathTrunc
XFloat EwMathTrunc(XFloat aValue)
EwMaxStringCacheSize
int EwMaxStringCacheSize
EwCopy
void EwCopy(void *aDstPtr, const void *aSrcPtr, int aCount)
Definition: ewextrte.c:409
EwGetVariantOfUInt64
XUInt64 EwGetVariantOfUInt64(const XVariant *aConstant)
XUInt8
unsigned char XUInt8
Definition: ewrte.h:1588
EwGetInt64Abs
XInt64 EwGetInt64Abs(XInt64 aValue)
EwSetStackBaseAddress
void EwSetStackBaseAddress(void *aStackBaseAddress)
XVariant::SubVariants
const struct _XSubVariant * SubVariants
Definition: ewrte.h:1885
EwOnSetColor
void EwOnSetColor(XRef aRef, XColor aValue)
_vmt_XObject::_MagicNo
unsigned int _MagicNo
Definition: ewrte.h:346
EwFormatFloatToAnsiString
int EwFormatFloatToAnsiString(char *aBuf, float aValue, int aCount, int aPrecision, int aSign)
XVariantOfUInt64::LangId
int LangId
Definition: ewrte.h:1769
EwGetVariantOfBool
XBool EwGetVariantOfBool(const XVariant *aConstant)
EwSetPointX
XPoint EwSetPointX(XPoint aPoint, XInt32 aX)
EwGetRectAbs
XRect EwGetRectAbs(XRect aValue)
EwGetRectH
XInt32 EwGetRectH(XRect aRect)
XVariant
Definition: ewrte.h:1882
XRef::Object
void * Object
Definition: ewrte.h:2076
EwNewRect2Point
XRect EwNewRect2Point(XPoint aPoint1, XPoint aPoint2)
XVariantOfUInt32::LangId
int LangId
Definition: ewrte.h:1764
EwStrCmp
int EwStrCmp(const char *aStr1, const char *aStr2)
Definition: ewextrte.c:483
_XClassVariant::Style
int Style
Definition: ewrte.h:390
XFlashAreaReaderProc
const typedef void *(* XFlashAreaReaderProc)(const void *aAddress)
Definition: ewrte.h:7422
EwErrorS
void EwErrorS(int aCode, const char *aString)
EwOnSetInt64
void EwOnSetInt64(XRef aRef, XInt64 aValue)
EwGetColorMin
XColor EwGetColorMin(int aCount,...)
XClass
const typedef void * XClass
Definition: ewrte.h:290
_vmt_XObject::_Init
void(* _Init)(XObject _this, XObject aLink, XHandle aArg)
Definition: ewrte.h:352
EwMathRandInt32
XInt32 EwMathRandInt32(XInt32 aValue1, XInt32 aValue2)
Definition: ewextrte.c:777
EwGetColorMax
XColor EwGetColorMax(int aCount,...)
EwOnGetBool
XBool EwOnGetBool(XRef aRef)
XVariantOfChar::LangId
int LangId
Definition: ewrte.h:1794
EwOnSetInt8
void EwOnSetInt8(XRef aRef, XInt8 aValue)
XVariantOfRect::LangId
int LangId
Definition: ewrte.h:1809
EwOnSetUInt8
void EwOnSetUInt8(XRef aRef, XUInt8 aValue)
EwGetFloatAbs
XFloat EwGetFloatAbs(XFloat aValue)
XUInt64
unsigned long long XUInt64
Definition: ewrte.h:1591
EwResetTimer
void EwResetTimer(XTimer *aTimer)
EwErrorDD
void EwErrorDD(int aCode, int aSignedDecimal1, int aSignedDecimal2)
EwSetRectH
XRect EwSetRectH(XRect aRect, XInt32 aH)
EwMathPow
XFloat EwMathPow(XFloat aA, XFloat aB)
Definition: ewextrte.c:695
_XPerfCounter::Group
const char * Group
Definition: ewrte.h:7888
XColor
Definition: ewrte.h:1700
EwAddPerfCounter
#define EwAddPerfCounter(aPerfCounter)
Definition: ewrte.h:7944
EwGetInt32Max
XInt32 EwGetInt32Max(int aCount,...)
XResource
Definition: ewrte.h:1848
EwUnionRect
XRect EwUnionRect(XRect aRect1, XRect aRect2)
EwOnGetInt64
XInt64 EwOnGetInt64(XRef aRef)
XVariantOfStylesSet
Definition: ewrte.h:1823
_XTimer::Ticks
XTicks Ticks
Definition: ewrte.h:7203
EwOnGetUInt64
XUInt64 EwOnGetUInt64(XRef aRef)
XRefGetSetProc
void(* XRefGetSetProc)(void)
Definition: ewrte.h:2074
EwSetLanguage
XLangId EwSetLanguage(XLangId aLangId)
EwGetUInt64Min
XUInt64 EwGetUInt64Min(int aCount,...)
EwOnGetPoint
XPoint EwOnGetPoint(XRef aRef)
EwDeregisterResource
void EwDeregisterResource(XObject aObject)
XHandle
unsigned long XHandle
Definition: ewrte.h:291
EwStringRemove
XString EwStringRemove(XString aString, XInt32 aIndex, XInt32 aCount)
XVariantOfBool::Value
XBool Value
Definition: ewrte.h:1775
_XTimer::Proc
XTimerProc Proc
Definition: ewrte.h:7200
EwGetVariantOfFloat
XFloat EwGetVariantOfFloat(const XVariant *aConstant)
XVariantOfSet::LangId
int LangId
Definition: ewrte.h:1784
EwAttachObjectVariant
void EwAttachObjectVariant(XObject aThis, XObject aLink, XHandle aArg)
EwNewStringAnsi
XString EwNewStringAnsi(register const char *aAnsi)
_XPerfCounter
Definition: ewrte.h:7849
EwCompString
int EwCompString(XString aString1, XString aString2)
EwStringParseUInt64
XUInt64 EwStringParseUInt64(XString aString, XUInt64 aDefault, XInt32 aRadix)
EwMathSin
XFloat EwMathSin(XFloat aAngle)
Definition: ewextrte.c:524
XObject__ReInit
void XObject__ReInit(XObject _this)
XVariantOfLangId::Value
XLangId Value
Definition: ewrte.h:1820
EwMathFloor
XFloat EwMathFloor(XFloat aValue)
Definition: ewextrte.c:857
EwPostSignal
void EwPostSignal(XSlot aSlot, XObject aSender)
EwGetInt64Max
XInt64 EwGetInt64Max(int aCount,...)
EwCompColor
int EwCompColor(XColor aColor1, XColor aColor2)
XVariantOfEnum::LangId
int LangId
Definition: ewrte.h:1779
EwSetRectX
XRect EwSetRectX(XRect aRect, XInt32 aX)
EwMathLog10
XFloat EwMathLog10(XFloat aValue)
Definition: ewextrte.c:755
EwCompPoint
int EwCompPoint(XPoint aPoint1, XPoint aPoint2)
XVariantOfInt16::Value
XInt16 Value
Definition: ewrte.h:1740
EwAttachRefObserver
int EwAttachRefObserver(XSlot aSlot, XRef aRef, XUInt32 aId)
EwOnSetInt32
void EwOnSetInt32(XRef aRef, XInt32 aValue)
XVariantOfFloat::LangId
int LangId
Definition: ewrte.h:1789
_XPerfCounter::MaxTime
unsigned long MaxTime
Definition: ewrte.h:7895
XVariantOfPoint
Definition: ewrte.h:1803
XSubVariant
struct _XSubVariant XSubVariant
EwOnSetSet
void EwOnSetSet(XRef aRef, XSet aValue)
EwStringParseInt32
XInt32 EwStringParseInt32(XString aString, XInt32 aDefault, XInt32 aRadix)
XVariant::Content
const void * Content
Definition: ewrte.h:1883
EwCompRef
int EwCompRef(XRef aRef1, XRef aRef2)
_XPerfCounter::Recursions
unsigned long Recursions
Definition: ewrte.h:7889
EwGetVariantOfUInt16
XUInt16 EwGetVariantOfUInt16(const XVariant *aConstant)
EwGetCharUpper
XChar EwGetCharUpper(XChar aChar)
XVariantOfInt64::Value
XInt64 Value
Definition: ewrte.h:1750
EwNewObjectIndirect
XObject EwNewObjectIndirect(const void *aClass, XHandle aArg)
EwOnSetStylesSet
void EwOnSetStylesSet(XRef aRef, XStylesSet aValue)
void
XRect CoreOutline aOutline void(CoreRoot _this, GraphicsCanvas aCanvas, XRect aClip, XPoint aOffset, XInt32 aOpacity, XBool aBlend) EW_METHOD(HandleEvent
EwGetStringLower
XString EwGetStringLower(XString aString)
EwGetPointMax
XPoint EwGetPointMax(int aCount,...)
EwGetInt64UAbs
XUInt64 EwGetInt64UAbs(XInt64 aValue)
EwOnGetObject
XObject EwOnGetObject(XRef aRef)
EwMovePointPos
XPoint EwMovePointPos(XPoint aPoint, XPoint aOffset)
EwNewColor
XColor EwNewColor(XUInt8 aRed, XUInt8 aGreen, XUInt8 aBlue, XUInt8 aAlpha)
XSlot
Definition: ewrte.h:2114
EwStrCpy
void EwStrCpy(char *aDst, const char *aSrc)
Definition: ewextrte.c:433
XRef::OnGet
XRefGetSetProc OnGet
Definition: ewrte.h:2077
EwSetRectY
XRect EwSetRectY(XRect aRect, XInt32 aY)
aArg
XRect CoreOutline aOutline XHandle aArg
Definition: _ApplicationApplication.h:151
EwStringToAnsi
XInt32 EwStringToAnsi(XString aString, char *aDest, XInt32 aCount, char aDefChar)
_XPerfCounter::GroupTotalTime
unsigned long GroupTotalTime
Definition: ewrte.h:7899
EwGetHeapInfo
void EwGetHeapInfo(long *aNoOfMemoryPools, long *aTotalSize, long *aFreeSize, long *aNoOfUsedBlocks, long *aNoOfFreeBlocks, long *aSmallestFreeBlock, long *aLargestFreeBlock, unsigned long *aSmallAllocCounter, unsigned long *aLargeAllocCounter, unsigned long *aFreeCounter)
EwIdleSignal
void EwIdleSignal(XSlot aSlot, XObject aSender)
EwOnGetFloat
XFloat EwOnGetFloat(XRef aRef)
EwConsoleOutput
void EwConsoleOutput(const char *aMessage)
Definition: ewextrte.c:199
EwOnSetPoint
void EwOnSetPoint(XRef aRef, XPoint aValue)
EwGetVariantOfString
XString EwGetVariantOfString(const XVariant *aConstant)
EwOnGetHandle
XHandle EwOnGetHandle(XRef aRef)
EwThrow
void EwThrow(const XChar *aMessage)
_obj_XObject
Definition: ewrte.h:281
EwOnGetInt8
XInt8 EwOnGetInt8(XRef aRef)
XChar
unsigned short XChar
Definition: ewrte.h:1596
EwMathArcTan
XFloat EwMathArcTan(XFloat aValue)
Definition: ewextrte.c:631
EwMathRound
XFloat EwMathRound(XFloat aValue)
Definition: ewextrte.c:838
XPoint
XRect CoreOutline aOutline XPoint(CoreRectView _this, XRect aBounds, XEnum aFormation) EW_METHOD(MoveView
_obj_XObject::GCT
const struct _vmt_XObject * GCT
Definition: ewrte.h:286
EwFormatUInt64ToAnsiString
int EwFormatUInt64ToAnsiString(char *aBuf, XUInt64 aValue, int aCount, int aRadix, int aUpper, int aSign)
EwIsStringEmpty
XBool EwIsStringEmpty(XString aString)
EwSetRectX2
XRect EwSetRectX2(XRect aRect, XInt32 aX2)
EwStringMiddle
XString EwStringMiddle(XString aString, XInt32 aIndex, XInt32 aCount)
EwGetVariantOfInt8
XInt8 EwGetVariantOfInt8(const XVariant *aConstant)
XVariantOfInt64
Definition: ewrte.h:1748
XAutoObject::Init
XAutoObjectInitProc Init
Definition: ewrte.h:2139
_XTimer::InitialTime
XInt32 InitialTime
Definition: ewrte.h:7204
EwGetRectSize
XPoint EwGetRectSize(XRect aRect)
EwOnSetBool
void EwOnSetBool(XRef aRef, XBool aValue)
XStylesSet
unsigned long XStylesSet
Definition: ewrte.h:1598
EwNewFloatNaN
XFloat EwNewFloatNaN(void)
XAutoObjectInitProc
void(* XAutoObjectInitProc)(XObject _this)
Definition: ewrte.h:2136
XVariantOfSet
Definition: ewrte.h:1783
EwOnSetUInt32
void EwOnSetUInt32(XRef aRef, XUInt32 aValue)
EwNewRect
XRect EwNewRect(XInt32 aX1, XInt32 aY1, XInt32 aX2, XInt32 aY2)
EwNewStringUtf8
XString EwNewStringUtf8(const unsigned char *aUtf8, int aCount)
_vmt_XObject::_Done
void(* _Done)(XObject _this)
Definition: ewrte.h:354
XAutoObject
Definition: ewrte.h:2138
EwOnGetColor
XColor EwOnGetColor(XRef aRef)
XInt32
signed long XInt32
Definition: ewrte.h:1586
XVariantOfUInt64::Value
XUInt64 Value
Definition: ewrte.h:1770
XRef::OnSet
XRefGetSetProc OnSet
Definition: ewrte.h:2078
EwCompSlot
int EwCompSlot(XSlot aSlot1, XSlot aSlot2)
EwMathLengthPoint
XFloat EwMathLengthPoint(XPoint aPoint)
EwNewStringInt64
XString EwNewStringInt64(XInt64 aValue, XInt32 aCount, XInt32 aRadix)
EwGetInt32UAbs
XUInt32 EwGetInt32UAbs(XInt32 aValue)
_obj_XObject::Link
struct _obj_XObject * Link
Definition: ewrte.h:285
EwGetTime
XInt64 EwGetTime(void)
Definition: ewextrte.c:274
EwOnSetUInt16
void EwOnSetUInt16(XRef aRef, XUInt16 aValue)
EwNullRef
const XRef EwNullRef
EwConcatString
XString EwConcatString(XString aString1, XString aString2)
EwErrorPDS
void EwErrorPDS(int aCode, const void *aPointer, int aSignedDecimal, const char *aString)
EwDetachObjObserver
int EwDetachObjObserver(XSlot aSlot, XObject aObject, XUInt32 aId)
EwMathCeil
XFloat EwMathCeil(XFloat aValue)
Definition: ewextrte.c:876
XVariantOfChar::Value
XChar Value
Definition: ewrte.h:1795
EwReconstructObjects
void EwReconstructObjects(void)
_vmt_XObject::_Ancestor
const struct _vmt_XObject * _Ancestor
Definition: ewrte.h:348
XVariantOfUInt64
Definition: ewrte.h:1768
EwIntersectRect2
XRect EwIntersectRect2(XRect aRect1, XRect aRect2)
EwGetVariantOfInt64
XInt64 EwGetVariantOfInt64(const XVariant *aConstant)
XBool
char XBool
Definition: ewrte.h:1592
XTimer
struct _XTimer XTimer
EwProcessTimers
int EwProcessTimers(void)
XEnum
unsigned long XEnum
Definition: ewrte.h:1593
XInt64
signed long long XInt64
Definition: ewrte.h:1587
__vmt_XObject
const struct _vmt_XObject __vmt_XObject
EwSetContains
XBool EwSetContains(XSet aSet1, XSet aSet2)
EwConcatCharString
XString EwConcatCharString(XChar aChar, XString aString)
XVariantOfUInt16::LangId
int LangId
Definition: ewrte.h:1759
EwDoneHeap
void EwDoneHeap(void)
EwMathSqrt
XFloat EwMathSqrt(XFloat aValue)
Definition: ewextrte.c:674
EwNewStringFloat
XString EwNewStringFloat(XFloat aValue, XInt32 aCount, XInt32 aPrecision)
EwAttachObjObserver
int EwAttachObjObserver(XSlot aSlot, XObject aObject, XUInt32 aId)
EwZero
void EwZero(void *aDstPtr, int aCount)
Definition: ewextrte.c:335
EwGetRectCenter
XPoint EwGetRectCenter(XRect aRect)
XRect
Definition: ewrte.h:1639
EwSetRectOrigin
XRect EwSetRectOrigin(XRect aRect, XPoint aOrigin)
_XPerfCounter::TotalTime
unsigned long TotalTime
Definition: ewrte.h:7893
_XTimer::Next
struct _XTimer * Next
Definition: ewrte.h:7199
EwPlusColor
XColor EwPlusColor(XColor aColor1, XColor aColor2)
EwPrint
void EwPrint(const char *aFormat,...)
EwOnGetChar
XChar EwOnGetChar(XRef aRef)
_vmt_XObject::_SubVariants
const struct _XClassVariant * _SubVariants
Definition: ewrte.h:349
EwSetRectPoint2
XRect EwSetRectPoint2(XRect aRect, XPoint aPoint2)
EwShareString
XString EwShareString(XString aString)
EwAttachObserver
int EwAttachObserver(XSlot aSlot, XUInt32 aId)
EwFree
void EwFree(void *aMemory)
Definition: ewextrte.c:123
EwClassOf
XClass EwClassOf(register XObject aObject)
EwGetVariantOfRect
XRect EwGetVariantOfRect(const XVariant *aConstant)
_XPerfCounter::MinTime
unsigned long MinTime
Definition: ewrte.h:7894
EwLoadString
XString EwLoadString(const XStringRes *aStringConst)
XObject
struct _obj_XObject * XObject
Definition: ewrte.h:289
_XSubVariant::Variant
const XVariant * Variant
Definition: ewrte.h:1890
EwErrorSD
void EwErrorSD(int aCode, const char *aString, int aSignedDecimal)
_vmt_XObject::_Size
int _Size
Definition: ewrte.h:350
EwError
void EwError(int aCode)
EwSetRectPoint1
XRect EwSetRectPoint1(XRect aRect, XPoint aPoint1)
XVariantOfEnum::Value
XEnum Value
Definition: ewrte.h:1780
XVariantOfBool
Definition: ewrte.h:1773
EwGetVariantOfInt32
XInt32 EwGetVariantOfInt32(const XVariant *aConstant)
XRect
XRect CoreOutline aOutline XRect(CoreRectView _this) EW_METHOD(ChangeViewState
_vmt_XObject
Definition: ewrte.h:345
_vmt_XObject::_ReInit
void(* _ReInit)(XObject _this)
Definition: ewrte.h:353
EwConcatStringChar
XString EwConcatStringChar(XString aString, XChar aChar)
XSet
unsigned long XSet
Definition: ewrte.h:1594
EwDetachRefObserver
int EwDetachRefObserver(XSlot aSlot, XRef aRef, XUInt32 aId)
EwBlendColorInt
XColor EwBlendColorInt(XColor aColor, XInt32 aAlpha)
XVariantOfInt8
Definition: ewrte.h:1733
EwIntersectRect
XRect EwIntersectRect(XRect aRect1, XRect aRect2)
EwGetLanguage
XLangId EwGetLanguage(void)
EwIsRefNull
XBool EwIsRefNull(XRef aRef)
EwRegisterFlashAreaReader
void EwRegisterFlashAreaReader(XFlashAreaReaderProc aReaderProc, void *aStartAddress, void *aEndAddress, int aBlockSize)
EwStartTimer
void EwStartTimer(XTimer *aTimer, XInt32 aInitialTime, XInt32 aRepeatTime)
EwUnlockObject
#define EwUnlockObject(aObject)
Definition: ewrte.h:1357
EwGetAutoObject
#define EwGetAutoObject(aAutoObject, aClass)
Definition: ewrte.h:5584
EwOnSetEnum
void EwOnSetEnum(XRef aRef, XEnum aValue)
EwCreateTimer
XTimer * EwCreateTimer(XTimerProc aProc, XHandle aArg)
EwMathArcTan2
XFloat EwMathArcTan2(XFloat aY, XFloat aX)
Definition: ewextrte.c:652
EwProcessSignals
int EwProcessSignals(void)
EwStringParseFloat
XFloat EwStringParseFloat(XString aString, XFloat aDefault)
EwGetVariantOfColor
XColor EwGetVariantOfColor(const XVariant *aConstant)
EwDumpHeap
void EwDumpHeap(int aDetailed)
XVariantOfInt64::LangId
int LangId
Definition: ewrte.h:1749
_XClassVariant::Variant
const struct _vmt_XObject * Variant
Definition: ewrte.h:391
EwOnGetSlot
XSlot EwOnGetSlot(XRef aRef)
XVariantOfFloat
Definition: ewrte.h:1788
EwNewStringInt
XString EwNewStringInt(XInt32 aValue, XInt32 aCount, XInt32 aRadix)
XVariantOfInt16::LangId
int LangId
Definition: ewrte.h:1739
EwStringRight
XString EwStringRight(XString aString, XInt32 aCount)
EwGetVariantOfSet
XSet EwGetVariantOfSet(const XVariant *aConstant)
XVariantOfSet::Value
XSet Value
Definition: ewrte.h:1785
EwMoveRectNeg
XRect EwMoveRectNeg(XRect aRect, XPoint aOffset)
EwReclaimMemory
int EwReclaimMemory(void)
EwGetUtf8StringLength
XInt32 EwGetUtf8StringLength(XString aString)
XVariantOfString::LangId
int LangId
Definition: ewrte.h:1814
XVariantOfColor::Value
XColor Value
Definition: ewrte.h:1800
EwNextTimerExpiration
int EwNextTimerExpiration(void)
EwOnGetRect
XRect EwOnGetRect(XRef aRef)
EwCastClass
#define EwCastClass(aClass, aDesiredClass)
Definition: ewrte.h:1278
_XTimer::Arg
XHandle Arg
Definition: ewrte.h:7201
XVariantOfUInt32::Value
XUInt32 Value
Definition: ewrte.h:1765
_XPerfCounter::Next
struct _XPerfCounter * Next
Definition: ewrte.h:7886
EwMinusColor
XColor EwMinusColor(XColor aColor1, XColor aColor2)
EwSaveRegister
void EwSaveRegister(void *aBuffer)
Definition: ewextrte.c:228
EwStringParseInt64
XInt64 EwStringParseInt64(XString aString, XInt64 aDefault, XInt32 aRadix)
EwGetUInt64Max
XUInt64 EwGetUInt64Max(int aCount,...)
EwGetCharLower
XChar EwGetCharLower(XChar aChar)
_XSubVariant::Style
int Style
Definition: ewrte.h:1889
EwImmediateReclaimMemory
int EwImmediateReclaimMemory(int aErrorCode)
EwMovePointNeg
XPoint EwMovePointNeg(XPoint aPoint, XPoint aOffset)
EwGetVariantOf
#define EwGetVariantOf(aVariant, aKind)
Definition: ewrte.h:5775
EwGetTicks
unsigned long EwGetTicks(void)
Definition: ewextrte.c:251
EwAddHeapMemoryPool
void EwAddHeapMemoryPool(void *aAddress, long aSize)
EwGetUInt32Max
XUInt32 EwGetUInt32Max(int aCount,...)
XFloat
float XFloat
Definition: ewrte.h:1595
EwIsHeapPtr
int EwIsHeapPtr(void *aMemory)
XVariantOfRect::Value
XRect Value
Definition: ewrte.h:1810
XVariantOfInt16
Definition: ewrte.h:1738
_XTimer::Enabled
XBool Enabled
Definition: ewrte.h:7202
EwStringFind
XInt32 EwStringFind(XString aString1, XString aString2, XInt32 aStartIndex)
EwNewStringUInt
XString EwNewStringUInt(XUInt32 aValue, XInt32 aCount, XInt32 aRadix)
XStringRes
Definition: ewrte.h:1679
XObject__Done
void XObject__Done(XObject _this)
EwIsPointInRect
XBool EwIsPointInRect(XRect aRect, XPoint aPoint)
EwSetColorRed
XColor EwSetColorRed(XColor aColor, XUInt8 aRed)
EwSetPointY
XPoint EwSetPointY(XPoint aPoint, XInt32 aY)
EwSetRectY2
XRect EwSetRectY2(XRect aRect, XInt32 aY2)
XVariantOfColor::LangId
int LangId
Definition: ewrte.h:1799
EwCastObject
#define EwCastObject(aObject, aClass)
Definition: ewrte.h:1241
XVariantOfUInt8
Definition: ewrte.h:1753
EwNotifyObjObservers
void EwNotifyObjObservers(XObject aObject, XUInt32 aId)
EwStrLen
int EwStrLen(const char *aStr)
Definition: ewextrte.c:505
EwOnGetClass
XClass EwOnGetClass(XRef aRef)
XObject__Init
void XObject__Init(XObject _this, XObject aLink, XHandle aArg)
XVariantOfStylesSet::LangId
int LangId
Definition: ewrte.h:1824
EwGetRectORect
XRect EwGetRectORect(XRect aRect)
_XPerfCounter::StartTime1
unsigned long StartTime1
Definition: ewrte.h:7891
EwGetFloatMax
XFloat EwGetFloatMax(int aCount,...)
EwIsFloatInfP
XBool EwIsFloatInfP(XFloat aValue)
XPoint
Definition: ewrte.h:1616
XTicks
Definition: ewrte.h:7133
XVariantOfInt32::Value
XInt32 Value
Definition: ewrte.h:1745
EwNewFloatInfP
XFloat EwNewFloatInfP(void)
EwMoveRectPos
XRect EwMoveRectPos(XRect aRect, XPoint aOffset)
EwGetPointAbs
XPoint EwGetPointAbs(XPoint aValue)
XVariantOfLangId
Definition: ewrte.h:1818
XVariantOfUInt32
Definition: ewrte.h:1763
EwRegisterResource
void EwRegisterResource(XObject aObject, const void *aResource)
_XTimer::RepeatTime
XInt32 RepeatTime
Definition: ewrte.h:7205
EwSetRectX1
XRect EwSetRectX1(XRect aRect, XInt32 aX1)
EwGetFloatMin
XFloat EwGetFloatMin(int aCount,...)
EwGetVariantOfUInt32
XUInt32 EwGetVariantOfUInt32(const XVariant *aConstant)
aOffset
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint aOffset
Definition: _CoreOutline.h:172
EwNullSlot
const XSlot EwNullSlot
_XClassVariant
Definition: ewrte.h:374
EwOnGetInt32
XInt32 EwOnGetInt32(XRef aRef)
EwGetVariantOfPoint
XPoint EwGetVariantOfPoint(const XVariant *aConstant)
XTimerProc
void(* XTimerProc)(XHandle aArg)
Definition: ewrte.h:7153
EwMathLog
XFloat EwMathLog(XFloat aValue)
Definition: ewextrte.c:735
EwGetPointMin
XPoint EwGetPointMin(int aCount,...)
EwTrace
void EwTrace(const char *aFormat,...)
XPerfCounter
struct _XPerfCounter XPerfCounter
EwSetColorBlue
XColor EwSetColorBlue(XColor aColor, XUInt8 aBlue)
EwStringParseUInt32
XUInt32 EwStringParseUInt32(XString aString, XUInt32 aDefault, XInt32 aRadix)
EwCompRect
int EwCompRect(XRect aRect1, XRect aRect2)
EwOnSetUInt64
void EwOnSetUInt64(XRef aRef, XUInt64 aValue)
XUInt32
unsigned long XUInt32
Definition: ewrte.h:1590
EwErrorPD
void EwErrorPD(int aCode, const void *aPointer, int aSignedDecimal)
EwOnGetSet
XSet EwOnGetSet(XRef aRef)
ewconfig.h
This file contains general configuration settings for the target system, like memory ranges and displ...
XVariant::NoOfLanguages
int NoOfLanguages
Definition: ewrte.h:1884
EwGetVariantOfInt16
XInt16 EwGetVariantOfInt16(const XVariant *aConstant)
EwGetVariantOfStylesSet
XStylesSet EwGetVariantOfStylesSet(const XVariant *aConstant)
EwMathFract
XFloat EwMathFract(XFloat aValue)
EwDetachObjectVariant
void EwDetachObjectVariant(XObject aThis)
EwNewPoint
XPoint EwNewPoint(XInt32 aX, XInt32 aY)
XVariantOfPoint::Value
XPoint Value
Definition: ewrte.h:1805
XVariantOfStylesSet::Value
XStylesSet Value
Definition: ewrte.h:1825
EwGetVariantOfLangId
XLangId EwGetVariantOfLangId(const XVariant *aConstant)
EwOnGetUInt16
XUInt16 EwOnGetUInt16(XRef aRef)
EwResetPerfCounters
#define EwResetPerfCounters()
Definition: ewrte.h:8027
XVariantOfEnum
Definition: ewrte.h:1778
_XPerfCounter::StartTime2
unsigned long StartTime2
Definition: ewrte.h:7892
XVariantOfColor
Definition: ewrte.h:1798
EwStringToUtf8
XInt32 EwStringToUtf8(XString aString, unsigned char *aDest, XInt32 aCount)
EwOnSetLangId
void EwOnSetLangId(XRef aRef, XLangId aValue)
EwStylesContains
int EwStylesContains(XStylesSet aStylesSet1, XStylesSet aStylesSet2)
_obj_XObject::Mark
struct _obj_XObject * Mark
Definition: ewrte.h:284
EwGetRectW
XInt32 EwGetRectW(XRect aRect)
XVariantOfString
Definition: ewrte.h:1813
EwOnGetStylesSet
XStylesSet EwOnGetStylesSet(XRef aRef)
XVariantOfBool::LangId
int LangId
Definition: ewrte.h:1774
EwIsFloatNaN
XBool EwIsFloatNaN(XFloat aValue)
EwOnGetUInt32
XUInt32 EwOnGetUInt32(XRef aRef)
XString
XChar * XString
Definition: ewrte.h:1656
EwOnGetUInt8
XUInt8 EwOnGetUInt8(XRef aRef)
EwSetColorGreen
XColor EwSetColorGreen(XColor aColor, XUInt8 aGreen)
EwNewString
XString EwNewString(const XChar *aString)
EwNotifyRefObservers
void EwNotifyRefObservers(XRef aRef, XUInt32 aId)
EwMathLength
XFloat EwMathLength(XFloat aX, XFloat aY)
EwAllocHeapBlock
void * EwAllocHeapBlock(int aSize)
EwOnGetInt16
XInt16 EwOnGetInt16(XRef aRef)
EwIsColorNull
XBool EwIsColorNull(XColor aColor)
EwAlloc
void * EwAlloc(int aSize)
Definition: ewextrte.c:100
EwGetInt32Abs
XInt32 EwGetInt32Abs(XInt32 aValue)
XUInt16
unsigned short XUInt16
Definition: ewrte.h:1589
EwMathArcCos
XFloat EwMathArcCos(XFloat aValue)
Definition: ewextrte.c:610
EwGetVariantOfChar
XChar EwGetVariantOfChar(const XVariant *aConstant)
EwBlendColor
XColor EwBlendColor(XColor aColor1, XColor aColor2)
EwGetUInt32Min
XUInt32 EwGetUInt32Min(int aCount,...)
EwOnSetFloat
void EwOnSetFloat(XRef aRef, XFloat aValue)
_XPerfCounter::GroupRecursions
unsigned long GroupRecursions
Definition: ewrte.h:7897
XInt8
signed char XInt8
Definition: ewrte.h:1584
EwOnGetEnum
XEnum EwOnGetEnum(XRef aRef)
XVariantOfLangId::LangId
int LangId
Definition: ewrte.h:1819
EwIsMemory
int EwIsMemory(void *aPtr)
Definition: ewextrte.c:146
EwSetRectY1
XRect EwSetRectY1(XRect aRect, XInt32 aY1)
EwGetRectMax
XRect EwGetRectMax(int aCount,...)
XVariantOfInt32::LangId
int LangId
Definition: ewrte.h:1744
EwNewSlot
#define EwNewSlot(aObject, aSlotProc)
Definition: ewrte.h:5169
EwOnGetLangId
XLangId EwOnGetLangId(XRef aRef)
XVariantOfUInt8::Value
XUInt8 Value
Definition: ewrte.h:1755
EwInitHeap
int EwInitHeap(int aLargeObjectSize)
XVariantOfChar
Definition: ewrte.h:1793
EwLoadResource
#define EwLoadResource(aResource, aClass)
Definition: ewrte.h:5655
EwFill
void EwFill(void *aDstPtr, unsigned char aValue, int aCount)
Definition: ewextrte.c:359
EwFreeHeapBlock
void EwFreeHeapBlock(void *aMemory)
EwOnSetInt16
void EwOnSetInt16(XRef aRef, XInt16 aValue)
EwFormatIntToAnsiString
int EwFormatIntToAnsiString(char *aBuf, long aValue, int aCount, int aRadix, int aUpper, int aSign)
EwStringFindChar
XInt32 EwStringFindChar(XString aString, XChar aChar, XInt32 aStartIndex)
_vmt_XObject::_GCInfo
int _GCInfo[6]
Definition: ewrte.h:351
EwPrintProfilerStatistic
void EwPrintProfilerStatistic(int aDetailed)
EwStartPerfCounter
#define EwStartPerfCounter(aPerfCounter)
Definition: ewrte.h:7972
EwMathTan
XFloat EwMathTan(XFloat aAngle)
Definition: ewextrte.c:566
EwMathArcSin
XFloat EwMathArcSin(XFloat aValue)
Definition: ewextrte.c:588
XVariantOfUInt8::LangId
int LangId
Definition: ewrte.h:1754
EwTestImmediateReclaimMemory
int EwTestImmediateReclaimMemory(void)
EwAdaptByteOrder2
void EwAdaptByteOrder2(unsigned short *aData, int aCount)
EwInflateRect
XRect EwInflateRect(XRect aRect, XPoint aDelta)
EwOnSetChar
void EwOnSetChar(XRef aRef, XChar aValue)
EwGetStringUpper
XString EwGetStringUpper(XString aString)
EwGetStringChar
XChar EwGetStringChar(register XString aString, XInt32 aIndex)
_XSubVariant
Definition: ewrte.h:1888
EwPrintPerfCounters
#define EwPrintPerfCounters()
Definition: ewrte.h:8048
EwSetStringChar
XString EwSetStringChar(register XString aString, XInt32 aIndex, XChar aChar)
EwStopPerfCounter
#define EwStopPerfCounter(aPerfCounter)
Definition: ewrte.h:8001
EwIsPointNull
XBool EwIsPointNull(XPoint aPoint)
EwLockObject
#define EwLockObject(aObject)
Definition: ewrte.h:1329
_obj_XObject::_
struct _obj_XObject::@1 _
EwGetRectMin
XRect EwGetRectMin(int aCount,...)
EwOnSetSlot
void EwOnSetSlot(XRef aRef, XSlot aValue)
XInt16
signed short XInt16
Definition: ewrte.h:1585
EwVerifyHeap
int EwVerifyHeap(void)
XSlotProc
void(* XSlotProc)(void *aObject, XObject aSender)
Definition: ewrte.h:2100
EwSetStyles
XStylesSet EwSetStyles(XStylesSet aStylesSet)
EwGetInt32Min
XInt32 EwGetInt32Min(int aCount,...)
XVariantOfPoint::LangId
int LangId
Definition: ewrte.h:1804
EwMove
void EwMove(void *aDstPtr, const void *aSrcPtr, int aCount)
Definition: ewextrte.c:384
EwFormatInt64ToAnsiString
int EwFormatInt64ToAnsiString(char *aBuf, XInt64 aValue, int aCount, int aRadix, int aUpper, int aSign)
XVariantOfFloat::Value
XFloat Value
Definition: ewrte.h:1790
EwAdaptByteOrder4
void EwAdaptByteOrder4(unsigned int *aData, int aCount)
EwIsFloatInfN
XBool EwIsFloatInfN(XFloat aValue)
EwMathRandFloat
XFloat EwMathRandFloat(XFloat aValue1, XFloat aValue2)
Definition: ewextrte.c:809
_obj_XObject::VMT
const struct _vmt_XObject * VMT
Definition: ewrte.h:283
EwNewStringChar
XString EwNewStringChar(XChar aChar, XInt32 aCount)
EwBlendColorUInt
XColor EwBlendColorUInt(XColor aColor, XUInt32 aAlpha)
XVariantOfUInt16
Definition: ewrte.h:1758
XVariantOfInt32
Definition: ewrte.h:1743
_vmt_XObject::_Name
const char * _Name
Definition: ewrte.h:347
EwStrCat
void EwStrCat(char *aDst, const char *aSrc)
Definition: ewextrte.c:457
EwOnSetObject
void EwOnSetObject(XRef aRef, XObject aValue)
EwStringLeft
XString EwStringLeft(XString aString, XInt32 aCount)
XVariantOfRect
Definition: ewrte.h:1808
XVariantOfUInt16::Value
XUInt16 Value
Definition: ewrte.h:1760
EwIsFloatInf
XBool EwIsFloatInf(XFloat aValue)
EwNegPoint
XPoint EwNegPoint(XPoint aPoint)
EwGetPerfCounter
#define EwGetPerfCounter(aSeconds, aMicroseconds, aCPUMicroseconds)
Definition: ewrte.h:8173
EwSignal
void EwSignal(XSlot aSlot, XObject aSender)
EwAnyPendingSignals
int EwAnyPendingSignals(void)
EwOnSetClass
void EwOnSetClass(XRef aRef, XClass aValue)
_XTimer
Definition: ewrte.h:7177
EwSetRectW
XRect EwSetRectW(XRect aRect, XInt32 aW)
EwOnSetString
void EwOnSetString(XRef aRef, XString aValue)
EwNewStringUInt64
XString EwNewStringUInt64(XUInt64 aValue, XInt32 aCount, XInt32 aRadix)
EwStringInsert
XString EwStringInsert(XString aString1, XString aString2, XInt32 aIndex)