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 /**   Text Scroll Wheel Management (Scroll Wheel)                         */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_scroll_wheel.h"
29 
30 /**************************************************************************/
31 /*                                                                        */
32 /*  FUNCTION                                               RELEASE        */
33 /*                                                                        */
34 /*    _gxe_text_scroll_wheel_callback_set                 PORTABLE C      */
35 /*                                                           6.1          */
36 /*  AUTHOR                                                                */
37 /*                                                                        */
38 /*    Kenneth Maxwell, Microsoft Corporation                              */
39 /*                                                                        */
40 /*  DESCRIPTION                                                           */
41 /*                                                                        */
42 /*    This function checks for errors in the scroll wheel callback set    */
43 /*    function call.                                                      */
44 /*                                                                        */
45 /*  INPUT                                                                 */
46 /*                                                                        */
47 /*    widget                                Widget control block          */
48 /*    callback                              pointer to event process      */
49 /*                                            function                    */
50 /*                                                                        */
51 /*  OUTPUT                                                                */
52 /*                                                                        */
53 /*    status                                Completion status             */
54 /*                                                                        */
55 /*  CALLS                                                                 */
56 /*                                                                        */
57 /*    _gx_text_scroll_wheel_callback_set    Actual wheel event process    */
58 /*                                            set function                */
59 /*                                                                        */
60 /*  CALLED BY                                                             */
61 /*                                                                        */
62 /*    GUIX Application                                                    */
63 /*                                                                        */
64 /*  RELEASE HISTORY                                                       */
65 /*                                                                        */
66 /*    DATE              NAME                      DESCRIPTION             */
67 /*                                                                        */
68 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
69 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
70 /*                                            resulting in version 6.1    */
71 /*                                                                        */
72 /**************************************************************************/
73 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
_gxe_text_scroll_wheel_callback_set(GX_TEXT_SCROLL_WHEEL * widget,GX_CONST GX_CHAR * (* callback)(GX_TEXT_SCROLL_WHEEL *,INT))74 UINT _gxe_text_scroll_wheel_callback_set(GX_TEXT_SCROLL_WHEEL *widget, GX_CONST GX_CHAR *(*callback)(GX_TEXT_SCROLL_WHEEL *, INT))
75 {
76 UINT status;
77 
78     /* Check for invalid input pointers.  */
79     if ((widget == GX_NULL) || (callback == GX_NULL))
80     {
81         return(GX_PTR_ERROR);
82     }
83 
84     /* Check for invalid widget. */
85     if (widget -> gx_widget_type == 0)
86     {
87         return(GX_INVALID_WIDGET);
88     }
89 
90     /* Call actual widget event process set function.  */
91     status = _gx_text_scroll_wheel_callback_set(widget, callback);
92 
93     /* Return completion status.  */
94     return(status);
95 }
96 #endif
97 
98 /**************************************************************************/
99 /*                                                                        */
100 /*  FUNCTION                                               RELEASE        */
101 /*                                                                        */
102 /*    _gxe_text_scroll_wheel_callback_set_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 the scroll wheel callback set    */
111 /*    function call.                                                      */
112 /*                                                                        */
113 /*  INPUT                                                                 */
114 /*                                                                        */
115 /*    widget                                Widget control block          */
116 /*    callback                              pointer to event process      */
117 /*                                            function                    */
118 /*                                                                        */
119 /*  OUTPUT                                                                */
120 /*                                                                        */
121 /*    status                                Completion status             */
122 /*                                                                        */
123 /*  CALLS                                                                 */
124 /*                                                                        */
125 /*    _gx_text_scroll_wheel_callback_set_ext                              */
126 /*                                          Actual wheel event process    */
127 /*                                            set function                */
128 /*                                                                        */
129 /*  CALLED BY                                                             */
130 /*                                                                        */
131 /*    GUIX Application                                                    */
132 /*                                                                        */
133 /*  RELEASE HISTORY                                                       */
134 /*                                                                        */
135 /*    DATE              NAME                      DESCRIPTION             */
136 /*                                                                        */
137 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
138 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
139 /*                                            resulting in version 6.1    */
140 /*                                                                        */
141 /**************************************************************************/
_gxe_text_scroll_wheel_callback_set_ext(GX_TEXT_SCROLL_WHEEL * widget,UINT (* callback)(GX_TEXT_SCROLL_WHEEL *,INT,GX_STRING *))142 UINT _gxe_text_scroll_wheel_callback_set_ext(GX_TEXT_SCROLL_WHEEL *widget, UINT (*callback)(GX_TEXT_SCROLL_WHEEL *, INT, GX_STRING *))
143 {
144 UINT status;
145 
146     /* Check for invalid input pointers.  */
147     if ((widget == GX_NULL) || (callback == GX_NULL))
148     {
149         return(GX_PTR_ERROR);
150     }
151 
152     /* Check for invalid widget. */
153     if (widget -> gx_widget_type == 0)
154     {
155         return(GX_INVALID_WIDGET);
156     }
157 
158     /* Call actual widget event process set function.  */
159     status = _gx_text_scroll_wheel_callback_set_ext(widget, callback);
160 
161     /* Return completion status.  */
162     return(status);
163 }
164 
165