Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions common/inc/gx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ typedef struct GX_STRING_STRUCT
#define GX_TYPE_RICH_TEXT_VIEW 144
#define GX_TYPE_GENERIC_SCROLL_WHEEL 145

/* A pseudo-type, used by Studio code generator */
/* A pseudo-type, used by Studio code generator */
#define GX_TYPE_TEMPLATE 200

/* Applications can define their own window types */
Expand Down Expand Up @@ -1027,7 +1027,7 @@ typedef GX_UBYTE GX_CHAR_CODE;
#if !defined(GX_MOUSE_MAX_RESOLUTION)
#define GX_MOUSE_MAX_RESOLUTION 32
#endif
#endif
#endif

#if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
#define GX_PROMPT_BIDI_RESOLVED_TEXT_INFO GX_BIDI_RESOLVED_TEXT_INFO *gx_prompt_bidi_resolved_text_info;
Expand Down Expand Up @@ -1099,7 +1099,7 @@ typedef struct GX_VIEW_STRUCT
GX_UBYTE gx_glyph_advance; /* Glyph advance */ \
GX_BYTE gx_glyph_leading; /* Pen x-pre-advance */ \
GX_UBYTE gx_glyph_width; \
GX_UBYTE gx_glyph_height;
GX_UBYTE gx_glyph_height;

/* Define the Glyph type. */
typedef struct GX_GLYPH_STRUCT
Expand All @@ -1111,15 +1111,15 @@ typedef struct GX_GLYPH_STRUCT
/* Define the Kerning Glyph type. */
typedef struct GX_KERNING_GLYPH_STRUCT
{
GX_GLYPH_MEMBERS_DECLARE
GX_CONST GX_UBYTE *gx_kerning_table; /* Kerning table */
GX_GLYPH_MEMBERS_DECLARE
GX_CONST GX_UBYTE *gx_kerning_table; /* Kerning table */
} GX_KERNING_GLYPH;
#endif

/* Define the Compressed Glyph type. */
typedef struct GX_COMPRESSED_GLYPH_STRUCT
{
GX_GLYPH_MEMBERS_DECLARE
GX_GLYPH_MEMBERS_DECLARE
USHORT gx_glyph_map_size; /* Glyph size */
} GX_COMPRESSED_GLYPH;

Expand Down Expand Up @@ -1249,7 +1249,7 @@ typedef struct GX_EVENT_STRUCT
USHORT gx_event_sender; /* ID of the event sender */
union
{
UINT gx_event_timer_id;
UINT gx_event_timer_id;
GX_POINT gx_event_pointdata;
GX_UBYTE gx_event_uchardata[4];
USHORT gx_event_ushortdata[2];
Expand Down Expand Up @@ -1356,7 +1356,7 @@ typedef struct GX_RADIAL_PROGRESS_BAR_INFO_STRUCT
GX_VALUE gx_radial_progress_bar_info_selected_brush_width; /* width of upper track. */
GX_RESOURCE_ID gx_radial_progress_bar_info_normal_brush_color; /* resource ID of color for lower track. */
GX_RESOURCE_ID gx_radial_progress_bar_info_selected_brush_color; /* resource ID of color for upper track. */

} GX_RADIAL_PROGRESS_BAR_INFO;

