WebRadioApp  0.1
ewgfx.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  * Embedded Wizard Graphics Engine provides a platform independent environment
21  * for the execution of graphical operations as it is required by applications
22  * developped with Embedded Wizard. Following features are available:
23  *
24  * > 5 bitmap formats: Index8, Alpha8, Native, RGB565 and Screen. The Graphics
25  * Engine provides a rich set of drawing operations with bitmaps as a source
26  * and destination. Bitmaps can be copied, alpha-blended or even perspective
27  * correct projected as it is necessary for 3D effects.
28  *
29  * The denomination 'Native' refers to the bitmap format supported natively
30  * by the particular target system (e.g. 32 bit RGBA8888). Native bitmaps
31  *can serve as the destination and/or as the source for a drawing operation.
32  *
33  * Index8 bitmaps provide a generic format of an 8 bit / pixel bitmap with a
34  * color look-up table CLUT. When drawing an Index8 bitmap, its pixel values
35  * will be translates through the CLUT in the particular native color
36  *format. An advantage of Index8 bitmaps is the posibility to change its colors
37  *by modifying the color entries within its CLUT.
38  *
39  * Alpha8 bitmaps provide a generic format of an 8 bit / pixel bitmap with a
40  * single alpha (A) channel - no color (RGB) information is stored there.
41  * Alpha8 bitmaps are suitable for drawing patterns modulated by externally
42  * specified colors. For example: text output.
43  *
44  * RGB565 bitmaps exist optionally on platforms able to handle them. Unlike
45  * other formats, RGB565 does not store alpha-channel. It contains pure
46  *color information. The support of RGB565 depends on the used platform package.
47  * Bitmaps in the RGB565 format can be used exclusively as source only.
48  *
49  * The denomination 'Screen' refers to the format of the frame buffer in the
50  * particular target system (e.g. 32 bit RGBA8888). Screen bitmaps can serve
51  * exclusively as the destination for a drawing operation.
52  *
53  * In contrast to the Native bitmap format, Index8 and Alpha8 can serve as
54  * source only. It is not possible to draw to an Index8 or Alpha8 bitmap.
55  *
56  * An additional feature are 'frames'. Except the 'Screen' bitmap format,
57  * each bitmap can consist of several contents, so called frames. When
58  * working with the bitmap, the desired frame needs to be selected. Within
59  * a bitmap all frames always have the same size. The 'Screen' bitmap format
60  * allows a single frame only.
61  *
62  * > Rich set of drawing operations: paths, filled polygons, bitmap copying,
63  * 3D perspective correct projection and text output. All operations can be
64  * performed with or without the alpha-blending. Alpha-blending allows fine
65  * fading effects when several graphical objects are drawn one upon an
66  *other.
67  *
68  * Additionally all drawn pixel can be modulated by color or opacity values
69  * based on linear gradient calculation. In this manner, copied bitmap areas
70  * can, for example, be faded out on its edges. A gradient can be vertical,
71  * horizontal or both. In the last case for each corner of the gradient a
72  * different color value can be set, so 4 colors (or opacity values) can be
73  * mixed in the gradient area.
74  *
75  * With 'Warp' operations, Graphics Engine provides 3D perspective correct
76  * projection of bitmaps. Beside the 3D effect, this functionality allows 2D
77  * scaling and rotating of bitmap areas. For best possible quality, all warp
78  * operations are performed with increased sub-pixel precision. Additionally
79  * bi-linear filters reduce artefacts, when bitmaps are warped.
80  *
81  * > Resource management: bitmap and fonts can be loaded at the runtime into
82  * the Graphics Engine with the objective to display images and output text.
83  * The loaded resources remain in the Graphics Engine as long as they are
84  * needed. Unused resources also remain in the Graphics Engine as long as
85  * there is sufficient memory available. This kind of cache functionality
86  * reduces the effort for repeated reload of frequently used resources.
87  *
88  * > Optimization: before executing drawing operations, Graphics Engine can
89  * analyse them in order to optimize the stream of drawing instructions. In
90  * this manner superfluous drawing operations are detected and eliminated.
91  * If possible, the order of operations is changed in order to reduce the
92  * synchronization overhead between the hardware accelerator and software
93  * drawing routines.
94  *
95  * > Platform independency: The entire Graphics Engine is platform
96  *independent. It handles the complex drawing operations and generates from them
97  *a stream of primitive instructions destined for the particular graphics
98  *subsystem.
99  *
100  * Graphics functionality, which is not supported by the underlying graphics
101  * subsystem will be emulated by Graphics Engine's own software driver. In
102  * this manner the entire range of drawing operations is always guaranteed
103  * for all Embedded Wizard generated GUI applications.
104  *
105  * The integration with the underlying (native) graphics subsystem will take
106  * place through a well defined interface of external functions. Except few
107  * of them, the most of these functions are optional - if a function is not
108  * implemented, the corresponding functionality will be emulated as
109  *described above.
110  *
111  * Due to the wide range of possible graphical operations and the modes, the
112  * interface to the underlying graphics subsystem is scalable. For example,
113  * if the graphics hardware supports only one of the different copy modes,
114  * this special mode can be redirected to the hardware while all other modes
115  * continue using the software emulation.
116  *
117  * Note the possible performance limits, when software emulation is used.
118  *
119  * This is the public header file of the Embedded Wizard Graphics Engine
120  * EWGFX. It declares the top level API of the engine:
121  *
122  * > Bitmap and font management. Creation and destroying of bitmaps, loading
123  * of bitmap and font resources.
124  *
125  * > Drawing operations. Functions to perform all kinds of drawing operations
126  * like drawing lines, attributed text, bitmaps, etc.
127  *
128  * > Creation and management of path data.
129  *
130  * > Text, flow text and attributed text processing and size calculation.
131  * The attributed text provides a powerful way to layout and output strings
132  * with different fonts, embedded images, etc. Multiline text can be drawn
133  * with automatic line wraps, soft-hyphen, etc. Support for Bidirectional
134  * text (e.g. Arabic, Hebrew) is included.
135  *
136  *******************************************************************************/
137 
138 #ifndef EWGFX_H
139 #define EWGFX_H
140 
141 /* Include platform specific configuration file */
142 #include <ewconfig.h>
143 #include "ewgfxdriver.h"
144 #include "ewextgfx.h"
145 #include "ewgfxdefs.h"
146 
147 /* Include platform dependent bitmap and font resource provider declarations */
148 #include "ewextbmp.h"
149 #include "ewextfnt.h"
150 #include "ewgfxcore.h"
151 
152 #ifdef __cplusplus
153 extern "C" {
154 #endif
155 
156 /* The current version of the Graphics Engine. */
157 #define EW_GFX_VERSION 0x000A0000
158 
159 /******************************************************************************
160  * STATUS VARIABLE:
161  * EwFullScreenUpdate
162  * EwFullOffScreenBufferUpdate
163  * EwPreserveFramebufferContent
164  *
165  * DESCRIPTION:
166  * The following variables reflect the current screen update mode as it is
167  * predetermined by the used graphics subsystem. The variables are used
168  * internally by the Mosaic framework only. You never should evaluate or
169  * modify these variables directly.
170  *
171  ******************************************************************************/
172 extern int EwFullScreenUpdate;
173 extern int EwFullOffScreenBufferUpdate;
175 
176 /******************************************************************************
177  * CONFIG VARIABLE:
178  * EwMaxSurfaceCacheSize
179  * EwMaxGlyphSurfaceWidth
180  * EwMaxGlyphSurfaceHeight
181  * EwMaxIssueTasks
182  * EwLazyLoadBitmaps
183  * EwLazyLoadBitmapsIfAnimatedOnly
184  * EwDiscardBitmaps
185  * EwDiscardBitmapsIfAnimatedOnly
186  * EwDiscardBitmapsIfNotUsedInCurrentUpdate
187  *
188  * DESCRIPTION:
189  * The following variables exist for configuration purpose for diverse caches
190  * used by the Graphics Engine. Modifying the variables is possible only just
191  * before the Graphics Engine is initialized.
192  *
193  ******************************************************************************/
194 extern int EwMaxSurfaceCacheSize; /* = EW_MAX_SURFACE_CACHE_SIZE macro */
195 extern int EwMaxGlyphSurfaceWidth; /* = EW_MAX_GLYPH_SURFACE_WIDTH macro */
196 extern int EwMaxGlyphSurfaceHeight; /* = EW_MAX_GLYPH_SURFACE_HEIGHT macro */
197 extern int EwMaxIssueTasks; /* = EW_MAX_ISSUE_TASKS macro */
198 extern int EwLazyLoadBitmaps; /* = EW_LAZY_LOAD_BITMAPS */
199 extern int EwDiscardBitmaps; /* = EW_DISCARD_BITMAPS */
200 extern int
201  EwLazyLoadBitmapsIfAnimatedOnly; /* = EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY
202  */
203 extern int
204  EwDiscardBitmapsIfAnimatedOnly; /* = EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY */
205 extern int
207  EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE
208  */
209 extern int
211  EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES
212  */
213 
214 /*******************************************************************************
215  * MACRO:
216  * EW_PATH_CAP_XXX
217  * EW_PATH_JOIN_XXX
218  *
219  * DESCRIPTION:
220  * The following enumerations define the possible styles used when stroking
221  * paths. The enumeration EW_PATH_CAP_XXX controls the appearance of the ends
222  * of a stroken path. The enumeration EW_PATH_JOIN_XXX controls how the join
223  * points between two edges of the path should be connected.
224  *
225  * ELEMENTS:
226  * EW_PATH_CAP_START_FLAT - The begin of every path is squared off.
227  * EW_PATH_CAP_START_SQUARE - The begin of everry path is extended by the
228  * half of the line thickness and then squared off.
229  * EW_PATH_CAP_START_TRIANGLE - Every path does begin with a triangle.
230  * EW_PATH_CAP_START_ROUND - The begin of every path is rounded.
231  *
232  * EW_PATH_CAP_END_FLAT - The end of every path is squared off.
233  * EW_PATH_CAP_END_SQUARE - The end of every path end is extended by the
234  * half of the line thickness and then squared off.
235  * EW_PATH_CAP_END_TRIANGLE - Every path does end with a triangle.
236  * EW_PATH_CAP_END_ROUND - The end of every path is rounded.
237  *
238  * EW_PATH_CAP_FLAT - The begin and the end of every path are
239  *squared off at their endpoints. EW_PATH_CAP_SQUARE - The begin and the
240  *end of every path are extended by the half of the line thickness and then
241  *squared off. EW_PATH_CAP_TRIANGLE - The paths start and end with a
242  *triangle. EW_PATH_CAP_ROUND - The begin and the end of every path are
243  *rounded.
244  *
245  * EW_PATH_JOIN_BEVEL - The path segments are joined by connecting
246  *their outside edges with a single straight path segment. EW_PATH_JOIN_MITER -
247  *The path segments are joined by extending their outside edges until they
248  *intersect. EW_PATH_JOIN_ROUND - The path corners are rounded.
249  *
250  *******************************************************************************/
251 #define EW_PATH_CAP_START_FLAT 0x00000000
252 #define EW_PATH_CAP_START_SQUARE 0x00000001
253 #define EW_PATH_CAP_START_TRIANGLE 0x00000002
254 #define EW_PATH_CAP_START_ROUND 0x00000003
255 #define EW_PATH_CAP_END_FLAT 0x00000000
256 #define EW_PATH_CAP_END_SQUARE 0x00000100
257 #define EW_PATH_CAP_END_TRIANGLE 0x00000200
258 #define EW_PATH_CAP_END_ROUND 0x00000300
259 #define EW_PATH_CAP_FLAT 0x00000000
260 #define EW_PATH_CAP_SQUARE 0x00000101
261 #define EW_PATH_CAP_TRIANGLE 0x00000202
262 #define EW_PATH_CAP_ROUND 0x00000303
263 #define EW_PATH_JOIN_BEVEL 0x00000000
264 #define EW_PATH_JOIN_MITER 0x00010000
265 #define EW_PATH_JOIN_ROUND 0x00020000
266 
267 /*******************************************************************************
268  * MACRO:
269  * EW_SVG_PARSER_XXX
270  *
271  * DESCRIPTION:
272  * The following enumerations define the possible status values after parsing
273  * an SVG string.
274  *
275  * ELEMENTS:
276  * EW_SVG_PARSER_SUCCESS - SVG string could be processed
277  *successfully. EW_SVG_PARSER_EMPTY_STRING - No SVG string content to parse.
278  * EW_SVG_PARSER_SYNTAX_ERROR - Parsing has been aborted due to a syntax
279  * error in the SVG string.
280  * EW_SVG_PARSER_INVALID_ARGUMENT - Parsing has been aborted due to a found
281  * invalid argument in the SVG string (one parameter or combination of the
282  * parameters is not correct).
283  * EW_SVG_PARSER_OUT_OF_MEMORY - The SVG string is too complex.
284  *
285  *******************************************************************************/
286 #define EW_SVG_PARSER_SUCCESS 0
287 #define EW_SVG_PARSER_EMPTY_STRING 1
288 #define EW_SVG_PARSER_SYNTAX_ERROR 2
289 #define EW_SVG_PARSER_INVALID_ARGUMENT 3
290 #define EW_SVG_PARSER_OUT_OF_MEMORY 4
291 
292 /******************************************************************************
293  * TYPE:
294  * XBitmapFrame
295  *
296  * DESCRIPTION:
297  * The structure XBitmapFrame describes the location and an optional opaque
298  * area of a single bitmap frame.
299  *
300  * ELEMENTS:
301  * Surface - Reference to the low-level surface, where the frame pixel are
302  * stored.
303  * Origin - Frame origin relative to the top-left corner of the surface.
304  * OpaqueRect - Optional opaque area relative to the top-left corner of the
305  * frame. Empty rectangle, if no opaque area is available in the bitmap
306  * frame.
307  *
308  ******************************************************************************/
309 typedef struct {
310  struct XSurface *Surface;
311  XPoint Origin;
312  XRect OpaqueRect;
313 } XBitmapFrame;
314 
315 /******************************************************************************
316  * TYPE:
317  * XBitmap
318  *
319  * DESCRIPTION:
320  * The structure XBitmap describes the attributes of a bitmap. XBitmap serves
321  * as the public and abstract representation of a surface.
322  *
323  * ELEMENTS:
324  * Format - Pixel format of the bitmap. (See EW_PIXEL_FORMAT_XXX).
325  * FrameSize - Size of a single frame within the bitmap.
326  * FrameDelay - Delay in milliseconds for animated bitmaps. If no
327  *animation is specified for the bitmap, the value == 0. NoOfFrames - Number
328  *of frames, this bitmap resources consists of. NoOfVirtFrames - Total number of
329  *frames, including all duplicates. Mapping - If not NULL refers to a
330  *list with indices to map between virtual frames numbers and the numbers of
331  *really existing frames. Resource - Pointer to the original resource
332  *containing the pixel data if the bitmap has been loaded from a resource.
333  * Frames - Pointer to an array containing the attributes of all
334  * frames. At least one frame is available. Please note, it is possible for
335  * a bitmap to appear as containing more frames than existing in this array.
336  * In such case the existing frames are shared by several 'virtual' frames.
337  * This is used mainly in animation or short video sequences.
338  * NoOfSurfaces - Number of low-level surfaces to store the pixel data of
339  * the bitmap frames.
340  * Surfaces - Pointer to an array containing references to low-level
341  * surfaces with the bitmap pixel data.
342  *
343  ******************************************************************************/
344 typedef struct {
345  XInt32 Format;
346  XPoint FrameSize;
347  XInt32 FrameDelay;
348  XInt32 NoOfFrames;
349  XInt32 NoOfVirtFrames;
350  XUInt16 *Mapping;
351  const struct XBmpRes *Resource;
353  XInt32 NoOfSurfaces;
354  struct XSurface **Surfaces;
355 } XBitmap;
356 
357 /******************************************************************************
358  * TYPE:
359  * XFont
360  *
361  * DESCRIPTION:
362  * The structure XFont describes the attributes of a loaded font resource.
363  * XFont serves as the public and abstract representation of a font.
364  *
365  * ELEMENTS:
366  * Ascent - Ascent of the font (means the area above the baseline).
367  * Descent - Descent of the font (means the area below the baseline).
368  * Leading - Leading of the font (additional distance between two rows).
369  * DefChar - Default character code.
370  * Tag - Unique identification of the font. Used to find glyphs within
371  * the glyph cache.
372  * Handle - Reference to the opened font resource. Used to find and load
373  * glyphs.
374  * Name - The name of the respective font resource within Embedded Wizard
375  * project. This information is used to display error messages if glyphs
376  * are missing.
377  *
378  ******************************************************************************/
379 typedef struct {
380  XInt32 Ascent;
381  XInt32 Descent;
382  XInt32 Leading;
383  XChar DefChar;
384  char Reserved[2];
385  unsigned long Tag;
386  unsigned long Handle;
387  const char *Name;
388 } XFont;
389 
390 /******************************************************************************
391  * TYPE:
392  * XGlyphMetrics
393  *
394  * DESCRIPTION:
395  * The structure XGlyphMetrics covers the metrics of a single glyph.
396  *
397  * ELEMENTS:
398  * Size - Size of the glyph in pixel (means the size of the ink-box).
399  * Origin - Upper left corner of the glyph, relative to the current printing
400  * position on the baseline.
401  * Advance - Advance in horizontal direction added to the printing position.
402  *
403  *******************************************************************************/
404 typedef struct {
405  XPoint Size;
406  XPoint Origin;
407  XInt32 Advance;
409 
410 /*******************************************************************************
411  * TYPE:
412  * XBitmapLock
413  *
414  * DESCRIPTION:
415  * The XBitmapLock structure provides adresses to color planes of a previously
416  * locked bitmap. To lock a bitmap, use the function EwLockBitmap(). See the
417  * description of this function for more details about locking and the access
418  * to the bitmap memory.
419  *
420  * Note, the pixel storage depends on the pixel format. For more details see
421  * the 'ewextpxl_XXX.h' file (XXX stands for your target pixel format. e.g.
422  * 'ewextpxl_RGBA8888.h').
423  *
424  * ELEMENTS:
425  * Pixel1 - First color plane pointer. The pointer refers to the first pixel
426  * of the locked bitmap area.
427  * Pitch1X - Distance between two pixel columns of the first color plane in
428  * bytes.
429  * Pitch1Y - Distance between two pixel rows of the first color plane in
430  * bytes.
431  * Pixel2 - Pointer to the second (optional/if any) color plane or zero.
432  * If not zero, the pointer also refers to the first pixel of the locked
433  * bitmap area.
434  * Pitch2X - Distance between two pixel columns of the second color plane
435  * in bytes or zero if not applicable.
436  * Pitch2Y - Distance between two pixel rows of the second color plane in
437  * bytes or zero if not applicable.
438  *
439  *******************************************************************************/
440 typedef struct {
441  void *Pixel1;
442  int Pitch1X;
443  int Pitch1Y;
444  void *Pixel2;
445  int Pitch2X;
446  int Pitch2Y;
447 } XBitmapLock;
448 
449 /*******************************************************************************
450  * TYPE:
451  * XGlyphLock
452  *
453  * DESCRIPTION:
454  * The XGlyphLock structure provides adress to the pixel information of a
455  * previously locked glyph. To lock a glyph, use the function EwLockGlyph().
456  * See the description of this function for more details about locking and the
457  * access to the glyph memory.
458  *
459  * Note, glyphs are stored in the Alpha8 pixel format -> one byte per pixel.
460  * The pixel value 0 determines transparent pixel. The 255 full opaque pixel.
461  * Values 1 .. 254 determine the semitransparent pixel.
462  *
463  * ELEMENTS:
464  * Pixel - Pointer to the glyph pixel memory. The pointer refers to the
465  *first pixel of the locked glyph. PitchX - Distance between two pixel columns.
466  *Is always 1 byte. PitchY - Distance between two pixel rows in bytes.
467  *
468  *******************************************************************************/
469 typedef struct {
470  unsigned char *Pixel;
471  int PitchX;
472  int PitchY;
474 
475 /* Forward declaration */
476 typedef struct XViewport XViewport;
477 
478 /*******************************************************************************
479  * TYPE:
480  * XViewportProc
481  *
482  * DESCRIPTION:
483  * The following type declares a prototype of a user defined function, which
484  * can be passed as callback during the initialization of a viewport.
485  *
486  * This callback function will then be called each time the viewport update
487  * cycle terminates. In this manner some kind of viewport specific completion
488  * can be performed.
489  *
490  * ARGUMENTS:
491  * aViewport - Viewport which is performing the screen update.
492  * aHandle - Reference to the real viewport, the framebuffer, display, etc.
493  * This value depends on the underlying graphics subsystem.
494  * aDisplay1,
495  * aDisplay2,
496  * aDisplay3 - Platform dependent values, where already existing framebuffer
497  * or drawing context, etc. are stored. These values are passed during the
498  * initialization of the viewport (see EwInitViewport()).
499  * aArea - Area modified by the update relative to the top-left corner of
500  * the viewport.
501  *
502  * RETURN VALUE:
503  * None
504  *
505  *******************************************************************************/
506 typedef void (*XViewportProc)(XViewport *aViewport, unsigned long aHandle,
507  void *aDisplay1, void *aDisplay2, void *aDisplay3,
508  XRect aArea);
509 
510 /*******************************************************************************
511  * TYPE:
512  * XViewport
513  *
514  * DESCRIPTION:
515  * The structure XViewport stores the attributes of a viewport. A viewport
516  * provides a kind of abstraction of the physical framebuffer or display
517  * where graphical outputs are drawn.
518  *
519  * ELEMENTS:
520  * Size - Size of the viewport in pixel. This is the area where graphics
521  * outputs will occur.
522  * Bitmap - Internal bitmap object to cover the access to the framebuffer
523  * or to the display where the graphical outputs are drawn.
524  * Frames - The single entry of the bitmap frames array.
525  * Surfaces - The single entry of the bitmap surfaces array.
526  * Surface - Internal surface object to cover the access to the framebuffer
527  * or to the display where the graphical outputs are drawn.
528  * UpdateArea - The area relative to the top-left corner of the viewport for
529  * the currently active update cycle.
530  * Valid - Flag indicating whether the screen update cycle is active. The
531  * screen update begins with EwBeginUpdate() or EwBeginUpdateArea() and ends
532  * with EwEndUpdate(). As long as Valid != 0, the internal bitmap and
533  *surface objects are connected to the framebuffer and thay may be used as the
534  * destination in all drawing operations.
535  * Proc - Optional callback function to call when viewport update has
536  * been done. The callback function can then perform some particular tasks
537  * to complete the screen update, etc. If 0, no callback is called.
538  * Display1,
539  * Display2,
540  * Display3 - Platform dependent values, where already existing framebuffer
541  * or drawing context, etc. are stored. These values are passed during the
542  * initialization of the viewport (see EwInitViewport()).
543  * Handle - Reference to the real viewport, the framebuffer, display, etc.
544  * This value depends on the underlying graphics subsystem.
545  *
546  *******************************************************************************/
547 struct XViewport {
548  XPoint Size;
549  XBitmap Bitmap;
554  XBool Valid;
555  char Reserved[3];
557  void *Display1;
558  void *Display2;
559  void *Display3;
560  unsigned long Handle;
561 };
562 
563 /*******************************************************************************
564  * TYPE:
565  * XAttrSet
566  *
567  * DESCRIPTION:
568  * The structure XAttrSet stores a set of fonts, bitmaps and colors used while
569  * parsing and drawing of attributed strings. The set is a container with a
570  * fixed, predefined number of resource and color entries. The desired size of
571  * the set should be specified in the function call EwCreateAttrSet().
572  *
573  * ELEMENTS:
574  * NoOfFonts - Max. number of fonts.
575  * NoOfBitmaps - Max. number of bitmaps.
576  * NoOfColors - Max. number of colors.
577  * Fonts - Pointer to the list of fonts.
578  * Bitmaps - Pointer to the list of bitmaps.
579  * Colors - Pointer to the list of colors.
580  *
581  *******************************************************************************/
582 typedef struct {
583  XInt32 NoOfFonts;
584  XInt32 NoOfBitmaps;
585  XInt32 NoOfColors;
586  XFont **Fonts;
587  XBitmap **Bitmaps;
588  XColor *Colors;
590 
591 /*******************************************************************************
592  * TYPE:
593  * XAttrLink
594  *
595  * DESCRIPTION:
596  * The structure XAttrLink describes a single link stored within an already
597  * parsed, preprocessed attributed string.
598  *
599  * ELEMENTS:
600  * Name - The name of the link as zero terminated string.
601  * StartPtr,
602  * EndPtr - Pointers to the statements within the attributed string
603  * identifying the position where the first region of the affected link
604  * begins and the last region ends.
605  * NoOfRegions - Number of rectangular areas, the link consists of.
606  * X, Y - Offset to the left/top origin of the group statement
607  * containing the link.
608  *
609  *******************************************************************************/
610 typedef struct {
611  XChar *Name;
612  unsigned short *StartPtr;
613  unsigned short *EndPtr;
614  XInt32 NoOfRegions;
615  XInt32 X;
616  XInt32 Y;
617 } XAttrLink;
618 
619 /*******************************************************************************
620  * TYPE:
621  * XAttrString
622  *
623  * DESCRIPTION:
624  * The structure XAttrString is used to store the content of an already
625  *parsed, preprocessed attributed string. It consists of a lot of drawing
626  *statements, which describe how the attributed string should be drawn on the
627  *screen. These drawing statements are for internal use only. They are binary
628  *coded and optimized for fast drawing operations.
629  *
630  * Before an attributed string can be drawn on the screen, it has to be parsed
631  * (converted) into this internal attributed string format. This is done by
632  *the function EwParseAttrString().
633  *
634  * ELEMENTS:
635  * Size - Length of the parsed, preprocessed attributed string in words.
636  * Data - Pointer to the first statement within the attributed string.
637  * IsRTL - != 0 if the first found paragraph in the attributed string has
638  * the RTL base direction. Otherwise it is 0.
639  * NoOfLinks - Number of links defined within the attributed string.
640  * NamesArea - Size of the area containing the link names in characters.
641  * Links - Pointer to a table with the links.
642  *
643  *******************************************************************************/
644 typedef struct {
645  XInt32 Size;
646  unsigned short *Data;
647  XBool IsRTL;
648  XInt32 NoOfLinks;
649  XInt32 NamesArea;
650  XAttrLink *Links;
651 } XAttrString;
652 
653 /*******************************************************************************
654  * TYPE:
655  * XSubPath
656  *
657  * DESCRIPTION:
658  * The structure XSubPath is used to store the coordinates of a sub-path used
659  * in the XPath structure. In this manner several sub-paths can be managed
660  *from one and the same XPath, every treated individually when stroking or
661  *filling the path area.
662  *
663  * The implementation assumes, that the structure is immediately followed by
664  *an array of 'float' values storing the X, Y coordinate pairs of the sub-path.
665  * The first pair is available in the member 'Data'.
666  *
667  * ELEMENTS:
668  * Capacity - The max. number of edges this sub-path can accomodate in 'Data'
669  * without the necesity to reallocate it.
670  * NoOfEdges - The number of edges stored already in 'Data'.
671  * HasData - If != 0, there are data stored in Data array.
672  * IsOpened - If != 0, the sub-path is opened,
673  * IsClosed - If != 0, the sub-path is closed. This means the first and the
674  * last coordinate pair in 'Data' are equal and the path has been closed
675  * by explicitly calling the function EwClosePath().
676  * IsValid - If != 0, the value 'Bounds' is up to date.
677  * Bounds - Rectangular area enclosing all corners of the sub-path.
678  * Data - The begin of an array containing the edge coordinates. The data
679  * is stored pairwise as X and Y values. The number of coordinate pairs in
680  * the array is equal ( NoOfEdges + 1 ).
681  *
682  *******************************************************************************/
683 typedef struct _XSubPath {
686  XBool HasData;
687  XBool IsOpened;
688  XBool IsClosed;
689  XBool IsValid;
690  XRect Bounds;
691  float Data[2];
692 } XSubPath;
693 
694 /*******************************************************************************
695  * TYPE:
696  * XPathMatrix
697  *
698  * DESCRIPTION:
699  * The structure XPathMatrix is used to store the state of the path matrix in
700  * a single chained list. Every time EwPushPathMatrix() is used, the actual
701  * matrix of a path is copied in a new XPathMatrix object and stored within
702  * the XPath.
703  *
704  * ELEMENTS:
705  * Next - Pointer to the next matrix stored on the stack.
706  * Matrix - The stored content of the matrix.
707  *
708  *******************************************************************************/
709 typedef struct _XPathMatrix {
710  struct _XPathMatrix *Next;
711  float Matrix[6];
712 } XPathMatrix;
713 
714 /*******************************************************************************
715  * TYPE:
716  * XPath
717  *
718  * DESCRIPTION:
719  * The structure XPath is used to store the path information used to fill and
720  * stroke paths by using the functions EwFillPath() and EwStrokePath(). One
721  * path can consist of any number of sub-paths. Every sub-path consists of one
722  * or more edges (straight line segments) connected together. One path can be
723  * considered as opened or closed.
724  *
725  * ELEMENTS:
726  * MaxNoOfSubPaths - The max. number of sub-paths the path can manage.
727  * NoOfOpenedPaths - Counter reflecting the number of sub-paths which are
728  *open. NoOfClosedPaths - Counter reflecting the number of closed sub-paths.
729  * NoOfEdges - The number of edges stored totally in all sub-paths.
730  * IsValid - If != 0, the value 'Bounds' is up to date.
731  * Bounds - Rectangular area enclosing all corners of all sub-path.
732  * Matrix - 3x2 matrix describing transformations to apply on all
733  * shapes added to the path.
734  * MatrixStack - Pointer to a list with stored path matrices.
735  * SubPaths - An array with pointers to the sub-paths managed by this
736  * path.
737  *
738  *******************************************************************************/
739 typedef struct {
740  XInt32 MaxNoOfSubPaths;
741  XInt32 NoOfOpenedPaths;
742  XInt32 NoOfClosedPaths;
743  XInt32 NoOfEdges;
744  XBool IsValid;
745  char Reserved[3];
746  XRect Bounds;
747  float Matrix[6];
748  XPathMatrix *MatrixStack;
749  XSubPath *SubPaths[1];
750 } XPath;
751 
752 /*******************************************************************************
753  * FUNCTION:
754  * EwConfigGraphicsEngine
755  *
756  * DESCRIPTION:
757  * The pseudo function EwConfigGraphicsEngine() setups configuration variables
758  * of the Graphics Engine according to macros found in 'ewconfig.h' file or in
759  * the Make file.
760  *
761  * This function has to be executed before EwInitGraphicsEngine().
762  *
763  * ARGUMENTS:
764  * None
765  *
766  * RETURN VALUE:
767  * None
768  *
769  *******************************************************************************/
770 #define EwConfigGraphicsEngine() \
771  do { \
772  EwMaxSurfaceCacheSize = EW_MAX_SURFACE_CACHE_SIZE; \
773  EwMaxGlyphSurfaceWidth = EW_MAX_GLYPH_SURFACE_WIDTH; \
774  EwMaxGlyphSurfaceHeight = EW_MAX_GLYPH_SURFACE_HEIGHT; \
775  EwMaxIssueTasks = EW_MAX_ISSUE_TASKS; \
776  EwLazyLoadBitmaps = EW_LAZY_LOAD_BITMAPS; \
777  EwLazyLoadBitmapsIfAnimatedOnly = \
778  EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY; \
779  EwDiscardBitmaps = EW_DISCARD_BITMAPS; \
780  EwDiscardBitmapsIfAnimatedOnly = EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY; \
781  EwDiscardBitmapsIfNotUsedInCurrentUpdate = \
782  EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE; \
783  EwDiscardBitmapsIfNotUsedInRecentUpdates = \
784  EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES; \
785  } while (0)
786 
787 /*******************************************************************************
788  * FUNCTION:
789  * EwInitGraphicsEngine
790  *
791  * DESCRIPTION:
792  * The function EwInitGraphicsEngine() initializes the Graphics Engine.
793  *
794  * ARGUMENTS:
795  * aArgs - Optional argument to pass to the init function of the underlying
796  * platform specific adaptation layer.
797  *
798  * RETURN VALUE:
799  * If successful, returns != 0.
800  *
801  *******************************************************************************/
802 int EwInitGraphicsEngine(void *aArgs);
803 
804 /*******************************************************************************
805  * FUNCTION:
806  * EwDoneGraphicsEngine
807  *
808  * DESCRIPTION:
809  * The function EwDoneGraphicsEngine() deinitializes the Graphics Engine. If
810  * necessary, still existing resources will be freed.
811  *
812  * ARGUMENTS:
813  * None
814  *
815  * RETURN VALUE:
816  * None
817  *
818  *******************************************************************************/
819 void EwDoneGraphicsEngine(void);
820 
821 /*******************************************************************************
822  * FUNCTION:
823  * EwEnableGfxTaskTracing
824  *
825  * DESCRIPTION:
826  * The function EwEnableGfxTaskTracing() activates or deactivates the internal
827  * debugging mode of the Graphics Engine. With this mode enabled, the Graphics
828  * Engine prints log messages for every performed drawing operation, resource
829  * loading operation, etc.
830  *
831  * Please note, in order to use the 'task tracing' the Graphics Engine has to
832  * be rebuilt with the macro EW_SUPPORT_GFX_TASK_TRACING defined.
833  *
834  * ARGUMENTS:
835  * aEnable - If this parameter is != 0, the mode is activated. To deactivate
836  * it again, pass 0 in this parameter.
837  *
838  * RETURN VALUE:
839  * None
840  *
841  *******************************************************************************/
842 void EwEnableGfxTaskTracing(int aEnable);
843 
844 /*******************************************************************************
845  * FUNCTION:
846  * EwCreateBitmap
847  *
848  * DESCRIPTION:
849  * The function EwCreateBitmap() creates a new bitmap with the given size and
850  * color format. If no more used, the bitmap should be freed by calling the
851  * function EwFreeBitmap().
852  *
853  * ARGUMENTS:
854  * aFormat - Color format of the bitmap. (See EW_PIXEL_FORMAT_XXX).
855  * aFrameSize - Size of a single bitmap frame.
856  * aFrameDelay - Delay in milliseconds for animated bitmaps. If no animation
857  * is specified for the bitmap, the value == 0.
858  * aNoOfFrames - Number of frames to embed within the bitmap. At least one
859  * frame is created.
860  *
861  * RETURN VALUE:
862  * The function returns the pointer to the XBitmap structure, if the bitmap
863  * was created successfully, otherwise 0.
864  *
865  *******************************************************************************/
866 XBitmap *EwCreateBitmap(int aFormat, XPoint aFrameSize, XInt32 aFrameDelay,
867  XInt32 aNoOfFrames);
868 
869 /*******************************************************************************
870  * FUNCTION:
871  * EwLoadBitmap
872  *
873  * DESCRIPTION:
874  * The function EwLoadBitmap() creates a new bitmap and loads it with the
875  * content of the passed bitmap resource.
876  *
877  * ARGUMENTS:
878  * aResource - Descriptor of the bitmap resource to load. The content of this
879  * descriptor depends on the particular platform system.
880  *
881  * RETURN VALUE:
882  * If sucessful, the function returns a new bitmap initialized with the
883  *content of the resource. If failed, the function returns null.
884  *
885  *******************************************************************************/
886 XBitmap *EwLoadBitmap(const struct XBmpRes *aResource);
887 
888 /*******************************************************************************
889  * FUNCTION:
890  * EwFreeBitmap
891  *
892  * DESCRIPTION:
893  * The function EwFreeBitmap() frees the given bitmap. Bitmaps may be created
894  * by using EwCreateBitmap() or they may be loaded from a bitmap resource by
895  * calling the function EwLoadBitmap().
896  *
897  * ARGUMENTS:
898  * aBitmap - Bitmap to free.
899  *
900  * RETURN VALUE:
901  * None
902  *
903  *******************************************************************************/
904 void EwFreeBitmap(XBitmap *aBitmap);
905 
906 /*******************************************************************************
907  * FUNCTION:
908  * EwLockBitmap
909  *
910  * DESCRIPTION:
911  * The function EwLockBitmap() provides a direct access to the pixel memory of
912  * the given bitmap. The function returns a lock object containing pointers to
913  * memory, where the caller can read/write the bitmap pixel values. Additional
914  * pitch values also returned in the lock object allow the caller to calculate
915  * the desired pixel addresses.
916  *
917  * When finished the access cycle, the function EwUnlockBitmap() should be
918  *used in order to release the lock, update the affected bitmap, flush CPU
919  *caches, etc.
920  *
921  * The memory returned by the function is not guaranteed to be the real video
922  * memory of the bitmap. If necessary, the function will handle the access by
923  * using a shadow memory area. Therefore to limit the effort of memory copy
924  * operations, the desired bitmap area and the access mode should be
925  *specified. Note the three parameters aArea, aRead and aWrite. Depending on the
926  *graphics sub-system these three parameters may affect significantly the
927  *performance.
928  *
929  * If there was not possible to lock the surface, or the desired access mode
930  * is just not supported by the underlying graphics sub-system, the function
931  * fails and returns zero. (e.g. OpenGL based sub-systems usually allow the
932  * write access to bitmaps (textures) only. Read access may fail in this case)
933  *
934  * Note, the pixel storage depends on the pixel format. For more details see
935  * the 'ewextpxl_XXX.h' file (XXX stands for your target pixel format. e.g.
936  * 'ewextpxl_RGBA8888.h').
937  *
938  * ARGUMENTS:
939  * aBitmap - Bitmap to obtain the direct memory access.
940  * aFrameNo - Frame within the destination bitmap affected by the access
941  * operation.
942  * aArea - Area within the frame affected by the access operation (Relative
943  * to the top-left corner of the bitmap frame). This is the area, the caller
944  * intends to read/write the pixel data.
945  * aRead - Is != 0, if the caller intends to read the pixel information
946  * from the bitmap memory. If == 0, the memory content may remain undefined
947  * depending on the underlying graphics sub-system and its video-memory
948  * management.
949  * aWrite - Is != 0, if the caller intends to overwrite the pixel
950  *information within the bitmap memory. If == 0, any modifications within the
951  *memory may remain ignored depending on the underlying graphics sub-system and
952  *its video-memory management.
953  *
954  * RETURN VALUE:
955  * If successful, the function returns a temporary bitmap lock object. If the
956  * intended access is not possible or not supported by the underlying graphics
957  * sub-system, 0 is returned.
958  *
959  *******************************************************************************/
960 XBitmapLock *EwLockBitmap(XBitmap *aBitmap, XInt32 aFrameNo, XRect aArea,
961  XBool aRead, XBool aWrite);
962 
963 /*******************************************************************************
964  * FUNCTION:
965  * EwUnlockBitmap
966  *
967  * DESCRIPTION:
968  * The function EwUnlockBitmap() provides a counterpart to EwLockBitmap().
969  *When called, the function releases the given lock and if necessary, transfers
970  *the memory modifications back to the video memory of the bitmap and flushes
971  *the CPU caches.
972  *
973  * After calling this function, the aLock structure will become invalid.
974  *
975  * ARGUMENTS:
976  * aLock - Lock object returned by the previous EwLockBitmap() call.
977  *
978  * RETURN VALUE:
979  * None
980  *
981  *******************************************************************************/
982 void EwUnlockBitmap(XBitmapLock *aLock);
983 
984 /*******************************************************************************
985  * FUNCTION:
986  * EwModifyBitmapPalette
987  *
988  * DESCRIPTION:
989  * The function EwModifyBitmapPalette() changes color values within the
990  *palette of the given Index8 bitmap. If applied on a non Index8 bitmap, the
991  *function will ignore the operation.
992  *
993  * In case of a multi-frame bitmap, the modification affects all frames within
994  * this bitmap.
995  *
996  * ARGUMENTS:
997  * aBitmap - Index8 bitmap to modify its palette.
998  * aIndex - Number of the first palette entry affected by the modification.
999  * aCount - Number of entries to modify.
1000  * aColors - Array with aCount colors to store within the palette starting
1001  * with palette entry aIndex.
1002  *
1003  * RETURN VALUE:
1004  * None.
1005  *
1006  *******************************************************************************/
1007 void EwModifyBitmapPalette(XBitmap *aBitmap, XInt32 aIndex, XInt32 aCount,
1008  XColor *aColors);
1009 
1010 /*******************************************************************************
1011  * FUNCTION:
1012  * EwFlushBitmap
1013  *
1014  * DESCRIPTION:
1015  * The function EwFlushBitmap() has the job to flush any outstanding drawing
1016  * Graphics Engine operations for this bitmap as destination.
1017  *
1018  * ARGUMENTS:
1019  * aBitmap - Bitmap to flush drawing operations.
1020  *
1021  * RETURN VALUE:
1022  * None
1023  *
1024  *******************************************************************************/
1025 void EwFlushBitmap(XBitmap *aBitmap);
1026 
1027 /*******************************************************************************
1028  * FUNCTION:
1029  * EwLoadFont
1030  *
1031  * DESCRIPTION:
1032  * The function EwLoadFont() creates a new font and loads it with the content
1033  * of the passed font resource.
1034  *
1035  * ARGUMENTS:
1036  * aResource - Descriptor of the font resource to load. The content of this
1037  * descriptor depends on the particular platform system.
1038  *
1039  * RETURN VALUE:
1040  * If sucessful, the function returns a new font initialized with the content
1041  * of the resource. If failed, the function returns null.
1042  *
1043  *******************************************************************************/
1044 XFont *EwLoadFont(const struct XFntRes *aResource);
1045 
1046 /*******************************************************************************
1047  * FUNCTION:
1048  * EwFreeFont
1049  *
1050  * DESCRIPTION:
1051  * The function EwFreeFont() frees the given font. Fonts can be loaded from a
1052  * font resource by calling the function EwLoadFont().
1053  *
1054  * ARGUMENTS:
1055  * aFont - Font to free.
1056  *
1057  * RETURN VALUE:
1058  * None
1059  *
1060  *******************************************************************************/
1061 void EwFreeFont(XFont *aFont);
1062 
1063 /*******************************************************************************
1064  * FUNCTION:
1065  * EwInitViewport
1066  *
1067  * DESCRIPTION:
1068  * The function EwInitViewport() prepares a new viewport. Viewports provide a
1069  * kind of abstraction of the physical framebuffer or display where graphical
1070  * outputs are drawn. Depending on the particular target system there are two
1071  * mayor approaches how Graphics Engine can deal with a framebuffer:
1072  *
1073  * 1. The creation and the initialization of the framebuffer are perfomed by
1074  * the Graphics Engine in the particular platform adaptation layer. In this
1075  * case Graphics Engine maintains the full control and the ownership over
1076  * the framebuffer. The Graphics Engine can show, hide and reconfigure the
1077  * framebuffer every time. Therefore the viewport API provides functions
1078  * which allow the main software or other external software parts to change
1079  * the framebuffer configuration - in a platform independent way.
1080  *
1081  * In this use case, the arguments passed to EwInitViewport() are used to
1082  * create and configure a new framebuffer and finally to arrange it on the
1083  * display. These configuration can be changed later by EwConfigViewport().
1084  *
1085  * 2. The framebuffer creation and its initialization are tasks of the main
1086  * software, external frameworks, the operating system, etc. This means,
1087  * the framebuffer control lies completely beyond the Embedded Wizard. The
1088  * Graphics Engine is limited to draw into this framebuffer. The ownership
1089  * and the framebuffer configuration are aspects of the main software or
1090  * the external framework only.
1091  *
1092  * In this use case, EwInitViewport() receives a reference to an existing
1093  * framebuffer or other kind of graphical context where drawing operation
1094  * will take place and stores it internally. Optionally, EwInitViewport()
1095  * can create a private, internal off-screen surface which is used as the
1096  * framebuffer. When screen update is performed, Graphics Engine copies
1097  * the affected area from the off-screen surface into the framebuffer or
1098  * display passed to the EwInitViewport() function.
1099  *
1100  * After a viewport has been initialized, screen updates can be performed. To
1101  * do this the functions EwBeginUpdate(), EwBeginUpdateArea() and
1102  *EwEndUpdate() are intended. These functions cover the internal aspects of the
1103  *framebuffer access, the double buffering, V-Sync, etc.
1104  *
1105  * If unused anymore, viewports should be freed by EwDoneViewport().
1106  *
1107  * ARGUMENTS:
1108  * aSize - Size of the viewport in pixel. This is the area where graphics
1109  * outputs will occur. Depending on the use case, this parameter determines
1110  * the size of the framebuffer to create or the size of an already existing
1111  * framebuffer to use.
1112  * aExtent - Position and size, where the created framebuffer should be
1113  *shown on the screen. If the size of aExtent differs from aSize, the
1114  *framebuffer content should be scaled in order to fit in the aExtent area.
1115  * Please note: The area is already expressed in coordinates valid within
1116  *the target display by taking in account all particular configuration aspects
1117  * like the default rotation of the surface contents.
1118  * aOrient - Orientation hint. The meaning of this parameter depends on the
1119  * target system. For example, OpenGL target uses aOrient to determine the
1120  * screen rotation in degrees.
1121  * aOpacity - Opacity value for the created framebuffer in the range 0 ..
1122  *255. 0 -> fully transparent. 255 -> fully opaque. aDisplay1, aDisplay2,
1123  * aDisplay3 - Platform dependent parameter, where already existing
1124  *framebuffer or drawing context, etc. are passed. aProc - Optional callback
1125  *function to call when viewport update has been done. The callback function can
1126  *then perform some particular tasks to complete the screen update, etc. If 0,
1127  *no callback is called.
1128  *
1129  * RETURN VALUE:
1130  * If successful, the function returns a new viewport otherwise 0 is returned.
1131  *
1132  *******************************************************************************/
1133 XViewport *EwInitViewport(XPoint aSize, XRect aExtent, XInt32 aOrient,
1134  XInt32 aOpacity, void *aDisplay1, void *aDisplay2,
1135  void *aDisplay3, XViewportProc aProc);
1136 
1137 /*******************************************************************************
1138  * FUNCTION:
1139  * EwDoneViewport
1140  *
1141  * DESCRIPTION:
1142  * The function EwDoneViewport() deinitializes the given viewport. If
1143  *necessary the previously created framebuffers are hidden and video memory is
1144  *released.
1145  *
1146  * ARGUMENTS:
1147  * aViewport - Viewport to deinitialize.
1148  *
1149  * RETURN VALUE:
1150  * None
1151  *
1152  *******************************************************************************/
1153 void EwDoneViewport(XViewport *aViewport);
1154 
1155 /*******************************************************************************
1156  * FUNCTION:
1157  * EwConfigViewport
1158  *
1159  * DESCRIPTION:
1160  * The function EwConfigViewport() changes the configuration of the viewport.
1161  * Generally, the function can modify the settings of framebuffers belonging
1162  * to the viewport.
1163  *
1164  * ARGUMENTS:
1165  * aViewport - Viewport to reconfigure its framebuffer.
1166  * aPos - Position, where the framebuffer should be shown on the screen.
1167  * Please note: The value is already expressed in coordinates valid within
1168  * the target display by taking in account all particular configuration
1169  * aspects like the default rotation of the surface contents.
1170  * aOpacity - Opacity value for the framebuffer in the range 0 .. 255.
1171  * 0 -> fully transparent. 255 -> fully opaque.
1172  *
1173  * RETURN VALUE:
1174  * If successful, the function returns != 0. If the used framebuffer doesn't
1175  * belong to the viewport, or if it doesn't support the parameter modification
1176  * 0 is returned.
1177  *
1178  *******************************************************************************/
1179 int EwConfigViewport(XViewport *aViewport, XPoint aPos, XInt32 aOpacity);
1180 
1181 /*******************************************************************************
1182  * FUNCTION:
1183  * EwBeginUpdate
1184  *
1185  * DESCRIPTION:
1186  * The function EwBeginUpdate() initiates the screen update cycle for the
1187  *given viewport and provides access to its framebuffer via the returned
1188  *temporary bitmap.
1189  *
1190  * The returned bitmap covers the framebuffer and can serve as the destination
1191  * in all drawing operations until the function EwEndUpdate() is called. Due
1192  *to the platform specific framebuffer limitations the returned bitmap may not
1193  *be used as source in the drawing operations.
1194  *
1195  * The bitmap remains valid until EwEndUpdate() is called. Afterwards it may
1196  * not be used.
1197  *
1198  * ARGUMENTS:
1199  * aViewport - Viewport to begin the drawing operations.
1200  *
1201  * RETURN VALUE:
1202  * If successful, the function returns a temporary bitmap providing the access
1203  * to the framebuffer of the viewport.
1204  *
1205  *******************************************************************************/
1206 XBitmap *EwBeginUpdate(XViewport *aViewport);
1207 
1208 /*******************************************************************************
1209  * FUNCTION:
1210  * EwBeginUpdateArea
1211  *
1212  * DESCRIPTION:
1213  * The function EwBeginUpdateArea() initiates the screen update cycle for the
1214  * given viewport and provides access to the specified area of its framebuffer
1215  * via the returned temporary bitmap.
1216  *
1217  * The returned bitmap covers the area of the framebuffer and can serve as the
1218  * destination in all drawing operations until the function EwEndUpdate() is
1219  * called. Due to the platform specific framebuffer limitations the returned
1220  * bitmap may not be used as source in the drawing operations.
1221  *
1222  * The bitmap remains valid until EwEndUpdate() is called. Afterwards it may
1223  * not be used.
1224  *
1225  * ARGUMENTS:
1226  * aViewport - Viewport to begin the drawing operations.
1227  * aArea - Area to update relative to the top-left corner of the viewport.
1228  *
1229  * RETURN VALUE:
1230  * If successful, the function returns a temporary bitmap providing the access
1231  * to the framebuffer of the viewport.
1232  *
1233  *******************************************************************************/
1234 XBitmap *EwBeginUpdateArea(XViewport *aViewport, XRect aArea);
1235 
1236 /*******************************************************************************
1237  * FUNCTION:
1238  * EwEndUpdate
1239  *
1240  * DESCRIPTION:
1241  * The function EwEndUpdate() finalizes the screen update cycle for the given
1242  * viewport. This function flushes all outstanding drawing operations, updates
1243  * the framebuffer state and frees the temporary bitmap object provided by the
1244  * previous EwBeginUpdate() or EwBeginUpdateArea() function call.
1245  *
1246  * Depending on the particular platform double buffering is used or the update
1247  * is synchronized with the V-Sync.
1248  *
1249  * If there was a callback function specified during the initialization of the
1250  * viewport, the function is called at the fin of the update cycle.
1251  *
1252  * ARGUMENTS:
1253  * aViewport - Viewport to finalize the drawing operations.
1254  * aArea - Area modified by the update relative to the top-left corner of
1255  * the viewport.
1256  *
1257  * RETURN VALUE:
1258  * None
1259  *
1260  *******************************************************************************/
1261 void EwEndUpdate(XViewport *aViewport, XRect aArea);
1262 
1263 /*******************************************************************************
1264  * FUNCTION:
1265  * EwFillRectangle
1266  *
1267  * DESCRIPTION:
1268  * The function EwFillRectangle() fills the rectangular area aDstRect of the
1269  * bitmap aDst with a color gradient specified by the four color parameters
1270  * aColorTL .. aColorBL.
1271  *
1272  * An additional clipping area aClipRect limits the operation. All pixel lying
1273  * outside this area will not be drawn. The last aBlend parameter controls the
1274  * mode how drawn pixel are combined with the pixel already existing in the
1275  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
1276  * the background, otherwise the drawn pixel will overwrite the old content.
1277  *
1278  * ARGUMENTS:
1279  * aDst - Destination bitmap.
1280  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
1281  * operation.
1282  * aClipRect - Area to limit the drawing operation (Relative to the top-left
1283  * corner of the destination bitmap frame).
1284  * aDstRect - Area to fill with the color gradient (Relative to the top-
1285  * left corner of the destination bitmap frame).
1286  * aColorTL,
1287  * aColorTR,
1288  * aColorBR,
1289  * aColorBL - Color values corresponding to the four corners of aDstRect.
1290  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
1291  * in the background.
1292  *
1293  * RETURN VALUE:
1294  * None
1295  *
1296  *******************************************************************************/
1297 void EwFillRectangle(XBitmap *aDst, XInt32 aDstFrameNo, XRect aClipRect,
1298  XRect aDstRect, XColor aColorTL, XColor aColorTR,
1299  XColor aColorBR, XColor aColorBL, XBool aBlend);
1300 
1301 /*******************************************************************************
1302  * FUNCTION:
1303  * EwDrawBorder
1304  *
1305  * DESCRIPTION:
1306  * The function EwDrawBorder() draws a rectangle border within the area
1307  * aDstRect of the bitmap aDst with a color gradient specified by the four
1308  * color parameters aColorTL .. aColorBL. The parameter aEdgeWidth determines
1309  * the width of the border's edge.
1310  *
1311  * An additional clipping area aClipRect limits the operation. All pixel lying
1312  * outside this area will not be drawn. The last aBlend parameter controls the
1313  * mode how drawn pixel are combined with the pixel already existing in the
1314  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
1315  * the background, otherwise the drawn pixel will overwrite the old content.
1316  *
1317  * ARGUMENTS:
1318  * aDst - Destination bitmap.
1319  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
1320  * operation.
1321  * aClipRect - Area to limit the drawing operation (Relative to the top-left
1322  * corner of the destination bitmap frame).
1323  * aDstRect - Area to draw the border with color gradient (Relative to the
1324  * top-left corner of the destination bitmap frame).
1325  * aEdgeWidth - The width of the border in pixel.
1326  * aColorTL,
1327  * aColorTR,
1328  * aColorBR,
1329  * aColorBL - Color values corresponding to the four corners of aDstRect.
1330  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
1331  * in the background.
1332  *
1333  * RETURN VALUE:
1334  * None
1335  *
1336  *******************************************************************************/
1337 void EwDrawBorder(XBitmap *aDst, XInt32 aDstFrameNo, XRect aClipRect,
1338  XRect aDstRect, XInt32 aEdgeWidth, XColor aColorTL,
1339  XColor aColorTR, XColor aColorBR, XColor aColorBL,
1340  XBool aBlend);
1341 
1342 /*******************************************************************************
1343  * FUNCTION:
1344  * EwCreatePath
1345  *
1346  * DESCRIPTION:
1347  * The function EwCreatePath() creates a new path and reserves memory for up
1348  * aMaxNoOfSubPaths sub-paths. The sub-paths are initially empty. Before data
1349  * can be stored in a sub-path the function EwInitSubPath() should be called.
1350  *
1351  * Once the path is prepared and loaded with coordinate information, the path
1352  * can be passed to the EwFillPath() and EwStrokePath() functions. If not
1353  * used anymore the path should be freed by using the function EwFreePath().
1354  *
1355  * ARGUMENTS:
1356  * aMaxNoOfSubPaths - Max. number of sub-paths the new path can manage.
1357  *
1358  * RETURN VALUE:
1359  * If successful, the function returns a pointer to the newly created path.
1360  * Otherwise the function returns 0.
1361  *
1362  *******************************************************************************/
1363 XPath *EwCreatePath(XInt32 aMaxNoOfSubPaths);
1364 
1365 /*******************************************************************************
1366  * FUNCTION:
1367  * EwCreatePathFromSVGString
1368  *
1369  * DESCRIPTION:
1370  * The function EwCreatePathFromSVGString() creates a new path according to
1371  * SVG path instructions found in the passed aSVGString parameter.
1372  *
1373  * ARGUMENTS:
1374  * aSVGString - String containing the SVG instructions.
1375  * aScaleX,
1376  * aScaleY - Scaling factor to apply on the original SVG coordinates. The
1377  * values affect also how smooth curves are composed from line segments.
1378  * The larger a curve the more segments are used.
1379  * aDeltaX,
1380  * aDeltaY - Additional offset to add to the original SVG coordinates.
1381  * This results in a translation of the SVG path.
1382  * aAngle - Additional angle to apply a rotation transformation on the
1383  * original SVG coordinates. The angle is expressed in degree and measured
1384  * clockwise relative to the positive X-axis. The rotation is performed
1385  * around the origin position (X:0, Y:0) of the original SVG coordinates.
1386  *
1387  * RETURN VALUE:
1388  * If successful, the function returns a pointer to the newly created path.
1389  * Otherwise the function returns 0. If the specified SVG string contains
1390  * errors, the function stops and returns the already prepared path without
1391  * evaluating further SVG data. The success of the operation or error status
1392  * can be queried by the functions EwGetSVGParserStatus() and
1393  * EwGetSVGParserErrorPos().
1394  *
1395  *******************************************************************************/
1396 XPath *EwCreatePathFromSVGString(XString aSVGString, XFloat aScaleX,
1397  XFloat aScaleY, XFloat aDeltaX, XFloat aDeltaY,
1398  XFloat aAngle);
1399 
1400 /*******************************************************************************
1401  * FUNCTION:
1402  * EwGetSVGParserStatus
1403  *
1404  * DESCRIPTION:
1405  * The function EwGetSVGParserStatus() returns the status resulting from the
1406  * preceding invocation of the function EwCreatePathFromSVGString(). Possible
1407  * values are defined in the macros EW_SVG_PARSER_XXX.
1408  *
1409  * ARGUMENTS:
1410  * None
1411  *
1412  * RETURN VALUE:
1413  * Returns EW_SVG_PARSER_SUCCESS if the parsed SVG string did not contain any
1414  * errors. Otherwise another value defined in EW_SVG_PARSER_XXX is returned.
1415  * In such case use the function EwGetSVGParserErrorPos() to get the position
1416  * within the parsed SVG string, which has raised the error status.
1417  *
1418  *******************************************************************************/
1419 int EwGetSVGParserStatus(void);
1420 
1421 /*******************************************************************************
1422  * FUNCTION:
1423  * EwGetSVGParserErrorPos
1424  *
1425  * DESCRIPTION:
1426  * The function EwGetSVGParserErrorPos() returns the position within the SVG
1427  * string at which the function EwCreatePathFromSVGString() has encountered an
1428  * error. To query the error status use the function EwGetSVGParserStatus().
1429  *
1430  * ARGUMENTS:
1431  * None
1432  *
1433  * RETURN VALUE:
1434  * Returns the position (in characters) within the SVG string starting with 0
1435  * for the first character. In the case there is no error recorded, a value -1
1436  * is returned.
1437  *
1438  *******************************************************************************/
1440 
1441 /*******************************************************************************
1442  * FUNCTION:
1443  * EwFreePath
1444  *
1445  * DESCRIPTION:
1446  * The function EwFreePath() frees the memory occupied by the path and its all
1447  * sub-paths.
1448  *
1449  * ARGUMENTS:
1450  * aPath - Pointer to the path to free.
1451  *
1452  * RETURN VALUE:
1453  * None
1454  *
1455  *******************************************************************************/
1456 void EwFreePath(XPath *aPath);
1457 
1458 /*******************************************************************************
1459  * FUNCTION:
1460  * EwGetMaxNoOfSubPaths
1461  *
1462  * DESCRIPTION:
1463  * The function EwGetMaxNoOfSubPaths() returns how many sub-paths the given
1464  * path can maximally store. The returned value corresponds to the parameter
1465  * passed in the invocation of the EwCreatePath() function.
1466  *
1467  * ARGUMENTS:
1468  * aPath - Pointer to the path to query the information.
1469  *
1470  * RETURN VALUE:
1471  * If successful, the function returns the max. number of sub-path the path
1472  * can store. Otherwise the function returns 0.
1473  *
1474  *******************************************************************************/
1476 
1477 /*******************************************************************************
1478  * FUNCTION:
1479  * EwInitSubPath
1480  *
1481  * DESCRIPTION:
1482  * The function EwInitSubPath() prepares a sub-path to be able to store up to
1483  * aMaxNoOfEdges path edges. With this operation memory for the sub-path data
1484  * is reserved. Initially the just initialized sub-path is considered as being
1485  * still empty. To fill the sub-path with edge coordinates use the functions
1486  * EwAddSubPathLine(), EwAddSubPathArc(), etc.
1487  *
1488  * If the affected sub-path has been already initialized in the past, the old
1489  * information is discarded before initializing the new sub-path.
1490  *
1491  * ARGUMENTS:
1492  * aPath - Pointer to the path to initialize the sub-path.
1493  * aSubPathNo - Number identifying the sub-path within aPath to initialize.
1494  * The first sub-path has the number 0. The second 1, and so far.
1495  * aMaxNoOfEdges - The max. number of edges you intend to store in the sub-
1496  * path. This is the max. capacity for the sub-path. Passing 0 (zero) in
1497  * this parameter results in the existing sub-path data being released and
1498  * the sub-path is considered as empty again.
1499  *
1500  * RETURN VALUE:
1501  * If successful, the function returns != 0. If there is no available memory
1502  * for the sub-path allocation, 0 is returned.
1503  *
1504  *******************************************************************************/
1505 XBool EwInitSubPath(XPath *aPath, XInt32 aSubPathNo, XInt32 aMaxNoOfEdges);
1506 
1507 /*******************************************************************************
1508  * FUNCTION:
1509  * EwBeginSubPath
1510  *
1511  * DESCRIPTION:
1512  * The function EwBeginSubPath() sets the start position for the sub-path. The
1513  * affected sub-path has to be initialized previously by calling the function
1514  * EwInitSubPath(). Beginning with the position, the path can be filled with
1515  * edges by calling functions like EwAddSubPathLine(), EwAddSubPathBezier2(),
1516  * etc.
1517  *
1518  * Every sub-path contains exact one begin position. Calling this function for
1519  * a sub-path being already filled with edge coordinates will clear the actual
1520  * sub-path coordinate data and sets the new begin position.
1521  *
1522  * ARGUMENTS:
1523  * aPath - Pointer to the path containing the affected sub-path.
1524  * aSubPathNo - Number identifying the sub-path within aPath to configure. The
1525  * first sub-path has the number 0. The second 1, and so far.
1526  * aX, aY - The coordinates to be used as the start position for the sub-
1527  * path. The position is transformed by using the path transformation
1528  *matrix. See functions like EwScalePathMatrix(), EwRotatePathMatrix(), etc.
1529  *
1530  * RETURN VALUE:
1531  * None
1532  *
1533  *******************************************************************************/
1534 void EwBeginSubPath(XPath *aPath, XInt32 aSubPathNo, XFloat aX, XFloat aY);
1535 
1536 /*******************************************************************************
1537  * FUNCTION:
1538  * EwAddSubPathLine
1539  *
1540  * DESCRIPTION:
1541  * The function EwAddSubPathLine() appends at the actual position in the sub-
1542  * path a new straight line segment consisting of one edge. Then the sub-path
1543  * actual position is moved to the end of the just added line.
1544  *
1545  * The actual position results from the end position of the preceding sub-path
1546  * segment or it is the value specified in EwBeginSubPath() invocation. If the
1547  * sub-path is empty and no start position has been specified in the preceding
1548  * EwBeginSubPath() invocation, the function assumes the start position is
1549  *X=0, Y=0.
1550  *
1551  * ARGUMENTS:
1552  * aPath - Pointer to the path containing the affected sub-path.
1553  * aSubPathNo - Number identifying the sub-path within aPath to add the line.
1554  * The first sub-path has the number 0. The second 1, and so far.
1555  * aX, aY - The coordinates to be used as the end position for the new
1556  *line segment. The position is transformed by using the path transformation
1557  * matrix. See functions like EwScalePathMatrix(), EwRotatePathMatrix(),
1558  *etc.
1559  *
1560  * RETURN VALUE:
1561  * Returns the index of the node within the sub-path where the end position
1562  * of the new line segment has bee stored. Knowing this index, the position
1563  * can be modified later by using the function EwSetSubPathNode().
1564  *
1565  * If the sub-path has not been initialized previously by calling the function
1566  * EwInitSubPath(), the sub-path has been closed by EwCloseSubPath() or the
1567  * entire memory reserved for the sub-path is already occupied by other path
1568  * information, the function fails and returns 0.
1569  *
1570  *******************************************************************************/
1571 XInt32 EwAddSubPathLine(XPath *aPath, XInt32 aSubPathNo, XFloat aX, XFloat aY);
1572 
1573 /*******************************************************************************
1574  * FUNCTION:
1575  * EwAddSubPathBezier2
1576  *
1577  * DESCRIPTION:
1578  * The function EwAddSubPathBezier2() appends at the actual position in the
1579  * sub-path a new quadratic Bézier curve composed of exact aNoOfEdges straight
1580  * line segments. Then the sub-path actual position is moved to the end of the
1581  * just added curve.
1582  *
1583  * The actual position results from the end position of the preceding sub-path
1584  * segment or it is the value specified in EwBeginSubPath() invocation. If the
1585  * sub-path is empty and no start position has been specified in the preceding
1586  * EwBeginSubPath() invocation, the function assumes the start position is
1587  *X=0, Y=0.
1588  *
1589  * ARGUMENTS:
1590  * aPath - Pointer to the path containing the affected sub-path.
1591  * aSubPathNo - Number identifying the sub-path within aPath to add the curve.
1592  * The first sub-path has the number 0. The second 1, and so far.
1593  * aCPX, aCPY - The coordinates of the Bézier curve control point. The
1594  *position is transformed by using the path transformation matrix. See functions
1595  *like EwScalePathMatrix(), EwRotatePathMatrix(), etc. aX, aY - The
1596  *coordinates to be used as the end position for the Bézier curve. The position
1597  *is transformed by using the path transformation matrix. See functions like
1598  *EwScalePathMatrix(), EwRotatePathMatrix(), etc. aNoOfEdges - Number of
1599  *straight line segments the Bézier curve should be composed of. The more edges
1600  *the smoother the resulting curve.
1601  *
1602  * RETURN VALUE:
1603  * Returns the index of the node within the sub-path where the position of the
1604  * first Bézier line segment has bee stored. Knowing this index and the number
1605  * of segments the Bézier curve is composed of (aNoOfEdges), the position of
1606  * every Bézier line segment can be modified later. See EwSetSubPathNode().
1607  *
1608  * If the sub-path has not been initialized previously by calling the function
1609  * EwInitSubPath(), the sub-path has been closed by EwCloseSubPath() or there
1610  * is no sufficient memory in the sub-path for the new Bézier curve segments,
1611  * the function fails and returns 0.
1612  *
1613  *******************************************************************************/
1614 XInt32 EwAddSubPathBezier2(XPath *aPath, XInt32 aSubPathNo, XFloat aCPX,
1615  XFloat aCPY, XFloat aX, XFloat aY,
1616  XInt32 aNoOfEdges);
1617 
1618 /*******************************************************************************
1619  * FUNCTION:
1620  * EwAddSubPathBezier3
1621  *
1622  * DESCRIPTION:
1623  * The function EwAddSubPathBezier3() appends at the actual position in the
1624  * sub-path a new cubic Bézier curve composed of exact aNoOfEdges straight
1625  *line segments. Then the sub-path actual position is moved to the end of the
1626  *just added curve.
1627  *
1628  * The actual position results from the end position of the preceding sub-path
1629  * segment or it is the value specified in EwBeginSubPath() invocation. If the
1630  * sub-path is empty and no start position has been specified in the preceding
1631  * EwBeginSubPath() invocation, the function assumes the start position is
1632  *X=0, Y=0.
1633  *
1634  * ARGUMENTS:
1635  * aPath - Pointer to the path containing the affected sub-path.
1636  * aSubPathNo - Number identifying the sub-path within aPath to add the
1637  * curve. The first sub-path has the number 0. The second 1, and so far.
1638  * aCP1X, aCP1Y - The coordinates of the first Bézier curve control point. The
1639  * position is transformed by using the path transformation matrix. See
1640  * functions like EwScalePathMatrix(), EwRotatePathMatrix(), etc.
1641  * aCP2X, aCP2Y - The coordinates of the second Bézier curve control point.
1642  *The position is transformed by using the path transformation matrix. See
1643  * functions like EwScalePathMatrix(), EwRotatePathMatrix(), etc.
1644  * aX, aY - The coordinates to be used as the end position for the
1645  *Bézier curve. The position is transformed by using the path transformation
1646  *matrix. See functions like EwScalePathMatrix(), EwRotatePathMatrix(), etc.
1647  * aNoOfEdges - Number of straight line segments the Bézier curve should be
1648  * composed of. The more edges the smoother the resulting curve.
1649  *
1650  * RETURN VALUE:
1651  * Returns the index of the node within the sub-path where the position of the
1652  * first Bézier line segment has bee stored. Knowing this index and the number
1653  * of segments the Bézier curve is composed of (aNoOfEdges), the position of
1654  * every Bézier line segment can be modified later. See EwSetSubPathNode().
1655  *
1656  * If the sub-path has not been initialized previously by calling the function
1657  * EwInitSubPath(), the sub-path has been closed by EwCloseSubPath() or there
1658  * is no sufficient memory in the sub-path for the new Bézier curve segments,
1659  * the function fails and returns 0.
1660  *
1661  *******************************************************************************/
1662 XInt32 EwAddSubPathBezier3(XPath *aPath, XInt32 aSubPathNo, XFloat aCP1X,
1663  XFloat aCP1Y, XFloat aCP2X, XFloat aCP2Y, XFloat aX,
1664  XFloat aY, XInt32 aNoOfEdges);
1665 
1666 /*******************************************************************************
1667  * FUNCTION:
1668  * EwAddSubPathArc
1669  *
1670  * DESCRIPTION:
1671  * The function EwAddSubPathArc() adds to the sub-path a new arc curve
1672  *composed of exact aNoOfEdges straight line segments. If the sub-path contains
1673  *already any segment information, the start of the arc curve is connected with
1674  *the end of the last segment by an additional straight line.
1675  *
1676  * Similarly, if start position for the sub-path has been specified by using
1677  * EwBeginSubPath(), an additional line segment is added to connect the curve
1678  * with the specified sub-path start position.
1679  *
1680  * After the curve is stored in the path, the sub-path actual position is
1681  *moved to refer to the end position of the arc.
1682  *
1683  * ARGUMENTS:
1684  * aPath - Pointer to the path containing the affected sub-path.
1685  * aSubPathNo - Number identifying the sub-path within aPath to add the
1686  *curve. The first sub-path has the number 0. The second 1, and so far.
1687  * aCenterX,
1688  * aCenterY - The coordinates of the center of the arc to calculate. The
1689  * position is transformed by using the path transformation matrix. See
1690  * functions like EwScalePathMatrix(), EwRotatePathMatrix(), etc.
1691  * aRadiusX,
1692  * aRadiusY - Radius if the arc in X and Y direction.
1693  * aStartAngle,
1694  * aEndAngle - Start- and end-angle of the arc expressed in degree and
1695  * measured clockwise relative to the positive X-axis.
1696  * aNoOfEdges - Number of straight line segments the arc curve should be
1697  * composed of. The more edges the smoother the resulting curve.
1698  *
1699  * RETURN VALUE:
1700  * Returns the index of the node within the sub-path where the start position
1701  * of the first arc line segment has bee stored. Knowing this index and the
1702  * number of segments the arc curve is composed of (aNoOfEdges), the position
1703  * of every arc line segment can be modified later. See EwSetSubPathNode().
1704  *
1705  * If the sub-path has not been initialized previously by calling the function
1706  * EwInitSubPath(), the sub-path has been closed by EwCloseSubPath() or there
1707  * is no sufficient memory in the sub-path for the new arc curve segments, the
1708  * function fails and returns 0.
1709  *
1710  *******************************************************************************/
1711 XInt32 EwAddSubPathArc(XPath *aPath, XInt32 aSubPathNo, XFloat aCenterX,
1712  XFloat aCenterY, XFloat aRadiusX, XFloat aRadiusY,
1713  XFloat aStartAngle, XFloat aEndAngle, XInt32 aNoOfEdges);
1714 
1715 /*******************************************************************************
1716  * FUNCTION:
1717  * EwAddSubPathCopy
1718  *
1719  * DESCRIPTION:
1720  * The function EwAddSubPathCopy() adds to the sub-path a copy of another sub-
1721  * path. In this manner contents from different paths can be combined together
1722  * without the necessity to re-calculate them again.
1723  *
1724  * If the destination sub-path contains already any segment information, the
1725  * start of the copied source sub-path is connected with the end of the last
1726  * segment by an additional straight line.
1727  *
1728  * Similarly, if start position for the sub-path has been specified by using
1729  * EwBeginSubPath(), an additional line segment is added to connect it with
1730  * the copied sub-path.
1731  *
1732  * If the transformation matrix of the destination path has been configured,
1733  * the copied source coordinates are transformed by using the matrix. (See
1734  * EwTranslatePath(), EwScalePath(), etc.)
1735  *
1736  * After the copy is stored in the path, the sub-path actual position is moved
1737  * to refer to the end position of the copied sub-path.
1738  *
1739  * ARGUMENTS:
1740  * aPath - Pointer to the destination path containing the affected
1741  * sub-path to add the copy.
1742  * aSubPathNo - Number identifying the sub-path within aPath to add the
1743  * copy. The first sub-path has the number 0. The second 1, and so far.
1744  * aSrcPath - Pointer to the source path containing the sub-path to copy.
1745  * aSrcSubPathNo - Number identifying the sub-path within aSrcPath to create
1746  * a copy. The first sub-path has the number 0. The second 1, and so far.
1747  * aSrcNodeNo - The number of the node in the source sub-path to start the
1748  * copy operation. If this parameter is == 0, the operation starts with the
1749  * first node (the begin) of the source sub-path.
1750  * aNoOfEdges - The number of edges to copy from the source sub-path
1751  * beginning with the node specified in the parameter aSrcNodeNo. In total,
1752  * ( aNoOfEdges + 1 ) will be copied. Specifying -1 in this parameter means
1753  * that all edges until the source sub-path end should be copied. If there
1754  * are less edges available in the source path, the function fails.
1755  *
1756  * RETURN VALUE:
1757  * Returns the index of the node within the destination sub-path where the
1758  * start position of the first copied segment has bee stored. Knowing this
1759  * index and the number of copied segments the, the position of every segment
1760  * can be modified later. See EwSetSubPathNode().
1761  *
1762  * If the sub-path has not been initialized previously by calling the function
1763  * EwInitSubPath(), the sub-path has been closed by EwCloseSubPath(), there
1764  * is no sufficient memory in the destination sub-path for the complete copy
1765  * of the source sub-path or the source sub-path or the requested nodes do
1766  * not exist, the function fails and returns 0.
1767  *
1768  *******************************************************************************/
1769 XInt32 EwAddSubPathCopy(XPath *aPath, XInt32 aSubPathNo, XPath *aSrcPath,
1770  XInt32 aSrcSubPathNo, XInt32 aSrcNodeNo,
1771  XInt32 aNoOfEdges);
1772 
1773 /*******************************************************************************
1774  * FUNCTION:
1775  * EwCloseSubPath
1776  *
1777  * DESCRIPTION:
1778  * The function EwCloseSubPath() marks the affected sub-path as closed. The
1779  * function verifies whether the first and last position of the path are equal
1780  * and if this is not the case, adds an additional line segment to the path in
1781  * order to close it.
1782  *
1783  * Once the function is called, no additional path information can be added to
1784  * the affected path unless it is initialized again by using EwInitSubPath()
1785  * or cleared by using EwBeginSubPath().
1786  *
1787  * ARGUMENTS:
1788  * aPath - Pointer to the path containing the affected sub-path.
1789  * aSubPathNo - Number identifying the sub-path within aPath to close. The
1790  * first sub-path has the number 0. The second 1, and so far.
1791  *
1792  * RETURN VALUE:
1793  * None
1794  *
1795  *******************************************************************************/
1796 void EwCloseSubPath(XPath *aPath, XInt32 aSubPathNo);
1797 
1798 /*******************************************************************************
1799  * FUNCTION:
1800  * EwShiftSubPathNodes
1801  *
1802  * DESCRIPTION:
1803  * The function EwShiftSubPathNodes() removes from the sub-path the specified
1804  * number of leading coordinate values. This results in the sub-path content
1805  * being shifted and the number of sub-path edges being reduced by the given
1806  * aNoOfNodes parameter. Thereupon new edge data can be appended to the path,
1807  * e.g. by using the function EwAddSubPathLine().
1808  *
1809  * Applying the function on a sub-path closed by a preceding EwCloseSubPath()
1810  * is not possible and causes the function to return without any modification
1811  * on the sub-path data.
1812  *
1813  * Moreover, the operation is limited to leave at least one node in the path.
1814  * In other words, it is not possible to clear the path completely. Use the
1815  * functions EwBeginSubPath() or EwInitSubPath() in such application cases.
1816  *
1817  * ARGUMENTS:
1818  * aPath - Pointer to the path containing the affected sub-path.
1819  * aSubPathNo - Number identifying the sub-path within aPath to close. The
1820  * first sub-path has the number 0. The second 1, and so far.
1821  * aNoOfNodes - The number of X,Y coordinate pairs to remove from the sub-
1822  * path starting with the very first node # 0.
1823  * aTranslateX,
1824  * aTranslateY - Offset to add to all coordinates after the content is
1825  * shifted.
1826  *
1827  * RETURN VALUE:
1828  * Returns the number of nodes removed from the sub-path or 0 if the sub-path
1829  * doesn't exist, is not initialized (see EwInitSubPath()), is empty or it has
1830  * been closed by preceding EwCloseSubPath() invocation.
1831  *
1832  *******************************************************************************/
1833 XInt32 EwShiftSubPathNodes(XPath *aPath, XInt32 aSubPathNo, XInt32 aNoOfNodes,
1834  XFloat aTranslateX, XFloat aTranslateY);
1835 
1836 /*******************************************************************************
1837  * FUNCTION:
1838  * EwSetSubPathNode
1839  *
1840  * DESCRIPTION:
1841  * The function EwSetSubPathNode() modifies the X,Y coordinate of the given
1842  * node within the path. In this manner it is not necessary to re-initialize
1843  * and re-calculate the complete path if only few path corners do move.
1844  *
1845  * Trying to modify a not existing node is ignored.
1846  *
1847  * ARGUMENTS:
1848  * aPath - Pointer to the path containing the affected sub-path.
1849  * aSubPathNo - Number identifying the sub-path within aPath to modify a
1850  *node. The first sub-path has the number 0. The second 1, and so far. aNodeNo
1851  *- The path node (the corner) affected by the modification. The nodes are
1852  *counted starting with 0. aX, aY - The coordinates to assign to the
1853  *affected node. The position is transformed by using the path transformation
1854  *matrix. See functions like EwScalePathMatrix(), EwRotatePathMatrix(), etc.
1855  *
1856  * RETURN VALUE:
1857  * None
1858  *
1859  *******************************************************************************/
1860 void EwSetSubPathNode(XPath *aPath, XInt32 aSubPathNo, XInt32 aNodeNo,
1861  XFloat aX, XFloat aY);
1862 
1863 /*******************************************************************************
1864  * FUNCTION:
1865  * EwGetSubPathNodeX
1866  *
1867  * DESCRIPTION:
1868  * The function EwGetSubPathNodeX() returns the X coordinate of the given
1869  * node within the path.
1870  *
1871  * ARGUMENTS:
1872  * aPath - Pointer to the path containing the affected sub-path.
1873  * aSubPathNo - Number identifying the sub-path within aPath to get the node
1874  * coordinate. The first sub-path has the number 0. The second 1, and so
1875  *far. aNodeNo - The path node (the corner) affected by the query
1876  *ioperation. The nodes are counted starting with 0.
1877  *
1878  * RETURN VALUE:
1879  * Returns the X coordinate stored in the specified node or 0.0 if the sub-
1880  * path doesn't exist, is not initialized (see EwInitSubPath()) or the desired
1881  * node is not available in the sub-apth.
1882  *
1883  *******************************************************************************/
1884 XFloat EwGetSubPathNodeX(XPath *aPath, XInt32 aSubPathNo, XInt32 aNodeNo);
1885 
1886 /*******************************************************************************
1887  * FUNCTION:
1888  * EwGetSubPathNodeY
1889  *
1890  * DESCRIPTION:
1891  * The function EwGetSubPathNodeY() returns the Y coordinate of the given
1892  * node within the path.
1893  *
1894  * ARGUMENTS:
1895  * aPath - Pointer to the path containing the affected sub-path.
1896  * aSubPathNo - Number identifying the sub-path within aPath to get the node
1897  * coordinate. The first sub-path has the number 0. The second 1, and so
1898  *far. aNodeNo - The path node (the corner) affected by the query
1899  *ioperation. The nodes are counted starting with 0.
1900  *
1901  * RETURN VALUE:
1902  * Returns the Y coordinate stored in the specified node or 0.0 if the sub-
1903  * path doesn't exist, is not initialized (see EwInitSubPath()) or the desired
1904  * node is not available in the sub-apth.
1905  *
1906  *******************************************************************************/
1907 XFloat EwGetSubPathNodeY(XPath *aPath, XInt32 aSubPathNo, XInt32 aNodeNo);
1908 
1909 /*******************************************************************************
1910  * FUNCTION:
1911  * EwGetNoOfSubPathEdges
1912  *
1913  * DESCRIPTION:
1914  * The function EwGetNoOfSubPathEdges() returns how many edges (straight line
1915  * segments) the affected sub-path actually store.
1916  *
1917  * ARGUMENTS:
1918  * aPath - Pointer to the path containing the affected sub-path.
1919  * aSubPathNo - Number identifying the sub-path within aPath to query the
1920  * information. The first sub-path has the number 0. The second 1, and so
1921  * far.
1922  *
1923  * RETURN VALUE:
1924  * Returns the number of edges existing actually in the sub-path or 0 if the
1925  * sub-path doesn't exist, is not initialized (see EwInitSubPath()) or is
1926  * empty.
1927  *
1928  *******************************************************************************/
1929 XInt32 EwGetNoOfSubPathEdges(XPath *aPath, XInt32 aSubPathNo);
1930 
1931 /*******************************************************************************
1932  * FUNCTION:
1933  * EwGetNoOfFreeSubPathEdges
1934  *
1935  * DESCRIPTION:
1936  * The function EwGetNoOfFreeSubPathEdges() returns how many edges (straight
1937  * line segments) can still be added to the affected sub-path.
1938  *
1939  * ARGUMENTS:
1940  * aPath - Pointer to the path containing the affected sub-path.
1941  * aSubPathNo - Number identifying the sub-path within aPath to query the
1942  * information. The first sub-path has the number 0. The second 1, and so
1943  * far.
1944  *
1945  * RETURN VALUE:
1946  * Returns the number of edges the sub-path can additionally accomodate or 0
1947  * if the sub-path doesn't exist, is not initialized (see EwInitSubPath()), is
1948  * closed (see EwCloseSubPath()) or is full.
1949  *
1950  *******************************************************************************/
1951 XInt32 EwGetNoOfFreeSubPathEdges(XPath *aPath, XInt32 aSubPathNo);
1952 
1953 /*******************************************************************************
1954  * FUNCTION:
1955  * EwIsSubPathClosed
1956  *
1957  * DESCRIPTION:
1958  * The function EwIsSubPathClosed() returns != 0 if the affected sub-path has
1959  * been closed by calling the function EwCloseSubPath(). Once closed, no new
1960  * path segments can be added to the sub-path.
1961  *
1962  * ARGUMENTS:
1963  * aPath - Pointer to the path containing the affected sub-path.
1964  * aSubPathNo - Number identifying the sub-path within aPath to query the
1965  * information. The first sub-path has the number 0. The second 1, and so
1966  * far.
1967  *
1968  * RETURN VALUE:
1969  * Returns != 0 if the sub-path has been closed.
1970  *
1971  *******************************************************************************/
1972 XBool EwIsSubPathClosed(XPath *aPath, XInt32 aSubPathNo);
1973 
1974 /*******************************************************************************
1975  * FUNCTION:
1976  * EwGetSubPathBounds
1977  *
1978  * DESCRIPTION:
1979  * The function EwGetSubPathBounds() returns the rectangular area enclosing
1980  * all nodes of the affected sub-path. The position and the size of the area
1981  * are rounded to the near integer value.
1982  *
1983  * ARGUMENTS:
1984  * aPath - Pointer to the path containing the affected sub-path.
1985  * aSubPathNo - Number identifying the sub-path within aPath to query the
1986  * information. The first sub-path has the number 0. The second 1, and so
1987  * far.
1988  *
1989  * RETURN VALUE:
1990  * Returns the area. If the specified sub-path does not exist, the function
1991  * returns an empty rectangle.
1992  *
1993  *******************************************************************************/
1994 XRect EwGetSubPathBounds(XPath *aPath, XInt32 aSubPathNo);
1995 
1996 /*******************************************************************************
1997  * FUNCTION:
1998  * EwGetPathBounds
1999  *
2000  * DESCRIPTION:
2001  * The function EwGetPathBounds() returns the rectangular area enclosing all
2002  * nodes of all sub-paths of the given path. The position and the size of the
2003  * area are rounded to the near integer value.
2004  *
2005  * ARGUMENTS:
2006  * aPath - Pointer to the path to query the information.
2007  *
2008  * RETURN VALUE:
2009  * Returns the area. If the specified path does not contain any edges, the
2010  * function returns an empty rectangle.
2011  *
2012  *******************************************************************************/
2013 XRect EwGetPathBounds(XPath *aPath);
2014 
2015 /*******************************************************************************
2016  * FUNCTION:
2017  * EwTranslatePathMatrix
2018  *
2019  * DESCRIPTION:
2020  * The function EwTranslatePathMatrix() applies the given displacement to the
2021  * path matrix. This corresponds to the translation of the origin of the path
2022  * coordinate system by the given values in the X- and Y-direction.
2023  *
2024  * The modification of the path matrix affects the position of line segments
2025  * added later to the sub-paths of the path.
2026  *
2027  * ARGUMENTS:
2028  * aPath - Pointer to the path to apply the transformation.
2029  * aDeltaX,
2030  * aDeltaY - Displacement to apply on the transformation matrix.
2031  *
2032  * RETURN VALUE:
2033  * None
2034  *
2035  *******************************************************************************/
2036 void EwTranslatePathMatrix(XPath *aPath, XFloat aDeltaX, XFloat aDeltaY);
2037 
2038 /*******************************************************************************
2039  * FUNCTION:
2040  * EwScalePathMatrix
2041  *
2042  * DESCRIPTION:
2043  * The function EwScalePathMatrix() applies the given factors to the path
2044  * matrix. This corresponds to the scaling of the path coordinate system by
2045  * the given values in the X- and Y-direction.
2046  *
2047  * The modification of the path matrix affects the position of line segments
2048  * added later to the sub-paths of the path.
2049  *
2050  * ARGUMENTS:
2051  * aPath - Pointer to the path to apply the transformation.
2052  * aScaleX,
2053  * aScaleY - Scaling factors to apply on the transformation matrix.
2054  *
2055  * RETURN VALUE:
2056  * None
2057  *
2058  *******************************************************************************/
2059 void EwScalePathMatrix(XPath *aPath, XFloat aScaleX, XFloat aScaleY);
2060 
2061 /*******************************************************************************
2062  * FUNCTION:
2063  * EwRotatePathMatrix
2064  *
2065  * DESCRIPTION:
2066  * The function EwRotatePathMatrix() applies the given angle to the path
2067  *matrix. This corresponds to the rotation of the path coordinate system around
2068  *its origin position.
2069  *
2070  * The modification of the path matrix affects the position of line segments
2071  * added later to the sub-paths of the path.
2072  *
2073  * ARGUMENTS:
2074  * aPath - Pointer to the path to apply the transformation.
2075  * aAngle - Rotation angle to apply on the transformation matrix. The angle is
2076  * expressed in degree and measured clockwise.
2077  *
2078  * RETURN VALUE:
2079  * None
2080  *
2081  *******************************************************************************/
2082 void EwRotatePathMatrix(XPath *aPath, XFloat aAngle);
2083 
2084 /*******************************************************************************
2085  * FUNCTION:
2086  * EwPushPathMatrix
2087  *
2088  * DESCRIPTION:
2089  * The function EwPushPathMatrix() stores the current state of the path matrix
2090  * on its internal stack. This is very useful during creation of complex
2091  *paths.
2092  *
2093  * To restore the matrix again use the function EwPopPathMatrix().
2094  *
2095  * ARGUMENTS:
2096  * aPath - Pointer to the path to store its matrix.
2097  *
2098  * RETURN VALUE:
2099  * None
2100  *
2101  *******************************************************************************/
2102 void EwPushPathMatrix(XPath *aPath);
2103 
2104 /*******************************************************************************
2105  * FUNCTION:
2106  * EwPopPathMatrix
2107  *
2108  * DESCRIPTION:
2109  * The function EwPopPathMatrix() restores the current state of the path
2110  *matrix from its internal stack. The matrix has to be stored by the preceding
2111  *call to the EwPushPathMatrix() function.
2112  *
2113  * If the stack is already empty, the identity matrix is loaded.
2114  *
2115  * ARGUMENTS:
2116  * aPath - Pointer to the path to restore its matrix.
2117  *
2118  * RETURN VALUE:
2119  * None
2120  *
2121  *******************************************************************************/
2122 void EwPopPathMatrix(XPath *aPath);
2123 
2124 /*******************************************************************************
2125  * FUNCTION:
2126  * EwInitPathMatrix
2127  *
2128  * DESCRIPTION:
2129  * The function EwInitPathMatrix() loads the identity matrix in the path.
2130  *
2131  * ARGUMENTS:
2132  * aPath - Pointer to the path to load the matrix.
2133  *
2134  * RETURN VALUE:
2135  * None
2136  *
2137  *******************************************************************************/
2138 void EwInitPathMatrix(XPath *aPath);
2139 
2140 /*******************************************************************************
2141  * FUNCTION:
2142  * EwFillPath
2143  *
2144  * DESCRIPTION:
2145  * The function EwFillPath() fills within the rectangular area aDstRect of
2146  * the given bitmap aDst a polygon determined by the data stored in aPath. The
2147  * polygon is filled with a color gradient specified by the four color
2148  * parameters aColorTL .. aColorBL.
2149  *
2150  * An additional clipping area aClipRect limits the operation. All pixel lying
2151  * outside this area will not be drawn. The last aBlend parameter controls the
2152  * mode how drawn pixel are combined with the pixel already existing in the
2153  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2154  * the background, otherwise the drawn pixel will overwrite the old content.
2155  *
2156  * ARGUMENTS:
2157  * aDst - Destination bitmap.
2158  * aPath - Data object providing the path information consisting of
2159  * one or more sub-paths. Sub-paths, which are opened, are automatically
2160  * closed by connecting their start and end positions with a straight line
2161  * segment. All path coordinates are assumed as being relative to the top-
2162  * left corner of the aDstRect area, or if aFlipY is != 0, relative to the
2163  * bottom-left corner.
2164  * aDstFrameNo - Frame within the destination bitmap affected by the
2165  * drawing operation.
2166  * aClipRect - Area to limit the drawing operation (Relative to the top-
2167  * left corner of the destination bitmap frame).
2168  * aDstRect - Area to fill with the color gradient (Relative to the
2169  *top- left corner of the destination bitmap frame). aFlipY - If != 0,
2170  *the coordinate system of the path is vertically mirrored and its origin is
2171  *moved to the bottom-left edge of aDstRect. aOffset - Offset to move
2172  *the origin of the path coordinate system. Changing this value scrolls the
2173  *displayed path content. aColorTL, aColorTR, aColorBR, aColorBL - Color
2174  *values corresponding to the four corners of aDstRect. aBlend - If !=
2175  *0, the drawn pixel will be alpha-blended with the pixel in the background.
2176  * aAntialiased - If != 0, the function applies antialiasing to the pixel.
2177  * The antialiasing is based on supersampling with 4 samples in X and Y
2178  * direction.
2179  * aNonZeroWinding - Controls the fill rule to be used by the algorithm. If
2180  * this parameter is == 0, the even-odd fill rule is used. If this parameter
2181  * is != 0, the non-zero winding rule is used.
2182  *
2183  * RETURN VALUE:
2184  * None
2185  *
2186  *******************************************************************************/
2187 void EwFillPath(XBitmap *aDst, XPath *aPath, XInt32 aDstFrameNo,
2188  XRect aClipRect, XRect aDstRect, XBool aFlipY, XPoint aOffset,
2189  XColor aColorTL, XColor aColorTR, XColor aColorBR,
2190  XColor aColorBL, XBool aBlend, XBool aAntialiased,
2191  XBool aNonZeroWinding);
2192 
2193 /*******************************************************************************
2194  * FUNCTION:
2195  * EwStrokePath
2196  *
2197  * DESCRIPTION:
2198  * The function EwStrokePath() strokes within the rectangular area aDstRect of
2199  * the given bitmap aDst a path determined by the data stored in aPath. The
2200  * path is stroked with line thickness specified in the parameter aWidth and
2201  * color gradient specified by the four color parameters aColorTL .. aColorBL.
2202  * With the parameter aStyle the cap and join points of the path are
2203  *configured.
2204  *
2205  * An additional clipping area aClipRect limits the operation. All pixel lying
2206  * outside this area will not be drawn. The last aBlend parameter controls the
2207  * mode how drawn pixel are combined with the pixel already existing in the
2208  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2209  * the background, otherwise the drawn pixel will overwrite the old content.
2210  *
2211  * ARGUMENTS:
2212  * aDst - Destination bitmap.
2213  * aPath - Data object providing the path information consisting of
2214  * one or more sub-paths. Sub-paths, which are opened, are automatically
2215  * closed by connecting their start and end positions with a straight line
2216  * segment. All path coordinates are assumed as being relative to the top-
2217  * left corner of the aDstRect area, or if aFlipY is != 0, relative to the
2218  * bottom-left corner.
2219  * aDstFrameNo - Frame within the destination bitmap affected by the
2220  * drawing operation.
2221  * aClipRect - Area to limit the drawing operation (Relative to the top-
2222  * left corner of the destination bitmap frame).
2223  * aDstRect - Area to fill with the color gradient (Relative to the
2224  *top- left corner of the destination bitmap frame). aFlipY - If != 0,
2225  *the coordinate system of the path is vertically mirrored and its origin is
2226  *moved to the bottom-left edge of aDstRect. aOffset - Offset to move
2227  *the origin of the path coordinate system. Changing this value scrolls the
2228  *displayed path content. aWidth - The width in pixel to stroke the
2229  *path. aStyle - Flags specifying how the path caps and join points
2230  *should appear. See the enumeration EW_PATH_CAP_XXX and EW_PATH_JOIN_XXX.
2231  * aMiterLimit - In case aStyle is configured with EW_PATH_JOIN_MITER,
2232  *this parameter imposes a limit on the ratio between the miter length and the
2233  * half of the line thickness aWidth. If the limit is exceeded for a corner,
2234  * the corner appears as bevel (EW_PATH_JOIN_BEVEL) instead of miter.
2235  * aColorTL,
2236  * aColorTR,
2237  * aColorBR,
2238  * aColorBL - Color values corresponding to the four corners of
2239  *aDstRect. aBlend - If != 0, the drawn pixel will be alpha-blended
2240  *with the pixel in the background. aAntialiased - If != 0, the function
2241  *applies antialiasing to the pixel. The antialiasing is based on supersampling
2242  *with 4 samples in X and Y direction.
2243  *
2244  * RETURN VALUE:
2245  * None
2246  *
2247  *******************************************************************************/
2248 void EwStrokePath(XBitmap *aDst, XPath *aPath, XInt32 aDstFrameNo,
2249  XRect aClipRect, XRect aDstRect, XBool aFlipY, XPoint aOffset,
2250  XFloat aWidth, XUInt32 aStyle, XFloat aMiterLimit,
2251  XColor aColorTL, XColor aColorTR, XColor aColorBR,
2252  XColor aColorBL, XBool aBlend, XBool aAntialiased);
2253 
2254 /*******************************************************************************
2255  * FUNCTION:
2256  * EwGetBitmapFromFillPath
2257  *
2258  * DESCRIPTION:
2259  * The function EwGetBitmapFromFillPath() creates an ALPHA8 bitmap consisting
2260  * of a single frame in the size aSize and fills within the bitmap a polygon
2261  * determined by the data stored in aPath. Finally, the function returns the
2262  * bitmap. Such bitmap can be used in copy operations to speed-up the screen
2263  * update without the necessity to rasterize the polygon again and again.
2264  *
2265  * ARGUMENTS:
2266  * aSize - Size of the bitmap to create.
2267  * aPath - Data object providing the path information consisting of
2268  * one or more sub-paths. Sub-paths, which are opened, are automatically
2269  * closed by connecting their start and end positions with a straight line
2270  * segment. All path coordinates are assumed as being relative to the top-
2271  * left corner of the bitmap area, or if aFlipY is != 0, relative to the
2272  * bottom-left corner.
2273  * aFlipY - If != 0, the coordinate system of the path is vertically
2274  * mirrored and its origin is moved to the bottom-left edge of the bitmap.
2275  * aOffset - Offset to move the origin of the path coordinate system.
2276  * Changing this value scrolls the displayed path content.
2277  * aAntialiased - If != 0, the function applies antialiasing to the pixel.
2278  * The antialiasing is based on supersampling with 4 samples in X and Y
2279  * direction.
2280  * aNonZeroWinding - Controls the fill rule to be used by the algorithm. If
2281  * this parameter is == 0, the even-odd fill rule is used. If this parameter
2282  * is != 0, the non-zero winding rule is used.
2283  *
2284  * RETURN VALUE:
2285  * If successful, the function returns the just created bitmap. If the path
2286  * is empty or the operation fails, the function returns 0.
2287  *
2288  *******************************************************************************/
2289 XBitmap *EwGetBitmapFromFillPath(XPoint aSize, XPath *aPath, XBool aFlipY,
2290  XPoint aOffset, XBool aAntialiased,
2291  XBool aNonZeroWinding);
2292 
2293 /*******************************************************************************
2294  * FUNCTION:
2295  * EwGetBitmapFromStrokePath
2296  *
2297  * DESCRIPTION:
2298  * The function EwGetBitmapFromStrokePath() creates an ALPHA8 bitmap
2299  *containing a single frame in the size aSize and strokes within it a path
2300  *determined by the data stored in aPath. The path is stroked with line
2301  *thickness specified in the parameter aWidth. With the parameter aStyle the cap
2302  *and join points of the path are configured. Finally, the function returns the
2303  *bitmap. Such bitmap can be used in copy operations to speed-up the screen
2304  *update without the necessity to rasterize the polygon again and again.
2305  *
2306  * ARGUMENTS:
2307  * aSize - Size of the bitmap to create.
2308  * aPath - Data object providing the path information consisting of
2309  * one or more sub-paths. Sub-paths, which are opened, are automatically
2310  * closed by connecting their start and end positions with a straight line
2311  * segment. All path coordinates are assumed as being relative to the top-
2312  * left corner of the bitmap area, or if aFlipY is != 0, relative to the
2313  * bottom-left corner.
2314  * aFlipY - If != 0, the coordinate system of the path is vertically
2315  * mirrored and its origin is moved to the bottom-left edge of the bitmap.
2316  * aOffset - Offset to move the origin of the path coordinate system.
2317  * Changing this value scrolls the displayed path content.
2318  * aWidth - The width in pixel to stroke the path.
2319  * aStyle - Flags specifying how the path caps and join points should
2320  * appear. See the enumeration EW_PATH_CAP_XXX and EW_PATH_JOIN_XXX.
2321  * aMiterLimit - In case aStyle is configured with EW_PATH_JOIN_MITER,
2322  *this parameter imposes a limit on the ratio between the miter length and the
2323  * half of the line thickness aWidth. If the limit is exceeded for a corner,
2324  * the corner appears as bevel (EW_PATH_JOIN_BEVEL) instead of miter.
2325  * aAntialiased - If != 0, the function applies antialiasing to the pixel.
2326  * The antialiasing is based on supersampling with 4 samples in X and Y
2327  * direction.
2328  *
2329  * RETURN VALUE:
2330  * If successful, the function returns the just created bitmap. If the path
2331  * is empty or the operation fails, the function returns 0.
2332  *
2333  *******************************************************************************/
2334 XBitmap *EwGetBitmapFromStrokePath(XPoint aSize, XPath *aPath, XBool aFlipY,
2335  XPoint aOffset, XFloat aWidth,
2336  XUInt32 aStyle, XFloat aMiterLimit,
2337  XBool aAntialiased);
2338 
2339 /*******************************************************************************
2340  * FUNCTION:
2341  * EwCopyBitmap
2342  *
2343  * DESCRIPTION:
2344  * The function EwCopyBitmap() copies a rectangular area from the bitmap aSrc
2345  * to the bitmap aDst. The areas affected by this operation are determined by
2346  * the both arguments aDstRect and aSrcPos. Optionally the copied pixel can be
2347  * modulated by a color gradient specified by the four parameters aColorTL ..
2348  * aColorBL.
2349  *
2350  * An additional clipping area aClipRect limits the operation. All pixel lying
2351  * outside this area will not be drawn. The last aBlend parameter controls the
2352  * mode how drawn pixel are combined with the pixel already existing in the
2353  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2354  * the background, otherwise the drawn pixel will overwrite the old content.
2355  *
2356  * ARGUMENTS:
2357  * aDst - Destination bitmap.
2358  * aSrc - Source bitmap.
2359  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
2360  * operation.
2361  * aSrcFrameNo - Source bitmap frame affected by the operation.
2362  * aClipRect - Area to limit the drawing operation (Relative to the top-left
2363  * corner of the destination bitmap frame).
2364  * aDstRect - Area to fill with the copied pixel (Relative to the top-left
2365  * corner of the destination bitmap frame).
2366  * aSrcPos - Origin of the area to copy from the source bitmap (Relative
2367  * to the top-left corner of the source bitmap frame). The size of the
2368  * source area corresponds to the size of the destination area as it is
2369  * specified in aDstRect.
2370  * aColorTL,
2371  * aColorTR,
2372  * aColorBR,
2373  * aColorBL - Color values corresponding to the four corners of aDstRect.
2374  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
2375  * in the background.
2376  *
2377  * RETURN VALUE:
2378  * None
2379  *
2380  *******************************************************************************/
2381 void EwCopyBitmap(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo,
2382  XInt32 aSrcFrameNo, XRect aClipRect, XRect aDstRect,
2383  XPoint aSrcPos, XColor aColorTL, XColor aColorTR,
2384  XColor aColorBR, XColor aColorBL, XBool aBlend);
2385 
2386 /*******************************************************************************
2387  * FUNCTION:
2388  * EwTileBitmap
2389  *
2390  * DESCRIPTION:
2391  * The function EwTileBitmap() fills the rectangular area aDstRect of the aDst
2392  * bitmap with multiple copies of an area aSrcRect from the bitmap aSrc. The
2393  * copied pixel can optionally be modulated by a color gradient specified by
2394  * the four color parameters aColorTL .. aColorBL.
2395  *
2396  * An additional clipping area aClipRect limits the operation. All pixel lying
2397  * outside this area will not be drawn. The last aBlend parameter controls the
2398  * mode how drawn pixel are combined with the pixel already existing in the
2399  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2400  * the background, otherwise the drawn pixel will overwrite the old content.
2401  *
2402  * ARGUMENTS:
2403  * aDst - Destination bitmap.
2404  * aSrc - Source bitmap.
2405  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
2406  * operation.
2407  * aSrcFrameNo - Source bitmap frame affected by the operation.
2408  * aClipRect - Area to limit the drawing operation (Relative to the top-left
2409  * corner of the destination bitmap frame).
2410  * aDstRect - Area to fill with the copied pixel (Relative to the top-left
2411  * corner of the destination bitmap frame).
2412  * aSrcRect - Area to copy from the source bitmap (Relative to the top-left
2413  * corner of the source bitmap frame).
2414  * aSrcPos - Position within the source area to start the operation. This
2415  * is an offset, which allows the scrolling of the drawn content within the
2416  * destination area. The source position has to lie within the aSrcRect.
2417  * aColorTL,
2418  * aColorTR,
2419  * aColorBR,
2420  * aColorBL - Color values corresponding to the four corners of aDstRect.
2421  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
2422  * in the background.
2423  *
2424  * RETURN VALUE:
2425  * None
2426  *
2427  *******************************************************************************/
2428 void EwTileBitmap(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo,
2429  XInt32 aSrcFrameNo, XRect aClipRect, XRect aDstRect,
2430  XRect aSrcRect, XPoint aSrcPos, XColor aColorTL,
2431  XColor aColorTR, XColor aColorBR, XColor aColorBL,
2432  XBool aBlend);
2433 
2434 /*******************************************************************************
2435  * FUNCTION:
2436  * EwWarpBitmap
2437  *
2438  * DESCRIPTION:
2439  * The function EwWarpBitmap() performs the projection of a rectangular source
2440  * bitmap area on a 4 corner polygon within the destination bitmap. The kind
2441  * of transformation is predetermined by the given polygon coordinates. That
2442  * way scaling, rotating, mirroring and even 3D perspective warp effects can
2443  * be performed. In case of a perspective correct projection, the coefficients
2444  * aW1 .. aW4 controls the perspective warp.
2445  *
2446  * Please note that only convex polygons can be drawn with this technique.
2447  * Drawing non convex polygons can produce unexpected outputs depending on the
2448  * underlying graphics subsystem or the 3D hardware engine.
2449  *
2450  * When performing the projection, the function assumes that the 4 corners of
2451  * of the source bitmap area are mapped to the four corners of the destination
2452  * polygon. The top-left source corner corresponds to the first polygon
2453  *corner. The top-right to the second, bottom-right to the third and the
2454  *bottom-left to the fourth.
2455  *
2456  * The copied pixel can optionally be modulated by a color gradient specified
2457  * by the four color parameters aColor1 .. aColor4.
2458  *
2459  * An additional clipping area aClipRect limits the operation. All pixel lying
2460  * outside this area will not be drawn. The last aBlend parameter controls the
2461  * mode how drawn pixel are combined with the pixel already existing in the
2462  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2463  * the background, otherwise the drawn pixel will overwrite the old content.
2464  *
2465  * ARGUMENTS:
2466  * aDst - Destination bitmap.
2467  * aSrc - Source bitmap.
2468  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
2469  * operation.
2470  * aSrcFrameNo - Source bitmap frame affected by the operation.
2471  * aClipRect - Area to limit the drawing operation (Relative to the top-left
2472  * corner of the destination bitmap frame).
2473  * aDstX1,
2474  * aDstY1,
2475  * aDstW1,
2476  * ...
2477  * aDstX4,
2478  * aDstY4,
2479  * aDstW4 - Coordinates of the polygon to fill with the source bitmap as
2480  * floating point values for sub-pixel precision (Relative to the top-left
2481  * corner of the destination bitmap frame).
2482  * aSrcRect - Area to copy from the source bitmap (Relative to the top-left
2483  * corner of the source bitmap frame).
2484  * aColor1,
2485  * aColor2,
2486  * aColor3,
2487  * aColor4 - Color values corresponding to the four corners of the
2488  *polygon. aBlend - If != 0, the drawn pixel will be alpha-blended with the
2489  *pixel in the background. aFilter - If != 0, the source bitmap pixel will
2490  *be bi-linear filtered in order to get better output.
2491  *
2492  * RETURN VALUE:
2493  * None
2494  *
2495  *******************************************************************************/
2496 void EwWarpBitmap(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo,
2497  XInt32 aSrcFrameNo, XRect aClipRect, XFloat aDstX1,
2498  XFloat aDstY1, XFloat aDstW1, XFloat aDstX2, XFloat aDstY2,
2499  XFloat aDstW2, XFloat aDstX3, XFloat aDstY3, XFloat aDstW3,
2500  XFloat aDstX4, XFloat aDstY4, XFloat aDstW4, XRect aSrcRect,
2501  XColor aColor1, XColor aColor2, XColor aColor3,
2502  XColor aColor4, XBool aBlend, XBool aFilter);
2503 
2504 /*******************************************************************************
2505  * FUNCTION:
2506  * EwDrawLine
2507  *
2508  * DESCRIPTION:
2509  * The function EwDrawLine() draws a line between the coordinates aDstPos1 and
2510  * aDstPos2 within the destination bitmap aDst. The line will be drawn with a
2511  * color gradient specified by the both color values aColor1 and aColor2.
2512  *
2513  * An additional clipping area aClipRect limits the operation. All pixel lying
2514  * outside this area will not be drawn. The last aBlend parameter controls the
2515  * mode how drawn pixel are combined with the pixel already existing in the
2516  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2517  * the background, otherwise the drawn pixel will overwrite the old content.
2518  *
2519  * ARGUMENTS:
2520  * aDst - Destination bitmap.
2521  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
2522  * operation.
2523  * aClipRect - Area to limit the drawing operation (Relative to the top-left
2524  * corner of the destination bitmap frame).
2525  * aDstPos1,
2526  * aDstPos2 - Start and end coordinates of the line (Relative to the top-
2527  * left corner of the destination bitmap frame).
2528  * aColor1,
2529  * aColor2 - Color values corresponding to the start and end of the line.
2530  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
2531  * in the background.
2532  *
2533  * RETURN VALUE:
2534  * None
2535  *
2536  *******************************************************************************/
2537 void EwDrawLine(XBitmap *aDst, XInt32 aDstFrameNo, XRect aClipRect,
2538  XPoint aDstPos1, XPoint aDstPos2, XColor aColor1,
2539  XColor aColor2, XBool aBlend);
2540 
2541 /*******************************************************************************
2542  * FUNCTION:
2543  * EwDrawText
2544  *
2545  * DESCRIPTION:
2546  * The function EwDrawText() prints a single text row within the destination
2547  * bitmap aDst. The font and the characters to draw are specified in aFont and
2548  * aString. The area, where the text will be drawn is defined by aDstRect and
2549  * by aSrcPos. The copied pixel are modulated by a color gradient specified by
2550  * the four color parameters aColorTL .. aColorBL.
2551  *
2552  * The parameter aMinWidth controls optionally the minimum width of the text
2553  *to draw. If applied, the function extends white space characters in order to
2554  * stretch the text. By using this parameter justified text output is
2555  *possible.
2556  *
2557  * An additional clipping area aClipRect limits the operation. All pixel lying
2558  * outside this area will not be drawn. The last aBlend parameter controls the
2559  * mode how drawn pixel are combined with the pixel already existing in the
2560  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2561  * the background, otherwise the drawn pixel will overwrite the old content.
2562  *
2563  * ARGUMENTS:
2564  * aDst - Destination bitmap.
2565  * aFont - Font to draw the glyphs.
2566  * aString - Text to process.
2567  * aCount - Maximum number of text characters to draw or -1 if the
2568  *entire text should be drawn. aDstFrameNo - Frame within the destination
2569  *bitmap affected by the drawing operation. aClipRect - Area to limit the
2570  *drawing operation (Relative to the top-left corner of the destination bitmap
2571  *frame). aDstRect - Area to fill with the text glyphs (Relative to the
2572  *top-left corner of the destination bitmap frame). aSrcPos - Displacement
2573  *for the text baseline position relative to the corner of aDstRect, which by
2574  *taking in account the specified aOrientation parameter serves as the origin
2575  *for the drawing operation. aMinWidth - Minimum width of the text to draw.
2576  *If text width is less than aMinWidth, white space characters will be stretched
2577  *automatically. aOrientation - Orientation how to rotate the text. This
2578  *parameter can assume the values 0, 90, 180 or 270. The specified aOrientation
2579  *implies the corner of aDstRect serving as the origin relative to which the
2580  *text is drawn. For example, if aOrientation is 270, the text is drawn relative
2581  *to the bottom- right corner of aDstRect. aColorTL, aColorTR, aColorBR,
2582  * aColorBL - Color values corresponding to the four corners of aDstRect.
2583  * aBlend - If != 0, the drawn pixel will be alpha-blended with the
2584  *pixel in the background.
2585  *
2586  * RETURN VALUE:
2587  * None
2588  *
2589  *******************************************************************************/
2590 void EwDrawText(XBitmap *aDst, XFont *aFont, XChar *aString, XInt32 aCount,
2591  XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect,
2592  XPoint aSrcPos, XInt32 aMinWidth, XInt32 aOrientation,
2593  XColor aColorTL, XColor aColorTR, XColor aColorBR,
2594  XColor aColorBL, XBool aBlend);
2595 
2596 /*******************************************************************************
2597  * FUNCTION:
2598  * EwGetTextExtent
2599  *
2600  * DESCRIPTION:
2601  * The function EwGetTextExtent() calculates an area required to draw the text
2602  * aString with the font aFont. The size of the resulting rectangle determines
2603  * the space where character glyphs will be drawn. The origin of the rectangle
2604  * specifies the distance between a print position and the first drawn glyph.
2605  *
2606  * The origin of the calculated area can be passed as aSrcPos to the function
2607  * EwDrawText(), if seamless text output relative to the top-left corner of
2608  * the destination area is desired.
2609  *
2610  * ARGUMENTS:
2611  * aFont - Font to use for the text extent calculation.
2612  * aString - Text to process.
2613  * aCount - Maximum number of text characters to evaluate or -1 if the entire
2614  * text should be evaluated.
2615  *
2616  * RETURN VALUE:
2617  * Returns the rectangular area needed to display the string.
2618  *
2619  *******************************************************************************/
2620 XRect EwGetTextExtent(XFont *aFont, XChar *aString, XInt32 aCount);
2621 
2622 /*******************************************************************************
2623  * FUNCTION:
2624  * EwGetTextAdvance
2625  *
2626  * DESCRIPTION:
2627  * The function EwGetTextAdvance() calculates the advance of the entire text
2628  * aString with the font aFont. The value is calculated by the sum of advance
2629  * values of glyphs to display the text.
2630  *
2631  * ARGUMENTS:
2632  * aFont - Font to use for the text calculation.
2633  * aString - Text to process.
2634  * aCount - Maximum number of text characters to evaluate or -1 if the entire
2635  * text should be evaluated.
2636  *
2637  * RETURN VALUE:
2638  * Returns the advance width of the text to display.
2639  *
2640  *******************************************************************************/
2641 XInt32 EwGetTextAdvance(XFont *aFont, XChar *aString, XInt32 aCount);
2642 
2643 /*******************************************************************************
2644  * FUNCTION:
2645  * EwGetTextColumnAtPosition
2646  *
2647  * DESCRIPTION:
2648  * The function EwGetTextColumnAtPosition() determines the character number in
2649  * the given text aString, which corresponds to a glyph enclosing the position
2650  * aX when aString would be printed by using the font aFont. The algorithm to
2651  * calculate the position is equal to the used by EwDrawText() to raster the
2652  * text.
2653  *
2654  * The parameter aMinWidth controls optionally the minimum width of the text.
2655  * If applied, the function assumes all white space characters to be extended
2656  * in order to stretch the text. By using this parameter justified text output
2657  * is possible.
2658  *
2659  * ARGUMENTS:
2660  * aFont - Font to be used for the calculation.
2661  * aString - Text to process.
2662  * aCount - Maximum number of text characters to draw or -1 if the entire
2663  * text should be drawn.
2664  * aX - Position in pixel relative to the left edge of the text row
2665  * as if it would be rasterized by EwDrawText().
2666  * aMinWidth - Minimum width of the text to consider. If text width is less
2667  * than aMinWidth, the function will calculate with white space characters
2668  * being stretched accordingly.
2669  *
2670  * RETURN VALUE:
2671  * Returns the number of the character in the string corresponding to a glyph
2672  * enclosing the position aX. The first character has the number 0, the second
2673  * 1, and so far. If aX lies on the left of the first character the function
2674  * returns -1; If aX lies on the right of the last character, the function
2675  * returns the number of the character following it, which corresponds to the
2676  * number of characters in aString.
2677  *
2678  *******************************************************************************/
2679 XInt32 EwGetTextColumnAtPosition(XFont *aFont, XChar *aString, XInt32 aCount,
2680  XInt32 aX, XInt32 aMinWidth);
2681 
2682 /*******************************************************************************
2683  * FUNCTION:
2684  * EwGetPositionAtTextColumn
2685  *
2686  * DESCRIPTION:
2687  * The function EwGetPositionForTextColumn() determines the start position for
2688  * the glyph corresponding to the character aColumn within the string aString
2689  * when aString would be printed by using the font aFont. The algorithm to
2690  * calculate the position is equal to the used by EwDrawText() to raster the
2691  * text.
2692  *
2693  * The parameter aMinWidth controls optionally the minimum width of the text.
2694  * If applied, the function assumes all white space characters to be extended
2695  * in order to stretch the text. By using this parameter justified text output
2696  * is possible.
2697  *
2698  * ARGUMENTS:
2699  * aFont - Font to be used for the calculation.
2700  * aString - Text to process.
2701  * aCount - Maximum number of text characters to draw or -1 if the entire
2702  * text should be drawn.
2703  * aColumn - Number of the interesting character. The first character has
2704  * the number 0, the second 1, and so far.
2705  * aMinWidth - Minimum width of the text to consider. If text width is less
2706  * than aMinWidth, the function will calculate with white space characters
2707  * being stretched accordingly.
2708  *
2709  * RETURN VALUE:
2710  * Returns the position in pixel of the found glyph relative to the left edge
2711  * of the text row as if it would be rasterized by EwDrawText(). If aColumn
2712  * is < 0, the function returns -1; If aColumn addresses a character not
2713  * existing in the string, the function returns the total length of the
2714  *string.
2715  *
2716  *******************************************************************************/
2717 XInt32 EwGetPositionAtTextColumn(XFont *aFont, XChar *aString, XInt32 aCount,
2718  XInt32 aColumn, XInt32 aMinWidth);
2719 
2720 /*******************************************************************************
2721  * FUNCTION:
2722  * EwIsGlyphAvailable
2723  *
2724  * DESCRIPTION:
2725  * The function EwIsGlyphAvailable() verifies, whether the given glyph is
2726  * available in the font.
2727  *
2728  * ARGUMENTS:
2729  * aFont - Font to verify the glyph existence.
2730  * aCharCode - Character code of the glyph.
2731  *
2732  * RETURN VALUE:
2733  * If the glyph is available in the font, the function returns != 0. Otherwise
2734  * 0 (zero) is returned.
2735  *
2736  *******************************************************************************/
2737 int EwIsGlyphAvailable(XFont *aFont, XChar aCharCode);
2738 
2739 /*******************************************************************************
2740  * FUNCTION:
2741  * EwGetGlyphMetrics
2742  *
2743  * DESCRIPTION:
2744  * The function EwGetGlyphMetrics() determines the glyph metrics of the given
2745  * font glyph. The function is useful when special application dependent text
2746  * flow calculations are necessary. The caller can determine the size and the
2747  * position of each glyph within the text.
2748  *
2749  * ARGUMENTS:
2750  * aFont - Font to get the glyph metrics.
2751  * aCharCode - Character code of the glyph.
2752  * aMetrics - Pointer to the structure where the metrics should be returned.
2753  *
2754  * RETURN VALUE:
2755  * If successful, the function returns != 0. When the desired glyph doesn't
2756  * exist in the font and there is no default glyph defined, zero is returned.
2757  *
2758  *******************************************************************************/
2759 int EwGetGlyphMetrics(XFont *aFont, XChar aCharCode, XGlyphMetrics *aMetrics);
2760 
2761 /*******************************************************************************
2762  * FUNCTION:
2763  * EwGetKerning
2764  *
2765  * DESCRIPTION:
2766  * The function EwGetKerning() determines the kerning to apply between the
2767  * given glyphs.
2768  *
2769  * ARGUMENTS:
2770  * aFont - Font to determine the kerning.
2771  * aCharCode1 - Character code of the first glyph.
2772  * aCharCode2 - Character code of the second glyph.
2773  *
2774  * RETURN VALUE:
2775  * The function returns the kerning value for the given pair of glyphs or 0
2776  * if the glyphs are not affected by kerning or at least one of the glyphs is
2777  * not existing in the font.
2778  *
2779  *******************************************************************************/
2780 XInt32 EwGetKerning(XFont *aFont, XChar aCharCode1, XChar aCharCode2);
2781 
2782 /*******************************************************************************
2783  * FUNCTION:
2784  * EwLockGlyph
2785  *
2786  * DESCRIPTION:
2787  * The function EwLockGlyph() provides a direct access to the pixel memory of
2788  * the given glyph. The function returns a lock object containing pointers to
2789  * memory, where the caller can read the glyph pixel values. Additional pitch
2790  * values also returned in the lock object allow the caller to calculate the
2791  * desired pixel addresses.
2792  *
2793  * When finished the access cycle, the function EwUnlockGlyph() should be used
2794  * in order to release the lock.
2795  *
2796  * Note, glyphs are stored in the Alpha8 pixel format -> one byte per pixel.
2797  * The pixel value 0 determines transparent pixel. The 255 full opaque pixel.
2798  * Values 1 .. 254 determine the semitransparent pixel.
2799  *
2800  * ARGUMENTS:
2801  * aFont - Font to lock the glyph pixel memory.
2802  * aCharCode - Character code of the glyph.
2803  *
2804  * RETURN VALUE:
2805  * If successful, the function returns a temporary glyph lock object. If the
2806  * intended glyph doesn't exist, 0 is returned.
2807  *
2808  *******************************************************************************/
2809 XGlyphLock *EwLockGlyph(XFont *aFont, XChar aCharCode);
2810 
2811 /*******************************************************************************
2812  * FUNCTION:
2813  * EwUnlockGlyph
2814  *
2815  * DESCRIPTION:
2816  * The function EwUnlockGlyph() provides a counterpart to EwLockGlyph(). When
2817  * called, the function releases the given lock.
2818  *
2819  * After calling this function, the aLock structure will become invalid.
2820  *
2821  * ARGUMENTS:
2822  * aLock - Lock object returned by the previous EwLockGlyph() call.
2823  *
2824  * RETURN VALUE:
2825  * None
2826  *
2827  *******************************************************************************/
2828 void EwUnlockGlyph(XGlyphLock *aLock);
2829 
2830 /*******************************************************************************
2831  * FUNCTION:
2832  * EwDrawBitmapFrame
2833  *
2834  * DESCRIPTION:
2835  * The function EwDrawBitmapFrame() draws a free scalable frame by composing
2836  *it from up to nine bitmap segments. These segments do correspond to the 4
2837  *frame corners, 4 edges and to the frame interior areas. By filling these areas
2838  *with repeated copies of the bitmap segments, flexible scalable frame is drawn.
2839  *
2840  * The segments come from the source bitmap aSrc, which for this purpose has
2841  *to be organized as 3 x 3 matrix of equal sized tiles --> the size of the
2842  *source area aSrcRect has to a multiple of 3.
2843  *
2844  * The resulting size of the drawn frame is specified by aDstRect parameter.
2845  * The aDrawXXX parameters control which edges are drawn. Optionally the
2846  *copied pixel can be modulated by a color gradient specified by the four
2847  *parameters aColorTL .. aColorBL.
2848  *
2849  * An additional clipping area aClipRect limits the operation. All pixel lying
2850  * outside this area will not be drawn. The last aBlend parameter controls the
2851  * mode how drawn pixel are combined with the pixel already existing in the
2852  * destination bitmap. If aBlend != 0, the drawn pixel are alpha-blended with
2853  * the background, otherwise the drawn pixel will overwrite the old content.
2854  *
2855  * ARGUMENTS:
2856  * aDst - Destination bitmap.
2857  * aSrc - Source bitmap.
2858  * aDstFrameNo - Frame within the destination bitmap affected by the drawing
2859  * operation.
2860  * aSrcFrameNo - Source bitmap frame affected by the operation.
2861  * aClipRect - Area to limit the drawing operation (Relative to the top-left
2862  * corner of the destination bitmap frame).
2863  * aDstRect - Area to fill with the segments (Relative to the top-left
2864  * corner of the destination bitmap frame).
2865  * aSrcRect - Area of the source bitmap to use as source for the drawing
2866  * operation. This area is assumed as composed of 3x3 equal sized tiles.
2867  * The area lies relative to the top-left corner of the source bitmap frame.
2868  * aDrawLeftEdge,
2869  * aDrawTopEdge,
2870  * aDrawRightEdge,
2871  * aDrawBottomEdge,
2872  * aDrawInterior - Flags to control, whether the corresponding area of the
2873  * frame is drawn or not. Not drawn edges are filled by the interior area.
2874  * aColorTL,
2875  * aColorTR,
2876  * aColorBR,
2877  * aColorBL - Color values corresponding to the four corners of aDstRect.
2878  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
2879  * in the background.
2880  *
2881  * RETURN VALUE:
2882  * None
2883  *
2884  *******************************************************************************/
2885 void EwDrawBitmapFrame(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo,
2886  XInt32 aSrcFrameNo, XRect aClipRect, XRect aDstRect,
2887  XRect aSrcRect, XBool aDrawLeftEdge, XBool aDrawTopEdge,
2888  XBool aDrawRightEdge, XBool aDrawBottomEdge,
2889  XBool aDrawInterior, XColor aColorTL, XColor aColorTR,
2890  XColor aColorBR, XColor aColorBL, XBool aBlend);
2891 
2892 /*******************************************************************************
2893  * FUNCTION:
2894  * EwParseFlowString
2895  *
2896  * DESCRIPTION:
2897  * The function EwParseFlowString() converts the given source string aString
2898  * into a new string consisting of an array of wrapped text lines. These lines
2899  * can then be drawn on the screen by using EwDrawText() function, so
2900  *multiline flow text output is possible.
2901  *
2902  * The function parses the passed string and tries to wrap it in separate text
2903  * rows with the specified width aWidth. The function stops if the string has
2904  * been processed or the resulting set of text rows has reached aMaxNoOfRows.
2905  *
2906  * The automatic line wrap is performed primarily between words. Additionally
2907  * the zero-width-space-sign) and soft-hyphen are possible candidates for the
2908  * wrap position. These can be specified as special characters '^' or '\x00A0'
2909  * (for the zero-width-space) and '~' or '\x00AD' (for soft-hyphen).
2910  *
2911  * The both special characters '^' and '~' are usually ignored and they are
2912  *not displayed until the line wrap took place at its position. Then the '~'
2913  *sign is converted into the hyphen '-'. The zero-width-space in contrast breaks
2914  *a row only and remains invisible. These both special characters provide a
2915  * flexibel way to output multi-line text.
2916  *
2917  * Beside the automatic text wrap, an explicit linefeed is possible when the
2918  * '\n' sign has been found in the string.
2919  *
2920  * In order to be able to output the special characters as regular signs, the
2921  * character '%' can be applied in front of the affected sign to convert it
2922  * to a regular sign (e.g. "%~" for the '~' sign or "%%" for the '%' sign).
2923  *
2924  * The returned string contains an array of text lines. These are stored in
2925  * following structure:
2926  *
2927  * +-------------+
2928  * | No of lines |
2929  * +-------------+------+------+------+------+------+ +------+
2930  * | Offset | Char | Char | Char | Char | Char | ... | Char |
2931  * +-------------+------+------+------+------+------+ +------+
2932  * | Offset | Char | Char | Char | Char | Char | ... | Char |
2933  * +-------------+------+------+------+------+------+ +------+
2934  * ...
2935  * +-------------+------+------+------+------+------+ +------+
2936  * | Offset | Char | Char | Char | Char | Char | ... | Char |
2937  * +-------------+------+------+------+------+------+ +------+
2938  * | 0 |
2939  * +-------------+
2940  *
2941  * The first character contains the number of lines inside the string. Each
2942  * line starts with the offset (in character) to the next line, followed by
2943  *the signs belonging to the line. The lines are not terminated. The entire
2944  *string is terminated with 0.
2945  *
2946  * ARGUMENTS:
2947  * aFont - Pointer to the used font.
2948  * aString - String to wrap.
2949  * aWidth - Width to wrap the text rows. If this parameter is < 0, the
2950  * text is not automatically wrapped in rows expcept the linefeed signs.
2951  * aMaxNoOfRows - Limit when to stop the text processing. If this parameter
2952  * is < 0, the entire string is processed.
2953  * aBidi - If not NULL refers the Bidi context to be used by the
2954  * function while processing the string.
2955  *
2956  * RETURN VALUE:
2957  * The function returns a string containing an array of text lines.
2958  *
2959  * Please note, the returned string is controlled by the Embedded Wizard
2960  * Runtime Environment EWRTE. If not used anymore, the string is released
2961  * automatically.
2962  *
2963  *******************************************************************************/
2964 XString EwParseFlowString(XFont *aFont, XChar *aString, XInt32 aWidth,
2965  XInt32 aMaxNoOfRows, XHandle aBidi);
2966 
2967 /*******************************************************************************
2968  * FUNCTION:
2969  * EwGetFlowTextAdvance
2970  *
2971  * DESCRIPTION:
2972  * The function EwGetFlowTextAdvance() calculates the advance of the widest
2973  * text row in the multi-line text block aFlowString by using the font aFont.
2974  * The value is calculated by the sum of advance values of all glyphs needed
2975  *to display the respective text row and then by selecting the result of the row
2976  * which is the widest one.
2977  *
2978  * ARGUMENTS:
2979  * aFont - Font to use for the text calculation.
2980  * aFlowString - Text to process as already parsed flow string (see the
2981  * function EwParseFlowString())
2982  *
2983  * RETURN VALUE:
2984  * Returns the advance value for the widest text row.
2985  *
2986  *******************************************************************************/
2987 XInt32 EwGetFlowTextAdvance(XFont *aFont, XChar *aFlowString);
2988 
2989 /*******************************************************************************
2990  * FUNCTION:
2991  * EwCreateAttrSet
2992  *
2993  * DESCRIPTION:
2994  * The function EwCreateAttrSet() creates and initializes a new XAttrSet. The
2995  * set is used as a simple container for storing of fonts, bitmaps and colors.
2996  * These resources are necessary for parsing and drawing of attributed
2997  *strings.
2998  *
2999  * The size of the set (the max. number of entries, it can store) is passed in
3000  * the arguments aNoOfFonts, aNoOfBitmaps and aNoOfColors. After creation, the
3001  * size of the set is fixed and can not be changed any more.
3002  *
3003  * All entries of a newly created set are always initialized with 0. To start
3004  * working with attributed strings, the set should be loaded with necessary
3005  * fonts, bitmaps and colors. The functions, defined below allow an access to
3006  * these entries.
3007  *
3008  * ARGUMENTS:
3009  * aNoOfFonts - Max. number of fonts.
3010  * aNoOfBitmaps - Max. number of bitmaps.
3011  * aNoOfColors - Max. number of colors.
3012  *
3013  * RETURN VALUE:
3014  * If successful, the function returns a pointer to the newly created set.
3015  * Otherwise the function returns 0.
3016  *
3017  *******************************************************************************/
3018 XAttrSet *EwCreateAttrSet(XInt32 aNoOfFonts, XInt32 aNoOfBitmaps,
3019  XInt32 aNoOfColors);
3020 
3021 /*******************************************************************************
3022  * FUNCTION:
3023  * EwFreeAttrSet
3024  *
3025  * DESCRIPTION:
3026  * The function EwFreeAttrSet() frees the memory occupied by the set. The
3027  * function frees the memory only - the corresponding fonts, bitmaps are not
3028  * affected!
3029  *
3030  * ARGUMENTS:
3031  * aAttrSet - Pointer to the set to free.
3032  *
3033  * RETURN VALUE:
3034  * None
3035  *
3036  *******************************************************************************/
3037 void EwFreeAttrSet(XAttrSet *aAttrSet);
3038 
3039 /*******************************************************************************
3040  * FUNCTION:
3041  * EwGetNoOfAttrFonts
3042  *
3043  * DESCRIPTION:
3044  * The function EwGetNoOfAttrFonts() determinate how many fonts can be stored
3045  * within the given set.
3046  *
3047  * ARGUMENTS:
3048  * aAttrSet - Pointer to the set.
3049  *
3050  * RETURN VALUE:
3051  * If successful, the function returns the max. number of fonts. Otherwise the
3052  * function returns 0.
3053  *
3054  *******************************************************************************/
3056 
3057 /*******************************************************************************
3058  * FUNCTION:
3059  * EwGetNoOfAttrBitmaps
3060  *
3061  * DESCRIPTION:
3062  * The function EwGetNoOfAttrBitmaps() determinate how many bitmaps can be
3063  * stored within the given set.
3064  *
3065  * ARGUMENTS:
3066  * aAttrSet - Pointer to the set.
3067  *
3068  * RETURN VALUE:
3069  * If successful, the function returns the max. number of bitmaps. Otherwise
3070  * the function returns 0.
3071  *
3072  *******************************************************************************/
3074 
3075 /*******************************************************************************
3076  * FUNCTION:
3077  * EwGetNoOfAttrColors
3078  *
3079  * DESCRIPTION:
3080  * The function EwGetNoOfAttrColors() determinate how many colors can be
3081  *stored within the given set.
3082  *
3083  * ARGUMENTS:
3084  * aAttrSet - Pointer to the set.
3085  *
3086  * RETURN VALUE:
3087  * If successful, the function returns the max. number of colors. Otherwise
3088  * the function returns 0.
3089  *
3090  *******************************************************************************/
3092 
3093 /*******************************************************************************
3094  * FUNCTION:
3095  * EwGetAttrFont
3096  *
3097  * DESCRIPTION:
3098  * The function EwGetAttrFont() returns the font entry aFontNo from the given
3099  * set aAttrSet.
3100  *
3101  * ARGUMENTS:
3102  * aAttrSet - Pointer to the set.
3103  * aFontNo - Number of the affected font entry within the set. The first
3104  * entry has the number 0, the second 1, and so far.
3105  *
3106  * RETURN VALUE:
3107  * If successful, the function returns the pointer to the corresponding font
3108  * object. Otherwise the function returns 0.
3109  *
3110  *******************************************************************************/
3111 XFont *EwGetAttrFont(XAttrSet *aAttrSet, XInt32 aFontNo);
3112 
3113 /*******************************************************************************
3114  * FUNCTION:
3115  * EwGetAttrBitmap
3116  *
3117  * DESCRIPTION:
3118  * The function EwGetAttrBitmap() returns the bitmap entry aBitmapNo from the
3119  * given set aAttrSet.
3120  *
3121  * ARGUMENTS:
3122  * aAttrSet - Pointer to the set.
3123  * aBitmapNo - Number of the affected bitmap entry within the set. The first
3124  * entry has the number 0, the second 1, and so far.
3125  *
3126  * RETURN VALUE:
3127  * If successful, the function returns the pointer to the corresponding bitmap
3128  * object. Otherwise the function returns 0.
3129  *
3130  *******************************************************************************/
3131 XBitmap *EwGetAttrBitmap(XAttrSet *aAttrSet, XInt32 aBitmapNo);
3132 
3133 /*******************************************************************************
3134  * FUNCTION:
3135  * EwGetAttrColor
3136  *
3137  * DESCRIPTION:
3138  * The function EwGetAttrColor() returns the color entry aColorNo from the
3139  * given set aAttrSet.
3140  *
3141  * ARGUMENTS:
3142  * aAttrSet - Pointer to the set.
3143  * aColorNo - Number of the affected color entry within the set. The first
3144  * entry has the number 0, the second 1, and so far.
3145  *
3146  * RETURN VALUE:
3147  * If successful, the function returns the affected color value. Otherwise the
3148  * function returns 0.
3149  *
3150  *******************************************************************************/
3151 XColor EwGetAttrColor(XAttrSet *aAttrSet, XInt32 aColorNo);
3152 
3153 /*******************************************************************************
3154  * FUNCTION:
3155  * EwSetAttrFont
3156  *
3157  * DESCRIPTION:
3158  * The function EwSetAttrFont() assigns new font aFont to the entry aFontNo
3159  * within the given set aAttrSet.
3160  *
3161  * ARGUMENTS:
3162  * aAttrSet - Pointer to the set.
3163  * aFontNo - Number of the affected font entry. The first entry has the
3164  *number 0, the second 1, and so far. aFont - Pointer to the font object to
3165  *be stored within the set. If aFont is 0, the affected font entry is set to
3166  *zero.
3167  *
3168  * RETURN VALUE:
3169  * None
3170  *
3171  *******************************************************************************/
3172 void EwSetAttrFont(XAttrSet *aAttrSet, XInt32 aFontNo, XFont *aFont);
3173 
3174 /*******************************************************************************
3175  * FUNCTION:
3176  * EwSetAttrBitmap
3177  *
3178  * DESCRIPTION:
3179  * The function EwSetAttrBitmap() assigns new bitmap aBitmap to the entry
3180  * aBitmapNo within the given set aAttrSet.
3181  *
3182  * ARGUMENTS:
3183  * aAttrSet - Pointer to the set.
3184  * aBitmapNo - Number of the affected bitmap entry. The first entry has the
3185  * number 0, the second 1, and so far.
3186  * aBitmap - Pointer to the bitmap object to be stored within the set. If
3187  * aBitmap is 0, the affected bitmap entry is set to zero.
3188  *
3189  * RETURN VALUE:
3190  * None
3191  *
3192  *******************************************************************************/
3193 void EwSetAttrBitmap(XAttrSet *aAttrSet, XInt32 aBitmapNo, XBitmap *aBitmap);
3194 
3195 /*******************************************************************************
3196  * FUNCTION:
3197  * EwSetAttrColor
3198  *
3199  * DESCRIPTION:
3200  * The function EwSetAttrColor() assigns new color value aColor to the entry
3201  * aColorNo within the given set aAttrSet.
3202  *
3203  * ARGUMENTS:
3204  * aAttrSet - Pointer to the set.
3205  * aColorNo - Number of the affected color entry. The first entry has the
3206  * number 0, the second 1, and so far.
3207  * aColor - The color value to store within the set.
3208  *
3209  * RETURN VALUE:
3210  * None
3211  *
3212  *******************************************************************************/
3213 void EwSetAttrColor(XAttrSet *aAttrSet, XInt32 aColorNo, XColor aColor);
3214 
3215 /*******************************************************************************
3216  * FUNCTION:
3217  * EwParseAttrString
3218  *
3219  * DESCRIPTION:
3220  * The function EwParseAttrString() converts the given source string aString
3221  * into a list of drawing statements. Unlike simple text drawing operations,
3222  * attributed strings may appear with multiple fonts, colors and images - like
3223  * HTML.
3224  *
3225  * The appearance of the string is determinated by the used attributes and by
3226  * the passed aAttrSet container. The attributes describe what to do with the
3227  * text, which font/color should be used or what images should be displayed
3228  * together with the text. The attributes are always enclosed in '{ .... }'
3229  * braces. For example, the attribute for color selection looks like this:
3230  *
3231  * "The text with other {clr1}text color{clr0}."
3232  *
3233  * The attribute {clr1} forces the Graphics Engine to draw the following text
3234  * with the color number 1. The value of the desired color is stored in the
3235  * aAttrSet container. In the same manner a font selection can be applied or
3236  * an image can be displayed together with the text. The attributed strings
3237  * use a small but very powerfull set of attributes. They control the entire
3238  * layout and the appearance of the displayed text.
3239  *
3240  * The function EwParseAttrString() returns a memory block containing the
3241  * preprocessed drawing statements. These statements can then be executed
3242  * very fast by the EwDrawAttrText() function. In this manner the parsing of
3243  * the string is done only once - the text can be displayed several times.
3244  *
3245  * ARGUMENTS:
3246  * aAttrSet - Pointer to the set containing fonts, bitmaps and colors
3247  * for the attributed string.
3248  * aString - Source string containing the text and the attributes.
3249  * aWidth - Width of the rectangular area used for the text
3250  * formatting and line wrapping.
3251  * aEnableBidiText - If != 0, the Unicode Bidi Algorithm is applied on every
3252  * paragraph content.
3253  *
3254  * RETURN VALUE:
3255  * If successful, the function returns a pointer to a memory area containing
3256  * drawing statements. If the parsing is failed, or the memory is exhausted
3257  * the function returns 0.
3258  *
3259  *******************************************************************************/
3260 XAttrString *EwParseAttrString(XAttrSet *aAttrSet, XChar *aString,
3261  XInt32 aWidth, XBool aEnableBidiText);
3262 
3263 /*******************************************************************************
3264  * FUNCTION:
3265  * EwFreeAttrString
3266  *
3267  * DESCRIPTION:
3268  * The function EwFreeAttrString() releases the memory area reserved by the
3269  * function EwParseAttrString() for drawing statements.
3270  *
3271  * ARGUMENTS:
3272  * aAttrString - Pointer to the attributed string to free the memory.
3273  *
3274  * RETURN VALUE:
3275  * None
3276  *
3277  *******************************************************************************/
3278 void EwFreeAttrString(XAttrString *aAttrString);
3279 
3280 /*******************************************************************************
3281  * FUNCTION:
3282  * EwDrawAttrText
3283  *
3284  * DESCRIPTION:
3285  * The function EwDrawAttrText() executes the drawing statements from the
3286  * attributed string aAttrString and draws the text and images into the aDst
3287  * bitmap at the origin (aDstX, aDstY). The drawing area is clipped by the
3288  * aClipping rectangle. The necessary fonts, bitmaps and colors are passed in
3289  * the aAttrSet container.
3290  *
3291  * ARGUMENTS:
3292  * aDst - Destination bitmap.
3293  * aAttrSet - Pointer to the set of fonts, bitmaps and colors.
3294  * aAttrString - Pointer to the memory area containing the parsed,
3295  *preprocessed drawing statements. This area is created by the
3296  *EwParseAttrString() function. aDstFrameNo - Frame within the destination
3297  *bitmap affected by the drawing operation. aClipRect - Area to limit the
3298  *drawing operation (Relative to the top-left corner of the destination bitmap
3299  *frame). aDstRect - Area to fill with the text (Relative to the top-left
3300  *corner of the destination bitmap frame). aSrcPos - Text output origin
3301  *(relative to the top-left corner of the text area). aOpacityTL, aOpacityTR,
3302  * aOpacityBR,
3303  * aOpacityBL - Opacity values corresponding to the four corners of aDstRect.
3304  * aBlend - If != 0, the drawn pixel will be alpha-blended with the pixel
3305  * in the background.
3306  *
3307  * RETURN VALUE:
3308  * None
3309  *
3310  *******************************************************************************/
3311 void EwDrawAttrText(XBitmap *aDst, XAttrSet *aAttrSet, XAttrString *aAttrString,
3312  XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect,
3313  XPoint aSrcPos, XInt32 aOpacityTL, XInt32 aOpacityTR,
3314  XInt32 aOpacityBR, XInt32 aOpacityBL, XBool aBlend);
3315 
3316 /*******************************************************************************
3317  * FUNCTION:
3318  * EwGetAttrTextSize
3319  *
3320  * DESCRIPTION:
3321  * The function EwGetAttrTextSize() calculates the rectangular area necessary
3322  * to draw the given attributed string. The rectangular area is calculated by
3323  * building an union of all drawing statements of the attributed string.
3324  *
3325  * ARGUMENTS:
3326  * aAttrString - Pointer to the memory area containing the parsed,
3327  *preprocessed drawing statements. This area is created by the
3328  *EwParseAttrString() function.
3329  *
3330  * RETURN VALUE:
3331  * Returns the size of the rectangular area needed to display the string.
3332  *
3333  *******************************************************************************/
3334 XPoint EwGetAttrTextSize(XAttrString *aAttrString);
3335 
3336 /*******************************************************************************
3337  * FUNCTION:
3338  * EwIsAttrTextRTL
3339  *
3340  * DESCRIPTION:
3341  * The function EwIsAttrTextRTL() returns the basic paragraph direction
3342  * resulting from the very first processed paragraph in the attributed string.
3343  *
3344  * ARGUMENTS:
3345  * aAttrString - Pointer to the memory area containing the parsed,
3346  *preprocessed drawing statements. This area is created by the
3347  *EwParseAttrString() function.
3348  *
3349  * RETURN VALUE:
3350  * Returns != 0 if the first paragraph of the attributed string has RTL
3351  * paragraph direction. Otherwise return 0.
3352  *
3353  *******************************************************************************/
3354 XBool EwIsAttrTextRTL(XAttrString *aAttrString);
3355 
3356 /*******************************************************************************
3357  * FUNCTION:
3358  * EwGetNoOfAttrLinks
3359  *
3360  * DESCRIPTION:
3361  * The function EwGetNoOfAttrLinks() returns the total number of links stored
3362  * within the given attributed string aAttrString.
3363  *
3364  * ARGUMENTS:
3365  * aAttrString - Pointer to the memory area containing the parsed,
3366  *preprocessed drawing statements. This area is created by the
3367  *EwParseAttrString() function.
3368  *
3369  * RETURN VALUE:
3370  * The function returns the number of links or zero if no links are defined in
3371  * the given attributed string.
3372  *
3373  *******************************************************************************/
3374 XInt32 EwGetNoOfAttrLinks(XAttrString *aAttrString);
3375 
3376 /*******************************************************************************
3377  * FUNCTION:
3378  * EwGetAttrLinkName
3379  *
3380  * DESCRIPTION:
3381  * The function EwGetAttrLinkName() returns the name of a link, which is
3382  *stored within the given attributed string aAttrString. The number of the
3383  *desired link is passed in the argument aLinkNo. The first link has the number
3384  *0, the second 1, ...
3385  *
3386  * The total number of available links can be determinated by the call to the
3387  * function EwGetNoOfAttrLinks().
3388  *
3389  * ARGUMENTS:
3390  * aAttrString - Pointer to the memory area containing the parsed,
3391  *preprocessed drawing statements. This area is created by the
3392  *EwParseAttrString() function. aLinkNo - The number of the affected link.
3393  *The first link has the number 0, the second 1, ...
3394  *
3395  * RETURN VALUE:
3396  * The function returns a pointer to the zero terminated string containing the
3397  * link's name. If the link has no name or the desired link does not exist,
3398  * null pointer is returned.
3399  *
3400  * Please note, the returned string is controlled by the Embedded Wizard
3401  * Runtime Environment EWRTE. If not used anymore, the string is released
3402  * automatically.
3403  *
3404  *******************************************************************************/
3405 XString EwGetAttrLinkName(XAttrString *aAttrString, XInt32 aLinkNo);
3406 
3407 /*******************************************************************************
3408  * FUNCTION:
3409  * EwGetNoOfAttrLinkRegions
3410  *
3411  * DESCRIPTION:
3412  * The function EwGetNoOfAttrLinkRegions() returns the number of rectangular
3413  * text areas enclosed by the given link aLinkNo within the attributed string
3414  * aAttrString.
3415  *
3416  * Due to the line wrap, the text enclosed by a single link can be wrapped in
3417  * several text lines, so the link area may become a very complex polygon. To
3418  * describe this polygon, it is divided in several rectangular areas, one for
3419  * each text line enclosed by the link. To get the origin and the size of an
3420  * area, the function EwGetAttrLinkRect() should be used.
3421  *
3422  * The regions are very useful, if a selection frame or an other kind of
3423  * decoration should be drawn together with the link.
3424  *
3425  * ARGUMENTS:
3426  * aAttrString - Pointer to the memory area containing the parsed,
3427  *preprocessed drawing statements. This area is created by the
3428  *EwParseAttrString() function. aLinkNo - Number of the affected link. The
3429  *first link has the number 0, the second 1, ...
3430  *
3431  * RETURN VALUE:
3432  * The function returns the number of rectangular areas or zero if the desired
3433  * link is not defined within the attributed string, or the link does not
3434  * enclose any text.
3435  *
3436  *******************************************************************************/
3437 XInt32 EwGetNoOfAttrLinkRegions(XAttrString *aAttrString, XInt32 aLinkNo);
3438 
3439 /*******************************************************************************
3440  * FUNCTION:
3441  * EwGetAttrLinkRect
3442  *
3443  * DESCRIPTION:
3444  * The function EwGetAttrLinkRect() returns the origin and the size of an area
3445  * occupied by the link aLinkNo within the attributed string aAttrString.
3446  *
3447  * Due to the line wrap, the text enclosed by a single link can be wrapped in
3448  * several text lines, so the link area may become a very complex polygon. To
3449  * describe this polygon, it is divided in several rectangular areas, one for
3450  * each text line enclosed by the link. The number of the desired rectangular
3451  * area should be passed in the argument aRegionNo. The first region has the
3452  * number 0, the second 1, ...
3453  *
3454  * The total number of available regions can be determinated by the call to
3455  *the function EwGetNoOfAttrLinkRegions().
3456  *
3457  * ARGUMENTS:
3458  * aAttrString - Pointer to the memory area containing the parsed,
3459  *preprocessed drawing statements. This area is created by the
3460  *EwParseAttrString() function. aLinkNo - Number of the affected link. The
3461  *first link has the number 0, the second 1, ... aRegionNo - Number of the
3462  *affected region. The first region has the number 0, the second 1, ...
3463  *
3464  * RETURN VALUE:
3465  * Returns the origin and the size of the area relative to the origin of the
3466  * drawn attributed text. If the desired link or region do not exist, an empty
3467  * rectangle is returned.
3468  *
3469  *******************************************************************************/
3470 XRect EwGetAttrLinkRect(XAttrString *aAttrString, XInt32 aLinkNo,
3471  XInt32 aRegionNo);
3472 
3473 /*******************************************************************************
3474  * FUNCTION:
3475  * EwGetAttrLinkBaseline
3476  *
3477  * DESCRIPTION:
3478  * The function EwGetAttrLinkBaseline() returns the vertical offset to the
3479  *base line of the text enclosed by the link aLinkNo within the attributed
3480  *string aAttrString. The base line is used for vertical text alignment.
3481  *
3482  * Due to the line wrap, the text enclosed by a single link can be wrapped in
3483  * several text lines. For each text line a different base line may be used.
3484  * This function provides you with an access to this base line offset for each
3485  * text region enclosed by the link. The number of the desired region should
3486  *be passed in the argument aRegionNo. The first region has the number 0, the
3487  * second 1, ...
3488  *
3489  * The total number of available regions can be determinated by the call to
3490  *the function EwGetNoOfAttrLinkRegions().
3491  *
3492  * ARGUMENTS:
3493  * aAttrString - Pointer to the memory area containing the parsed,
3494  *preprocessed drawing statements. This area is created by the
3495  *EwParseAttrString() function. aLinkNo - Number of the affected link. The
3496  *first link has the number 0, the second 1, ... aRegionNo - Number of the
3497  *affected region. The first region has the number 0, the second 1, ...
3498  *
3499  * RETURN VALUE:
3500  * The function returns the vertical offset to the base line of the affected
3501  * region relative to the origin of the drawn attributed text. If the desired
3502  * link or region do not exist, the function returns 0.
3503  *
3504  *******************************************************************************/
3505 XInt32 EwGetAttrLinkBaseline(XAttrString *aAttrString, XInt32 aLinkNo,
3506  XInt32 aRegionNo);
3507 
3508 /*******************************************************************************
3509  * FUNCTION:
3510  * EwCreateBidi
3511  *
3512  * DESCRIPTION:
3513  * The function EwCreateBidi() creates a new Bidi-Context able to manage Bidi
3514  * information for at the least as many characters as specified in parameter
3515  * aMaxSize.
3516  *
3517  * The Bidi-information in the context is not initialized. Use the function
3518  * EwBidiInit() for this purpose. If the returned Bidi-Context is not needed
3519  * anymore, it has to be released by using the function EwFreeBidi().
3520  *
3521  * ARGUMENTS:
3522  * aMaxSize - The desired capacity for the Bidi-Context expressed in text
3523  * characters this context should be able to process maximally.
3524  *
3525  * RETURN VALUE:
3526  * The function returns a pointer referring to the Bidi-Context.
3527  *
3528  *******************************************************************************/
3529 XHandle EwCreateBidi(XInt32 aMaxSize);
3530 
3531 /*******************************************************************************
3532  * FUNCTION:
3533  * EwFreeBidi
3534  *
3535  * DESCRIPTION:
3536  * The function EwFreeBidi() frees all resources associated with the given
3537  * Bidi-Context aBidi again.
3538  *
3539  * ARGUMENTS:
3540  * aBidi - The Bidi-Context to release.
3541  *
3542  * RETURN VALUE:
3543  * None
3544  *
3545  *******************************************************************************/
3546 void EwFreeBidi(XHandle aBidi);
3547 
3548 /*******************************************************************************
3549  * FUNCTION:
3550  * EwBidiIsNeeded
3551  *
3552  * DESCRIPTION:
3553  * The function EwBidiIsNeeded() returns != 0 if further Bidi processing is
3554  * required. If the original text does not contain any RTL signs nor Bidi
3555  * control signs, the function returns 0.
3556  *
3557  * ARGUMENTS:
3558  * aBidi - The Bidi-Context to query the mode.
3559  *
3560  * RETURN VALUE:
3561  * Returns != 0 if the context describes text which needs Bidi processing.
3562  *
3563  *******************************************************************************/
3565 
3566 /*******************************************************************************
3567  * FUNCTION:
3568  * EwBidiIsRTL
3569  *
3570  * DESCRIPTION:
3571  * The function EwBidiIsRTL() returns the basic paragraph direction stored in
3572  * the given Bidi-Context.
3573  *
3574  * ARGUMENTS:
3575  * aBidi - The Bidi-Context to query the paragraph direction.
3576  *
3577  * RETURN VALUE:
3578  * Returns != 0 if the context describes text with RTL paragraph direction.
3579  * Otherwise return 0.
3580  *
3581  *******************************************************************************/
3582 XBool EwBidiIsRTL(XHandle aBidi);
3583 
3584 /*******************************************************************************
3585  * FUNCTION:
3586  * EwBidiGetCharLevel
3587  *
3588  * DESCRIPTION:
3589  * The function EwBidiGetCharLevel() returns the embedding level corresponding
3590  * to the character with the specified number.
3591  *
3592  * ARGUMENTS:
3593  * aBidi - The Bidi-Context to query the embedding level.
3594  * aIndex - Index identifying the character. The characters are counted
3595  * starting with 0.
3596  *
3597  * RETURN VALUE:
3598  * Returns a number in range 0 .. 127 identifying the embedding level of the
3599  * respective character as it is stored in the Bidi context. If the index
3600  * addresses a non existing character, the paragraph level is returned. If
3601  * the context is not valid, 0 is returned.
3602  *
3603  *******************************************************************************/
3604 XInt32 EwBidiGetCharLevel(XHandle aBidi, XInt32 aIndex);
3605 
3606 /*******************************************************************************
3607  * FUNCTION:
3608  * EwBidiInit
3609  *
3610  * DESCRIPTION:
3611  * The function EwBidiInit() evaluates the characters in aString and stores in
3612  * the Bidi-Context aBidi for every evaluated character the corresponding Bidi
3613  * type. Finally the function determines the paragraph's base direction and
3614  * stores it also in the context.
3615  *
3616  * Please note, before invoking this function you should create a new Bidi
3617  * context with enough capacity so all string characters can be stored in it.
3618  * If the passed context is invalid or too small, the function fails.
3619  *
3620  * ARGUMENTS:
3621  * aBidi - Bidi-Context where to store the Bidi-Information.
3622  * aString - The original string to process.
3623  * aCount - The number of characters in aString to process. If this
3624  * parameter is negative, the function processes all characters found in the
3625  * string.
3626  * aBaseDirection - Determines the default paragraph level. If this parameter
3627  * is 0, the paragraph level is set to 0 (LTR). If this parameter > 0, the
3628  * paragraph level is set 1 (RTL). If this parameter is < 0, the paragraph
3629  * level is determined automatically depending on the first strong character
3630  * in the string.
3631  *
3632  * RETURN VALUE:
3633  * The function returns != 0 if the original string contains at least one RTL
3634  * or any Bidi-Control sign. If the string does not contain any of those signs
3635  * the function returns 0. Thereupon no further Bidi processing is required.
3636  *
3637  *******************************************************************************/
3638 XBool EwBidiInit(XHandle aBidi, XChar *aString, XInt32 aCount,
3639  XInt32 aBaseDirection);
3640 
3641 /*******************************************************************************
3642  * FUNCTION:
3643  * EwBidiProcess
3644  *
3645  * DESCRIPTION:
3646  * The function EwBidiProcess() performs the main part of the Bidi-Algorithm
3647  * deriving from the characters in the given string aString and their Bidi-
3648  * Types provided in aBidi the corresponding direction levels. Finally the
3649  * estimated levels are stored in aBidi for every character in aString.
3650  *
3651  * ARGUMENTS:
3652  * aBidi - The Bidi-Context containing Bidi-Types for the characters in the
3653  * string aString.
3654  * aString - Characters to apply the Bidi-Algorithm.
3655  *
3656  * RETURN VALUE:
3657  * None
3658  *
3659  *******************************************************************************/
3660 void EwBidiProcess(XHandle aBidi, XChar *aString);
3661 
3662 /*******************************************************************************
3663  * FUNCTION:
3664  * EwBidiApplyShaping
3665  *
3666  * DESCRIPTION:
3667  * The function EwBidiApplyShaping() performs the part of the Bidi-Algorithm
3668  * needed to handle the special case of Arabic glyphs and mandatory ligatures.
3669  * The function evaluates the characters in the string aString and adapts all
3670  * found Arabic glyphs accordingly.
3671  *
3672  * ARGUMENTS:
3673  * aBidi - The Bidi-Context containing Bidi-Types for the characters in the
3674  * string aString.
3675  * aString - Characters to apply the Shaping-Algorithm.
3676  * aAttrs - In case of an attributed string points to an array containing
3677  * the attributes (in particular the font numbers) for the corresponding
3678  * characters from aString. If aString is not an attributed string, aAttrs
3679  * is NULL.
3680  * aFonts - An array containing the fonts used in aString. The fonts are
3681  * selected by the font-number value from aAttrs attributes. If aString
3682  * is not an attributed string, aFonts contains just one entry valid for
3683  * all characters in the string.
3684  * aNoOfFonts - Number of fonts in the array aFonts.
3685  *
3686  * RETURN VALUE:
3687  * None
3688  *
3689  *******************************************************************************/
3690 void EwBidiApplyShaping(XHandle aBidi, XChar *aString, XUInt32 *aAttrs,
3691  XFont **aFonts, XInt32 aNoOfFonts);
3692 
3693 /*******************************************************************************
3694  * FUNCTION:
3695  * EwBidiMirrorGlyphs
3696  *
3697  * DESCRIPTION:
3698  * The function EwBidiMirrorGlyphs() performs the part of the Bidi-Algorithm
3699  * responsable for the mirroring of glyphs within level-runs with reversed
3700  * writing direction. For every character within aString which is signed as
3701  * RTL the function verifies whether there is mirror version of the sign and
3702  * replaces it with this version.
3703  *
3704  * ARGUMENTS:
3705  * aBidi - The Bidi-Context containing Bidi-Types for the characters in the
3706  * string aString.
3707  * aString - Characters to mirror.
3708  *
3709  * RETURN VALUE:
3710  * None
3711  *
3712  *******************************************************************************/
3713 void EwBidiMirrorGlyphs(XHandle aBidi, XChar *aString);
3714 
3715 /*******************************************************************************
3716  * FUNCTION:
3717  * EwBidiCompleteRow
3718  *
3719  * DESCRIPTION:
3720  * The function EwBidiCompleteRow() performs the part of the Bidi-Algorithm
3721  * after text wrap has been applied on a row. Accordingly it runs the final
3722  * rules of the Bidi-Algorithm on a single text row only.
3723  *
3724  * ARGUMENTS:
3725  * aBidi - The Bidi-Context containing Bidi-Types for the text row.
3726  * aRowStart - The number of the data entry in aBidi addressing the begin of
3727  * the row to process.
3728  * aRowEnd - The number of the data entry in aBidi addressing the end of
3729  * the row to process.
3730  *
3731  * RETURN VALUE:
3732  * None
3733  *
3734  *******************************************************************************/
3735 void EwBidiCompleteRow(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd);
3736 
3737 /*******************************************************************************
3738  * FUNCTION:
3739  * EwBidiReorderChars
3740  *
3741  * DESCRIPTION:
3742  * The function EwBidiReorderChars() performs the reordering of the orignal
3743  * text entities within a text row according to the previously estimated Bidi
3744  * run levels. The operation is limited to a single text row.
3745  *
3746  * ARGUMENTS:
3747  * aBidi - The Bidi-Context containing Bidi-Types for the text row.
3748  * aRowStart - The number of the data entry in aBidi addressing the begin of
3749  * the row to process.
3750  * aRowEnd - The number of the data entry in aBidi addressing the end of
3751  * the row to process.
3752  * aChars - Pointer addressing the first character of the affected text
3753  * row to reorder its content.
3754  *
3755  * RETURN VALUE:
3756  * None
3757  *
3758  *******************************************************************************/
3759 void EwBidiReorderChars(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd,
3760  XChar *aChars);
3761 
3762 /*******************************************************************************
3763  * FUNCTION:
3764  * EwBidiReorderDWords
3765  *
3766  * DESCRIPTION:
3767  * The function EwBidiReorderDWords() performs the reordering of the orignal
3768  * text entities within a text row according to the previously estimated Bidi
3769  * run levels. The operation is limited to a single text row and unlike the
3770  * above function it is intended to handle with text entities of 32-bit size.
3771  *
3772  * ARGUMENTS:
3773  * aBidi - The Bidi-Context containing Bidi-Types for the text row.
3774  * aRowStart - The number of the data entry in aBidi addressing the begin of
3775  * the row to process.
3776  * aRowEnd - The number of the data entry in aBidi addressing the end of
3777  * the row to process.
3778  * aDWords - Pointer addressing the first entity of the affected text row
3779  * to reorder its content.
3780  *
3781  * RETURN VALUE:
3782  * None
3783  *
3784  *******************************************************************************/
3785 void EwBidiReorderDWords(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd,
3786  XUInt32 *aDWords);
3787 
3788 /*******************************************************************************
3789  * FUNCTION:
3790  * EwBidiReorderIndex
3791  *
3792  * DESCRIPTION:
3793  * The function EwBidiReorderIndex() estimates the resulting index of a given
3794  * text entity after applying the Bidi reorder algorithm. In other words, it
3795  * returns the display position of a character within the original text row
3796  * after the row has been reordered.
3797  *
3798  * ARGUMENTS:
3799  * aBidi - The Bidi-Context containing Bidi-Types for the text row.
3800  * aRowStart - The number of the data entry in aBidi addressing the begin of
3801  * the row to process.
3802  * aRowEnd - The number of the data entry in aBidi addressing the end of
3803  * the row to process.
3804  * aIndex - The number of the entity within the text row to get its display
3805  * position.
3806  *
3807  * RETURN VALUE:
3808  * Returns the display position for the given text entity aIndex.
3809  *
3810  *******************************************************************************/
3811 XInt32 EwBidiReorderIndex(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd,
3812  XInt32 aIndex);
3813 
3814 /*******************************************************************************
3815  * FUNCTION:
3816  * EwBidiReverseReorderIndex
3817  *
3818  * DESCRIPTION:
3819  * The function EwBidiReverseReorderIndex() estimates the original index of a
3820  * given text entity before applying the Bidi reorder algorithm. In other
3821  * words, it returns the position of the character within the original text
3822  * row corresponding to the given display position in the reordered row.
3823  *
3824  * ARGUMENTS:
3825  * aBidi - The Bidi-Context containing Bidi-Types for the text row.
3826  * aRowStart - The number of the data entry in aBidi addressing the begin of
3827  * the row to process.
3828  * aRowEnd - The number of the data entry in aBidi addressing the end of
3829  * the row to process.
3830  * aIndex - The number of the entity within the final reordered text row
3831  * to get its original position.
3832  *
3833  * RETURN VALUE:
3834  * Returns the original position for the given text entity aIndex.
3835  *
3836  *******************************************************************************/
3838  XInt32 aRowEnd, XInt32 aIndex);
3839 
3840 /*******************************************************************************
3841  * FUNCTION:
3842  * EwBidiGetTypesAndLevels
3843  *
3844  * DESCRIPTION:
3845  * The function EwBidiGetTypesAndLevels() exists for test purpose only. The
3846  * function copies all estimates Bidi types and levels from aBidi context to
3847  * the corresponding entries in the both arrays aTypes and aLevels. Note, the
3848  * arrays have to be large enough!
3849  *
3850  * ARGUMENTS:
3851  * aBidi - The Bidi-Context containing the estimated types and levels.
3852  * aTypes - Array to fill with the estimated Bidi types.
3853  * aLevels - Array to fill with the estimated embedding levels.
3854  *
3855  * RETURN VALUE:
3856  * None
3857  *
3858  *******************************************************************************/
3859 void EwBidiGetTypesAndLevels(XHandle aBidi, unsigned char *aTypes,
3860  unsigned char *aLevels);
3861 
3862 /*******************************************************************************
3863  * FUNCTION:
3864  * EwIndexToColor
3865  *
3866  * DESCRIPTION:
3867  * The function EwIndexToColor() returns the color entry from the global CLUT
3868  * (palette).
3869  *
3870  * This functionality is available on Index8, palette based target systems
3871  * only.
3872  *
3873  * ARGUMENTS:
3874  * aIndex - Index of the desired color entry within the global CLUT/palette.
3875  *
3876  * RETURN VALUE:
3877  * The color value or a transparent color if there is no global CLUT available
3878  * or the entry index is invalid.
3879  *
3880  *******************************************************************************/
3881 XColor EwIndexToColor(XInt32 aIndex);
3882 
3883 /*******************************************************************************
3884  * FUNCTION:
3885  * EwColorToIndex
3886  *
3887  * DESCRIPTION:
3888  * The function EwColorToIndex() determines an entry within the global CLUT/
3889  * palette, which corresponds to the given color (nearest color matching).
3890  *
3891  * This functionality is available on Index8, palette based target systems
3892  * only.
3893  *
3894  * ARGUMENTS:
3895  * aColor - Color to be found in the global CLUT/palette.
3896  *
3897  * RETURN VALUE:
3898  * The determined global CLUT/palette entry in range 0 .. 255. If there is no
3899  * global CLUT/palette functionality available, the returned value is 0.
3900  *
3901  *******************************************************************************/
3902 XUInt8 EwColorToIndex(XColor aColor);
3903 
3904 /*******************************************************************************
3905  * FUNCTION:
3906  * EwAllocUserColor
3907  *
3908  * DESCRIPTION:
3909  * The function EwAllocUserColor() tries to store the given user defined color
3910  * within an empty area in the global CLUT/palette. User defined colors exist
3911  * for external applications (native applications) only. In this manner the
3912  * external application can manage its own/private set of color values.
3913  *
3914  * This functionality is available on Index8, palette based target systems
3915  * only.
3916  *
3917  * ARGUMENTS:
3918  * aColor - Color to be stored in the global CLUT/palette.
3919  *
3920  * RETURN VALUE:
3921  * The global CLUT/palette entry, where the color could be stored. If there
3922  * are no entries available for new colors, 0 is returned.
3923  *
3924  *******************************************************************************/
3926 
3927 /*******************************************************************************
3928  * FUNCTION:
3929  * EwFreeUserColor
3930  *
3931  * DESCRIPTION:
3932  * The function EwFreeUserColor() removes the user defined color entry from
3933  * the global CLUT/palette. After this the affected entry remains empty. User
3934  * defined colors exist for external applications (native applications) only.
3935  * In this manner the external application can manage its own/private set of
3936  * color values.
3937  *
3938  * This functionality is available on Index8, palette based target systems
3939  * only.
3940  *
3941  * ARGUMENTS:
3942  * aIndex - Index of the user color entry within the global CLUT/palette.
3943  *
3944  * RETURN VALUE:
3945  * None.
3946  *
3947  *******************************************************************************/
3948 void EwFreeUserColor(XInt32 aIndex);
3949 
3950 /*******************************************************************************
3951  * FUNCTION:
3952  * EwSetUserColor
3953  *
3954  * DESCRIPTION:
3955  * The function EwSetUserColor() changes the color value of an user defined
3956  * color within the global CLUT/palette. User defined colors exist for
3957  *external applications (native applications) only. In this manner the
3958  *application can manage its own/private set of color values.
3959  *
3960  * This functionality is available on Index8, palette based target systems
3961  * only.
3962  *
3963  * ARGUMENTS:
3964  * aIndex - Index of the user color entry within the global CLUT/palette.
3965  * aColor - New color to be replace the old color value.
3966  *
3967  * RETURN VALUE:
3968  * None.
3969  *
3970  *******************************************************************************/
3971 void EwSetUserColor(XInt32 aIndex, XColor aColor);
3972 
3973 /*******************************************************************************
3974  * FUNCTION:
3975  * EwFindUserColor
3976  *
3977  * DESCRIPTION:
3978  * The function EwFindUserColor() searches the global CLUT/palette for an
3979  *entry containing exactly the given user defined color. If no corresponding
3980  *entry could be found, the function returns 0. In this case, the best fit color
3981  *can be found by using the function EwColorToIndex().
3982  *
3983  * User defined colors exist for external applications (native applications)
3984  * only. In this manner the application can manage its own/private set of
3985  *color values.
3986  *
3987  * This functionality is available on Index8, palette based target systems
3988  * only.
3989  *
3990  * ARGUMENTS:
3991  * aColor - Color to be found within the user defined color area of the global
3992  * CLUT/palette.
3993  *
3994  * RETURN VALUE:
3995  * The global CLUT/palette entry, where the desired color is stored. If no
3996  * corresponding entry could be found, the function returns 0.
3997  *
3998  *******************************************************************************/
3999 XUInt8 EwFindUserColor(XColor aColor);
4000 
4001 /*******************************************************************************
4002  * FUNCTION:
4003  * EwGetOverlayArea
4004  *
4005  * DESCRIPTION:
4006  * The function EwGetOverlayArea() is used internaly by the Mosaic framework
4007  * to obtain the additional area occupied by the overlay image. The Mosaic
4008  * framework uses the returned area to optimize the screen redrawing. Without
4009  * this information, the update process would result in an incomplete screen
4010  * showing only parts of the overlay.
4011  *
4012  * Please note, this function can't supress the overlay from being shown.
4013  * It exists only for optimization purpose.
4014  *
4015  * ARGUMENTS:
4016  * aVisible - If != 0, the function returns the currently visible area of
4017  * the overlay. If the overlay is hidden, the function will return an
4018  * empty area.
4019  * aUpdate - If != 0, the function returns the current update area of the
4020  * overlay. The update area results when overlay changes between the
4021  * visible and hidden state. If no state transition is recorded, an empty
4022  * area is returned.
4023  *
4024  * RETURN VALUE:
4025  * The currently visible area or the update area of the overlay. If no area
4026  * is available, the function returns an empty rectangle.
4027  *
4028  *******************************************************************************/
4029 XRect EwGetOverlayArea(XBool aVisible, XBool aUpdate);
4030 
4031 #ifdef __cplusplus
4032 }
4033 #endif
4034 
4035 #endif /* EWGFX_H */
4036 
4037 /* pba */
EwFreeAttrString
void EwFreeAttrString(XAttrString *aAttrString)
XSurface::Reserved
char Reserved[2]
Definition: ewgfxcore.h:293
EwGetAttrBitmap
XBitmap * EwGetAttrBitmap(XAttrSet *aAttrSet, XInt32 aBitmapNo)
_XSubPath::IsOpened
XBool IsOpened
Definition: ewgfx.h:716
EwGetNoOfAttrFonts
XInt32 EwGetNoOfAttrFonts(XAttrSet *aAttrSet)
_XSubPath
Definition: ewgfx.h:683
XAttrString
Definition: ewgfx.h:644
EwGetOverlayArea
XRect EwGetOverlayArea(XBool aVisible, XBool aUpdate)
XPathMatrix
struct _XPathMatrix XPathMatrix
EwBidiGetTypesAndLevels
void EwBidiGetTypesAndLevels(XHandle aBidi, unsigned char *aTypes, unsigned char *aLevels)
EwGetBitmapFromStrokePath
XBitmap * EwGetBitmapFromStrokePath(XPoint aSize, XPath *aPath, XBool aFlipY, XPoint aOffset, XFloat aWidth, XUInt32 aStyle, XFloat aMiterLimit, XBool aAntialiased)
EwDrawLine
void EwDrawLine(XBitmap *aDst, XInt32 aDstFrameNo, XRect aClipRect, XPoint aDstPos1, XPoint aDstPos2, XColor aColor1, XColor aColor2, XBool aBlend)
EwCloseSubPath
void EwCloseSubPath(XPath *aPath, XInt32 aSubPathNo)
ewgfxcore.h
ewextbmp.h
XViewport::Surfaces
XSurface * Surfaces
Definition: ewgfx.h:587
_XPathMatrix
Definition: ewgfx.h:709
EwGetAttrLinkName
XString EwGetAttrLinkName(XAttrString *aAttrString, XInt32 aLinkNo)
XUInt8
unsigned char XUInt8
Definition: ewrte.h:1588
EwLockBitmap
XBitmapLock * EwLockBitmap(XBitmap *aBitmap, XInt32 aFrameNo, XRect aArea, XBool aRead, XBool aWrite)
EwSetSubPathNode
void EwSetSubPathNode(XPath *aPath, XInt32 aSubPathNo, XInt32 aNodeNo, XFloat aX, XFloat aY)
EwSetAttrColor
void EwSetAttrColor(XAttrSet *aAttrSet, XInt32 aColorNo, XColor aColor)
EwGetSVGParserErrorPos
XInt32 EwGetSVGParserErrorPos(void)
EwFlushBitmap
void EwFlushBitmap(XBitmap *aBitmap)
EwBeginUpdateArea
XBitmap * EwBeginUpdateArea(XViewport *aViewport, XRect aArea)
EwFindUserColor
XUInt8 EwFindUserColor(XColor aColor)
XViewport::Display2
void * Display2
Definition: ewgfx.h:594
EwFullOffScreenBufferUpdate
int EwFullOffScreenBufferUpdate
EwFreeFont
void EwFreeFont(XFont *aFont)
XViewport::Valid
XBool Valid
Definition: ewgfx.h:590
XAttrSet
Definition: ewgfx.h:582
XBitmapLock
Definition: ewgfx.h:440
EwSetAttrBitmap
void EwSetAttrBitmap(XAttrSet *aAttrSet, XInt32 aBitmapNo, XBitmap *aBitmap)
EwAllocUserColor
XUInt8 EwAllocUserColor(XColor aColor)
_XSubPath::HasData
XBool HasData
Definition: ewgfx.h:715
EwMaxIssueTasks
int EwMaxIssueTasks
EwLazyLoadBitmapsIfAnimatedOnly
int EwLazyLoadBitmapsIfAnimatedOnly
XColor
Definition: ewrte.h:1700
EwModifyBitmapPalette
void EwModifyBitmapPalette(XBitmap *aBitmap, XInt32 aIndex, XInt32 aCount, XColor *aColors)
EwAddSubPathBezier3
XInt32 EwAddSubPathBezier3(XPath *aPath, XInt32 aSubPathNo, XFloat aCP1X, XFloat aCP1Y, XFloat aCP2X, XFloat aCP2Y, XFloat aX, XFloat aY, XInt32 aNoOfEdges)
XBmpRes::Frames
const XBmpFrameRes * Frames
Definition: ewextbmp.h:181
EwStrokePath
void EwStrokePath(XBitmap *aDst, XPath *aPath, XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect, XBool aFlipY, XPoint aOffset, XFloat aWidth, XUInt32 aStyle, XFloat aMiterLimit, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend, XBool aAntialiased)
EwGetAttrLinkBaseline
XInt32 EwGetAttrLinkBaseline(XAttrString *aAttrString, XInt32 aLinkNo, XInt32 aRegionNo)
EwDrawAttrText
void EwDrawAttrText(XBitmap *aDst, XAttrSet *aAttrSet, XAttrString *aAttrString, XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect, XPoint aSrcPos, XInt32 aOpacityTL, XInt32 aOpacityTR, XInt32 aOpacityBR, XInt32 aOpacityBL, XBool aBlend)
XHandle
unsigned long XHandle
Definition: ewrte.h:291
EwParseFlowString
XString EwParseFlowString(XFont *aFont, XChar *aString, XInt32 aWidth, XInt32 aMaxNoOfRows, XHandle aBidi)
EwSetAttrFont
void EwSetAttrFont(XAttrSet *aAttrSet, XInt32 aFontNo, XFont *aFont)
EwDoneGraphicsEngine
void EwDoneGraphicsEngine(void)
EwGetAttrLinkRect
XRect EwGetAttrLinkRect(XAttrString *aAttrString, XInt32 aLinkNo, XInt32 aRegionNo)
EwDrawBitmapFrame
void EwDrawBitmapFrame(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo, XInt32 aSrcFrameNo, XRect aClipRect, XRect aDstRect, XRect aSrcRect, XBool aDrawLeftEdge, XBool aDrawTopEdge, XBool aDrawRightEdge, XBool aDrawBottomEdge, XBool aDrawInterior, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend)
EwGetAttrColor
XColor EwGetAttrColor(XAttrSet *aAttrSet, XInt32 aColorNo)
XBmpRes
Definition: ewextbmp.h:133
EwDoneViewport
void EwDoneViewport(XViewport *aViewport)
_XSubPath::IsValid
XBool IsValid
Definition: ewgfx.h:718
void
XRect CoreOutline aOutline void(CoreRoot _this, GraphicsCanvas aCanvas, XRect aClip, XPoint aOffset, XInt32 aOpacity, XBool aBlend) EW_METHOD(HandleEvent
EwCreateAttrSet
XAttrSet * EwCreateAttrSet(XInt32 aNoOfFonts, XInt32 aNoOfBitmaps, XInt32 aNoOfColors)
XPath
Definition: ewgfx.h:739
EwTileBitmap
void EwTileBitmap(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo, XInt32 aSrcFrameNo, XRect aClipRect, XRect aDstRect, XRect aSrcRect, XPoint aSrcPos, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend)
EwGetNoOfAttrLinks
XInt32 EwGetNoOfAttrLinks(XAttrString *aAttrString)
EwGetFlowTextAdvance
XInt32 EwGetFlowTextAdvance(XFont *aFont, XChar *aFlowString)
_XSubPath::NoOfEdges
XInt32 NoOfEdges
Definition: ewgfx.h:714
EwAddSubPathArc
XInt32 EwAddSubPathArc(XPath *aPath, XInt32 aSubPathNo, XFloat aCenterX, XFloat aCenterY, XFloat aRadiusX, XFloat aRadiusY, XFloat aStartAngle, XFloat aEndAngle, XInt32 aNoOfEdges)
EwGetNoOfAttrColors
XInt32 EwGetNoOfAttrColors(XAttrSet *aAttrSet)
EwInitSubPath
XBool EwInitSubPath(XPath *aPath, XInt32 aSubPathNo, XInt32 aMaxNoOfEdges)
EwWarpBitmap
void EwWarpBitmap(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo, XInt32 aSrcFrameNo, XRect aClipRect, XFloat aDstX1, XFloat aDstY1, XFloat aDstW1, XFloat aDstX2, XFloat aDstY2, XFloat aDstW2, XFloat aDstX3, XFloat aDstY3, XFloat aDstW3, XFloat aDstX4, XFloat aDstY4, XFloat aDstW4, XRect aSrcRect, XColor aColor1, XColor aColor2, XColor aColor3, XColor aColor4, XBool aBlend, XBool aFilter)
XChar
unsigned short XChar
Definition: ewrte.h:1596
EwGetBitmapFromFillPath
XBitmap * EwGetBitmapFromFillPath(XPoint aSize, XPath *aPath, XBool aFlipY, XPoint aOffset, XBool aAntialiased, XBool aNonZeroWinding)
EwGetAttrTextSize
XPoint EwGetAttrTextSize(XAttrString *aAttrString)
EwBidiCompleteRow
void EwBidiCompleteRow(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd)
EwGetNoOfAttrBitmaps
XInt32 EwGetNoOfAttrBitmaps(XAttrSet *aAttrSet)
EwBidiReorderDWords
void EwBidiReorderDWords(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd, XUInt32 *aDWords)
_XSubPath::Data
float Data[2]
Definition: ewgfx.h:720
EwGetMaxNoOfSubPaths
XInt32 EwGetMaxNoOfSubPaths(XPath *aPath)
EwIndexToColor
XColor EwIndexToColor(XInt32 aIndex)
XViewport::Display1
void * Display1
Definition: ewgfx.h:593
XViewport::Bitmap
XBitmap Bitmap
Definition: ewgfx.h:585
XInt32
signed long XInt32
Definition: ewrte.h:1586
EwPopPathMatrix
void EwPopPathMatrix(XPath *aPath)
EwFillRectangle
void EwFillRectangle(XBitmap *aDst, XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend)
EwLoadFont
XFont * EwLoadFont(const struct XFntRes *aResource)
EwDiscardBitmapsIfNotUsedInRecentUpdates
int EwDiscardBitmapsIfNotUsedInRecentUpdates
EwBeginSubPath
void EwBeginSubPath(XPath *aPath, XInt32 aSubPathNo, XFloat aX, XFloat aY)
EwGetAttrFont
XFont * EwGetAttrFont(XAttrSet *aAttrSet, XInt32 aFontNo)
EwMaxSurfaceCacheSize
int EwMaxSurfaceCacheSize
ewextgfx.h
XSubPath
struct _XSubPath XSubPath
EwIsGlyphAvailable
int EwIsGlyphAvailable(XFont *aFont, XChar aCharCode)
XBool
char XBool
Definition: ewrte.h:1592
XViewport::Proc
XViewportProc Proc
Definition: ewgfx.h:592
EwColorToIndex
XUInt8 EwColorToIndex(XColor aColor)
XRect
Definition: ewrte.h:1639
_XSubPath::Bounds
XRect Bounds
Definition: ewgfx.h:719
EwCreateBitmap
XBitmap * EwCreateBitmap(int aFormat, XPoint aFrameSize, XInt32 aFrameDelay, XInt32 aNoOfFrames)
EwGetNoOfSubPathEdges
XInt32 EwGetNoOfSubPathEdges(XPath *aPath, XInt32 aSubPathNo)
EwGetPositionAtTextColumn
XInt32 EwGetPositionAtTextColumn(XFont *aFont, XChar *aString, XInt32 aCount, XInt32 aColumn, XInt32 aMinWidth)
EwUnlockGlyph
void EwUnlockGlyph(XGlyphLock *aLock)
EwBidiIsNeeded
XBool EwBidiIsNeeded(XHandle aBidi)
EwGetSubPathBounds
XRect EwGetSubPathBounds(XPath *aPath, XInt32 aSubPathNo)
EwCreatePath
XPath * EwCreatePath(XInt32 aMaxNoOfSubPaths)
EwBidiMirrorGlyphs
void EwBidiMirrorGlyphs(XHandle aBidi, XChar *aString)
XViewport::Frames
XBitmapFrame Frames
Definition: ewgfx.h:586
EwBeginUpdate
XBitmap * EwBeginUpdate(XViewport *aViewport)
EwGetTextColumnAtPosition
XInt32 EwGetTextColumnAtPosition(XFont *aFont, XChar *aString, XInt32 aCount, XInt32 aX, XInt32 aMinWidth)
aOpacity
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 aOpacity
Definition: _CoreOutline.h:172
_XPathMatrix::Matrix
float Matrix[6]
Definition: ewgfx.h:725
EwGetSVGParserStatus
int EwGetSVGParserStatus(void)
EwBidiIsRTL
XBool EwBidiIsRTL(XHandle aBidi)
XViewport::Display3
void * Display3
Definition: ewgfx.h:595
EwInitViewport
XViewport * EwInitViewport(XPoint aSize, XRect aExtent, XInt32 aOrient, XInt32 aOpacity, void *aDisplay1, void *aDisplay2, void *aDisplay3, XViewportProc aProc)
XViewport::Reserved
char Reserved[3]
Definition: ewgfx.h:591
EwShiftSubPathNodes
XInt32 EwShiftSubPathNodes(XPath *aPath, XInt32 aSubPathNo, XInt32 aNoOfNodes, XFloat aTranslateX, XFloat aTranslateY)
EwGetNoOfAttrLinkRegions
XInt32 EwGetNoOfAttrLinkRegions(XAttrString *aAttrString, XInt32 aLinkNo)
EwScalePathMatrix
void EwScalePathMatrix(XPath *aPath, XFloat aScaleX, XFloat aScaleY)
EwAddSubPathLine
XInt32 EwAddSubPathLine(XPath *aPath, XInt32 aSubPathNo, XFloat aX, XFloat aY)
EwGetTextAdvance
XInt32 EwGetTextAdvance(XFont *aFont, XChar *aString, XInt32 aCount)
EwFreeBitmap
void EwFreeBitmap(XBitmap *aBitmap)
EwCopyBitmap
void EwCopyBitmap(XBitmap *aDst, XBitmap *aSrc, XInt32 aDstFrameNo, XInt32 aSrcFrameNo, XRect aClipRect, XRect aDstRect, XPoint aSrcPos, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend)
XSurface::Format
short Format
Definition: ewgfxcore.h:290
EwBidiInit
XBool EwBidiInit(XHandle aBidi, XChar *aString, XInt32 aCount, XInt32 aBaseDirection)
EwGetNoOfFreeSubPathEdges
XInt32 EwGetNoOfFreeSubPathEdges(XPath *aPath, XInt32 aSubPathNo)
EwCreatePathFromSVGString
XPath * EwCreatePathFromSVGString(XString aSVGString, XFloat aScaleX, XFloat aScaleY, XFloat aDeltaX, XFloat aDeltaY, XFloat aAngle)
XBitmapFrame
Definition: ewgfx.h:309
EwEndUpdate
void EwEndUpdate(XViewport *aViewport, XRect aArea)
EwBidiGetCharLevel
XInt32 EwBidiGetCharLevel(XHandle aBidi, XInt32 aIndex)
EwGetPathBounds
XRect EwGetPathBounds(XPath *aPath)
EwAddSubPathBezier2
XInt32 EwAddSubPathBezier2(XPath *aPath, XInt32 aSubPathNo, XFloat aCPX, XFloat aCPY, XFloat aX, XFloat aY, XInt32 aNoOfEdges)
ewgfxdriver.h
XFloat
float XFloat
Definition: ewrte.h:1595
_XSubPath::IsClosed
XBool IsClosed
Definition: ewgfx.h:717
EwFreeBidi
void EwFreeBidi(XHandle aBidi)
EwBidiReorderIndex
XInt32 EwBidiReorderIndex(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd, XInt32 aIndex)
XFntRes
Definition: ewextfnt.h:126
EwMaxGlyphSurfaceHeight
int EwMaxGlyphSurfaceHeight
EwMaxGlyphSurfaceWidth
int EwMaxGlyphSurfaceWidth
ewgfxdefs.h
EwInitGraphicsEngine
int EwInitGraphicsEngine(void *aArgs)
EwInitPathMatrix
void EwInitPathMatrix(XPath *aPath)
EwDrawBorder
void EwDrawBorder(XBitmap *aDst, XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect, XInt32 aEdgeWidth, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend)
EwGetKerning
XInt32 EwGetKerning(XFont *aFont, XChar aCharCode1, XChar aCharCode2)
EwFreeUserColor
void EwFreeUserColor(XInt32 aIndex)
EwFreeAttrSet
void EwFreeAttrSet(XAttrSet *aAttrSet)
EwDiscardBitmapsIfNotUsedInCurrentUpdate
int EwDiscardBitmapsIfNotUsedInCurrentUpdate
EwGetGlyphMetrics
int EwGetGlyphMetrics(XFont *aFont, XChar aCharCode, XGlyphMetrics *aMetrics)
EwTranslatePathMatrix
void EwTranslatePathMatrix(XPath *aPath, XFloat aDeltaX, XFloat aDeltaY)
EwSetUserColor
void EwSetUserColor(XInt32 aIndex, XColor aColor)
XViewport::UpdateArea
XRect UpdateArea
Definition: ewgfx.h:589
EwIsSubPathClosed
XBool EwIsSubPathClosed(XPath *aPath, XInt32 aSubPathNo)
EwFreePath
void EwFreePath(XPath *aPath)
EwFullScreenUpdate
int EwFullScreenUpdate
EwPreserveFramebufferContent
int EwPreserveFramebufferContent
XPoint
Definition: ewrte.h:1616
_XPathMatrix::Next
struct _XPathMatrix * Next
Definition: ewgfx.h:724
EwEnableGfxTaskTracing
void EwEnableGfxTaskTracing(int aEnable)
aOffset
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint aOffset
Definition: _CoreOutline.h:172
EwConfigViewport
int EwConfigViewport(XViewport *aViewport, XPoint aPos, XInt32 aOpacity)
EwLazyLoadBitmaps
int EwLazyLoadBitmaps
EwLoadBitmap
XBitmap * EwLoadBitmap(const struct XBmpRes *aResource)
EwBidiReorderChars
void EwBidiReorderChars(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd, XChar *aChars)
EwBidiProcess
void EwBidiProcess(XHandle aBidi, XChar *aString)
XUInt32
unsigned long XUInt32
Definition: ewrte.h:1590
XGlyphMetrics
Definition: ewgfx.h:404
XSurface
Definition: ewgfxcore.h:221
ewconfig.h
This file contains general configuration settings for the target system, like memory ranges and displ...
EwUnlockBitmap
void EwUnlockBitmap(XBitmapLock *aLock)
XViewport::Size
XPoint Size
Definition: ewgfx.h:584
EwLockGlyph
XGlyphLock * EwLockGlyph(XFont *aFont, XChar aCharCode)
EwGetSubPathNodeX
XFloat EwGetSubPathNodeX(XPath *aPath, XInt32 aSubPathNo, XInt32 aNodeNo)
XString
XChar * XString
Definition: ewrte.h:1656
XViewport::Surface
XSurface Surface
Definition: ewgfx.h:588
EwGetTextExtent
XRect EwGetTextExtent(XFont *aFont, XChar *aString, XInt32 aCount)
EwPushPathMatrix
void EwPushPathMatrix(XPath *aPath)
XUInt16
unsigned short XUInt16
Definition: ewrte.h:1589
EwDrawText
void EwDrawText(XBitmap *aDst, XFont *aFont, XChar *aString, XInt32 aCount, XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect, XPoint aSrcPos, XInt32 aMinWidth, XInt32 aOrientation, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend)
EwAddSubPathCopy
XInt32 EwAddSubPathCopy(XPath *aPath, XInt32 aSubPathNo, XPath *aSrcPath, XInt32 aSrcSubPathNo, XInt32 aSrcNodeNo, XInt32 aNoOfEdges)
EwDiscardBitmapsIfAnimatedOnly
int EwDiscardBitmapsIfAnimatedOnly
XViewport
Definition: ewgfx.h:547
XViewport::Handle
unsigned long Handle
Definition: ewgfx.h:596
EwBidiApplyShaping
void EwBidiApplyShaping(XHandle aBidi, XChar *aString, XUInt32 *aAttrs, XFont **aFonts, XInt32 aNoOfFonts)
EwFillPath
void EwFillPath(XBitmap *aDst, XPath *aPath, XInt32 aDstFrameNo, XRect aClipRect, XRect aDstRect, XBool aFlipY, XPoint aOffset, XColor aColorTL, XColor aColorTR, XColor aColorBR, XColor aColorBL, XBool aBlend, XBool aAntialiased, XBool aNonZeroWinding)
EwDiscardBitmaps
int EwDiscardBitmaps
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
XSurface::Handle
unsigned long Handle
Definition: ewgfxcore.h:298
ewextfnt.h
EwGetSubPathNodeY
XFloat EwGetSubPathNodeY(XPath *aPath, XInt32 aSubPathNo, XInt32 aNodeNo)
EwCreateBidi
XHandle EwCreateBidi(XInt32 aMaxSize)
EwRotatePathMatrix
void EwRotatePathMatrix(XPath *aPath, XFloat aAngle)
XFont
Definition: ewgfx.h:379
XBitmap
Definition: ewgfx.h:344
XViewportProc
void(* XViewportProc)(XViewport *aViewport, unsigned long aHandle, void *aDisplay1, void *aDisplay2, void *aDisplay3, XRect aArea)
Definition: ewgfx.h:506
EwBidiReverseReorderIndex
XInt32 EwBidiReverseReorderIndex(XHandle aBidi, XInt32 aRowStart, XInt32 aRowEnd, XInt32 aIndex)
EwIsAttrTextRTL
XBool EwIsAttrTextRTL(XAttrString *aAttrString)
EwParseAttrString
XAttrString * EwParseAttrString(XAttrSet *aAttrSet, XChar *aString, XInt32 aWidth, XBool aEnableBidiText)
_XSubPath::Capacity
XInt32 Capacity
Definition: ewgfx.h:713
XGlyphLock
Definition: ewgfx.h:469