GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_text_id_draw.c Lines: 5 5 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 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
/**   Widget Management (Widget)                                          */
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_widget.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_widget_text_id_draw                             PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function draws text over a widget given a text id.             */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    widget                                Widget control block          */
49
/*    tColor                                Text Color                    */
50
/*    fColor                                Text fill color               */
51
/*    font_id                               Font Id                       */
52
/*    text_id                               Text Id                       */
53
/*    x_offset                              Drawing position adjustment   */
54
/*    y_offset                              Drawing position adjustment   */
55
/*                                                                        */
56
/*  OUTPUT                                                                */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    _gx_context_string_get                Retrieve the text string      */
63
/*    _gx_widget_text_draw                  Draw text on canvas           */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    GUIX Internal Code                                                  */
68
/*                                                                        */
69
/**************************************************************************/
70
2
VOID  _gx_widget_text_id_draw(GX_WIDGET *widget, UINT tColor,
71
                              UINT font_id, UINT text_id,
72
                              INT x_offset, INT y_offset)
73
{
74
GX_STRING string;
75
76
    /* Get string.  */
77
2
    _gx_context_string_get_ext(text_id, &string);
78
79
2
    if (string.gx_string_ptr)
80
    {
81
        /* Draw text.  */
82
1
        _gx_widget_text_draw_ext(widget, tColor, font_id, &string,
83
                                 x_offset, y_offset);
84
    }
85
2
}
86