/* Define radial slider information structure, this structure is used to
Expand Down Expand Up @@ -5898,6 +5898,9 @@ UINT _gxe_window_wallpaper_set(GX_WINDOW *window, GX_RESOURCE_ID wallpaper_id, G

#ifdef GX_MULTITHREAD_SUPPORT

VOID _gx_system_lock(VOID);
VOID _gx_system_unlock(VOID);

#define GX_ENTER_CRITICAL _gx_system_lock();
#define GX_EXIT_CRITICAL _gx_system_unlock();

Expand Down
9 changes: 9 additions & 0 deletions common/src/gx_canvas_glyphs_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ UINT index = 0;
xstart = (GX_VALUE)(xstart + glyph -> gx_glyph_advance);
}
} while (string_copy.gx_string_length > 0);

#ifdef GX_UTF8_SUPPORT
#if defined(GX_THAI_GLYPH_SHAPING_SUPPORT)
if (code_list)
{
_gx_system_memory_free((void*)code_list);
}
#endif
#endif
}

/**************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions common/src/gx_circular_gauge_event_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ UINT status = GX_SUCCESS;
case GX_EVENT_TIMER:
if (event_ptr -> gx_event_payload.gx_event_timer_id == GX_CIRCULAR_GAUGE_TIMER)
{
if (gauge->gx_circular_gauge_current_angle == gauge->gx_circular_gauge_target_angle)
{
break;
}

/* Calculate current angle. */
gauge -> gx_circular_gauge_animation_step++;
Expand Down
10 changes: 5 additions & 5 deletions common/src/gx_display_driver_24xrgb_rotated_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ VOID _gx_display_driver_24xrgb_rotated_setup(GX_DISPLAY *display, VOID *aux_data
_gx_display_driver_24xrgb_setup(display, aux_data, toggle_function);

#if defined(GX_MOUSE_SUPPORT)
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_draw = GX_NULL;
display -> gx_display_driver_drawing_initiate = GX_NULL;
display -> gx_display_driver_drawing_complete = GX_NULL;
display -> gx_display_mouse_position_set = GX_NULL;
display -> gx_display_mouse_enable = GX_NULL;
#if !defined(GX_HARDWARE_MOUSE_SUPPORT)
display->gx_display_mouse_capture = GX_NULL;
display->gx_display_mouse_restore = GX_NULL;
display->gx_display_mouse_draw = GX_NULL;
#endif
#endif

display -> gx_display_rotation_angle = GX_SCREEN_ROTATION_CW;
Expand Down
10 changes: 5 additions & 5 deletions common/src/gx_display_driver_32argb_rotated_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ VOID _gx_display_driver_32argb_rotated_setup(GX_DISPLAY *display, VOID *aux_data
_gx_display_driver_32argb_setup(display, aux_data, toggle_function);

#if defined(GX_MOUSE_SUPPORT)
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_draw = GX_NULL;
display -> gx_display_driver_drawing_initiate = GX_NULL;
display -> gx_display_driver_drawing_complete = GX_NULL;
display -> gx_display_mouse_position_set = GX_NULL;
display -> gx_display_mouse_enable = GX_NULL;
#if !defined(GX_HARDWARE_MOUSE_SUPPORT)
display->gx_display_mouse_capture = GX_NULL;
display->gx_display_mouse_restore = GX_NULL;
display->gx_display_mouse_draw = GX_NULL;
#endif
#endif

display -> gx_display_rotation_angle = GX_SCREEN_ROTATION_CW;
Expand Down
10 changes: 5 additions & 5 deletions common/src/gx_display_driver_565rgb_rotated_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ VOID _gx_display_driver_565rgb_rotated_setup(GX_DISPLAY *display, VOID *aux_data

/* Default initiate and complete function to null for general condition. */
#if defined(GX_MOUSE_SUPPORT)
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_draw = GX_NULL;
display -> gx_display_driver_drawing_initiate = GX_NULL;
display -> gx_display_driver_drawing_complete = GX_NULL;
display -> gx_display_mouse_position_set = GX_NULL;
display -> gx_display_mouse_enable = GX_NULL;
#if !defined(GX_HARDWARE_MOUSE_SUPPORT)
display->gx_display_mouse_capture = GX_NULL;
display->gx_display_mouse_restore = GX_NULL;
display->gx_display_mouse_draw = GX_NULL;
#endif
#endif

// default to 90 degree rotation angle
Expand Down
12 changes: 6 additions & 6 deletions common/src/gx_display_driver_8bit_palette_rotated_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/* */
/* DESCRIPTION */
/* */
/* 8-bit palettte color format display driver rotated setup routine. */
/* 8-bit palette color format display driver rotated setup routine. */
/* */
/* INPUT */
/* */
Expand Down Expand Up @@ -70,15 +70,15 @@ VOID _gx_display_driver_8bit_palette_rotated_setup(GX_DISPLAY *display, VOID
_gx_display_driver_8bit_palette_setup(display, aux_data, toggle_function);

#if defined(GX_MOUSE_SUPPORT)
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_capture = GX_NULL;
display -> gx_display_mouse_restore = GX_NULL;
display -> gx_display_mouse_draw = GX_NULL;
display -> gx_display_driver_drawing_initiate = GX_NULL;
display -> gx_display_driver_drawing_complete = GX_NULL;
display -> gx_display_mouse_position_set = GX_NULL;
display -> gx_display_mouse_enable = GX_NULL;
#if !defined(GX_HARDWARE_MOUSE_SUPPORT)
display->gx_display_mouse_capture = GX_NULL;
display->gx_display_mouse_restore = GX_NULL;
display->gx_display_mouse_draw = GX_NULL;
#endif
#endif

display -> gx_display_rotation_angle = GX_SCREEN_ROTATION_CW;
Expand Down
16 changes: 3 additions & 13 deletions common/src/gx_multi_line_text_input_backspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ UINT insert_pos;
INT shift;
INT last_visible_line;
GX_VALUE line_height;
GX_VALUE delete_width;
UINT old_text_rows;
UINT glyph_len = 1;
GX_STRING string;
GX_CONST GX_CHAR *string;
GX_SCROLLBAR *scroll;
UINT start_mark = text_input -> gx_multi_line_text_input_start_mark;
UINT end_mark = text_input -> gx_multi_line_text_input_end_mark;
Expand All @@ -127,8 +126,6 @@ UINT end_mark = text_input -> gx_multi_line_text_input_end_m
glyph_len = (UINT)GX_ABS((INT)start_mark - (INT)end_mark);
text_input -> gx_multi_line_text_input_start_mark = 0;
text_input -> gx_multi_line_text_input_end_mark = 0;

string.gx_string_ptr = &text_input -> gx_multi_line_text_view_text.gx_string_ptr[insert_pos - glyph_len];
}
else
{
Expand All @@ -140,21 +137,14 @@ UINT end_mark = text_input -> gx_multi_line_text_input_end_m
#endif

/* Get the character to be deleted. */
string.gx_string_ptr = &text_input -> gx_multi_line_text_view_text.gx_string_ptr[insert_pos - glyph_len];
string = &text_input -> gx_multi_line_text_view_text.gx_string_ptr[insert_pos - glyph_len];

if (string.gx_string_ptr[0] == GX_KEY_CARRIAGE_RETURN || string.gx_string_ptr[0] == GX_KEY_LINE_FEED)
if (string[0] == GX_KEY_CARRIAGE_RETURN || string[0] == GX_KEY_LINE_FEED)
{
glyph_len = text_input -> gx_multi_line_text_input_new_line_character_size;

string.gx_string_ptr = &text_input -> gx_multi_line_text_view_text.gx_string_ptr[insert_pos - glyph_len];
}
}

string.gx_string_length = glyph_len;

/* Get the width of the character to be deleted. */
_gx_system_string_width_get_ext(font, &string, &delete_width);

/* Record old shift value. */
shift = text_input -> gx_multi_line_text_view_text_scroll_shift;

Expand Down
1 change: 0 additions & 1 deletion common/src/gx_scrollbar_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ GX_COLOR fill_color;
fill_color,
GX_BRUSH_SOLID_FILL);
_gx_context_brush_width_set(0);
_gx_canvas_rectangle_draw(&size);
}
_gx_canvas_rectangle_draw(&size);

Expand Down
3 changes: 3 additions & 0 deletions common/src/gx_system_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ UINT length;
_gx_animation_create(&_gx_system_animation_pool[index]);
_gx_system_animation_pool[index].gx_animation_next = &_gx_system_animation_pool[index + 1];
}
_gx_animation_create(&_gx_system_animation_pool[index]);
_gx_system_animation_pool[index].gx_animation_next = GX_NULL;

_gx_system_animation_free_list = _gx_system_animation_pool;
#endif

Expand Down
6 changes: 1 addition & 5 deletions common/src/gx_widget_unlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,8 @@ GX_WIDGET *parent;
}
else
{
sibling = parent -> gx_widget_first_child;
sibling = widget -> gx_widget_previous;

while (sibling -> gx_widget_next != widget)
{
sibling = sibling -> gx_widget_next;
}
sibling -> gx_widget_next = widget -> gx_widget_next;

if (parent -> gx_widget_last_child == widget)
Expand Down