Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Extras / CDTestFramework / AntTweakBar / src / TwMgr.h
1 //  ---------------------------------------------------------------------------
2 //
3 //  @file       TwMgr.h
4 //  @brief      Tweak bar manager.
5 //  @author     Philippe Decaudin - http://www.antisphere.com
6 //  @license    This file is part of the AntTweakBar library.
7 //              For conditions of distribution and use, see License.txt
8 //
9 //  notes:      Private header
10 //              TAB=4
11 //
12 //  ---------------------------------------------------------------------------
13
14
15 #if !defined ANT_TW_MGR_INCLUDED
16 #define ANT_TW_MGR_INCLUDED
17
18 #include <AntTweakBar.h>
19 #define ANT_CALL TW_CALL
20
21 #include "TwColors.h"
22 #include "TwFonts.h"
23 #include "TwGraph.h"
24 #include "AntPerfTimer.h"
25
26
27 //#define BENCH // uncomment to activate benchmarks
28
29 #ifdef BENCH
30 #   define PERF(cmd)    cmd
31 #else   // BENCH
32 #   define PERF(cmd)
33 #endif  // BENCH
34
35 const int NB_ROTO_CURSORS = 12;
36
37
38 //  ---------------------------------------------------------------------------
39 //  API unexposed by AntTweakBar.h
40 //  ---------------------------------------------------------------------------
41
42 // bar states -> use TwDefine instead
43 typedef enum ETwState
44 {
45     TW_STATE_SHOWN       = 1,
46     TW_STATE_ICONIFIED   = 2,
47     TW_STATE_HIDDEN      = 3,
48     TW_STATE_UNICONIFIED = 4,
49     TW_STATE_ERROR       = 0
50 } TwState;
51 /*ANT_TWEAK_BAR_API*/ int       ANT_CALL TwSetBarState(TwBar *bar, TwState state);
52 /*ANT_TWEAK_BAR_API*/ //TwState ANT_CALL TwGetBarState(const TwBar *bar);
53 // var states -> use TwDefine instead: visible/iconified implemented only as string commands
54 //ANT_TWEAK_BAR_API int     ANT_CALL TwSetVarState(TwBar *bar, const char *name, TwState state);
55 //ANT_TWEAK_BAR_API TwState ANT_CALL TwGetVarState(const TwBar *bar, const char *name);
56
57 struct CTwVarGroup;
58 typedef void (ANT_CALL *TwStructExtInitCallback)(void *structExtValue, void *clientData);
59 typedef void (ANT_CALL *TwCopyVarFromExtCallback)(void *structValue, const void *structExtValue, unsigned int structExtMemberIndex, void *clientData);
60 typedef void (ANT_CALL *TwCopyVarToExtCallback)(const void *structValue, void *structExtValue, unsigned int structExtMemberIndex, void *clientData);
61 /*ANT_TWEAK_BAR_API*/ TwType    ANT_CALL TwDefineStructExt(const char *name, const TwStructMember *structExtMembers, unsigned int nbExtMembers, size_t structSize, size_t structExtSize, TwStructExtInitCallback structExtInitCallback, TwCopyVarFromExtCallback copyVarFromExtCallback, TwCopyVarToExtCallback copyVarToExtCallback, TwSummaryCallback summaryCallback, void *clientData, const char *help);
62 typedef void (ANT_CALL *TwCustomDrawCallback)(int w, int h, void *structExtValue, void *clientData, TwBar *bar, CTwVarGroup *varGrp);
63 typedef bool (ANT_CALL *TwCustomMouseMotionCallback)(int mouseX, int mouseY, int w, int h, void *structExtValue, void *clientData, TwBar *bar, CTwVarGroup *varGrp);
64 typedef bool (ANT_CALL *TwCustomMouseButtonCallback)(TwMouseButtonID button, bool pressed, int mouseX, int mouseY, int w, int h, void *structExtValue, void *clientData, TwBar *bar, CTwVarGroup *varGrp);
65 typedef void (ANT_CALL *TwCustomMouseLeaveCallback)(void *structExtValue, void *clientData, TwBar *bar);
66
67 enum ERetType 
68 {
69     RET_ERROR = 0,
70     RET_DOUBLE,
71     RET_STRING
72 };
73
74 enum EButtonAlign   
75
76     BUTTON_ALIGN_LEFT, 
77     BUTTON_ALIGN_CENTER, 
78     BUTTON_ALIGN_RIGHT 
79 };
80
81 //  ---------------------------------------------------------------------------
82 //  AntTweakBar Manager
83 //  ---------------------------------------------------------------------------
84
85 struct CTwMgr
86 {
87     ETwGraphAPI         m_GraphAPI;
88     void *              m_Device;
89     int                 m_WndID;
90     class ITwGraph *    m_Graph;
91     int                 m_WndWidth;
92     int                 m_WndHeight;
93     const CTexFont *    m_CurrentFont;
94
95     std::vector<TwBar*> m_Bars;
96     std::vector<int>    m_Order;
97
98     std::vector<bool>   m_MinOccupied;
99     void                Minimize(TwBar *_Bar);
100     void                Maximize(TwBar *_Bar);
101     void                Hide(TwBar *_Bar);
102     void                Unhide(TwBar *_Bar);
103     void                SetFont(const CTexFont *_Font, bool _ResizeBars);
104     int                 m_LastMouseX;
105     int                 m_LastMouseY;
106     int                 m_LastMouseWheelPos;
107     int                 m_IconPos;      // 0: bottom-left, 1:bottom-right, 2:top-left, 3:top-right
108     int                 m_IconAlign;    // 0: vertical, 1: horizontal
109     int                 m_IconMarginX, m_IconMarginY;
110     bool                m_FontResizable;
111     std::string         m_BarAlwaysOnTop;
112     std::string         m_BarAlwaysOnBottom;
113     bool                m_UseOldColorScheme;
114     bool                m_Contained;
115     EButtonAlign        m_ButtonAlign;
116     bool                m_OverlapContent;
117     bool                m_Terminating;
118
119     std::string         m_Help;
120     TwBar *             m_HelpBar;
121     float               m_LastHelpUpdateTime;
122     void                UpdateHelpBar();
123     bool                m_HelpBarNotUpToDate;
124     bool                m_HelpBarUpdateNow;
125     void *              m_KeyPressedTextObj;
126     bool                m_KeyPressedBuildText;
127     std::string         m_KeyPressedStr;
128     float               m_KeyPressedTime;
129     void *              m_InfoTextObj;
130     bool                m_InfoBuildText;
131     int                 m_BarInitColorHue;
132     int                 FindBar(const char *_Name) const;
133     int                 HasAttrib(const char *_Attrib, bool *_HasValue) const;
134     int                 SetAttrib(int _AttribID, const char *_Value);
135     ERetType            GetAttrib(int _AttribID, std::vector<double>& outDouble, std::ostringstream& outString) const;
136     void                SetLastError(const char *_StaticErrorMesssage); // _StaticErrorMesssage must be a static string
137     const char *        GetLastError();                                 // returns a static string describing the error, and set LastError to NULL
138     const char *        CheckLastError() const;                         // returns the LastError, but does not set it to NULL
139     void                SetCurrentDbgParams(const char *file, int line);
140     TwBar *             m_PopupBar;
141     //bool              IsProcessing() const            { return m_Processing);
142     //void              SetProcessing(bool processing)  { m_Processing = processing; }
143
144                         CTwMgr(ETwGraphAPI _GraphAPI, void *_Device, int _WndID);
145                         ~CTwMgr();
146
147     struct CStructMember
148     {
149         std::string     m_Name;
150         std::string     m_Label;
151         TwType          m_Type;
152         size_t          m_Offset;
153         std::string     m_DefString;
154         size_t          m_Size;
155         std::string     m_Help;
156     };
157     struct CStruct
158     {
159         std::string                 m_Name;
160         std::vector<CStructMember>  m_Members;
161         size_t                      m_Size;
162         TwSummaryCallback           m_SummaryCallback;
163         void *                      m_SummaryClientData;
164         std::string                 m_Help;
165         bool                        m_IsExt;
166         size_t                      m_ClientStructSize;
167         TwStructExtInitCallback     m_StructExtInitCallback;
168         TwCopyVarFromExtCallback    m_CopyVarFromExtCallback;
169         TwCopyVarToExtCallback      m_CopyVarToExtCallback;
170         void *                      m_ExtClientData;
171         CStruct() : m_IsExt(false), m_StructExtInitCallback(NULL), m_CopyVarFromExtCallback(NULL), m_CopyVarToExtCallback(NULL), m_ExtClientData(NULL) {}
172         static void ANT_CALL        DefaultSummary(char *_SummaryString, size_t _SummaryMaxLength, const void *_Value, void *_ClientData);
173         static void *               s_PassProxyAsClientData;
174     };
175     std::vector<CStruct> m_Structs;
176
177     // followings are used for TwAddVarCB( ... StructType ... )
178     struct CStructProxy
179     {
180         TwType           m_Type;
181         void *           m_StructData;
182         bool             m_DeleteStructData;
183         void *           m_StructExtData;
184         TwSetVarCallback m_StructSetCallback;
185         TwGetVarCallback m_StructGetCallback;
186         void *           m_StructClientData;
187         TwCustomDrawCallback        m_CustomDrawCallback;
188         TwCustomMouseMotionCallback m_CustomMouseMotionCallback;
189         TwCustomMouseButtonCallback m_CustomMouseButtonCallback;
190         TwCustomMouseLeaveCallback  m_CustomMouseLeaveCallback;
191         bool             m_CustomCaptureFocus;
192         int              m_CustomIndexFirst;
193         int              m_CustomIndexLast;
194         CStructProxy();
195         ~CStructProxy();
196     };
197     struct CMemberProxy
198     {
199         CStructProxy *  m_StructProxy;
200         int             m_MemberIndex;
201         struct CTwVar * m_Var;
202         struct CTwVarGroup * m_VarParent;
203         CTwBar *        m_Bar;
204         CMemberProxy();
205         ~CMemberProxy();
206         static void ANT_CALL SetCB(const void *_Value, void *_ClientData);
207         static void ANT_CALL GetCB(void *_Value, void *_ClientData);
208     };
209     std::list<CStructProxy> m_StructProxies;    // elements should not move
210     std::list<CMemberProxy> m_MemberProxies;    // elements should not move
211     //void              InitVarData(TwType _Type, void *_Data, size_t _Size);
212     //void              UninitVarData(TwType _Type, void *_Data, size_t _Size);
213
214     struct CEnum
215     {
216         std::string     m_Name;
217         typedef std::map<unsigned int, std::string> CEntries;
218         CEntries        m_Entries;
219     };
220     std::vector<CEnum>  m_Enums;
221
222     TwType              m_TypeColor32;
223     TwType              m_TypeColor3F;
224     TwType              m_TypeColor4F;
225     TwType              m_TypeQuat4F;
226     TwType              m_TypeQuat4D;
227     TwType              m_TypeDir3F;
228     TwType              m_TypeDir3D;
229
230     std::vector<char>   m_CSStringBuffer;
231     struct CCDStdString
232     {
233         std::string *        m_ClientStdStringPtr;
234         char                 m_LocalString[sizeof(std::string)+2*sizeof(void*)]; //+2*sizeof(void*) because of VC++ std::string extra info in Debug
235         TwSetVarCallback     m_ClientSetCallback;
236         TwGetVarCallback     m_ClientGetCallback;
237         void *               m_ClientData;
238         static void ANT_CALL SetCB(const void *_Value, void *_ClientData);
239         static void ANT_CALL GetCB(void *_Value, void *_ClientData);
240     };
241     std::list<CCDStdString>  m_CDStdStrings;
242     struct CClientStdString  // Convertion between VC++ Debug/Release std::string
243     {
244                         CClientStdString();
245         void            FromLib(const char *libStr);
246         std::string&    ToClient();
247     private:
248         char            m_Data[sizeof(std::string)+2*sizeof(void *)];
249         std::string     m_LibStr;
250     };
251     struct CLibStdString   // Convertion between VC++ Debug/Release std::string
252     {
253                         CLibStdString();
254         void            FromClient(const std::string& clientStr);
255         std::string&    ToLib();
256     private:
257         char            m_Data[sizeof(std::string)+2*sizeof(void *)];
258     };
259     struct CCDStdStringRecord 
260     {
261         void *              m_DataPtr;
262         char                m_PrevValue[sizeof(std::string)+2*sizeof(void*)];
263         CClientStdString    m_ClientStdString;
264     };
265     std::vector<CCDStdStringRecord> m_CDStdStringRecords;
266     void                UnrollCDStdString(std::vector<CCDStdStringRecord>& _Records, TwType _Type, void *_Data);
267     void                RestoreCDStdString(const std::vector<CCDStdStringRecord>& _Records);
268     std::map<void *, std::vector<char> > m_CDStdStringCopyBuffers;
269
270     struct CCustom      // custom var type
271     {
272         virtual         ~CCustom() = 0;
273     };
274     std::vector<CCustom *> m_Customs;
275
276     PerfTimer           m_Timer;
277     double              m_LastMousePressedTime;
278     TwMouseButtonID     m_LastMousePressedButtonID;
279     int                 m_LastMousePressedPosition[2];
280     double              m_RepeatMousePressedDelay;
281     double              m_RepeatMousePressedPeriod;
282     bool                m_CanRepeatMousePressed;
283     bool                m_IsRepeatingMousePressed;
284     double              m_LastDrawTime;
285
286     #if defined(ANT_WINDOWS)
287         typedef HCURSOR CCursor;
288         CCursor         PixmapCursor(int _CurIdx);
289     #elif defined(ANT_UNIX)
290         typedef Cursor  CCursor;
291         CCursor         PixmapCursor(int _CurIdx);
292         Display *       m_CurrentXDisplay;
293         Window          m_CurrentXWindow;
294     #elif defined(ANT_OSX)
295         typedef NSCursor * CCursor;
296         CCursor         PixmapCursor(int _CurIdx);
297     #endif  // defined(ANT_UNIX)
298     bool                m_CursorsCreated;
299     void                CreateCursors();
300     void                FreeCursors();
301     void                SetCursor(CCursor _Cursor);
302     CCursor             m_CursorArrow;
303     CCursor             m_CursorMove;
304     CCursor             m_CursorWE;
305     CCursor             m_CursorNS;
306     CCursor             m_CursorTopLeft;
307     CCursor             m_CursorTopRight;
308     CCursor             m_CursorBottomLeft;
309     CCursor             m_CursorBottomRight;    
310     CCursor             m_CursorHelp;
311     CCursor             m_CursorHand;
312     CCursor             m_CursorCross;
313     CCursor             m_CursorUpArrow;
314     CCursor             m_CursorNo;
315     CCursor             m_CursorIBeam;
316     CCursor             m_RotoCursors[NB_ROTO_CURSORS];
317     CCursor             m_CursorCenter;
318     CCursor             m_CursorPoint;
319
320     TwCopyCDStringToClient  m_CopyCDStringToClient;
321     TwCopyStdStringToClient m_CopyStdStringToClient;
322     size_t              m_ClientStdStringStructSize;
323     TwType              m_ClientStdStringBaseType;
324
325 protected:
326     int                 m_NbMinimizedBars;
327     const char *        m_LastError;
328     const char *        m_CurrentDbgFile;
329     int                 m_CurrentDbgLine;
330     //bool              m_Processing;
331 };
332
333 extern CTwMgr *g_TwMgr;
334
335
336 //  ---------------------------------------------------------------------------
337 //  Extra functions and TwTypes
338 //  ---------------------------------------------------------------------------
339
340
341 bool TwGetKeyCode(int *_Code, int *_Modif, const char *_String);
342 bool TwGetKeyString(std::string *_String, int _Code, int _Modif); 
343
344 const TwType TW_TYPE_SHORTCUT       = TwType(0xfff1);
345 const TwType TW_TYPE_HELP_GRP       = TwType(0xfff2);
346 const TwType TW_TYPE_HELP_ATOM      = TwType(0xfff3);
347 const TwType TW_TYPE_HELP_HEADER    = TwType(0xfff4);
348 const TwType TW_TYPE_HELP_STRUCT    = TwType(0xfff5);
349 const TwType TW_TYPE_BUTTON         = TwType(0xfff6);
350 const TwType TW_TYPE_CDSTDSTRING    = TwType(0xfff7);
351 const TwType TW_TYPE_STRUCT_BASE    = TwType(0x10000000);
352 const TwType TW_TYPE_ENUM_BASE      = TwType(0x20000000);
353 const TwType TW_TYPE_CSSTRING_BASE  = TW_TYPE_CSSTRING(0);          // defined as 0x30000000 (see AntTweakBar.h)
354 const TwType TW_TYPE_CSSTRING_MAX   = TW_TYPE_CSSTRING(0xfffffff);
355 #define TW_CSSTRING_SIZE(type)      ((int)((type)&0xfffffff))
356 const TwType TW_TYPE_CUSTOM_BASE    = TwType(0x40000000);
357 const TwType TW_TYPE_STDSTRING_VS2008 = TwType(0x2fff0000);
358 const TwType TW_TYPE_STDSTRING_VS2010 = TwType(0x2ffe0000);
359
360 extern "C" int ANT_CALL TwSetLastError(const char *_StaticErrorMessage);
361
362 //const TwGraphAPI TW_OPENGL_CORE = (TwGraphAPI)5; // WIP (note: OpenGL Core Profil requires OpenGL 3.2 or later)
363
364 // Clipping helper
365 struct CRect 
366
367     int X, Y, W, H;
368     CRect() : X(0), Y(0), W(0), H(0) {}
369     CRect(int _X, int _Y, int _W, int _H) : X(_X), Y(_Y), W(_W), H(_H) {}
370     bool operator==(const CRect& _Rect) { return (Empty() && _Rect.Empty()) || (X==_Rect.X && Y==_Rect.Y && W==_Rect.W && H==_Rect.H); }
371     bool Empty(int _Margin=0) const { return (W<=_Margin || H<=_Margin); }
372     bool Subtract(const CRect& _Rect, std::vector<CRect>& _OutRects) const;
373     bool Subtract(const std::vector<CRect>& _Rects, std::vector<CRect>& _OutRects) const;
374 };
375
376
377 //  ---------------------------------------------------------------------------
378 //  Global bar attribs
379 //  ---------------------------------------------------------------------------
380
381
382 enum EMgrAttribs
383 {
384     MGR_HELP = 1,
385     MGR_FONT_SIZE,
386     MGR_FONT_STYLE,
387     MGR_ICON_POS,
388     MGR_ICON_ALIGN,
389     MGR_ICON_MARGIN,
390     MGR_FONT_RESIZABLE,
391     MGR_COLOR_SCHEME,
392     MGR_CONTAINED,
393     MGR_BUTTON_ALIGN,
394     MGR_OVERLAP
395 };
396
397
398 //  ---------------------------------------------------------------------------
399 //  Color struct ext
400 //  ---------------------------------------------------------------------------
401
402
403 struct CColorExt
404 {
405     int                  R, G, B;
406     int                  H, L, S;
407     int                  A;
408     bool                 m_HLS, m_HasAlpha, m_OGL;
409     bool                 m_CanHaveAlpha;
410     bool                 m_IsColorF;
411     unsigned int         m_PrevConvertedColor;
412     CTwMgr::CStructProxy*m_StructProxy;
413     void                 RGB2HLS();
414     void                 HLS2RGB();
415     static void ANT_CALL InitColor32CB(void *_ExtValue, void *_ClientData);
416     static void ANT_CALL InitColor3FCB(void *_ExtValue, void *_ClientData);
417     static void ANT_CALL InitColor4FCB(void *_ExtValue, void *_ClientData);
418     static void ANT_CALL CopyVarFromExtCB(void *_VarValue, const void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
419     static void ANT_CALL CopyVarToExtCB(const void *_VarValue, void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
420     static void ANT_CALL SummaryCB(char *_SummaryString, size_t _SummaryMaxLength, const void *_ExtValue, void *_ClientData);
421     static void          CreateTypes();
422 };
423
424
425 //  ---------------------------------------------------------------------------
426 //  Quaternion struct ext
427 //  ---------------------------------------------------------------------------
428
429
430 struct CQuaternionExt
431 {
432     double               Qx, Qy, Qz, Qs;    // Quat value
433     double               Vx, Vy, Vz, Angle; // Not used
434     double               Dx, Dy, Dz;        // Dir value set when used as a direction
435     bool                 m_AAMode;          // Axis & angle mode -> disabled
436     bool                 m_ShowVal;         // Display values
437     bool                 m_IsFloat;         // Quat/Dir uses floats
438     bool                 m_IsDir;           // Mapped to a dir vector instead of a quat
439     double               m_Dir[3];          // If not zero, display one direction vector
440     color32              m_DirColor;        // Direction vector color
441     float                m_Permute[3][3];   // Permute frame axis
442     CTwMgr::CStructProxy*m_StructProxy;
443     static void ANT_CALL InitQuat4FCB(void *_ExtValue, void *_ClientData);
444     static void ANT_CALL InitQuat4DCB(void *_ExtValue, void *_ClientData);
445     static void ANT_CALL InitDir3FCB(void *_ExtValue, void *_ClientData);
446     static void ANT_CALL InitDir3DCB(void *_ExtValue, void *_ClientData);
447     static void ANT_CALL CopyVarFromExtCB(void *_VarValue, const void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
448     static void ANT_CALL CopyVarToExtCB(const void *_VarValue, void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
449     static void ANT_CALL SummaryCB(char *_SummaryString, size_t _SummaryMaxLength, const void *_ExtValue, void *_ClientData);
450     static void ANT_CALL DrawCB(int _W, int _H, void *_ExtValue, void *_ClientData, TwBar *_Bar, CTwVarGroup *varGrp);
451     static bool ANT_CALL MouseMotionCB(int _MouseX, int _MouseY, int _W, int _H, void *_StructExtValue, void *_ClientData, TwBar *_Bar, CTwVarGroup *varGrp);
452     static bool ANT_CALL MouseButtonCB(TwMouseButtonID _Button, bool _Pressed, int _MouseX, int _MouseY, int _W, int _H, void *_StructExtValue, void *_ClientData, TwBar *_Bar, CTwVarGroup *varGrp);
453     static void ANT_CALL MouseLeaveCB(void *_StructExtValue, void *_ClientData, TwBar *_Bar);
454     static void          CreateTypes();
455     static TwType        s_CustomType;
456     void                 ConvertToAxisAngle();
457     void                 ConvertFromAxisAngle();
458     void                 CopyToVar();
459     static std::vector<float>   s_SphTri;
460     static std::vector<color32> s_SphCol;
461     static std::vector<int>     s_SphTriProj;
462     static std::vector<color32> s_SphColLight;
463     static std::vector<float>   s_ArrowTri[4];
464     static std::vector<int>     s_ArrowTriProj[4];
465     static std::vector<float>   s_ArrowNorm[4];
466     static std::vector<color32> s_ArrowColLight[4];
467     enum EArrowParts     { ARROW_CONE, ARROW_CONE_CAP, ARROW_CYL, ARROW_CYL_CAP };
468     static void          CreateSphere();
469     static void          CreateArrow();
470     static void          ApplyQuat(float *outX, float *outY, float *outZ, float x, float y, float z, float qx, float qy, float qz, float qs);
471     static void          QuatFromDir(double *outQx, double *outQy, double *outQz, double *outQs, double dx, double dy, double dz);
472     inline void          Permute(float *outX, float *outY, float *outZ, float x, float y, float z);
473     inline void          PermuteInv(float *outX, float *outY, float *outZ, float x, float y, float z);
474     inline void          Permute(double *outX, double *outY, double *outZ, double x, double y, double z);
475     inline void          PermuteInv(double *outX, double *outY, double *outZ, double x, double y, double z);
476     bool                 m_Highlighted;
477     bool                 m_Rotating;
478     double               m_OrigQuat[4];
479     float                m_OrigX, m_OrigY;
480     double               m_PrevX, m_PrevY;
481 };
482
483
484 //  ---------------------------------------------------------------------------
485 //  CTwFPU objects set and restore the fpu precision if needed.
486 //  (could be useful because DirectX changes it and AntTweakBar requires default double precision)
487 //  ---------------------------------------------------------------------------
488
489
490 struct CTwFPU
491 {
492     CTwFPU()    
493     { 
494     #ifdef ANT_WINDOWS
495         state0 = _controlfp(0, 0); 
496         if( (state0&MCW_PC)==_PC_24 )   // we need at least _PC_53
497             _controlfp(_PC_53, MCW_PC);
498     #else
499         state0 = 0;
500     #endif
501     }
502     ~CTwFPU()
503     {
504     #ifdef ANT_WINDOWS      
505         if( (state0&MCW_PC)==_PC_24 )
506             _controlfp(_PC_24, MCW_PC);
507     #else
508         state0 = 0;
509     #endif
510     }
511 private:
512     unsigned int state0;
513 };
514
515 //  ---------------------------------------------------------------------------
516
517
518 #endif // !defined ANT_TW_MGR_INCLUDED