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 /**   Scroll Wheel Management (Generic Scroll Wheel)                      */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_scroll_wheel.h"
28 
29 /**************************************************************************/
30 /*                                                                        */
31 /*  FUNCTION                                               RELEASE        */
32 /*                                                                        */
33 /*    _gx_generic_scroll_wheel_wrap_style_check           PORTABLE C      */
34 /*                                                           6.1.7        */
35 /*  AUTHOR                                                                */
36 /*                                                                        */
37 /*    Ting Zhu, Microsoft Corporation                                     */
38 /*                                                                        */
39 /*  DESCRIPTION                                                           */
40 /*                                                                        */
41 /*    This function checks if wrap style is supported.                    */
42 /*                                                                        */
43 /*  INPUT                                                                 */
44 /*                                                                        */
45 /*    wheel                                 Generic scroll wheel control  */
46 /*                                            block                       */
47 /*                                                                        */
48 /*  OUTPUT                                                                */
49 /*                                                                        */
50 /*    GX_BOOL                               Wrap style check result       */
51 /*                                                                        */
52 /*  CALLS                                                                 */
53 /*                                                                        */
54 /*    None                                                                */
55 /*                                                                        */
56 /*  CALLED BY                                                             */
57 /*                                                                        */
58 /*    GUIX Internal Code                                                  */
59 /*                                                                        */
60 /*  RELEASE HISTORY                                                       */
61 /*                                                                        */
62 /*    DATE              NAME                      DESCRIPTION             */
63 /*                                                                        */
64 /*  06-02-2021        Ting Zhu              Initial Version 6.1.7         */
65 /*                                                                        */
66 /**************************************************************************/
_gx_generic_scroll_wheel_wrap_style_check(GX_GENERIC_SCROLL_WHEEL * wheel)67 GX_BOOL _gx_generic_scroll_wheel_wrap_style_check(GX_GENERIC_SCROLL_WHEEL *wheel)
68 {
69 
70     if ((wheel -> gx_widget_style & GX_STYLE_WRAP) &&
71         (wheel -> gx_generic_scroll_wheel_callback != GX_NULL) &&
72         (wheel -> gx_generic_scroll_wheel_visible_rows < wheel -> gx_scroll_wheel_total_rows))
73     {
74 
75         /* Wrap style is supported.  */
76         return GX_TRUE;
77     }
78 
79     return GX_FALSE;
80 }
81 
82