mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mtransroundpiece.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-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 
52 #ifndef TRANSROUNDPIECE_H
53 #define TRANSROUNDPIECE_H
54 
55 #include <mgplus/mgplus.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 typedef enum _TranRoundPaintMode {
62  TRANROUND_PAINTMODE_GRAPHICSAVE,
63  TRANROUND_PAINTMODE_BITBLT,
64 }TRANROUND_PAINTMODE;
65 
66 typedef enum _TranRoundFillMode{
67  NCSP_TRANROUND_SINGLE_FILL,
68  NCSP_TRANROUND_GRADIENT_FILL,
69 }TRANROUND_FILLMODE;
70 
71 enum mShapeTransRoundPieceProp
72 {
73  NCSP_TRANROUND_RADIUS = USER_PIECE_PROP_BEGIN + 1,
74  NCSP_TRANROUND_PAINTWAY,
75  NCSP_TRANROUND_BKCOLOR,
76  NCSP_TRANROUND_BORDERSIZE,
77  NCSP_TRANROUND_BORDERCOLOR,
78  NCSP_TRANROUND_GRADIENTBORDER,
79  NCSP_TRANROUND_FILLMODE,
80  NCSP_TRANROUND_CORNERFLAG,
81  NCSP_TRANROUND_PAINTMODE,
82  NCSP_TRANROUND_SHARPFLAG,
83  NCSP_TRANROUND_SHARPWIDTH,
84  NCSP_TRANROUND_USESHADOW,
85  NCSP_TRANROUND_FILLENGINE,
86 };
87 
88 enum _TranRoundCornerFlag {
89  TRANROUND_CORNERFLAG_LEFTTOP = 1,
90  TRANROUND_CORNERFLAG_RIGHTTOP = 2,
91  TRANROUND_CORNERFLAG_RIGHTBOTTOM = 4,
92  TRANROUND_CORNERFLAG_LEFTBOTTOM = 8,
93 };
94 
95 enum _TranRoundSharpFlag {
96  TRANROUND_SHARPFLAG_LEFT = 1,
97  TRANROUND_SHARPFLAG_RIGHT = 2,
98 };
99 
100 enum _TranRoundFillEngine{
101  TRANROUND_FILLENGINE_NORMAL,
102  TRANROUND_FILLENGINE_PLUS,
103 };
104 
105 typedef struct _mColorTable {
106  unsigned int tableSize;
107  ARGB *colors;
108  float *positions;
109 } mColorTable;
110 
111 typedef struct _mShapeTransRoundPieceClass mShapeTransRoundPieceClass;
112 typedef struct _mShapeTransRoundPiece mShapeTransRoundPiece;
113 
114 #define mShapeTransRoundPieceHeader(clss) \
115  mStaticPieceHeader(clss) \
116  int corner_radius; \
117  int corner_flag; \
118  int sharp_width; \
119  int sharp_flag; \
120  int border_size; \
121  int fill_engine; \
122  BOOL use_gradient_border; \
123  HBRUSH brush_solid; \
124  HBRUSH brush_gradient; \
125  HBRUSH brush_gradient_border; \
126  HGRAPHICS hgs; \
127  ARGB border_color; \
128  ARGB bk_color; \
129  int hgs_width; \
130  int hgs_height; \
131  BOOL use_shadow; \
132  TRANROUND_FILLMODE fill_mode; \
133  TRANROUND_PAINTMODE paint_mode;
134 
135 struct _mShapeTransRoundPiece
136 {
137  mShapeTransRoundPieceHeader(mShapeTransRoundPiece)
138 };
139 
140 #define mShapeTransRoundPieceClassHeader(clss, superCls) \
141  mStaticPieceClassHeader(clss, superCls) \
142  HBRUSH (*getBrush) (clss*); \
143  HBRUSH (*getBorderBrush)(clss*); \
144  int (*setGradientFillColors) (clss*, ARGB *, int);
145 
146 struct _mShapeTransRoundPieceClass
147 {
148  mShapeTransRoundPieceClassHeader (mShapeTransRoundPiece, mStaticPiece)
149 };
150 
151 // global functions
152 extern void ShapeTransRoundPiece_setColorTable(mColorTable *colorTable,
153  ARGB *colors, float *pos, int num);
154 extern void ShapeTransRoundPiece_setBrushGradientColors (HBRUSH brush,
155  mColorTable *colorTable);
156 
157 MGNCS_EXPORT extern mShapeTransRoundPieceClass g_stmShapeTransRoundPieceCls;
158 
159 #ifdef __cplusplus
160 }
161 #endif
162 #endif /* TRANSROUNDPIECE_H */