GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_text_input_cursor_dirty_rectangle_get.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 0 0 - %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   Button Management (Button)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_context.h"
29
#include "gx_system.h"
30
#include "gx_widget.h"
31
#include "gx_text_input_cursor.h"
32
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gx_text_input_cursor_dirty_rectangle_get           PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function get the cursor area of the widget.                    */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    text_input                            Single line text input        */
51
/*                                            control block               */
52
/*    event_type                            Input type                    */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    status                                Completion status             */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    Application Code                                                    */
64
/*    GUIX Internal Code                                                  */
65
/*                                                                        */
66
/**************************************************************************/
67
11997
UINT _gx_text_input_cursor_dirty_rectangle_get(GX_TEXT_INPUT_CURSOR *cursor_ptr, GX_RECTANGLE *dirty_rect)
68
{
69
GX_VALUE cur_height;
70
GX_VALUE cur_width;
71
72
11997
    cur_height = cursor_ptr -> gx_text_input_cursor_height;
73
11997
    cur_width = cursor_ptr -> gx_text_input_cursor_width;
74
75
11997
    dirty_rect -> gx_rectangle_left = (GX_VALUE)(cursor_ptr -> gx_text_input_cursor_pos.gx_point_x - (cur_width >> 1));
76
11997
    dirty_rect -> gx_rectangle_right = (GX_VALUE)(dirty_rect -> gx_rectangle_left + cur_width - 1);
77
11997
    dirty_rect -> gx_rectangle_top = (GX_VALUE)(cursor_ptr -> gx_text_input_cursor_pos.gx_point_y - (cur_height >> 1));
78
11997
    dirty_rect -> gx_rectangle_bottom = (GX_VALUE)(dirty_rect -> gx_rectangle_top + cur_height - 1);
79
80
11997
    return GX_SUCCESS;
81
}
82