Merged in v 26.12.
[AROS-Contrib.git] / mui / classes / thebar / mcc / button / private.h
blob4430e9e0b847f8b40ecd2875f5d3d3d7be8744dc
1 /***************************************************************************
3 TheBar.mcc - Next Generation Toolbar MUI Custom Class
4 Copyright (C) 2003-2005 Alfonso Ranieri
5 Copyright (C) 2005-2013 by TheBar.mcc Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 TheBar class Support Site: http://www.sf.net/projects/thebar
19 $Id$
21 ***************************************************************************/
23 struct pen
25 UBYTE pen;
26 UBYTE done;
29 struct InstData
31 APTR pool; // private memory pool for allocations
32 Object *tb; // Parent TheBar object, if any
33 ULONG id; // As it says
35 struct Screen *screen; // _screen(obj) local copy
36 ULONG screenDepth; // screen depth
37 struct RastPort rp; // _rp(obj)
39 struct MUIS_TheBar_Strip *strip;
41 ULONG imgWidth; // Image width
42 ULONG imgHeight; // Image height
44 struct MUIS_TheBar_Brush *image; // Brush
45 struct BitMap *normalBM; // Normal BitMap
46 struct BitMap *greyBM; // Sunny BitMap
47 APTR mask; // Normal mask
48 struct pen pens[256]; // Allocated pens
49 struct pen gpens[256]; // Grey allocated pens
51 struct MUIS_TheBar_Brush *simage; // Selected brush
52 struct BitMap *snormalBM; // Selected BitMap
53 struct BitMap *sgreyBM; // Selected sunny BitMap
54 APTR smask; // Selected mask
55 struct pen spens[256]; // Allocated pens
56 struct pen sgpens[256]; // Grey allocated pens
58 struct MUIS_TheBar_Brush *dimage; // Disabled brush
59 struct BitMap *dnormalBM; // Disabled BitMap
60 struct BitMap *dgreyBM; // Disabled sunny BitMap
61 APTR dmask; // Disabled mask
62 struct pen dpens[256]; // Allocated pens
63 struct pen dgpens[256]; // Grey allocated pens
65 APTR activeBack; // Button background
66 APTR parentBack; // Parent background
68 LONG shine; // Frame shine pen
69 LONG shadow; // Frame shadow pen
70 LONG disBodyPen; // Disabled body pen
71 LONG disShadowPen; // Disabled shadow pen
73 ULONG vMode; // ViewMode
74 ULONG fStyle; // Frame style
75 ULONG fSize; // Frame size
76 ULONG scale; // Scaled % ratio
77 ULONG disMode; // Disable mode
78 ULONG precision; // Remapping precision
80 UBYTE blabel[TB_MAXLABELLEN]; // Button label
81 UBYTE *end; // Point to text followin _?
82 UBYTE cchar; // Char after _
83 ULONG labelLen; // blabel strlen
84 ULONG lPos; // Label position
85 struct TextExtent lInfo; // blabel TextExtent
86 struct TextExtent eInfo; // end TextExtent
87 struct TextExtent ccInfo; // cchar TextExtent
89 ULONG stripsRows;
90 ULONG stripsCols;
91 ULONG stripHorizSpace;
92 ULONG stripVertSpace;
94 struct MUI_EventHandlerNode eh; // Event handler
96 struct TextFont *tf; // Text font
97 struct TextFont *tgf; // TextGfx font
99 ULONG horizInnerSpacing; // Horiz Inner spacing
100 ULONG topInnerSpacing; // Top Inner spacing
101 ULONG bottomInnerSpacing; // Bottom Inner spacing
103 ULONG horizTextGfxSpacing; // Text/Gfx horiz spacing
104 ULONG vertTextGfxSpacing; // Text/Gfx vert spacing
106 ULONG flags; // As it says
107 ULONG flags2; // As it says
108 ULONG userFlags; // As it says
110 UBYTE *nchunky; // Normal chunky
111 UBYTE *gchunky; // Sunny chunky
112 UBYTE *snchunky; // Selected chunky
113 UBYTE *sgchunky; // Selected sunny chunky
114 UBYTE *dnchunky; // Disabled chunky
115 UBYTE *dgchunky; // Disabled sunny chunky
117 struct MinList notifyList; // list of set notifies on the button
119 ULONG qualifier; // cureently active RAWKEY-Qualifiers
121 #if defined(__amigaos3__)
122 BOOL allowAlphaChannel;
123 #endif
126 /* flags */
127 enum
129 FLG_Setup = 1<<0, // MUIM_Setup
130 FLG_Visible = 1<<1, // MUIM_Show
131 FLG_MouseOver = 1<<2, // Mouse is currently over the button
132 FLG_Handler = 1<<3, // Event added
133 FLG_RedrawBack = 1<<4, // MUIM_Draw will be called to redraw background
135 FLG_Raised = 1<<5, // Rasing frame
136 FLG_Borderless = 1<<6, // Borderless
137 FLG_Sunny = 1<<7, // Sunny
138 FLG_Scaled = 1<<8, // Scaled
140 FLG_Horiz = 1<<9, // Horiz
141 FLG_ShowMe = 1<<10, // MUIA_ShowMe
142 FLG_Disabled = 1<<11, // MUIA_Disabled
143 FLG_Selected = 1<<12, // MUIA_Selected
144 FLG_IsInVirtgroup = 1<<13, // Some parent is a Virtgroup
146 FLG_IsSpacer = 1<<14, // It is a spacer
147 FLG_NoNotify = 1<<15, // No notification
148 FLG_NoClick = 1<<16, // No input
150 FLG_CyberMap = 1<<17, // Cyber screen
151 FLG_CyberDeep = 1<<18, // Cyber screen and depth>256
153 FLG_CloseTF = 1<<19, // tf opened
154 FLG_CloseTGF = 1<<20, // tgf opened
156 FLG_EnableKey = 1<<21, // Key char shortcut in use
158 FLG_Strip = 1<<22,
161 /* flags2 */
162 enum
164 FLG2_Limbo = 1<<0, // Limbo mode ON
165 FLG2_Special = 1<<1, // Special mode ON
166 FLG2_InVirtGroup = 1<<2, // In a Virtgroup for sure
169 /* userFlags */
170 enum
172 UFLG_UserHorizTextGfxSpacing = 1<<0, // Forced HorizTextGfxSpacing
173 UFLG_UserVertTextGfxSpacing = 1<<1, // Forced VertTextGfxSpacing
174 UFLG_UserHorizInnerSpacing = 1<<2, // Forced HorizInnerSpacing
175 UFLG_UserTopInnerSpacing = 1<<3, // Forced TopInnerSpacing
176 UFLG_UserBottomInnerSpacing = 1<<4, // Forced BottomInnerSpacing
177 UFLG_UserPrecision = 1<<5, // Forced Precision
178 UFLG_UserScale = 1<<7, // Forced Scale
179 UFLG_UserDisMode = 1<<6, // Forced DisMode
180 UFLG_UserSpecialSelect = 1<<9, // Forced SpecialSelect
181 UFLG_SpecialSelect = 1<<10, // SpecialSelect?
182 UFLG_UserTextOverUseShine = 1<<11, // Forced TextOverUseShine
183 UFLG_TextOverUseShine = 1<<12, // TextOverUseShine?
184 UFLG_UserIgnoreSelImages = 1<<13, // Forced IgnoreSelImages
185 UFLG_IgnoreSelImages = 1<<14, // IgnoreSelImages?
186 UFLG_UserIgnoreDisImages = 1<<15, // Forced IgnoreDisImages
187 UFLG_IgnoreDisImages = 1<<16, // IgnoreDisImages?
188 UFLG_UserDontMove = 1<<17,
189 UFLG_DontMove = 1<<18,
190 UFLG_UserNtRaiseActive = 1<<19,
191 UFLG_NtRaiseActive = 1<<20,
194 // Notify
195 struct ButtonNotify
197 struct MinNode node; // to link it in the notifies list of a button
198 struct MUIP_Notify msg; // the cached MUI Notify message
201 /***********************************************************************/
203 /* build.c */
204 void scaleStripBitMaps(struct InstData *data);
205 void freeBitMaps(struct InstData *data);
206 void build(struct InstData *data);
208 /***********************************************************************/
210 // new attribute of MUI 4.0 to indicate that a class knows a custom way to indicate disabled objects
211 #ifndef MUIA_KnowsDisabled
212 #define MUIA_KnowsDisabled 0x8042deef /* V20 isg BOOL */
213 #endif