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 (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_scroll_wheel_speed_set PORTABLE C */ |
38 |
|
|
/* 6.1 */ |
39 |
|
|
/* AUTHOR */ |
40 |
|
|
/* */ |
41 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
42 |
|
|
/* */ |
43 |
|
|
/* DESCRIPTION */ |
44 |
|
|
/* */ |
45 |
|
|
/* This function checks for errors in scroll wheel speed set. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* wheel Scroll wheel control block */ |
50 |
|
|
/* wheel Scroll wheel control block */ |
51 |
|
|
/* start_speed_rate The rate of start speed to */ |
52 |
|
|
/* flick speed. */ |
53 |
|
|
/* end_speed_rate The rate of end speed to */ |
54 |
|
|
/* flick speed. */ |
55 |
|
|
/* max_steps Max steps for scrolling */ |
56 |
|
|
/* delay Delay time of each step */ |
57 |
|
|
/* */ |
58 |
|
|
/* OUTPUT */ |
59 |
|
|
/* */ |
60 |
|
|
/* status Completion status */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLS */ |
63 |
|
|
/* */ |
64 |
|
|
/* _gx_scroll_wheel_speed_set Actual scroll wheel speed set */ |
65 |
|
|
/* call */ |
66 |
|
|
/* */ |
67 |
|
|
/* CALLED BY */ |
68 |
|
|
/* */ |
69 |
|
|
/* Application Code */ |
70 |
|
|
/* */ |
71 |
|
|
/**************************************************************************/ |
72 |
|
133 |
UINT _gxe_scroll_wheel_speed_set(GX_SCROLL_WHEEL *wheel, GX_FIXED_VAL start_speed_rate, GX_FIXED_VAL end_speed_rate, |
73 |
|
|
GX_VALUE max_steps, GX_VALUE delay) |
74 |
|
|
{ |
75 |
|
|
UINT status; |
76 |
|
|
|
77 |
|
|
/* Check for appropriate caller. */ |
78 |
✓✓✓✓ ✓✓ |
133 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
79 |
|
|
|
80 |
✓✓ |
131 |
if (wheel == GX_NULL) |
81 |
|
|
{ |
82 |
|
2 |
return GX_PTR_ERROR; |
83 |
|
|
} |
84 |
|
|
|
85 |
✓✓ |
129 |
if (wheel -> gx_widget_type == 0) |
86 |
|
|
{ |
87 |
|
1 |
return GX_INVALID_WIDGET; |
88 |
|
|
} |
89 |
|
|
|
90 |
✓✓ |
128 |
if (delay <= 0) |
91 |
|
|
{ |
92 |
|
1 |
return GX_INVALID_VALUE; |
93 |
|
|
} |
94 |
|
|
|
95 |
|
127 |
status = _gx_scroll_wheel_speed_set(wheel, start_speed_rate, end_speed_rate, max_steps, delay); |
96 |
|
|
|
97 |
|
127 |
return status; |
98 |
|
|
} |
99 |
|
|
|