mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mspeedmeter.h
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 /*
14  * \file
15  * \author FMSoft
16  * \date
17  *
18  \verbatim
19 
20  This file is part of mGNCS4Touch, one of MiniGUI components.
21 
22  Copyright (C) 2008-2020 FMSoft (http://www.fmsoft.cn).
23 
24  This program is free software: you can redistribute it and/or modify
25  it under the terms of the GNU General Public License as published by
26  the Free Software Foundation, either version 3 of the License, or
27  (at your option) any later version.
28 
29  This program is distributed in the hope that it will be useful,
30  but WITHOUT ANY WARRANTY; without even the implied warranty of
31  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32  GNU General Public License for more details.
33 
34  You should have received a copy of the GNU General Public License
35  along with this program. If not, see <http://www.gnu.org/licenses/>.
36 
37  Or,
38 
39  As this program is a library, any link to this program must follow
40  GNU General Public License version 3 (GPLv3). If you cannot accept
41  GPLv3, you need to be licensed from FMSoft.
42 
43  If you have got a commercial license of this program, please use it
44  under the terms and conditions of the commercial license.
45 
46  For more information about the commercial license, please refer to
47  <http://www.minigui.com/blog/minigui-licensing-policy/>.
48 
49  \endverbatim
50 */
51 
52 #ifndef MSPEEDMETER_H
53 #define MSPEEDMETER_H
54 
55 #define EXPORT /* TODO */
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 static inline int QueryMouseMoveVelocity (float *v_x, float *v_y)
62 {
63  *v_x = *v_y = 0.0f;
64  return -1;
65 }
66 
67 /* Proc for MiniGUI */
68 EXPORT int SpeedMeterProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
69 
70 #ifdef NCSCTRL_WIDGET
71 /* Handler for mGNCS */
72 EXPORT BOOL SpeedMeterMessageHandler(mWidget*, int message, int x, int y, DWORD keyStatus);
73 #endif
74 
75 #if 0
76 EXPORT int QueryMouseMovePath(POINT *points, unsigned int *times, int count);
77 EXPORT int mSpeedMeter_getpath(SPEEDMETER handle, POINT *points, unsigned int *times, int count);
78 #endif
79 
80 /*
81  * Low level APIs
82  */
83 /* DECLARE_HANDLE(SPEEDMETER) */
84 typedef struct _notused_mSpeedMeter_handle{ int not_used; } *SPEEDMETER;
85 
86 EXPORT SPEEDMETER mSpeedMeter_create (int duration_ms, int precision_ms);
87 EXPORT void mSpeedMeter_destroy (SPEEDMETER handle);
88 EXPORT void mSpeedMeter_append (SPEEDMETER handle, int x, int y, unsigned int t);
89 EXPORT void mSpeedMeter_stop (SPEEDMETER handle);
90 EXPORT void mSpeedMeter_reset (SPEEDMETER handle);
91 EXPORT int mSpeedMeter_velocity (SPEEDMETER handle, float *v_x, float *v_y);
92 EXPORT int mSpeedMeter_query_velocity (SPEEDMETER handle, float *v_x, float *v_y);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* MSPEEDMETER_H */