Updated to rev. 134 from its own Sourceforge project
[AROS-Contrib.git] / mui / classes / thebar / mcc / private.h
blob114a2118545a79d603a7882f1d6a0220d7591a21
1 #ifndef _PRIVATE_H
2 #define _PRIVATE_H
4 /***************************************************************************
6 TheBar.mcc - Next Generation Toolbar MUI Custom Class
7 Copyright (C) 2003-2005 Alfonso Ranieri
8 Copyright (C) 2005-2007 by TheBar.mcc Open Source Team
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 TheBar class Support Site: http://www.sf.net/projects/thebar
22 $Id: private.h 134 2007-12-03 23:12:52Z damato $
24 ***************************************************************************/
26 #include <mui/TheBar_mcc.h>
28 #include "TheBar_mcp.h"
30 #include <mui/muiundoc.h>
32 /***************************************************************************/
34 extern ULONG lib_flags;
36 extern struct MUI_CustomClass *lib_thisClass;
37 extern struct MUI_CustomClass *lib_spacerClass;
38 extern struct MUI_CustomClass *lib_dragBarClass;
40 enum
42 BASEFLG_Init = 1<<0,
43 BASEFLG_MUI20 = 1<<1,
44 BASEFLG_MUI4 = 1<<2,
47 /***************************************************************************/
49 struct pen
51 UBYTE pen;
52 UBYTE done;
55 #define STATICSORTSIZE 31
57 struct InstData
59 APTR pool;
60 struct MinList buttons;
62 struct Screen *screen;
63 ULONG screenDepth;
65 struct MUIS_TheBar_Brush **brushes;
66 struct MUIS_TheBar_Brush **sbrushes;
67 struct MUIS_TheBar_Brush **dbrushes;
68 struct MUIS_TheBar_Strip strip;
69 ULONG nbr;
71 struct MUIS_TheBar_Brush image;
72 struct pen pens[256];
73 struct pen gpens[256];
75 struct MUIS_TheBar_Brush simage;
76 struct pen spens[256];
77 struct pen sgpens[256];
79 struct MUIS_TheBar_Brush dimage;
80 struct pen dpens[256];
81 struct pen dgpens[256];
83 Object *db;
85 ULONG spacer;
86 ULONG barPos;
87 ULONG viewMode;
88 ULONG labelPos;
90 ULONG buttonWidth;
91 ULONG buttonHeight;
92 ULONG width;
93 ULONG height;
95 ULONG precision;
96 ULONG scale;
97 ULONG disMode;
98 ULONG active;
99 ULONG changes;
100 ULONG remove;
102 LONG cols;
103 LONG rows;
104 LONG lcols;
105 LONG lrows;
107 ULONG horizSpacing;
108 ULONG vertSpacing;
109 ULONG leftBarFrameSpacing;
110 ULONG rightBarFrameSpacing;
111 ULONG topBarFrameSpacing;
112 ULONG bottomBarFrameSpacing;
113 ULONG barSpacerSpacing;
114 ULONG horizInnerSpacing;
115 ULONG topInnerSpacing;
116 ULONG bottomInnerSpacing;
117 ULONG horizTextGfxSpacing;
118 ULONG vertTextGfxSpacing;
119 LONG barFrameShinePen;
120 LONG barFrameShadowPen;
122 ULONG sortMsgID;
123 ULONG sort[STATICSORTSIZE+1];
125 ULONG stripsRows;
126 ULONG stripsCols;
127 ULONG stripHorizSpace;
128 ULONG stripVertSpace;
130 struct MUI_DragImage *dm;
131 struct MUIS_TheBar_DragImage di;
133 struct BitMap *gradbm;
134 struct MUIS_TheBar_Gradient grad;
136 struct MUIS_TheBar_Appearance ap;
138 ULONG id;
140 ULONG spacersSize;
142 #if defined(VIRTUAL)
143 ULONG objWidth;
144 ULONG objHeight;
145 #endif
147 #if defined(__MORPHOS__) || defined(__amigaos4__)
148 ULONG userFrame;
149 char frameSpec[256];
150 #endif
152 ULONG flags;
153 ULONG userFlags;
154 ULONG flags2;
155 ULONG userFlags2;
157 struct MUI_EventHandlerNode eh;
160 /* flags */
161 enum
163 FLG_Horiz = 1<<0,
164 FLG_Borderless = 1<<1,
165 FLG_Raised = 1<<2,
166 FLG_Scaled = 1<<3,
167 FLG_Sunny = 1<<4,
168 FLG_EnableKeys = 1<<5,
169 FLG_Setup = 1<<6,
170 FLG_Limbo = 1<<7,
171 FLG_TextOnly = 1<<8,
172 FLG_FreeBrushes = 1<<9,
173 FLG_FreeStrip = 1<<10,
174 FLG_Background = 1<<11,
175 FLG_IsInVirtgroup = 1<<12,
176 FLG_DragBar = 1<<13,
177 FLG_Framed = 1<<14,
178 FLG_Table = 1<<15,
179 FLG_FreeHoriz = 1<<16,
180 FLG_FreeVert = 1<<17,
181 FLG_BarSpacer = 1<<18,
182 FLG_Strip = 1<<20,
183 FLG_CyberMap = 1<<21,
184 FLG_CyberDeep = 1<<22,
185 FLG_RebuildbitMaps = 1<<23,
188 /* flags 2 */
189 enum
191 FLG2_Gradient = 1<<0,
192 FLG2_IgnoreAppearance = 1<<1,
193 FLG2_ForceWindowActivity = 1<<2,
194 FLG2_EventHandler = 1<<3,
197 /* userFlags */
198 enum
200 UFLG_UserHorizSpacing = 1<<0,
201 UFLG_UserVertSpacing = 1<<1,
202 UFLG_UserBarSpacerSpacing = 1<<2,
203 UFLG_UserHorizInnerSpacing = 1<<3,
204 UFLG_UserTopInnerSpacing = 1<<4,
205 UFLG_UserBottomInnerSpacing = 1<<5,
206 UFLG_UserLeftBarFrameSpacing = 1<<6,
207 UFLG_UserRightBarFrameSpacing = 1<<7,
208 UFLG_UserTopBarFrameSpacing = 1<<8,
209 UFLG_UserBottomBarFrameSpacing = 1<<9,
210 UFLG_UserHorizTextGfxSpacing = 1<<10,
211 UFLG_UserVertTextGfxSpacing = 1<<11,
212 UFLG_UserPrecision = 1<<12,
213 UFLG_UserScale = 1<<13,
214 UFLG_UserDisMode = 1<<14,
215 UFLG_UserSpecialSelect = 1<<15,
216 UFLG_SpecialSelect = 1<<16,
217 UFLG_UserTextOverUseShine = 1<<17,
218 UFLG_TextOverUseShine = 1<<18,
219 UFLG_UserIgnoreSelImages = 1<<19,
220 UFLG_IgnoreSelImages = 1<<20,
221 UFLG_UserIgnoreDisImages = 1<<21,
222 UFLG_IgnoreDisImages = 1<<22,
225 /* userFlags2 */
226 enum
228 UFLG2_UserDontMove = 1<<0,
229 UFLG2_DontMove = 1<<1,
230 UFLG2_UserNtRaiseActive = 1<<2,
231 UFLG2_NtRaiseActive = 1<<3,
232 UFLG2_UserSpacersSize = 1<<4,
233 UFLG2_UserFrame = 1<<5,
236 /***********************************************************************/
238 // Button
239 struct Button
241 struct MinNode node;
242 ULONG ID;
243 Object *obj;
244 ULONG img;
245 const char *text;
246 const char *help;
247 struct IClass *class;
248 ULONG exclude;
249 struct MinList notifyListClone;
251 ULONG flags;
254 // Notify
255 struct ButtonNotify
257 struct MinNode node; // to link it in the notifies list of a button
258 struct MUIP_Notify msg; // the cached MUI Notify message
261 enum
263 BFLG_NoClick = 1<<0,
264 BFLG_Immediate = 1<<1,
265 BFLG_Toggle = 1<<2,
266 BFLG_Disabled = 1<<3,
267 BFLG_Selected = 1<<4,
268 BFLG_Sleep = 1<<5,
269 BFLG_Hide = 1<<6,
271 BFLG_TableHide = 1<<23,
274 /***********************************************************************/
276 /* build.c */
277 void build(struct InstData *data);
278 void freeBitMaps(struct InstData *data);
280 /***********************************************************************/
282 #define MUIVER20 20
284 /***********************************************************************/
286 // some general macros
287 #define RAWIDTH(w) ((((UWORD)(w))+15)>>3 & 0xFFFE)
288 #define BOOLSAME(a,b) (((a) ? TRUE : FALSE)==((b) ? TRUE : FALSE))
289 #define getconfigitem(cl,obj,item,ptr) DoSuperMethod(cl,obj,MUIM_GetConfigItem,item,(ULONG)ptr)
291 #if !defined(IsMinListEmpty)
292 #define IsMinListEmpty(x) (((x)->mlh_TailPred) == (struct MinNode *)(x))
293 #endif
295 #endif /* _PRIVATE_H */