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_system.h"
28 #include "gx_display.h"
29 #include "gx_context.h"
30
31 /* Bring in externs for caller checking code. */
32 GX_CALLER_CHECKING_EXTERNS
33
34 /**************************************************************************/
35 /* */
36 /* FUNCTION RELEASE */
37 /* */
38 /* _gxe_context_string_get PORTABLE C */
39 /* 6.1 */
40 /* AUTHOR */
41 /* */
42 /* Kenneth Maxwell, Microsoft Corporation */
43 /* */
44 /* DESCRIPTION */
45 /* */
46 /* This function checks for errors in context pixelmap set call. */
47 /* */
48 /* INPUT */
49 /* */
50 /* pixelmap_id Pixelmap resource ID */
51 /* return_pixelmap Pointer to pixelmap */
52 /* destination pointer */
53 /* */
54 /* OUTPUT */
55 /* */
56 /* status Completion status */
57 /* */
58 /* CALLS */
59 /* */
60 /* _gx_context_pixelmap_get Actual context pixelmap get */
61 /* call */
62 /* */
63 /* CALLED BY */
64 /* */
65 /* Application Code */
66 /* GUIX default draw funtions */
67 /* */
68 /* RELEASE HISTORY */
69 /* */
70 /* DATE NAME DESCRIPTION */
71 /* */
72 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
73 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
74 /* resulting in version 6.1 */
75 /* */
76 /**************************************************************************/
77 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
_gxe_context_string_get(GX_RESOURCE_ID string_id,GX_CONST GX_CHAR ** return_string)78 UINT _gxe_context_string_get(GX_RESOURCE_ID string_id, GX_CONST GX_CHAR **return_string)
79 {
80 UINT status;
81
82 /* Check for appropriate caller. */
83 GX_INIT_AND_THREADS_CALLER_CHECKING
84
85 /* Check for invalid pointer. */
86 if (return_string == GX_NULL)
87 {
88 return(GX_PTR_ERROR);
89 }
90
91 if (_gx_system_current_draw_context == GX_NULL)
92 {
93 *return_string = GX_NULL;
94 return GX_INVALID_CONTEXT;
95 }
96
97 /* Call actual string. */
98 status = _gx_context_string_get(string_id, return_string);
99
100 /* Return status. */
101 return(status);
102 }
103 #endif
104
105 /**************************************************************************/
106 /* */
107 /* FUNCTION RELEASE */
108 /* */
109 /* _gxe_context_string_get_ext PORTABLE C */
110 /* 6.1 */
111 /* AUTHOR */
112 /* */
113 /* Kenneth Maxwell, Microsoft Corporation */
114 /* */
115 /* DESCRIPTION */
116 /* */
117 /* This function checks for errors in context pixelmap set call. */
118 /* */
119 /* INPUT */
120 /* */
121 /* pixelmap_id Pixelmap resource ID */
122 /* return_pixelmap Pointer to pixelmap */
123 /* destination pointer */
124 /* */
125 /* OUTPUT */
126 /* */
127 /* status Completion status */
128 /* */
129 /* CALLS */
130 /* */
131 /* _gx_context_pixelmap_get Actual context pixelmap get */
132 /* call */
133 /* */
134 /* CALLED BY */
135 /* */
136 /* Application Code */
137 /* GUIX default draw funtions */
138 /* */
139 /* RELEASE HISTORY */
140 /* */
141 /* DATE NAME DESCRIPTION */
142 /* */
143 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
144 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
145 /* resulting in version 6.1 */
146 /* */
147 /**************************************************************************/
_gxe_context_string_get_ext(GX_RESOURCE_ID string_id,GX_STRING * return_string)148 UINT _gxe_context_string_get_ext(GX_RESOURCE_ID string_id, GX_STRING *return_string)
149 {
150 UINT status;
151
152 /* Check for appropriate caller. */
153 GX_INIT_AND_THREADS_CALLER_CHECKING
154
155 /* Check for invalid pointer. */
156 if (return_string == GX_NULL)
157 {
158 return(GX_PTR_ERROR);
159 }
160
161 if (_gx_system_current_draw_context == GX_NULL)
162 {
163 return_string -> gx_string_ptr = GX_NULL;
164 return_string -> gx_string_length = 0;
165 return GX_INVALID_CONTEXT;
166 }
167
168 /* Call actual string. */
169 status = _gx_context_string_get_ext(string_id, return_string);
170
171 /* Return status. */
172 return(status);
173 }
174
175