GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_multi_line_text_button_text_set.c Lines: 10 10 100.0 %
Date: 2024-12-05 08:52:37 Branches: 3 4 75.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
/**   Text Button Management (Button)                                     */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_widget.h"
28
#include "gx_button.h"
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_multi_line_text_button_text_set                 PORTABLE C      */
35
/*                                                           6.3.0        */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION (Deprecated)                                              */
41
/*                                                                        */
42
/*    This function assigns text to a multi-line text button              */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    button                                Button control block          */
47
/*    text                                  text pointer                  */
48
/*                                                                        */
49
/*  OUTPUT                                                                */
50
/*                                                                        */
51
/*    status                                Completion status             */
52
/*                                                                        */
53
/*  CALLS                                                                 */
54
/*                                                                        */
55
/*    _gx_text_button_text_set                                            */
56
/*    _gx_multi_line_text_button_line_pointers_set                        */
57
/*                                                                        */
58
/*  CALLED BY                                                             */
59
/*                                                                        */
60
/*    Application Code                                                    */
61
/*                                                                        */
62
/*  RELEASE HISTORY                                                       */
63
/*                                                                        */
64
/*    DATE              NAME                      DESCRIPTION             */
65
/*                                                                        */
66
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
67
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
68
/*                                            resulting in version 6.1    */
69
/*  10-31-2023     Ting Zhu                 Modified comment(s),          */
70
/*                                            added return status check,  */
71
/*                                            resulting in version 6.3.0  */
72
/*                                                                        */
73
/**************************************************************************/
74
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
75
3
UINT  _gx_multi_line_text_button_text_set(GX_MULTI_LINE_TEXT_BUTTON *button, GX_CONST GX_CHAR *text)
76
{
77
UINT status;
78
79
3
    status = _gx_text_button_text_set((GX_TEXT_BUTTON *)button, text);
80
81
3
    if (status == GX_SUCCESS)
82
    {
83
2
        _gx_multi_line_text_button_line_pointers_set(button);
84
    }
85
86
3
    return status;
87
}
88
#endif
89
90
/**************************************************************************/
91
/*                                                                        */
92
/*  FUNCTION                                               RELEASE        */
93
/*                                                                        */
94
/*    _gx_multi_line_text_button_text_set_ext             PORTABLE C      */
95
/*                                                           6.3.0        */
96
/*  AUTHOR                                                                */
97
/*                                                                        */
98
/*    Kenneth Maxwell, Microsoft Corporation                              */
99
/*                                                                        */
100
/*  DESCRIPTION (Deprecated)                                              */
101
/*                                                                        */
102
/*    This function assigns text to a multi-line text button              */
103
/*                                                                        */
104
/*  INPUT                                                                 */
105
/*                                                                        */
106
/*    button                                Button control block          */
107
/*    text                                  text pointer                  */
108
/*                                                                        */
109
/*  OUTPUT                                                                */
110
/*                                                                        */
111
/*    status                                Completion status             */
112
/*                                                                        */
113
/*  CALLS                                                                 */
114
/*                                                                        */
115
/*    _gx_text_button_text_set_ext                                        */
116
/*    _gx_multi_line_text_button_line_pointers_set                        */
117
/*                                                                        */
118
/*  CALLED BY                                                             */
119
/*                                                                        */
120
/*    Application Code                                                    */
121
/*                                                                        */
122
/*  RELEASE HISTORY                                                       */
123
/*                                                                        */
124
/*    DATE              NAME                      DESCRIPTION             */
125
/*                                                                        */
126
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
127
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
128
/*                                            resulting in version 6.1    */
129
/*  10-31-2023     Ting Zhu                 Modified comment(s),          */
130
/*                                            added return status check,  */
131
/*                                            resulting in version 6.3.0  */
132
/*                                                                        */
133
/**************************************************************************/
134
3
UINT  _gx_multi_line_text_button_text_set_ext(GX_MULTI_LINE_TEXT_BUTTON *button, GX_CONST GX_STRING *text)
135
{
136
UINT status;
137
138
3
    status = _gx_text_button_text_set_ext((GX_TEXT_BUTTON *)button, text);
139
140
3
    if (status == GX_SUCCESS)
141
    {
142
3
        _gx_multi_line_text_button_line_pointers_set(button);
143
    }
144
3
    return status;
145
}