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