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 |
|
|
/* */ |
33 |
|
|
/* FUNCTION RELEASE */ |
34 |
|
|
/* */ |
35 |
|
|
/* _gx_text_scroll_wheel_callback_set PORTABLE C */ |
36 |
|
|
/* 6.1 */ |
37 |
|
|
/* AUTHOR */ |
38 |
|
|
/* */ |
39 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
40 |
|
|
/* */ |
41 |
|
|
/* DESCRIPTION (deprecated) */ |
42 |
|
|
/* */ |
43 |
|
|
/* This function updates the pointer to the callback function */ |
44 |
|
|
/* used to determine the string to be displayed at a give wheel row */ |
45 |
|
|
/* */ |
46 |
|
|
/* INPUT */ |
47 |
|
|
/* */ |
48 |
|
|
/* wheel Text scroll wheel control */ |
49 |
|
|
/* block */ |
50 |
|
|
/* callback Scroll wheel text get callback*/ |
51 |
|
|
/* */ |
52 |
|
|
/* OUTPUT */ |
53 |
|
|
/* */ |
54 |
|
|
/* status Completion status */ |
55 |
|
|
/* */ |
56 |
|
|
/* CALLS */ |
57 |
|
|
/* */ |
58 |
|
|
/* None */ |
59 |
|
|
/* */ |
60 |
|
|
/* CALLED BY */ |
61 |
|
|
/* */ |
62 |
|
|
/* Application Code */ |
63 |
|
|
/* */ |
64 |
|
|
/**************************************************************************/ |
65 |
|
|
#if defined(GX_ENABLE_DEPRECATED_STRING_API) |
66 |
|
9 |
UINT _gx_text_scroll_wheel_callback_set(GX_TEXT_SCROLL_WHEEL *wheel, GX_CONST GX_CHAR *(*callback)(GX_TEXT_SCROLL_WHEEL *, INT)) |
67 |
|
|
{ |
68 |
|
|
|
69 |
|
|
/* Update event processing function pointer */ |
70 |
|
9 |
wheel -> gx_text_scroll_wheel_text_get_deprecated = callback; |
71 |
|
9 |
wheel -> gx_text_scroll_wheel_text_get = GX_NULL; |
72 |
|
|
|
73 |
|
|
#ifdef GX_DYNAMIC_BIDI_TEXT_SUPPORT |
74 |
|
|
_gx_text_scroll_wheel_dynamic_bidi_text_delete(wheel); |
75 |
|
|
#endif // GX_DYNAMIC_BIDI_TEXT_SUPPORT |
76 |
|
|
|
77 |
|
9 |
return(GX_SUCCESS); |
78 |
|
|
} |
79 |
|
|
#endif |
80 |
|
|
|
81 |
|
|
/**************************************************************************/ |
82 |
|
|
/* */ |
83 |
|
|
/* FUNCTION RELEASE */ |
84 |
|
|
/* */ |
85 |
|
|
/* _gx_text_scroll_wheel_callback_set_ext PORTABLE C */ |
86 |
|
|
/* 6.1 */ |
87 |
|
|
/* AUTHOR */ |
88 |
|
|
/* */ |
89 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
90 |
|
|
/* */ |
91 |
|
|
/* DESCRIPTION */ |
92 |
|
|
/* */ |
93 |
|
|
/* This function updates the pointer to the callback function */ |
94 |
|
|
/* used to determine the string to be displayed at a give wheel row */ |
95 |
|
|
/* */ |
96 |
|
|
/* INPUT */ |
97 |
|
|
/* */ |
98 |
|
|
/* wheel Text scroll wheel control */ |
99 |
|
|
/* block */ |
100 |
|
|
/* callback Scroll wheel text get callback*/ |
101 |
|
|
/* */ |
102 |
|
|
/* OUTPUT */ |
103 |
|
|
/* */ |
104 |
|
|
/* status Completion status */ |
105 |
|
|
/* */ |
106 |
|
|
/* CALLS */ |
107 |
|
|
/* */ |
108 |
|
|
/* None */ |
109 |
|
|
/* */ |
110 |
|
|
/* CALLED BY */ |
111 |
|
|
/* */ |
112 |
|
|
/* Application Code */ |
113 |
|
|
/* */ |
114 |
|
|
/**************************************************************************/ |
115 |
|
92 |
UINT _gx_text_scroll_wheel_callback_set_ext(GX_TEXT_SCROLL_WHEEL *wheel, UINT (*callback)(GX_TEXT_SCROLL_WHEEL *, INT, GX_STRING *)) |
116 |
|
|
{ |
117 |
|
|
|
118 |
|
|
/* Update event processing function pointer */ |
119 |
|
92 |
wheel -> gx_text_scroll_wheel_text_get = callback; |
120 |
|
|
#if defined(GX_ENABLE_DEPRECATED_STRING_API) |
121 |
|
92 |
wheel -> gx_text_scroll_wheel_text_get_deprecated = GX_NULL; |
122 |
|
|
#endif |
123 |
|
|
|
124 |
|
|
#ifdef GX_DYNAMIC_BIDI_TEXT_SUPPORT |
125 |
|
|
_gx_text_scroll_wheel_dynamic_bidi_text_delete(wheel); |
126 |
|
|
#endif // GX_DYNAMIC_BIDI_TEXT_SUPPORT |
127 |
|
|
|
128 |
|
92 |
return(GX_SUCCESS); |
129 |
|
|
} |
130 |
|
|
|