GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_context_string_get.c Lines: 19 19 100.0 %
Date: 2026-03-06 19:21:09 Branches: 20 20 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
/**   Context Management (Context)                                        */
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_context.h"
31
32
/* Bring in externs for caller checking code.  */
33
GX_CALLER_CHECKING_EXTERNS
34
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _gxe_context_string_get                             PORTABLE C      */
40
/*                                                           6.1          */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    Kenneth Maxwell, Microsoft Corporation                              */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    This function checks for errors in context pixelmap set call.       */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    pixelmap_id                           Pixelmap resource ID          */
52
/*    return_pixelmap                       Pointer to pixelmap           */
53
/*                                            destination pointer         */
54
/*                                                                        */
55
/*  OUTPUT                                                                */
56
/*                                                                        */
57
/*    status                                Completion status             */
58
/*                                                                        */
59
/*  CALLS                                                                 */
60
/*                                                                        */
61
/*    _gx_context_pixelmap_get              Actual context pixelmap get   */
62
/*                                            call                        */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    Application Code                                                    */
67
/*    GUIX default draw funtions                                          */
68
/*                                                                        */
69
/**************************************************************************/
70
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
71
5
UINT _gxe_context_string_get(GX_RESOURCE_ID string_id, GX_CONST GX_CHAR **return_string)
72
{
73
UINT status;
74
75
    /* Check for appropriate caller.  */
76

5
    GX_INIT_AND_THREADS_CALLER_CHECKING
77
78
    /* Check for invalid pointer.  */
79
3
    if (return_string == GX_NULL)
80
    {
81
1
        return(GX_PTR_ERROR);
82
    }
83
84
2
    if (_gx_system_current_draw_context == GX_NULL)
85
    {
86
1
        *return_string = GX_NULL;
87
1
        return GX_INVALID_CONTEXT;
88
    }
89
90
    /* Call actual string.  */
91
1
    status = _gx_context_string_get(string_id, return_string);
92
93
    /* Return status.  */
94
1
    return(status);
95
}
96
#endif
97
98
/**************************************************************************/
99
/*                                                                        */
100
/*  FUNCTION                                               RELEASE        */
101
/*                                                                        */
102
/*    _gxe_context_string_get_ext                         PORTABLE C      */
103
/*                                                           6.1          */
104
/*  AUTHOR                                                                */
105
/*                                                                        */
106
/*    Kenneth Maxwell, Microsoft Corporation                              */
107
/*                                                                        */
108
/*  DESCRIPTION                                                           */
109
/*                                                                        */
110
/*    This function checks for errors in context pixelmap set call.       */
111
/*                                                                        */
112
/*  INPUT                                                                 */
113
/*                                                                        */
114
/*    pixelmap_id                           Pixelmap resource ID          */
115
/*    return_pixelmap                       Pointer to pixelmap           */
116
/*                                            destination pointer         */
117
/*                                                                        */
118
/*  OUTPUT                                                                */
119
/*                                                                        */
120
/*    status                                Completion status             */
121
/*                                                                        */
122
/*  CALLS                                                                 */
123
/*                                                                        */
124
/*    _gx_context_pixelmap_get              Actual context pixelmap get   */
125
/*                                            call                        */
126
/*                                                                        */
127
/*  CALLED BY                                                             */
128
/*                                                                        */
129
/*    Application Code                                                    */
130
/*    GUIX default draw funtions                                          */
131
/*                                                                        */
132
/**************************************************************************/
133
1228
UINT _gxe_context_string_get_ext(GX_RESOURCE_ID string_id, GX_STRING *return_string)
134
{
135
UINT status;
136
137
    /* Check for appropriate caller.  */
138

1228
    GX_INIT_AND_THREADS_CALLER_CHECKING
139
140
    /* Check for invalid pointer.  */
141
1226
    if (return_string == GX_NULL)
142
    {
143
1
        return(GX_PTR_ERROR);
144
    }
145
146
1225
    if (_gx_system_current_draw_context == GX_NULL)
147
    {
148
1
        return_string -> gx_string_ptr = GX_NULL;
149
1
        return_string -> gx_string_length = 0;
150
1
        return GX_INVALID_CONTEXT;
151
    }
152
153
    /* Call actual string.  */
154
1224
    status = _gx_context_string_get_ext(string_id, return_string);
155
156
    /* Return status.  */
157
1224
    return(status);
158
}
159