GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_context_string_get.c Lines: 8 8 100.0 %
Date: 2024-12-05 08:52:37 Branches: 0 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
/**   Context Management (Context)                                        */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_display.h"
28
#include "gx_system.h"
29
#include "gx_context.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_context_string_get                              PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION  (deprecated)                                             */
43
/*                                                                        */
44
/*    This service gets the string associated with the supplied           */
45
/*      resource ID.                                                      */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    string_id                             String resource ID            */
50
/*    return_string                         Pointer to string             */
51
/*                                            destination pointer         */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    status                                Completion status             */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*                                                                        */
59
/*    _gx_display_string_get                                              */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    _gx_widget_text_id_draw                                             */
64
/*                                                                        */
65
/*  RELEASE HISTORY                                                       */
66
/*                                                                        */
67
/*    DATE              NAME                      DESCRIPTION             */
68
/*                                                                        */
69
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
70
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
71
/*                                            resulting in version 6.1    */
72
/*                                                                        */
73
/**************************************************************************/
74
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
75
76
1
UINT  _gx_context_string_get(GX_RESOURCE_ID resource_id, GX_CONST GX_CHAR **return_string)
77
{
78
1
GX_DRAW_CONTEXT *context = _gx_system_current_draw_context;
79
GX_DISPLAY      *display;
80
81
1
    display = context -> gx_draw_context_display;
82
1
    return _gx_display_string_get(display, resource_id, return_string);
83
}
84
85
#endif
86
87
/**************************************************************************/
88
/*                                                                        */
89
/*  FUNCTION                                               RELEASE        */
90
/*                                                                        */
91
/*    _gx_context_string_get_ext                          PORTABLE C      */
92
/*                                                           6.1          */
93
/*  AUTHOR                                                                */
94
/*                                                                        */
95
/*    Kenneth Maxwell, Microsoft Corporation                              */
96
/*                                                                        */
97
/*  DESCRIPTION                                                           */
98
/*                                                                        */
99
/*    This service gets the string associated with the supplied           */
100
/*      resource ID.                                                      */
101
/*                                                                        */
102
/*  INPUT                                                                 */
103
/*                                                                        */
104
/*    string_id                             String resource ID            */
105
/*    return_string                         Pointer to string             */
106
/*                                            destination pointer         */
107
/*                                                                        */
108
/*  OUTPUT                                                                */
109
/*                                                                        */
110
/*    status                                Completion status             */
111
/*                                                                        */
112
/*  CALLS                                                                 */
113
/*                                                                        */
114
/*    _gx_display_string_get_ext                                          */
115
/*                                                                        */
116
/*  CALLED BY                                                             */
117
/*                                                                        */
118
/*    _gx_widget_text_id_draw                                             */
119
/*                                                                        */
120
/*  RELEASE HISTORY                                                       */
121
/*                                                                        */
122
/*    DATE              NAME                      DESCRIPTION             */
123
/*                                                                        */
124
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
125
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
126
/*                                            resulting in version 6.1    */
127
/*                                                                        */
128
/**************************************************************************/
129
1226
UINT  _gx_context_string_get_ext(GX_RESOURCE_ID resource_id, GX_STRING *return_string)
130
{
131
1226
GX_DRAW_CONTEXT *context = _gx_system_current_draw_context;
132
GX_DISPLAY      *display;
133
134
1226
    display = context -> gx_draw_context_display;
135
1226
    return _gx_display_string_get_ext(display, resource_id, return_string);
136
}
137