1 /*$ 2 Copyright (C) 2013-2020 Azel. 3 4 This file is part of AzPainter. 5 6 AzPainter 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 AzPainter 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 20 #ifndef MLIB_SCROLLVIEWAREA_H 21 #define MLIB_SCROLLVIEWAREA_H 22 23 #include "mWidgetDef.h" 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 #define M_SCROLLVIEWAREA(p) ((mScrollViewArea *)(p)) 30 31 typedef struct _mScrollViewArea mScrollViewArea; 32 typedef struct _mScrollBar mScrollBar; 33 34 typedef struct 35 { 36 mBool (*isBarVisible)(mScrollViewArea *,int size,mBool horz); 37 }mScrollViewAreaData; 38 39 struct _mScrollViewArea 40 { 41 mWidget wg; 42 mScrollViewAreaData sva; 43 }; 44 45 enum MSCROLLVIEWAREA_NOTIFY 46 { 47 MSCROLLVIEWAREA_N_SCROLL_HORZ, 48 MSCROLLVIEWAREA_N_SCROLL_VERT 49 }; 50 51 52 mScrollViewArea *mScrollViewAreaNew(int size,mWidget *parent); 53 54 void mScrollViewAreaGetScrollPos(mScrollViewArea *p,mPoint *pt); 55 int mScrollViewAreaGetHorzScrollPos(mScrollViewArea *p); 56 int mScrollViewAreaGetVertScrollPos(mScrollViewArea *p); 57 mScrollBar *mScrollViewAreaGetScrollBar(mScrollViewArea *p,mBool vert); 58 59 #ifdef __cplusplus 60 } 61 #endif 62 63 #endif 64