mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mnsdrawpiece.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 mnsdrawpiece.h
15  * \author miniStudio team of FMSoft
16  * \date 2010/10/09
17  *
18  \verbatim
19 
20  This file is part of mGNCS4Touch, one of MiniGUI components.
21 
22  Copyright (C) 2008-2018 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 #ifndef __MGNCS4TOUCH_NSDRAWPIECE_H__
52 #define __MGNCS4TOUCH_NSDRAWPIECE_H__
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #define SetNSDrawPieceRect(self, prc) do { \
59  (self)->left = (short)((prc->left) & 0xFFFF); \
60  (self)->top = (short)((prc->top) & 0xFFFF); \
61  (self)->right = (short)((prc->right) & 0xFFFF); \
62  (self)->bottom = (short)((prc->bottom) & 0xFFFF); \
63 } while (0)
64 
65 typedef struct _mNSDrawPiece mNSDrawPiece;
66 typedef struct _mNSDrawPieceClass mNSDrawPieceClass;
67 
68 #define mNSDrawPieceHeader(clss) \
69  mHotPieceHeader(clss) \
70  DWORD shape; \
71  DWORD dotHit; \
72  int left:16; \
73  int top:16; \
74  int right:16; \
75  int bottom:16;
76 
77 struct _mNSDrawPiece {
78  mNSDrawPieceHeader(mNSDrawPiece)
79 };
80 
81 #define mNSDrawPieceClassHeader(clss, superCls) \
82  mHotPieceClassHeader(clss, superCls)
83 
84 struct _mNSDrawPieceClass {
85  mNSDrawPieceClassHeader(mNSDrawPiece, mHotPiece)
86 };
87 
88 MGNCS_EXPORT extern mNSDrawPieceClass g_stmNSDrawPieceCls;
89 
90 enum mNSDrawPieceProp {
91  NCSP_NSDRAW_PIECE_TICK = USER_PIECE_PROP_BEGIN + 1,
92  NCSP_NSDRAW_PIECE_ANGLE,
93  NCSP_NSDRAW_PIECE_DOTHIT,
94  NCSP_NSDRAW_PIECE_MAX,
95 };
96 
97 enum mNSDrawPieceShape {
98  NSDRAW_SHAPE_TICK = NCSP_NSDRAW_PIECE_MAX + 1,
99  NSDRAW_SHAPE_ANGLE,
100 };
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif // __MGNCS4TOUCH_NSDRAWPIECE_H__
107