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

whipcore.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 WHIPCORE_HEADER
00019 #define WHIPCORE_HEADER
00020 
00022 //
00023 // Recognize the newer DWF Toolkit pre-processor macros
00024 // 
00025 //
00026 #ifdef  DWFTK_STATIC
00027 #ifndef WHIP_STATIC_LIB
00028 #define WHIP_STATIC_LIB
00029 #endif
00030 #endif
00031 
00032 #ifdef  DWFTK_READ_ONLY
00033 #ifdef  CODE_NOT_WANTED
00034 #undef  CODE_NOT_WANTED
00035 #endif
00036 #define CODE_NOT_WANTED             WHIP_OUTPUT
00037 #endif
00038 
00039 #ifdef  DWFTK_EXPORT_API
00040 #undef  WHIPTOOL_CLIENT
00041 #undef  WHIP_STATIC_LIB
00042 #endif
00043 
00044 
00045 
00046 
00047 //
00048 // There are many products now using the Toolkit, however many
00049 // of these products use only a fraction of the code.  The
00050 // following 'defines' allow a product makefile to exclude
00051 // certain types of routines from the build by defining
00052 // the CODE_NOT_WANTED variable.  I know it makes the code a bit
00053 // ugly having a bunch of #if's everywhere, but the Web demands
00054 // small downloads... If you have a better idea, let me know... BPM
00055 //
00056 #ifndef CODE_NOT_WANTED
00057 #   define CODE_NOT_WANTED 0
00058 #endif
00059 #define WHIP_OUTPUT 0x10000000
00060 #define WHIP_INPUT 0x20000000
00061 // DESIRED_CODE is defined in HEIDI's core.h if needed, and is the same as the one here.
00062 #ifndef DESIRED_CODE
00063 #define DESIRED_CODE(bits)  (!((bits) & (CODE_NOT_WANTED)))
00064 #endif
00065 
00066 
00067 #if(!DESIRED_CODE(WHIP_INPUT))
00068 #pragma message ("Whip input code disabled")
00069 #endif
00070 #if(!DESIRED_CODE(WHIP_OUTPUT))
00071 #pragma message ("Whip output code disabled")
00072 #endif
00073 
00074 #include <stdlib.h>
00075 
00076 #if   defined   __sgi
00077     #define             WD_SGI_SYSTEM
00078     #define             WD_BIGENDIAN       TRUE
00079 
00080 #elif defined   __linux
00081     #include <endian.h>
00082     #define             WD_LINUX_SYSTEM
00083     #define             WD_BIGENDIAN       (__BYTE_ORDER == __BIG_ENDIAN)
00084 
00085     //
00086     // GNU macros messing with class methods... strange
00087     // for example, matrix.h will complain about minor()
00088     //
00089     #ifdef major
00090         #undef major
00091     #endif
00092 
00093     #ifdef minor
00094         #undef minor
00095     #endif
00096     #define             WD_PREFERRED_RGB32     b, g, r, a      // GDI's preference
00097 
00098 #elif defined (macintosh) || (defined (__MACH__) && defined (__APPLE__))
00099     #define     WD_MAC_SYSTEM
00100     #define     WD_BIGENDIAN        1
00101 
00102     //
00103     // GNU macros messing with class methods... strange
00104     // for example, matrix.h will complain about minor()
00105     //
00106     #ifdef major
00107         #undef major
00108     #endif
00109 
00110     #ifdef minor
00111         #undef minor
00112     #endif
00113 
00114     #define             WD_PREFERRED_RGB32     b, g, r, a      // GDI's preference
00115 
00116 #elif defined   _MSC_VER
00117     #define             WD_WIN32_SYSTEM
00118     #define             WD_BIGENDIAN       FALSE
00119     //#define           WD_PREFERRED_RGB32         r, g, b, a // OpenGL's preference
00120     #define             WD_PREFERRED_RGB32         b, g, r, a // GDI's preference
00121     #define             WD_NEWLINE          "\r\n"
00122 
00123     #ifndef WHIP_STATIC_LIB
00124         #if defined WHIPTOOL_CLIENT
00125             #define         WHIPTK_API __declspec(dllimport)
00126             #pragma message ("Whip client (dllimport) ")
00127         #else
00128             #define         WHIPTK_API  __declspec(dllexport)
00129             #pragma message ("Whip server (dllexport) ")
00130         #endif
00131         #define     WHIPTOOL_LOADABLE  extern "C" __declspec(dllexport)
00132     #else
00133         #define WHIPTK_API
00134         #define WHIPTOOL_LOADABLE  extern "C"
00135         #pragma message ("Whip static library ")
00136     #endif
00137 
00138     #define     WHIPTOOL_CALL      __cdecl
00139 
00140     #pragma warning (disable : 4127)  // conditional expression is constant (used in "do {...} while (0)" for macro safety)
00141     #pragma warning (disable : 4251)  // 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
00142 
00143     #if defined (_DEBUG) && defined (_AFXDLL)
00144         #include <afx.h>
00145         #if !defined WHIPTOOL_CLIENT
00146             #define new DEBUG_NEW
00147         #endif
00148     #else
00149         #include <windows.h>
00150     #endif
00151 
00152 #else
00153     #error      "Fatal WHIP! toolkit build error -- Unknown system type"
00154 #endif
00155 
00156 
00157 // default definitions if not set per-system
00158 
00159 #if !defined WD_PREFERRED_RGB32
00160     #define     WD_PREFERRED_RGB32          a, b, g, r
00161 #endif
00162 
00163 #if !defined WD_NEWLINE
00164     #define     WD_NEWLINE                  "\n"
00165 #endif
00166 
00167 #if !defined WD_SET_MEMORY
00168     #include <string.h>
00169     #define     WD_SET_MEMORY(dest, size, value)   memset ((dest), (value), (size))
00170 #endif
00171 
00172 #if !defined WD_COPY_MEMORY
00173     #include <string.h>
00174     #define     WD_COPY_MEMORY(src, count, dest)   memcpy ((dest), (src), (count))
00175 #endif
00176 
00177 #if !defined WHIPTK_API
00178     #define     WHIPTK_API
00179 #endif
00180 
00181 #if !defined WHIPTOOL_LOADABLE
00182     #define     WHIPTOOL_LOADABLE          extern "C"
00183 #endif
00184 
00185 #if !defined WHIPTOOL_CALL
00186     #define     WHIPTOOL_CALL
00187 #endif
00188 
00189 //
00190 // The presence of _DEBUG contraindicates "production" code.
00191 // Control all other debugging flags with this global
00192 // sense of debuggability.
00193 //
00194 #if defined _DEBUG
00195     #define DEBUG_ASSERTIONS    // enables assertions
00196 #endif
00197 
00198 extern WHIPTK_API  void WHIPTOOL_CALL WD_Fail_Assertion (char const *assertion, char const * file, int line);
00199 #if defined DEBUG_ASSERTIONS
00200     #define WD_Complain(reason) WD_Fail_Assertion (reason, __FILE__, __LINE__)
00201     #define WD_Assert(condition) \
00202        for(;;) {if (!(condition)) WD_Complain (#condition); break; }
00203 #else
00204     #define WD_Complain(reason)
00205     #define WD_Assert(condition)
00206 #endif
00207 
00208 #if defined (_DEBUG) && defined (_MSC_VER)
00209     #define CRTDBG_MAP_ALLOC
00210     #include <crtdbg.h>
00211 #endif
00212 
00213 #include "whiptk/typedefs_defines.h"
00214 #include "whiptk/whiperrs.h"
00215 #include "whiptk/rgb.h"
00216 #include "whiptk/logical_point.h"
00217 #include "whiptk/point.h"
00218 #include "whiptk/logical_box.h"
00219 #include "whiptk/transform.h"
00220 #include "whiptk/wtstring.h"
00221 #include "whiptk/opcode_defs.h"
00222 
00223 #endif // WHIPCORE_HEADER
00224 

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