mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mboxlayoutpiece.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 
44 #ifndef _MGUI_NCSCTRL_BOXLAYOUTPIECE_H
45 #define _MGUI_NCSCTRL_BOXLAYOUTPIECE_H
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 typedef struct _mBoxLayoutPieceClass mBoxLayoutPieceClass;
52 typedef struct _mBoxLayoutPiece mBoxLayoutPiece;
53 
54 #define mBoxLayoutPieceClassHeader(clss, superCls) \
55  mLayoutPieceClassHeader(clss, superCls) \
56  \
57  void (*recalcBox)(clss *); \
58  int (*getCellAutoSize)(clss *, int i); \
59  \
60  int (*setCellInfo)(clss *, int idx, int size, int type/*=NCS_BOXLAYOUTPIECE_ST_FIXED*/, BOOL bupdate/*=FALSE*/); \
61  mHotPiece* (*setCell)(clss *, int idx, mHotPiece *cell); \
62  mHotPiece* (*getCell)(clss *, int idx);
63 
64 struct _mBoxLayoutPieceClass
65 {
66  mBoxLayoutPieceClassHeader(mBoxLayoutPiece, mLayoutPiece)
67 };
68 
69 MGNCS_EXPORT extern mBoxLayoutPieceClass g_stmBoxLayoutPieceCls;
70 
71 #define mBoxLayoutPieceHeader(clss) \
72  mLayoutPieceHeader(clss) \
73  int left:16; \
74  int top:16; \
75  int right:16; \
76  int bottom:16; \
77  unsigned short count; \
78  unsigned char margin; \
79  unsigned char space; \
80  unsigned short * cell_info; \
81  mHotPiece ** cells;
82 
83 
84 struct _mBoxLayoutPiece
85 {
86  mBoxLayoutPieceHeader(mBoxLayoutPiece)
87 };
88 
89 #define mBoxLayoutPiece_getSizeType(size) mLayoutPiece_getSizeType(size)
90 #define mBoxLayoutPiece_setSizeType(size, type) mLayoutPiece_setSizeType(size, type)
91 #define mBoxLayoutPiece_setSize(size, value) mLayoutPiece_setSize(size, value)
92 #define mBoxLayoutPiece_getSize(size) mLayoutPiece_getSize(size)
93 
94 
95 enum mBoxLayoutPieceProps{
96  NCSP_BOXLAYOUTPIECE_COUNT = BOXLAYOUTPIECE_PROP_BEGIN,
97  NCSP_BOXLAYOUTPIECE_SPACE = PIECECOMM_PROP_SPACE,
98  NCSP_BOXLAYOUTPIECE_MARGIN = PIECECOMM_PROP_MARGIN
99 };
100 
103 BOOL mBoxLayoutPiece_calcSize(mBoxLayoutPiece *self, int total_size, int *sizes);
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif
110