GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_prompt_text_color_set.c Lines: 7 7 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
/**   Prompt Management (Prompt)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_display.h"
30
#include "gx_widget.h"
31
#include "gx_prompt.h"
32
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gx_prompt_text_color_set                           PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This service sets the text color of a prompt widget.                */
47
/*                                                                        */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    prompt                                Pointer to prompt control     */
52
/*                                             block                      */
53
/*    normal_text_color_id                  Resource ID of the normal     */
54
/*                                             text color                 */
55
/*    selected_text_color_id                Resource ID of the selected   */
56
/*                                             text color                 */
57
/*                                                                        */
58
/*  OUTPUT                                                                */
59
/*                                                                        */
60
/*    status                                Completion status             */
61
/*                                                                        */
62
/*  CALLS                                                                 */
63
/*                                                                        */
64
/*    _gx_system_dirty_mark                 Mark this prompt as dirty     */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/**************************************************************************/
71
71877
UINT  _gx_prompt_text_color_set(GX_PROMPT *prompt,
72
                                GX_RESOURCE_ID normal_text_color_id,
73
                                GX_RESOURCE_ID selected_text_color_id,
74
                                GX_RESOURCE_ID disabled_text_color_id)
75
{
76
77
71877
    prompt -> gx_prompt_normal_text_color = normal_text_color_id;
78
71877
    prompt -> gx_prompt_selected_text_color = selected_text_color_id;
79
71877
    prompt -> gx_prompt_disabled_text_color = disabled_text_color_id;
80
81
71877
    if (prompt -> gx_widget_status & GX_STATUS_VISIBLE)
82
    {
83
16
        _gx_system_dirty_mark((GX_WIDGET *)prompt);
84
    }
85
86
71877
    return(GX_SUCCESS);
87
}
88