GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_prompt_text_color_set.c Lines: 8 8 100.0 %
Date: 2024-12-05 08:52:37 Branches: 10 10 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   Prompt Management (Prompt)                                          */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_system.h"
28
#include "gx_prompt.h"
29
30
/* Bring in externs for caller checking code.  */
31
GX_CALLER_CHECKING_EXTERNS
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_prompt_text_color_set                          PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This service checks errors in the prompt text color get function.   */
46
/*                                                                        */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    prompt                                Pointer to prompt control     */
51
/*                                             block                      */
52
/*    normal_text_color_id                  Resource ID of the normal     */
53
/*                                             text color                 */
54
/*    selected_text_color_id                Resource ID of the selected   */
55
/*                                             text color                 */
56
/*    disabled_text_color_id                Resource ID of the disabled   */
57
/*                                             text color                 */
58
/*                                                                        */
59
/*  OUTPUT                                                                */
60
/*                                                                        */
61
/*    status                                Completion status             */
62
/*                                                                        */
63
/*  CALLS                                                                 */
64
/*                                                                        */
65
/*    _gx_prompt_text_color_set             The actual function           */
66
/*                                                                        */
67
/*  CALLED BY                                                             */
68
/*                                                                        */
69
/*    Application Code                                                    */
70
/*                                                                        */
71
/*  RELEASE HISTORY                                                       */
72
/*                                                                        */
73
/*    DATE              NAME                      DESCRIPTION             */
74
/*                                                                        */
75
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
76
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
77
/*                                            resulting in version 6.1    */
78
/*                                                                        */
79
/**************************************************************************/
80
71882
UINT  _gxe_prompt_text_color_set(GX_PROMPT *prompt,
81
                                 GX_RESOURCE_ID normal_text_color_id,
82
                                 GX_RESOURCE_ID selected_text_color_id,
83
                                 GX_RESOURCE_ID disabled_text_color_id)
84
{
85
UINT status;
86
87
    /* Check for appropriate caller.  */
88

71882
    GX_INIT_AND_THREADS_CALLER_CHECKING
89
90
    /* Check error for valid pointer. */
91
71880
    if (prompt == GX_NULL)
92
    {
93
2
        return(GX_PTR_ERROR);
94
    }
95
96
    /* Check for invalid widget size.  */
97
71878
    if (prompt -> gx_widget_type == 0)
98
    {
99
1
        return(GX_INVALID_WIDGET);
100
    }
101
102
    /* Call the actual function.  */
103
71877
    status = _gx_prompt_text_color_set(prompt, normal_text_color_id, selected_text_color_id, disabled_text_color_id);
104
105
    /* Return completion status.  */
106
71877
    return(status);
107
}
108