1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** GUIX Component                                                        */
17 /**                                                                       */
18 /**   Utility (Utility)                                                   */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  COMPONENT DEFINITION                                   RELEASE        */
27 /*                                                                        */
28 /*    gx_utility.h                                        PORTABLE C      */
29 /*                                                           6.1.10       */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Kenneth Maxwell, Microsoft Corporation                              */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file defines the GUIX utility component,                       */
37 /*    including all data types and external references.  It is assumed    */
38 /*    that gx_api.h and gx_port.h have already been included.             */
39 /*                                                                        */
40 /*  RELEASE HISTORY                                                       */
41 /*                                                                        */
42 /*    DATE              NAME                      DESCRIPTION             */
43 /*                                                                        */
44 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
45 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
46 /*                                            added new prototype,        */
47 /*                                            resulting in version 6.1    */
48 /*  12-31-2020     Kenneth Maxwell          Modified comment(s), added    */
49 /*                                            bidi test reordering APIs,  */
50 /*                                            resulting in version 6.1.3  */
51 /*  06-02-2021     Kenneth Maxwell          Modified comment(s),          */
52 /*                                            rename RENESAS_DAVE2D       */
53 /*                                            support conditional,        */
54 /*                                            resulting in version 6.1.7  */
55 /*  01-31-2022     Ting Zhu                 Modified comment(s),          */
56 /*                                            added new bidi text         */
57 /*                                            reordering API,             */
58 /*                                            resulting in version 6.1.10 */
59 /*                                                                        */
60 /**************************************************************************/
61 
62 #ifndef GX_UTILITY_H
63 #define GX_UTILITY_H
64 
65 #if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
66 /* Define bidi character types. */
67 #define GX_BIDI_CHARACTER_TYPE_L     0x01 /* Left to Right */
68 #define GX_BIDI_CHARACTER_TYPE_R     0x02 /* Right to Left */
69 #define GX_BIDI_CHARACTER_TYPE_AL    0x03 /* Right to Left Arabic */
70 #define GX_BIDI_CHARACTER_TYPE_EN    0x04 /* European Number */
71 #define GX_BIDI_CHARACTER_TYPE_ES    0x05 /* European Number Separator */
72 #define GX_BIDI_CHARACTER_TYPE_ET    0x06 /* European Number Terminator */
73 #define GX_BIDI_CHARACTER_TYPE_AN    0x07 /* Arabic Number */
74 #define GX_BIDI_CHARACTER_TYPE_CS    0x08 /* Common Number Separator */
75 #define GX_BIDI_CHARACTER_TYPE_NSM   0x09 /* Nonspacing Mark */
76 #define GX_BIDI_CHARACTER_TYPE_BN    0x0A /* Boundary Neutral */
77 #define GX_BIDI_CHARACTER_TYPE_B     0x0B /* Paragraph Separator */
78 #define GX_BIDI_CHARACTER_TYPE_S     0x0C /* Segment Separator */
79 #define GX_BIDI_CHARACTER_TYPE_WS    0x0D /* Whitespace */
80 #define GX_BIDI_CHARACTER_TYPE_ON    0x0E /* Other Neutrals */
81 #define GX_BIDI_CHARACTER_TYPE_LRE   0x0F
82 #define GX_BIDI_CHARACTER_TYPE_LRO   0x10
83 #define GX_BIDI_CHARACTER_TYPE_RLE   0x11
84 #define GX_BIDI_CHARACTER_TYPE_RLO   0x12
85 #define GX_BIDI_CHARACTER_TYPE_PDF   0x13
86 #define GX_BIDI_CHARACTER_TYPE_LRI   0x14
87 #define GX_BIDI_CHARACTER_TYPE_RLI   0x15
88 #define GX_BIDI_CHARACTER_TYPE_FSI   0x16
89 #define GX_BIDI_CHARACTER_TYPE_PDI   0x17
90 
91 #define GX_BIDI_CATEGORY_STRONG      0x01
92 #define GX_BIDI_CATEGORY_WEAK        0x02
93 #define GX_BIDI_CATEGORY_NEUTRAL     0x03
94 
95 #define GX_BIDI_DIRECTION_FORMAT_LRE 0x202A /* Left to Right Embedding */
96 #define GX_BIDI_DIRECTION_FORMAT_LRO 0x202D /* Left to Right Override */
97 #define GX_BIDI_DIRECTION_FORMAT_RLE 0x202B /* Right to Left Embedding */
98 #define GX_BIDI_DIRECTION_FORMAT_RLO 0x202E /* Right to Left Override */
99 #define GX_BIDI_DIRECTION_FORMAT_PDF 0x202C /* Pop Directional Format */
100 #define GX_BIDI_DIRECTION_FORMAT_LRI 0x2066 /* Left to Right Isolate */
101 #define GX_BIDI_DIRECTION_FORMAT_RLI 0x2067 /* Right to Left Isolate */
102 #define GX_BIDI_DIRECTION_FORMAT_FSI 0x2068 /* First Strong Isolate */
103 #define GX_BIDI_DIRECTION_FORMAT_PDI 0x2069 /* Pop Directional Isolate */
104 
105 
106 #define GX_BIDI_OVERRIDE_STATUS_N    0x01 /* No override is currently active */
107 #define GX_BIDI_OVERRIDE_STATUS_R    0x02 /* Characters are to be reset to R */
108 #define GX_BIDI_OVERRIDE_STATUS_L    0x03 /* Characters are to be reset to L */
109 
110 #define GX_BIDI_MAX_EXPLICIT_DEPTH   125
111 #define GX_BIDI_MAX_BRACKET_DEPTH    63
112 
113 /* Define explicit entry structure. */
114 typedef struct GX_BIDI_EXPLICIT_ENTRY_STRUCT
115 {
116     GX_UBYTE gx_bidi_explicit_level;
117     GX_BOOL  gx_bidi_explicit_override_status;
118     GX_BOOL  gx_bidi_explicit_isolate_status;
119 } GX_BIDI_EXPLICIT_ENTRY;
120 
121 /* Define level run information structure. */
122 typedef struct GX_BIDI_LEVEL_RUN_STRUCT
123 {
124     INT                              gx_bidi_level_run_start_index;
125     INT                              gx_bidi_level_run_end_index;
126     GX_UBYTE                         gx_bidi_level_run_level;
127     struct GX_BIDI_LEVEL_RUN_STRUCT *gx_bidi_level_run_next;
128 } GX_BIDI_LEVEL_RUN;
129 
130 /* Define isolate run sequence information structure. */
131 typedef struct GX_BIDI_ISOLATE_RUN_STRUCT
132 {
133     INT                               *gx_bidi_isolate_run_index_list;
134     INT                                gx_bidi_isolate_run_index_count;
135     GX_UBYTE                           gx_bidi_isolate_run_sos;
136     GX_UBYTE                           gx_bidi_isolate_run_eos;
137     struct GX_BIDI_ISOLATE_RUN_STRUCT *gx_bidi_isolate_run_next;
138 } GX_BIDI_ISOLATE_RUN;
139 
140 /* Define unicode information structure. */
141 typedef struct GX_BIDI_UNIT_STRUCT
142 {
143     ULONG    gx_bidi_unit_code;
144     GX_UBYTE gx_bidi_unit_level;
145     GX_UBYTE gx_bidi_unit_type;
146     GX_UBYTE gx_bidi_unit_org_type;
147 } GX_BIDI_UNIT;
148 
149 /* Define a truture to keep parameters for a bunch of functions. */
150 typedef struct GX_BIDI_CONTEXT_STRUCT
151 {
152     GX_BIDI_TEXT_INFO   *gx_bidi_context_input_info;
153     UINT                 gx_bidi_context_processced_size;
154     UINT                 gx_bidi_context_total_lines;
155     GX_BIDI_UNIT        *gx_bidi_context_unit_list;
156     INT                  gx_bidi_context_unit_count;
157     INT                 *gx_bidi_context_line_index_cache;
158     GX_BIDI_LEVEL_RUN   *gx_bidi_context_level_runs;
159     GX_BIDI_ISOLATE_RUN *gx_bidi_context_isolate_runs;
160     GX_UBYTE            *gx_bidi_context_buffer;
161     UINT                 gx_bidi_context_buffer_size;
162     UINT                 gx_bidi_context_buffer_index;
163     UINT                 gx_bidi_context_bracket_pair_size;
164     GX_UBYTE             gx_bidi_context_base_level;
165     ULONG                gx_bidi_context_reordered_utf8_size;
166 } GX_BIDI_CONTEXT;
167 
168 /* Define bidirectional character infomation structure. */
169 typedef struct GX_BIDI_CHARACTER_INFO_STRUCT
170 {
171     ULONG    gx_bidi_character_info_range_start;
172     ULONG    gx_bidi_character_info_range_end;
173     GX_UBYTE gx_bidi_character_info_type;
174 } GX_BIDI_CHARACTER_INFO;
175 
176 typedef struct GX_BIDI_BRACKET_PAIR_STRUCT
177 {
178     ULONG gx_bidi_bracket_pair_open;
179     ULONG gx_bidi_bracket_pair_close;
180 } GX_BIDI_BRACKET_PAIR;
181 
182 #define GX_UTILITY_TEXT_DIRECTION_GET(direction, widget, canvas, display)                                                      \
183             direction = GX_LANGUAGE_DIRECTION_LTR;                                                                             \
184                                                                                                                                \
185             if (_gx_widget_canvas_get((GX_WIDGET *)widget, &canvas) == GX_SUCCESS)                                             \
186             {                                                                                                                  \
187                 display = canvas -> gx_canvas_display;                                                                         \
188                                                                                                                                \
189                 if (display -> gx_display_language_direction_table)                                                            \
190                 {                                                                                                              \
191                     direction = (GX_BYTE)display -> gx_display_language_direction_table[display -> gx_display_active_language];\
192                 }                                                                                                              \
193             }
194 #endif
195 
196 #define GX_UTILITY_MATH_UINT_ADD(augend, addend, result) \
197     if ((UINT)-1 - (augend) < (addend))                  \
198     {                                                    \
199         return GX_MATH_OVERFLOW;                         \
200     }                                                    \
201     else                                                 \
202     {                                                    \
203         (result) = (augend) + (addend);                  \
204     }
205 
206 #define GX_UTILITY_MATH_UINT_MULT(multiplicand, multiplier, result) \
207     if ((UINT)-1 / (multiplier) < (multiplicand))                   \
208     {                                                               \
209         return GX_MATH_OVERFLOW;                                    \
210     }                                                               \
211     else                                                            \
212     {                                                               \
213         (result) = (multiplicand) * (multiplier);                   \
214     }
215 
216 #define GX_UTILITY_MATH_USHORT_ADD(augend, addend, result) \
217     if ((USHORT)-1 - (augend) < (addend))                  \
218     {                                                      \
219         return GX_MATH_OVERFLOW;                           \
220     }                                                      \
221     else                                                   \
222     {                                                      \
223         (result) = (USHORT)((augend) + (addend));          \
224     }
225 
226 #define GX_UTILITY_MATH_USHORT_MULT(multiplicand, multiplier, result) \
227     if ((USHORT)-1 / (multiplier) < (multiplicand))                   \
228     {                                                                 \
229         return GX_MATH_OVERFLOW;                                      \
230     }                                                                 \
231     else                                                              \
232     {                                                                 \
233         result = (USHORT)((multiplicand) * (multiplier));             \
234     }
235 
236 #define GX_UTILITY_USHORT_CHECK(a)\
237     if((a) > (USHORT)-1)          \
238     {                             \
239         return GX_MATH_OVERFLOW;  \
240     }
241 
242 /* Define utility component function prototypes.  */
243 UINT _gx_utility_1bpp_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
244 UINT _gx_utility_1bpp_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
245 UINT _gx_utility_1bpp_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
246 UINT _gx_utility_4bpp_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
247 UINT _gx_utility_4bpp_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
248 UINT _gx_utility_4bpp_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
249 UINT _gx_utility_8bpp_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
250 UINT _gx_utility_8bit_alphamap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
251 UINT _gx_utility_8bpp_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
252 UINT _gx_utility_8bpp_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
253 UINT _gx_utility_8bit_alphamap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
254 UINT _gx_utility_16bpp_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
255 UINT _gx_utility_32argb_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
256 UINT _gx_utility_32argb_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
257 UINT _gx_utility_32argb_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
258 UINT _gx_utility_332rgb_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
259 UINT _gx_utility_332rgb_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
260 UINT _gx_utility_565rgb_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
261 UINT _gx_utility_565rgb_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
262 UINT _gx_utility_1555xrgb_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
263 UINT _gx_utility_1555xrgb_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
264 UINT _gx_utility_4444argb_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
265 UINT _gx_utility_4444argb_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
266 UINT _gx_utility_4444argb_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
267 UINT _gx_utility_alphamap_create(INT width, INT height, GX_PIXELMAP *map);
268 UINT _gx_utility_circle_point_get(INT xcenter, INT ycenter, UINT r, INT angle, GX_POINT *point);
269 UINT _gx_utility_easing_function_calculate(USHORT easing_function_style, INT start_val, INT end_val, INT t, INT d, INT *return_value);
270 
271 VOID _gx_utility_glyph_1bpp_to_alphamap_draw(GX_PIXELMAP *map, INT xpos, INT ypos, GX_CONST GX_GLYPH *glyph);
272 VOID _gx_utility_glyph_4bpp_to_alphamap_draw(GX_PIXELMAP *map, INT xpos, INT ypos, GX_CONST GX_GLYPH *glyph);
273 VOID _gx_utility_glyph_8bpp_to_alphamap_draw(GX_PIXELMAP *map, INT xpos, INT ypos, GX_CONST GX_GLYPH *glyph);
274 
275 #if defined(GX_RENESAS_DAVE2D_FONT_SUPPORT)
276 VOID _gx_utility_glyph_reversed_4bpp_to_alphamap_draw(GX_PIXELMAP *map, INT xpos, INT ypos, GX_CONST GX_GLYPH *glyph);
277 VOID _gx_utility_glyph_reversed_1bpp_to_alphamap_draw(GX_PIXELMAP *map, INT xpos, INT ypos, GX_CONST GX_GLYPH *glyph);
278 #endif
279 
280 UINT _gx_utility_gradient_create(GX_GRADIENT *gradient, GX_VALUE width, GX_VALUE height, UCHAR type, GX_UBYTE start_alpha, GX_UBYTE end_alpha);
281 UINT _gx_utility_gradient_delete(GX_GRADIENT *gradient);
282 UINT _gx_utility_canvas_to_bmp(GX_CANVAS *canvas, GX_RECTANGLE *rect, UINT (*write_data)(GX_UBYTE *byte_data, UINT data_count));
283 UINT _gx_utility_ltoa(LONG value, GX_CHAR *return_buffer, UINT return_buffer_size);
284 
285 #if defined(GUIX_5_4_0_COMPATIBILITY)
286 INT _gx_utility_math_acos_5_4_0(INT x);
287 INT _gx_utility_math_asin_5_4_0(INT x);
288 INT _gx_utility_math_cos_5_4_0(INT angle);
289 INT _gx_utility_math_sin_5_4_0(INT angle);
290 #endif
291 
292 INT          _gx_utility_math_acos(GX_FIXED_VAL x);
293 INT          _gx_utility_math_asin(GX_FIXED_VAL x);
294 GX_FIXED_VAL _gx_utility_math_cos(GX_FIXED_VAL angle);
295 GX_FIXED_VAL _gx_utility_math_sin(GX_FIXED_VAL angle);
296 UINT         _gx_utility_math_sqrt(UINT n);
297 
298 UINT         _gx_utility_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
299 UINT         _gx_utility_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
300 UINT         _gx_utility_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
301 UINT         _gx_utility_rectangle_center(GX_RECTANGLE *rectangle, GX_RECTANGLE *within);
302 UINT         _gx_utility_rectangle_center_find(GX_RECTANGLE *rectangle, GX_POINT *return_center);
303 UINT         _gx_utility_rectangle_combine(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle);
304 GX_BOOL      _gx_utility_rectangle_compare(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle);
305 UINT         _gx_utility_rectangle_define(GX_RECTANGLE *rectangle, GX_VALUE left, GX_VALUE top, GX_VALUE right, GX_VALUE bottom);
306 GX_BOOL      _gx_utility_rectangle_inside_detect(GX_RECTANGLE *outer, GX_RECTANGLE *inner);
307 GX_BOOL      _gx_utility_rectangle_overlap_detect(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle, GX_RECTANGLE *return_overlap_area);
308 GX_BOOL      _gx_utility_rectangle_point_detect(GX_RECTANGLE *rectangle, GX_POINT point);
309 UINT         _gx_utility_rectangle_resize(GX_RECTANGLE *rectangle, GX_VALUE adjust);
310 UINT         _gx_utility_rectangle_shift(GX_RECTANGLE *rectangle, GX_VALUE x_shift, GX_VALUE y_shift);
311 
312 #if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
313 #if defined(GX_DYNAMIC_ARABIC_SHAPING_SUPPORT)
314 UINT _gx_utility_bidi_arabic_shaping(GX_BIDI_CONTEXT *context);
315 #endif
316 UINT _gx_utility_bidi_bracket_pair_get(ULONG code, GX_BIDI_BRACKET_PAIR *bracket_pair);
317 UINT _gx_utility_bidi_character_type_get(ULONG code, GX_UBYTE *type);
318 UINT _gx_utility_bidi_mirroring_get(USHORT code, USHORT *mirror);
319 UINT _gx_utility_bidi_paragraph_reorder(GX_BIDI_TEXT_INFO *input_info, GX_BIDI_RESOLVED_TEXT_INFO **resolved_info_head);
320 UINT _gx_utility_bidi_paragraph_reorder_ext(GX_BIDI_TEXT_INFO *input_info, GX_BIDI_RESOLVED_TEXT_INFO **resolved_info_head);
321 UINT _gx_utility_bidi_resolved_text_info_delete(GX_BIDI_RESOLVED_TEXT_INFO **resolved_info_head);
322 #endif
323 
324 #ifdef GX_THAI_GLYPH_SHAPING_SUPPORT
325 UINT    _gx_utility_thai_glyph_shaping(GX_CONST GX_STRING *string, GX_CHAR_CODE **returned_code_list, UINT *returned_code_count);
326 #endif
327 
328 UINT    _gx_utility_string_length_check(GX_CONST GX_CHAR *string, UINT *length, UINT max_string_length);
329 GX_BOOL _gx_utility_string_compare(GX_CONST GX_STRING *string_1, GX_CONST GX_STRING *string_2, UINT count);
330 
331 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
332 UINT    _gx_utility_string_to_alphamap(GX_CONST GX_CHAR *text, GX_CONST GX_FONT *font, GX_PIXELMAP *textmap);
333 #endif
334 UINT    _gx_utility_string_to_alphamap_ext(GX_CONST GX_STRING *text, GX_CONST GX_FONT *font, GX_PIXELMAP *textmap);
335 VOID    _gx_utility_string_to_alphamap_draw(GX_CONST GX_STRING *text, GX_CONST GX_FONT *font, GX_PIXELMAP *map);
336 
337 #ifdef GX_UTF8_SUPPORT
338 UINT    _gx_utility_unicode_to_utf8(ULONG unicode, GX_UBYTE *return_utf8_str, UINT *return_utf8_size);
339 UINT    _gx_utility_utf8_string_character_get(GX_STRING *utf8_str, GX_CHAR_CODE *glyph_value, UINT *glyph_len);
340 UINT    _gx_utility_utf8_string_backward_character_length_get(GX_STRING *utf8_str, INT start_index, UINT *glyph_len);
341 #endif /* GX_UTF8_SUPPORT */
342 
343 /* Define error checking shells for API services.  These are only referenced by the
344    application.  */
345 UINT    _gxe_utility_canvas_to_bmp(GX_CANVAS *canvas, GX_RECTANGLE *rect, UINT (*write_data)(GX_UBYTE *byte_data, UINT data_count));
346 UINT    _gxe_utility_circle_point_get(INT xcenter, INT ycenter, UINT r, INT angle, GX_POINT *point);
347 UINT    _gxe_utility_gradient_create(GX_GRADIENT *gradient, GX_VALUE width, GX_VALUE height, UCHAR type, GX_UBYTE start_alpha, GX_UBYTE end_alpha);
348 UINT    _gxe_utility_gradient_delete(GX_GRADIENT *gradient);
349 UINT    _gxe_utility_ltoa(LONG value, GX_CHAR *return_buffer, UINT return_buffer_size);
350 UINT    _gxe_utility_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height);
351 UINT    _gxe_utility_pixelmap_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
352 UINT    _gxe_utility_pixelmap_simple_rotate(GX_PIXELMAP *src, INT angle, GX_PIXELMAP *destination, INT *rot_cx, INT *rot_cy);
353 UINT    _gxe_utility_rectangle_center(GX_RECTANGLE *rectangle, GX_RECTANGLE *within);
354 UINT    _gxe_utility_rectangle_center_find(GX_RECTANGLE *rectangle, GX_POINT *return_center);
355 UINT    _gxe_utility_rectangle_combine(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle);
356 GX_BOOL _gxe_utility_rectangle_compare(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle);
357 UINT    _gxe_utility_rectangle_define(GX_RECTANGLE *rectangle, GX_VALUE left, GX_VALUE top, GX_VALUE right, GX_VALUE bottom);
358 UINT    _gxe_utility_rectangle_resize(GX_RECTANGLE *rectangle, GX_VALUE adjust);
359 GX_BOOL _gxe_utility_rectangle_overlap_detect(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle, GX_RECTANGLE *return_overlap_area);
360 GX_BOOL _gxe_utility_rectangle_point_detect(GX_RECTANGLE *rectangle, GX_POINT point);
361 UINT    _gxe_utility_rectangle_shift(GX_RECTANGLE *rectangle, GX_VALUE x_shift, GX_VALUE y_shift);
362 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
363 UINT    _gxe_utility_string_to_alphamap(GX_CONST GX_CHAR *text, GX_CONST GX_FONT *font, GX_PIXELMAP *textmap);
364 #endif
365 UINT    _gxe_utility_string_to_alphamap_ext(GX_CONST GX_STRING *text, GX_CONST GX_FONT *font, GX_PIXELMAP *textmap);
366 #if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
367 UINT    _gxe_utility_bidi_paragraph_reorder(GX_BIDI_TEXT_INFO *input_info, GX_BIDI_RESOLVED_TEXT_INFO **resolved_info_head);
368 UINT    _gxe_utility_bidi_paragraph_reorder_ext(GX_BIDI_TEXT_INFO *input_info, GX_BIDI_RESOLVED_TEXT_INFO **resolved_info_head);
369 UINT    _gxe_utility_bidi_resolved_text_info_delete(GX_BIDI_RESOLVED_TEXT_INFO **resolved_info_head);
370 #endif
371 #endif
372 
373