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 /**   Scroll Wheel Management (Generic 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 GX_CALLER_CHECKING_EXTERNS
31 
32 
33 /**************************************************************************/
34 /*                                                                        */
35 /*  FUNCTION                                               RELEASE        */
36 /*                                                                        */
37 /*    _gxe_generic_scroll_wheel_row_height_set            PORTABLE C      */
38 /*                                                           6.1.7        */
39 /*  AUTHOR                                                                */
40 /*                                                                        */
41 /*    Ting Zhu, Microsoft Corporation                                     */
42 /*                                                                        */
43 /*  DESCRIPTION                                                           */
44 /*                                                                        */
45 /*    This function checks for errors in generic scroll wheel row height  */
46 /*    set.                                                                */
47 /*                                                                        */
48 /*  INPUT                                                                 */
49 /*                                                                        */
50 /*    wheel                                 Generic scroll wheel control  */
51 /*                                            block                       */
52 /*    count                                 Number of rows                */
53 /*                                                                        */
54 /*  OUTPUT                                                                */
55 /*                                                                        */
56 /*    status                                Completion status             */
57 /*                                                                        */
58 /*  CALLS                                                                 */
59 /*                                                                        */
60 /*    _gx_generic_scroll_wheel_row_height_set                             */
61 /*                                          Actual generic scroll wheel   */
62 /*                                            row height set call         */
63 /*                                                                        */
64 /*  CALLED BY                                                             */
65 /*                                                                        */
66 /*    Application Code                                                    */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  06-02-2021     Kenneth Maxwell          Initial Version 6.1.7         */
73 /*                                                                        */
74 /**************************************************************************/
_gxe_generic_scroll_wheel_row_height_set(GX_GENERIC_SCROLL_WHEEL * wheel,GX_VALUE row_height)75 UINT _gxe_generic_scroll_wheel_row_height_set(GX_GENERIC_SCROLL_WHEEL *wheel, GX_VALUE row_height)
76 {
77 UINT status;
78 
79     /* Check for appropriate caller.  */
80     GX_INIT_AND_THREADS_CALLER_CHECKING
81 
82     if (wheel == GX_NULL)
83     {
84         return GX_PTR_ERROR;
85     }
86 
87     if (wheel -> gx_widget_type == 0)
88     {
89         return GX_INVALID_WIDGET;
90     }
91 
92     if (row_height <= 0)
93     {
94         return GX_INVALID_VALUE;
95     }
96 
97     status = _gx_generic_scroll_wheel_row_height_set(wheel, row_height);
98     return status;
99 }
100 
101