1 /***************************************************************************
3 NBalance.mcc - New Balance MUI Custom Class
4 Copyright (C) 2008-2013 by NList Open Source Team
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library 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 GNU
14 Lesser General Public License for more details.
16 NList classes Support Site: http://www.sf.net/projects/nlist-classes
20 ***************************************************************************/
26 #include <dos/exall.h>
27 #include <exec/types.h>
28 #include <intuition/classusr.h>
29 #include <libraries/mui.h>
32 #include <mcc_common.h>
39 /* private structures */
45 BOOL ignoreNextHidePointer
;
49 Object
*horizSizePointerObj
;
50 Object
*vertSizePointerObj
;
51 enum PointerType activeCustomPointer
;
53 struct MUI_EventHandlerNode ehnode
;
56 #define VERSION_IS_AT_LEAST(ver, rev, minver, minrev) (((ver) > (minver)) || ((ver) == (minver) && (rev) == (minrev)) || ((ver) == (minver) && (rev) > (minrev)))
57 #define LIB_VERSION_IS_AT_LEAST(lib, minver, minrev) VERSION_IS_AT_LEAST(((struct Library *)(lib))->lib_Version, ((struct Library *)(lib))->lib_Revision, minver, minrev)
59 #if defined(__MORPHOS__)
60 #include <proto/exec.h>
61 #define IS_MORPHOS2 LIB_VERSION_IS_AT_LEAST(SysBase, 51, 0)
65 #define _id(obj) (muiNotifyData(obj)->mnd_ObjectID)
66 #define _between(a,x,b) ((x)>=(a) && (x)<=(b))
67 #define _isinobject(x,y) (_between(_left(obj),(x),_right(obj)) && _between(_top(obj),(y),_bottom(obj)))
70 // Gets an attribute value from a MUI object
71 IPTR
xget(Object
*obj
, const IPTR attr
);
73 // please note that we do not evaluate the return value of GetAttr()
74 // as some attributes (e.g. MUIA_Selected) always return FALSE, even
75 // when they are supported by the object. But setting b=0 right before
76 // the GetAttr() should catch the case when attr doesn't exist at all
77 #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;})
81 // structure to export/import the balancing weights
89 IPTR
mNew(struct IClass
*cl
, Object
*obj
, struct opSet
*set
);
90 IPTR
mSet(struct IClass
*cl
, Object
*obj
, Msg msg
);
91 IPTR
mGet(struct IClass
*cl
, Object
*obj
, Msg msg
);
92 IPTR
mSetup(struct IClass
*cl
, Object
*obj
, struct MUI_RenderInfo
*rinfo
);
93 IPTR
mCleanup(struct IClass
*cl
, Object
*obj
, Msg msg
);
94 IPTR
mHide(struct IClass
*cl
, Object
*obj
, Msg msg
);
95 IPTR
mHandleEvent(struct IClass
*cl
, Object
*obj
, struct MUIP_HandleEvent
*msg
);
96 IPTR
mExport(struct IClass
*cl
, Object
*obj
, struct MUIP_Export
*msg
);
97 IPTR
mImport(struct IClass
*cl
, Object
*obj
, struct MUIP_Import
*msg
);
99 #endif /* PRIVATE_H */