mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mscrollviewpiece.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 __MGUI_NCSCTRL_SCROLLVIEWPIECE_H
53 #define __MGUI_NCSCTRL_SCROLLVIEWPIECE_H
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58 
59 typedef enum _ScrollViewBkMode {
60  SCROLLVIEW_BKMODE_SOLID_COLOR,
61  SCROLLVIEW_BKMODE_IMAGE_CENTER,
62  SCROLLVIEW_BKMODE_IMAGE_SCALED,
63  SCROLLVIEW_BKMODE_IMAGE_TILED,
64  SCROLLVIEW_BKMODE_PATTERN,
65 } SCROLLVIEWBKMODE;
66 
67 enum mScrollViewPieceProp
68 {
69  NCSP_BACKGROUND_MODE = USER_PIECE_PROP_BEGIN + 1,
70  NCSP_BACKGROUND_DATA,
71 };
72 
73 typedef struct _mScrollViewPieceClass mScrollViewPieceClass;
74 typedef struct _mScrollViewPiece mScrollViewPiece;
75 
76 #define mScrollViewPieceClassHeader(clss, superCls) \
77  mPanelPieceClassHeader(clss, superCls) \
78  void (*moveViewport)(clss*, int x, int y); \
79  void (*getViewport)(clss*, RECT *rc); \
80  void (*showScrollBar)(clss*, BOOL show); \
81  void (*enableCache)(clss*, BOOL cachable);
82 
83 struct _mScrollViewPieceClass
84 {
85  mScrollViewPieceClassHeader(mScrollViewPiece, mPanelPiece)
86 };
87 
88 MGNCS_EXPORT extern mScrollViewPieceClass g_stmScrollViewPieceCls;
89 
90 #define mScrollViewPieceHeader(clss) \
91  mPanelPieceHeader(clss) \
92  DWORD m_timePressed; \
93  BOOL m_bScrollbarAutoHided; \
94  BOOL m_bNeedScrollBar; \
95  BOOL m_bPressed; \
96  BOOL m_bMouseMoved; \
97  int m_movingStatus; /* -1, 0, 1 */ \
98  unsigned int m_mouseFlag; /* 1: move, 2: cancel animation */ \
99  BOOL m_bTimedout; \
100  BOOL m_cachable; \
101  HDC m_cache; \
102  POINT m_pressMousePos; \
103  POINT m_oldMousePos; \
104  float m_ratioX; \
105  float m_ratioY; \
106  RECT m_contentDirtyRect; \
107  RECT m_cachedViewport; \
108  mPieceItem *m_content; \
109  mPieceItem *m_scrollbar; \
110  MGEFF_ANIMATION m_animation; \
111  SPEEDMETER m_speedmeter; \
112  void *m_phy_ctx; \
113  int bkgnd_mode; \
114  DWORD bkgnd_data;
115 
116 struct _mScrollViewPiece
117 {
118  mScrollViewPieceHeader(mScrollViewPiece)
119 };
120 
121 #ifdef __cplusplus
122 }
123 #endif /* __cplusplus */
124 
125 #endif /* __MGUI_NCSCTRL_SCROLLVIEWPIECE_H */