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 /**   Widget Management (Widget)                                          */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_widget.h"
28 
29 /* Bring in externs for caller checking code.  */
30 GX_CALLER_CHECKING_EXTERNS
31 
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _gxe_widget_string_get                              PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Kenneth Maxwell, Microsoft Corporation                              */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function checks for errors in widget_string_get call.          */
45 /*                                                                        */
46 /*  INPUT                                                                 */
47 /*                                                                        */
48 /*    widget                                called widget control block   */
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_widget_string_get                 Actual widget string get      */
60 /*                                            call                        */
61 /*                                                                        */
62 /*  CALLED BY                                                             */
63 /*                                                                        */
64 /*    Application Code                                                    */
65 /*                                                                        */
66 /*  RELEASE HISTORY                                                       */
67 /*                                                                        */
68 /*    DATE              NAME                      DESCRIPTION             */
69 /*                                                                        */
70 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
71 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
72 /*                                            resulting in version 6.1    */
73 /*                                                                        */
74 /**************************************************************************/
75 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
_gxe_widget_string_get(GX_WIDGET * widget,GX_RESOURCE_ID resource_id,GX_CONST GX_CHAR ** return_string)76 UINT  _gxe_widget_string_get(GX_WIDGET *widget, GX_RESOURCE_ID resource_id, GX_CONST GX_CHAR **return_string)
77 {
78 UINT status;
79 
80     /* Check for appropriate caller.  */
81     GX_INIT_AND_THREADS_CALLER_CHECKING
82 
83     /* Check for invalid pointer.  */
84     if (return_string == GX_NULL || widget == GX_NULL)
85     {
86         return(GX_PTR_ERROR);
87     }
88 
89     /* Check for invalid widget.*/
90     if (widget -> gx_widget_type == 0)
91     {
92         return(GX_INVALID_WIDGET);
93     }
94 
95     /* Call actual system pixelmap get.  */
96     status = _gx_widget_string_get(widget, resource_id, return_string);
97 
98     /* Return status.  */
99     return(status);
100 }
101 #endif
102 
103 /**************************************************************************/
104 /*                                                                        */
105 /*  FUNCTION                                               RELEASE        */
106 /*                                                                        */
107 /*    _gxe_widget_string_get_ext                          PORTABLE C      */
108 /*                                                           6.1          */
109 /*  AUTHOR                                                                */
110 /*                                                                        */
111 /*    Kenneth Maxwell, Microsoft Corporation                              */
112 /*                                                                        */
113 /*  DESCRIPTION                                                           */
114 /*                                                                        */
115 /*    This function checks for errors in widget_string_get_ext call.      */
116 /*                                                                        */
117 /*  INPUT                                                                 */
118 /*                                                                        */
119 /*    widget                                called widget control block   */
120 /*    string_id                             String resource ID            */
121 /*    return_string                         Pointer to string             */
122 /*                                            destination pointer         */
123 /*                                                                        */
124 /*  OUTPUT                                                                */
125 /*                                                                        */
126 /*    status                                Completion status             */
127 /*                                                                        */
128 /*  CALLS                                                                 */
129 /*                                                                        */
130 /*    _gx_widget_string_get_ext             Actual widget string get      */
131 /*                                            call                        */
132 /*                                                                        */
133 /*  CALLED BY                                                             */
134 /*                                                                        */
135 /*    Application Code                                                    */
136 /*                                                                        */
137 /*  RELEASE HISTORY                                                       */
138 /*                                                                        */
139 /*    DATE              NAME                      DESCRIPTION             */
140 /*                                                                        */
141 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
142 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
143 /*                                            resulting in version 6.1    */
144 /*                                                                        */
145 /**************************************************************************/
_gxe_widget_string_get_ext(GX_WIDGET * widget,GX_RESOURCE_ID string_id,GX_STRING * return_string)146 UINT    _gxe_widget_string_get_ext(GX_WIDGET *widget, GX_RESOURCE_ID string_id, GX_STRING *return_string)
147 {
148 UINT status;
149 
150     /* Check for appropriate caller.  */
151     GX_INIT_AND_THREADS_CALLER_CHECKING
152 
153     /* Check for invalid pointer.  */
154     if (return_string == GX_NULL || widget == GX_NULL)
155     {
156         return(GX_PTR_ERROR);
157     }
158 
159     /* Check for invalid widget.*/
160     if (widget -> gx_widget_type == 0)
161     {
162         return(GX_INVALID_WIDGET);
163     }
164 
165     /* Call actual system pixelmap get.  */
166     status = _gx_widget_string_get_ext(widget, string_id, return_string);
167 
168     /* Return status.  */
169     return(status);
170 }
171 
172