Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

typedefs_defines.h

00001 //  Copyright (c) 1996-2002 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 #if !defined TYPEDEF_DEFINES_HEADER
00019 #define TYPEDEF_DEFINES_HEADER
00020 
00021 // basic types & definitions
00022 
00025 typedef char WT_Boolean;
00026 
00029 typedef long WT_Integer32;
00030 
00033 typedef short WT_Integer16;
00034 
00037 typedef unsigned long WT_Unsigned_Integer32;
00038 
00041 typedef unsigned short WT_Unsigned_Integer16;
00042 
00045 typedef unsigned char WT_Byte;
00046 
00049 typedef WT_Integer32 WT_Color_Index;
00050 
00053 
00054 class WD_GUID
00055 {
00056   public:
00057     WD_GUID()
00058       : Data1(0)
00059       , Data2(0)
00060       , Data3(0)
00061     { Data4[0] = Data4[1] = Data4[2] = Data4[3] = Data4[4] = Data4[5] = Data4[6] = Data4[7] = 0; }
00062 
00063   WT_Unsigned_Integer32  Data1; 
00064   WT_Unsigned_Integer16 Data2;  
00065   WT_Unsigned_Integer16 Data3; 
00066   WT_Byte  Data4[8]; 
00067 };
00068 
00071 typedef WD_GUID WD_UUID;
00072 
00073 #define WD_NO_COLOR_INDEX       -1
00074 #define WD_Null                 NULL
00075 #define WD_False                (static_cast<WT_Boolean>(0))
00076 #define WD_True                 (static_cast<WT_Boolean>(-1))
00077 #define WD_stack
00078 #define WD_Opaque               255
00079 #define WD_Clear                0
00080 
00081 #define TWO_PI                  6.283185308
00082 #define WD_90_DEGREES_AS_SHORT  (0x00010000 / 4)
00083 
00084 #define WD_HEAP_LOCK
00085 #define WD_HEAP_UNLOCK
00086 
00087 inline WT_Boolean WD_fits_in_short(long x)
00088 {
00089     return  x <= 32767 && x >= -32768;
00090 }
00091 
00092 // Note: use macro instead of inline since we need to return from the caller, not just the check.
00093 //       macro is considered "safe" for side effects as its argument is only referenced once.
00094 #define WD_CHECK(x) do {                                    \
00095                         WT_Result       result = (x);       \
00096                         if (result != WT_Result::Success)   \
00097                             return result;                  \
00098                     } while (0)                            //
00099 
00100 
00101 inline WT_Boolean WU_is_whitespace(WT_Byte byte)
00102 {
00103     switch (byte)
00104     {
00105     case (0x00):  // Null character -- ignore
00106     case (0x09):  // white space (Tab) -- ignore
00107     case (0x0A):  // white space (Line Feed) --ignore
00108     case (0x0D):  // white space (Carriage Return) -- ignore
00109     case (0x20):  // white space (space) -- ignore
00110         return WD_True;
00111     default:
00112       return WD_False;
00113     } // switch
00114 }
00115 
00116 #define BINARYSIZEOFGUID                                                                    \
00117     (WT_Integer32) (sizeof(WT_Integer32) + sizeof(WT_Unsigned_Integer16) +                  \
00118     sizeof(WT_Unsigned_Integer32) + sizeof(WT_Unsigned_Integer16) +                         \
00119     sizeof(WT_Unsigned_Integer16) + (8 * sizeof(WT_Byte)) + (2 * sizeof(WT_Byte)))          //
00120 
00121 
00122 #define WD_MIN(first, second)    (first < second ? first : second);
00123 #define WD_MAX(first, second)    (first > second ? first : second);
00124 
00125 #endif // TYPEDEF_DEFINES_HEADER

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1