mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mledstaticpiece.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  * This file is part of mGNCS, a component for MiniGUI.
15  *
16  * Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
17  *
18  * This program is free software: you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation, either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program. If not, see <http://www.gnu.org/licenses/>.
30  *
31  * Or,
32  *
33  * As this program is a library, any link to this program must follow
34  * GNU General Public License version 3 (GPLv3). If you cannot accept
35  * GPLv3, you need to be licensed from FMSoft.
36  *
37  * If you have got a commercial license of this program, please use it
38  * under the terms and conditions of the commercial license.
39  *
40  * For more information about the commercial license, please refer to
41  * <http://www.minigui.com/blog/minigui-licensing-policy/>.
42  */
43 #ifdef _MGNCSCTRL_LEDLABEL
44 
45 #ifndef _MGUI_NCSCTRL_LEDLABELPIECE_H
46 #define _MGUI_NCSCTRL_LEDLABELPIECE_H
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 typedef struct _mLedstaticPieceClass mLedstaticPieceClass;
53 typedef struct _mLedstaticPiece mLedstaticPiece;
54 
55 #define mLedstaticPieceClassHeader(clss, superCls) \
56  mStaticPieceClassHeader(clss, superCls)
57 
58 struct _mLedstaticPieceClass
59 {
60  mLedstaticPieceClassHeader(mLedstaticPiece, mStaticPiece)
61 };
62 
63 MGNCS_EXPORT extern mLedstaticPieceClass g_stmLedstaticPieceCls;
64 
65 #define mLedstaticPieceHeader(clss) \
66  mStaticPieceHeader(clss) \
67  char *text; \
68  unsigned int width:16; \
69  unsigned int height:16; \
70  DWORD color; \
71  unsigned int format;
72 
73 struct _mLedstaticPiece
74 {
75  mLedstaticPieceHeader(mLedstaticPiece)
76 };
77 
78 #define mLedstaticPiece_setFlag(self, bitmask) ((self)->format = (((bitmask) << 8) | (self->format & 0xFFFF00FF)))
79 #define mLedstaticPiece_clearFlag(self, bitmask) (((self)->format) &= (~(bitmask << 8)))
80 #define mLedstaticPiece_isFlag(self, bitmask) (((self->format) & (bitmask << 8)))
81 
82 #define mLedstaticPiece_setAutoWrap(self, autoWrap) ((autoWrap)?mLedstaticPiece_setFlag(self, 0x1):mLedstaticPiece_clearFlag(self, 0x1))
83 #define mLedstaticPiece_isAutoWrap(self) mLedstaticPiece_isFlag(self, 0x1)
84 
85 enum mLedstaticPieceProps {
86  NCSP_LEDLBLPIECE_TEXT = LEDLBLPIECE_PROP_BEGIN,
87  NCSP_LEDLBLPIECE_COLOR,
88  NCSP_LEDLBLPIECE_ALIGN = PIECECOMM_PROP_ALIGN,
89  NCSP_LEDLBLPIECE_VALIGN = PIECECOMM_PROP_VALIGN,
90  NCSP_LEDLBLPIECE_AUTOWRAP = PIECECOMM_PROP_AUTOWRAP,
91  NCSP_LEDLBLPIECE_WIDTH,
92  NCSP_LEDLBLPIECE_HEIGHT,
93  NCSP_LEDLBLPIECE_GAP,
94 };
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif
101 #endif //_MGNCSCTRL_LEDLABEL