1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
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_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_pixelmap_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 /**************************************************************************/
_gxe_context_pixelmap_get(GX_RESOURCE_ID pixelmap_id,GX_PIXELMAP ** return_pixelmap)77 UINT _gxe_context_pixelmap_get(GX_RESOURCE_ID pixelmap_id, GX_PIXELMAP **return_pixelmap)
78 {
79 UINT status;
80
81 /* Check for invalid pointer. */
82 if (return_pixelmap == GX_NULL)
83 {
84 return(GX_PTR_ERROR);
85 }
86
87 if (_gx_system_current_draw_context == GX_NULL)
88 {
89 *return_pixelmap = GX_NULL;
90 return GX_INVALID_CONTEXT;
91 }
92
93 /* Call actual pixelmap. */
94 status = _gx_context_pixelmap_get(pixelmap_id, return_pixelmap);
95
96 /* Return status. */
97 return(status);
98 }
99
100