Skip to content

Commit

Permalink
updated to 6.0.1 and added additional processors/toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Larson committed Jul 13, 2020
1 parent a41ff7c commit 59d985d
Show file tree
Hide file tree
Showing 7 changed files with 1,148 additions and 363 deletions.
1 change: 1 addition & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ target_sources(${PROJECT_NAME}
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_8bpp_pixelmap_resize.c
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_8bpp_pixelmap_rotate.c
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_alphamap_create.c
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_bidi_arabic_shaping.c
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_bidi_bracket_pair_get.c
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_bidi_character_type_get.c
${CMAKE_CURRENT_LIST_DIR}/src/gx_utility_bidi_mirroring_get.c
Expand Down
17 changes: 14 additions & 3 deletions common/inc/gx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* gx_api.h PORTABLE C */
/* 6.0 */
/* 6.0.1 */
/* AUTHOR */
/* */
/* Kenneth Maxwell, Microsoft Corporation */
Expand All @@ -42,6 +42,10 @@
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
/* 06-30-2020 Kenneth Maxwell Modified comment(s), */
/* added line break status, */
/* updated product constants, */
/* resulting in version 6.0.1 */
/* */
/**************************************************************************/

Expand All @@ -62,9 +66,15 @@ extern "C" {
/* Define the major/minor version information that can be used by the application
and the GUIX source as well. */

#define AZURE_RTOS_GUIX
#define GUIX_MAJOR_VERSION 6
#define GUIX_MINOR_VERSION 0
#define GUIX_PATCH_VERSION 1

/* The following symbols are defined for backward compatibility reasons.*/
#define __PRODUCT_GUIX__
#define __GUIX_MAJOR_VERSION 6
#define __GUIX_MINOR_VERSION 0
#define __GUIX_MAJOR_VERSION GUIX_MAJOR_VERSION
#define __GUIX_MINOR_VERSION GUIX_MINOR_VERSION

/* Ensure that ThreadX error checking is disabled for GUIX source code. */

Expand Down Expand Up @@ -664,6 +674,7 @@ typedef struct GX_STRING_STRUCT

#define GX_STATUS_MODAL 0x00100000UL

#define GX_STATUS_LINE_BREAK_PROCESSED 0x02000000UL
#define GX_STATUS_RESIZE_NOTIFY 0x04000000UL
#define GX_STATUS_STUDIO_CREATED 0x08000000UL

Expand Down
80 changes: 75 additions & 5 deletions common/inc/gx_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* COMPONENT DEFINITION RELEASE */
/* */
/* gx_utility.h PORTABLE C */
/* 6.0 */
/* 6.0.1 */
/* AUTHOR */
/* */
/* Kenneth Maxwell, Microsoft Corporation */
Expand All @@ -42,13 +42,17 @@
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
/* 06-30-2020 Kenneth Maxwell Modified comment(s), */
/* added new prototype, */
/* resulting in version 6.0.1 */
/* */
/**************************************************************************/

#ifndef GX_UTILITY_H
#define GX_UTILITY_H

#if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
/* Define bidi character types. */
#define GX_BIDI_CHARACTER_TYPE_L 0x01 /* Left to Right */
#define GX_BIDI_CHARACTER_TYPE_R 0x02 /* Right to Left */
#define GX_BIDI_CHARACTER_TYPE_AL 0x03 /* Right to Left Arabic */
Expand Down Expand Up @@ -87,13 +91,76 @@
#define GX_BIDI_DIRECTION_FORMAT_FSI 0x2068 /* First Strong Isolate */
#define GX_BIDI_DIRECTION_FORMAT_PDI 0x2069 /* Pop Directional Isolate */


#define GX_BIDI_OVERRIDE_STATUS_N 0x01 /* No override is currently active */
#define GX_BIDI_OVERRIDE_STATUS_R 0x02 /* Characters are to be reset to R */
#define GX_BIDI_OVERRIDE_STATUS_L 0x03 /* Characters are to be reset to L */

#define GX_BIDI_MAX_EXPLICIT_DEPTH 125
#define GX_BIDI_MAX_BRACKET_DEPTH 63

/* Define explicit entry structure. */
typedef struct GX_BIDI_EXPLICIT_ENTRY_STRUCT
{
GX_UBYTE gx_bidi_explicit_level;
GX_BOOL gx_bidi_explicit_override_status;
GX_BOOL gx_bidi_explicit_isolate_status;
} GX_BIDI_EXPLICIT_ENTRY;

/* Define level run information structure. */
typedef struct GX_BIDI_LEVEL_RUN_STRUCT
{
INT gx_bidi_level_run_start_index;
INT gx_bidi_level_run_end_index;
GX_UBYTE gx_bidi_level_run_level;
struct GX_BIDI_LEVEL_RUN_STRUCT *gx_bidi_level_run_next;
} GX_BIDI_LEVEL_RUN;

/* Define isolate run sequence information structure. */
typedef struct GX_BIDI_ISOLATE_RUN_STRUCT
{
INT *gx_bidi_isolate_run_index_list;
INT gx_bidi_isolate_run_index_count;
GX_UBYTE gx_bidi_isolate_run_sos;
GX_UBYTE gx_bidi_isolate_run_eos;
struct GX_BIDI_ISOLATE_RUN_STRUCT *gx_bidi_isolate_run_next;
} GX_BIDI_ISOLATE_RUN;

/* Define unicode information structure. */
typedef struct GX_BIDI_UNIT_STRUCT
{
ULONG gx_bidi_unit_code;
GX_UBYTE gx_bidi_unit_level;
GX_UBYTE gx_bidi_unit_type;
GX_UBYTE gx_bidi_unit_org_type;
} GX_BIDI_UNIT;

typedef struct GX_BIDI_TEXT_INFO_STRUCT
{
GX_STRING gx_bidi_text_info_text;
GX_FONT *gx_bidi_text_info_font;
GX_VALUE gx_bidi_text_info_display_width;
} GX_BIDI_TEXT_INFO;

/* Define a truture to keep parameters for a bunch of functions. */
typedef struct GX_BIDI_CONTEXT_STRUCT
{
GX_BIDI_TEXT_INFO *gx_bidi_context_input_info;
UINT gx_bidi_context_processced_size;
UINT gx_bidi_context_total_lines;
GX_BIDI_UNIT *gx_bidi_context_unit_list;
INT gx_bidi_context_unit_count;
INT *gx_bidi_context_line_index_cache;
GX_BIDI_LEVEL_RUN *gx_bidi_context_level_runs;
GX_BIDI_ISOLATE_RUN *gx_bidi_context_isolate_runs;
GX_UBYTE *gx_bidi_context_buffer;
UINT gx_bidi_context_buffer_size;
UINT gx_bidi_context_buffer_index;
UINT gx_bidi_context_bracket_pair_size;
GX_UBYTE gx_bidi_context_base_level;
ULONG gx_bidi_context_reordered_utf8_size;
} GX_BIDI_CONTEXT;

typedef struct GX_BIDI_RESOLVED_TEXT_INFO_STRUCT
{
GX_STRING *gx_bidi_resolved_text_info_text;
Expand Down Expand Up @@ -233,10 +300,13 @@ UINT _gx_utility_rectangle_resize(GX_RECTANGLE *rectangle, GX_VALUE adju
UINT _gx_utility_rectangle_shift(GX_RECTANGLE *rectangle, GX_VALUE x_shift, GX_VALUE y_shift);

#if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
UINT _gx_utility_bidi_bracket_pair_get(ULONG code, GX_BIDI_BRACKET_PAIR *bracket_pair);
UINT _gx_utility_bidi_character_type_get(ULONG code, GX_UBYTE *type);
UINT _gx_utility_bidi_mirroring_get(USHORT code, USHORT *mirror);
UINT _gx_utility_bidi_paragraph_reorder(GX_BIDI_TEXT_INFO *input_info, GX_BIDI_RESOLVED_TEXT_INFO *resolved_info);
#if defined(GX_DYNAMIC_ARABIC_SHAPING_SUPPORT)
UINT _gx_utility_bidi_arabic_shaping(GX_BIDI_CONTEXT *context);
#endif
UINT _gx_utility_bidi_bracket_pair_get(ULONG code, GX_BIDI_BRACKET_PAIR *bracket_pair);
UINT _gx_utility_bidi_character_type_get(ULONG code, GX_UBYTE *type);
UINT _gx_utility_bidi_mirroring_get(USHORT code, USHORT *mirror);
UINT _gx_utility_bidi_paragraph_reorder(GX_BIDI_TEXT_INFO *input_info, GX_BIDI_RESOLVED_TEXT_INFO *resolved_info);
#endif

#ifdef GX_THAI_GLYPH_SHAPING_SUPPORT
Expand Down
138 changes: 87 additions & 51 deletions common/src/gx_multi_line_text_view_display_info_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _gx_multi_line_text_view_display_info_get PORTABLE C */
/* 6.0 */
/* 6.0.1 */
/* AUTHOR */
/* */
/* Kenneth Maxwell, Microsoft Corporation */
Expand Down Expand Up @@ -81,12 +81,17 @@
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
/* 06-30-2020 Kenneth Maxwell Modified comment(s), */
/* support line break status, */
/* resulting in version 6.0.1 */
/* */
/**************************************************************************/
VOID _gx_multi_line_text_view_display_info_get(GX_MULTI_LINE_TEXT_VIEW *text_view, UINT start_index,
UINT end_index, GX_MULTI_LINE_TEXT_INFO *text_info, GX_VALUE available_width)
{
UINT current_index;
#ifdef GX_UTF8_SUPPORT
UINT current_index = start_index;
#endif
GX_STRING string;
GX_STRING ch;
GX_VALUE char_width;
Expand All @@ -98,18 +103,6 @@ GX_FONT *font;
text_info -> gx_text_display_width = 0;
text_info -> gx_text_display_number = 0;

_gx_widget_font_get((GX_WIDGET *)text_view, text_view -> gx_multi_line_text_view_font_id, &font);

if (!font)
{
return;
}

display_width = 0;
display_number = 0;

current_index = start_index;

if (text_view -> gx_multi_line_text_view_text_id)
{
_gx_widget_string_get_ext((GX_WIDGET *)text_view, text_view -> gx_multi_line_text_view_text_id, &string);
Expand All @@ -119,60 +112,103 @@ GX_FONT *font;
_gx_system_private_string_get(&text_view -> gx_multi_line_text_view_text, &string, text_view -> gx_widget_style);
}

string.gx_string_ptr += current_index;
string.gx_string_length = end_index - current_index;

while (string.gx_string_length > 0)
{
ch = string;

#ifdef GX_UTF8_SUPPORT
_gx_utility_utf8_string_character_get(&string, GX_NULL, &glyph_len);
current_index += glyph_len;
#else
string.gx_string_ptr++;
string.gx_string_length--;
#endif /* GX_UTF8_SUPPORT */
string.gx_string_ptr += start_index;
string.gx_string_length = end_index - start_index;

ch.gx_string_length = glyph_len;
_gx_system_string_width_get_ext(font, &ch, &char_width);

if (ch.gx_string_ptr[0] == GX_KEY_CARRIAGE_RETURN)
if (text_view -> gx_widget_status & GX_STATUS_LINE_BREAK_PROCESSED)
{
/* Line breaking alreay preprocessed, only need to search for line break characters to do line break. */
while (string.gx_string_length > 0)
{
if (ch.gx_string_ptr[1] == GX_KEY_LINE_FEED)
if (string.gx_string_ptr[0] == GX_KEY_CARRIAGE_RETURN)
{
text_info -> gx_text_display_number = (USHORT)(text_info -> gx_text_display_number + 2);
text_info -> gx_text_display_number++;

if ((string.gx_string_length > 1) && string.gx_string_ptr[1] == GX_KEY_LINE_FEED)
{
text_info -> gx_text_display_number++;
}
break;
}
else if (string.gx_string_ptr[0] == GX_KEY_LINE_FEED)
{
text_info -> gx_text_display_number++;
break;
}
else
{
text_info -> gx_text_display_number++;
}
break;

string.gx_string_length--;
string.gx_string_ptr++;
}
else if (ch.gx_string_ptr[0] == GX_KEY_LINE_FEED)
}
else
{
_gx_widget_font_get((GX_WIDGET *)text_view, text_view -> gx_multi_line_text_view_font_id, &font);

if (!font)
{
text_info -> gx_text_display_number++;
break;
return;
}
else if (((text_info -> gx_text_display_width + char_width) > available_width - 1) &&
(text_info -> gx_text_display_number > 0) &&
(ch.gx_string_ptr[0] != ' '))

display_width = 0;
display_number = 0;

while (string.gx_string_length > 0)
{
if (display_number == 0)
ch = string;

#ifdef GX_UTF8_SUPPORT
_gx_utility_utf8_string_character_get(&string, GX_NULL, &glyph_len);
current_index += glyph_len;
#else
string.gx_string_ptr++;
string.gx_string_length--;
#endif /* GX_UTF8_SUPPORT */

ch.gx_string_length = glyph_len;
_gx_system_string_width_get_ext(font, &ch, &char_width);

if (ch.gx_string_ptr[0] == GX_KEY_CARRIAGE_RETURN)
{
if (ch.gx_string_ptr[1] == GX_KEY_LINE_FEED)
{
text_info -> gx_text_display_number = (USHORT)(text_info -> gx_text_display_number + 2);
}
else
{
text_info -> gx_text_display_number++;
}
break;
}
text_info -> gx_text_display_width = display_width;
text_info -> gx_text_display_number = display_number;
break;
}
text_info -> gx_text_display_width = (USHORT)(text_info -> gx_text_display_width + char_width);
text_info -> gx_text_display_number = (USHORT)(text_info -> gx_text_display_number + glyph_len);
else if (ch.gx_string_ptr[0] == GX_KEY_LINE_FEED)
{
text_info -> gx_text_display_number++;
break;
}
else if (((text_info -> gx_text_display_width + char_width) > available_width - 1) &&
(text_info -> gx_text_display_number > 0) &&
(ch.gx_string_ptr[0] != ' '))
{
if (display_number == 0)
{
break;
}
text_info -> gx_text_display_width = display_width;
text_info -> gx_text_display_number = display_number;
break;
}
text_info -> gx_text_display_width = (USHORT)(text_info -> gx_text_display_width + char_width);
text_info -> gx_text_display_number = (USHORT)(text_info -> gx_text_display_number + glyph_len);

if ((ch.gx_string_ptr[0] == ' ') || (ch.gx_string_ptr[0] == ',') || (ch.gx_string_ptr[0] == ';'))
{
display_width = text_info -> gx_text_display_width;
display_number = text_info -> gx_text_display_number;
if ((ch.gx_string_ptr[0] == ' ') || (ch.gx_string_ptr[0] == ',') || (ch.gx_string_ptr[0] == ';'))
{
display_width = text_info -> gx_text_display_width;
display_number = text_info -> gx_text_display_number;
}
}
}
}
Expand Down
Loading

0 comments on commit 59d985d

Please sign in to comment.