revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / workbench / classes / zune / nlist / nbalance_mcc / private.h
blob1977663f2d8eb1b41675bfa6b868f20cbd4d269a
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
18 $Id$
20 ***************************************************************************/
22 #ifndef PRIVATE_H
23 #define PRIVATE_H
25 /* system includes */
26 #include <dos/exall.h>
27 #include <exec/types.h>
28 #include <intuition/classusr.h>
29 #include <libraries/mui.h>
31 /* mcc includes */
32 #include <mcc_common.h>
34 /* local includes */
35 #include "Debug.h"
36 #include "NBalance.h"
37 #include "Pointer.h"
39 /* private structures */
40 struct InstData
42 ULONG groupType;
43 BOOL mouseSelectDown;
44 BOOL mouseOverObject;
45 BOOL ignoreNextHidePointer;
47 LONG pointerType;
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)
62 #endif
64 /* macros */
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)))
69 /// xget()
70 // Gets an attribute value from a MUI object
71 IPTR xget(Object *obj, const IPTR attr);
72 #if defined(__GNUC__)
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;})
78 #endif
79 ///
81 // structure to export/import the balancing weights
82 struct MUIS_Weights
84 ULONG prevWeight;
85 ULONG nextWeight;
88 /* prototypes */
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 */