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 |
|
|
/** 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 |
|
|
/**************************************************************************/ |
65 |
|
|
#if defined(GX_ENABLE_DEPRECATED_STRING_API) |
66 |
|
12 |
UINT _gxe_text_scroll_wheel_callback_set(GX_TEXT_SCROLL_WHEEL *widget, GX_CONST GX_CHAR *(*callback)(GX_TEXT_SCROLL_WHEEL *, INT)) |
67 |
|
|
{ |
68 |
|
|
UINT status; |
69 |
|
|
|
70 |
|
|
/* Check for invalid input pointers. */ |
71 |
✓✓✓✓
|
12 |
if ((widget == GX_NULL) || (callback == GX_NULL)) |
72 |
|
|
{ |
73 |
|
2 |
return(GX_PTR_ERROR); |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
/* Check for invalid widget. */ |
77 |
✓✓ |
10 |
if (widget -> gx_widget_type == 0) |
78 |
|
|
{ |
79 |
|
1 |
return(GX_INVALID_WIDGET); |
80 |
|
|
} |
81 |
|
|
|
82 |
|
|
/* Call actual widget event process set function. */ |
83 |
|
9 |
status = _gx_text_scroll_wheel_callback_set(widget, callback); |
84 |
|
|
|
85 |
|
|
/* Return completion status. */ |
86 |
|
9 |
return(status); |
87 |
|
|
} |
88 |
|
|
#endif |
89 |
|
|
|
90 |
|
|
/**************************************************************************/ |
91 |
|
|
/* */ |
92 |
|
|
/* FUNCTION RELEASE */ |
93 |
|
|
/* */ |
94 |
|
|
/* _gxe_text_scroll_wheel_callback_set_ext PORTABLE C */ |
95 |
|
|
/* 6.1 */ |
96 |
|
|
/* AUTHOR */ |
97 |
|
|
/* */ |
98 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
99 |
|
|
/* */ |
100 |
|
|
/* DESCRIPTION */ |
101 |
|
|
/* */ |
102 |
|
|
/* This function checks for errors in the scroll wheel callback set */ |
103 |
|
|
/* function call. */ |
104 |
|
|
/* */ |
105 |
|
|
/* INPUT */ |
106 |
|
|
/* */ |
107 |
|
|
/* widget Widget control block */ |
108 |
|
|
/* callback pointer to event process */ |
109 |
|
|
/* function */ |
110 |
|
|
/* */ |
111 |
|
|
/* OUTPUT */ |
112 |
|
|
/* */ |
113 |
|
|
/* status Completion status */ |
114 |
|
|
/* */ |
115 |
|
|
/* CALLS */ |
116 |
|
|
/* */ |
117 |
|
|
/* _gx_text_scroll_wheel_callback_set_ext */ |
118 |
|
|
/* Actual wheel event process */ |
119 |
|
|
/* set function */ |
120 |
|
|
/* */ |
121 |
|
|
/* CALLED BY */ |
122 |
|
|
/* */ |
123 |
|
|
/* GUIX Application */ |
124 |
|
|
/* */ |
125 |
|
|
/**************************************************************************/ |
126 |
|
95 |
UINT _gxe_text_scroll_wheel_callback_set_ext(GX_TEXT_SCROLL_WHEEL *widget, UINT (*callback)(GX_TEXT_SCROLL_WHEEL *, INT, GX_STRING *)) |
127 |
|
|
{ |
128 |
|
|
UINT status; |
129 |
|
|
|
130 |
|
|
/* Check for invalid input pointers. */ |
131 |
✓✓✓✓
|
95 |
if ((widget == GX_NULL) || (callback == GX_NULL)) |
132 |
|
|
{ |
133 |
|
2 |
return(GX_PTR_ERROR); |
134 |
|
|
} |
135 |
|
|
|
136 |
|
|
/* Check for invalid widget. */ |
137 |
✓✓ |
93 |
if (widget -> gx_widget_type == 0) |
138 |
|
|
{ |
139 |
|
1 |
return(GX_INVALID_WIDGET); |
140 |
|
|
} |
141 |
|
|
|
142 |
|
|
/* Call actual widget event process set function. */ |
143 |
|
92 |
status = _gx_text_scroll_wheel_callback_set_ext(widget, callback); |
144 |
|
|
|
145 |
|
|
/* Return completion status. */ |
146 |
|
92 |
return(status); |
147 |
|
|
} |
148 |
|
|
|