GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_generic_scroll_wheel_event_process.c Lines: 11 11 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
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_widget.h"
29
#include "gx_scroll_wheel.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_generic_scroll_wheel_event_process              PORTABLE C      */
36
/*                                                           6.1.7        */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Ting Zhu, Microsoft Corporation                                     */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This service processes an event for the generic scroll wheel.       */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    wheel                                 Scroll wheel control block    */
48
/*    event_ptr                             Pointer to event to process   */
49
/*                                                                        */
50
/*  OUTPUT                                                                */
51
/*                                                                        */
52
/*    status                                Completion status             */
53
/*                                                                        */
54
/*  CALLS                                                                 */
55
/*                                                                        */
56
/*    _gx_generic_scroll_wheel_children_position                          */
57
/*                                          Position the children for     */
58
/*                                            the scroll wheel children   */
59
/*    _gx_scroll_wheel_event_process        Process events for the        */
60
/*                                            scroll wheel widget         */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*                                                                        */
66
/**************************************************************************/
67
221
UINT  _gx_generic_scroll_wheel_event_process(GX_GENERIC_SCROLL_WHEEL *wheel, GX_EVENT *event_ptr)
68
{
69
UINT status;
70
71
221
    switch (event_ptr -> gx_event_type)
72
    {
73
12
    case GX_EVENT_SHOW:
74
75
        /* Show the children before attempting to position them, because child
76
           widgets do not know their size until shown.  */
77
78
12
        status = _gx_scroll_wheel_event_process((GX_SCROLL_WHEEL *)wheel, event_ptr);
79
80
        /* Position the child widgets.  */
81
12
        if (!wheel -> gx_generic_scroll_wheel_child_count)
82
        {
83
11
            _gx_generic_scroll_wheel_children_position(wheel);
84
        }
85
12
        break;
86
87
209
    default:
88
209
        status = _gx_scroll_wheel_event_process((GX_SCROLL_WHEEL *)wheel, event_ptr);
89
209
        break;
90
    }
91
92
221
    return status;
93
}
94