mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mimagepiece.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 #ifndef _MGNCS_IMAGEPIECE_H
32 #define _MGNCS_IMAGEPIECE_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 typedef struct _mImagePieceClass mImagePieceClass;
39 typedef struct _mImagePiece mImagePiece;
40 
41 #define mImagePieceClassHeader(clss, superCls) \
42  mStaticPieceClassHeader(clss, superCls)
43 
44 struct _mImagePieceClass
45 {
46  mImagePieceClassHeader(mImagePiece, mStaticPiece)
47 };
48 
49 MGNCS_EXPORT extern mImagePieceClass g_stmImagePieceCls;
50 
51 #define mImagePieceHeader(clss) \
52  mStaticPieceHeader(clss) \
53  ImageDrawInfo img;
54 
55 struct _mImagePiece
56 {
57  mImagePieceHeader(mImagePiece)
58 };
59 
60 #define mImagePiece_setAlign(self, align) ((self)->img.revert=((((self)->img.revert)&0xF0)|((align)&0xF)))
61 #define mImagePiece_getAlign(self) ((self)->img.revert&0xF)
62 
63 #define mImagePiece_setVAlign(self, valign) ((self)->img.revert=(((self)->img.revert&0x0F)|(((valign)&0xF)<<4)))
64 #define mImagePiece_getVAlign(self) (((self)->img.revert&0xF0)>>4)
65 
66 enum mImagePieceProps {
67  NCSP_IMAGEPIECE_IMAGE = IMAGEPIECE_PROP_BEGIN,
68  NCSP_IMAGEPIECE_ICON,
69  NCSP_IMAGEPIECE_MYBITMAP,
70  NCSP_IMAGEPIECE_IMAGEFILE,
71  NCSP_IMAGEPIECE_ALIGN = PIECECOMM_PROP_ALIGN,
72  NCSP_IMAGEPIECE_VALIGN = PIECECOMM_PROP_VALIGN,
73  NCSP_IMAGEPIECE_DRAWMODE = PIECECOMM_PROP_DRAWMOD
74 };
75 
76 
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif
83