GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_multi_line_text_view_draw.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 100.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
/**   Multi Line Text View Management (Multi Line Text View)              */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_multi_line_text_view.h"
29
#include "gx_window.h"
30
#include "gx_widget.h"
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_multi_line_text_view_draw                       PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function draws a multi-line-text-view widget.                  */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    text_view                              Multi-line_text_view widget  */
49
/*                                           control block                */
50
/*  OUTPUT                                                                */
51
/*                                                                        */
52
/*    None                                                                */
53
/*                                                                        */
54
/*  CALLS                                                                 */
55
/*                                                                        */
56
/*    _gx_window_border_draw                Draw window background with   */
57
/*                                            specified fill color        */
58
/*    _gx_multi_line_text_view_text_draw    Draw text                     */
59
/*    _gx_widget_children_draw              Draw children widgets         */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    Application Code                                                    */
64
/*    GUIX Internal Code                                                  */
65
/*                                                                        */
66
/**************************************************************************/
67
9073
VOID  _gx_multi_line_text_view_draw(GX_MULTI_LINE_TEXT_VIEW *text_view)
68
{
69
GX_RESOURCE_ID text_color;
70
71
    /* Set the brush color, font, width. */
72
9073
    if (text_view -> gx_widget_style & GX_STYLE_ENABLED)
73
    {
74
8901
        if (text_view -> gx_widget_style & GX_STYLE_DRAW_SELECTED)
75
        {
76
1012
            text_color = text_view -> gx_multi_line_text_view_selected_text_color;
77
        }
78
        else
79
        {
80
7889
            text_color = text_view -> gx_multi_line_text_view_normal_text_color;
81
        }
82
    }
83
    else
84
    {
85
172
        text_color = text_view -> gx_multi_line_text_view_disabled_text_color;
86
    }
87
88
    /* Draw window background. */
89
9073
    _gx_window_background_draw((GX_WINDOW *)text_view);
90
91
    /* Draw text. */
92
9073
    _gx_multi_line_text_view_text_draw(text_view, text_color);
93
94
    /* Draw widget's children.  */
95
9073
    _gx_widget_children_draw((GX_WIDGET *)text_view);
96
9073
}
97