]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/HelpGen/src/wxstlac.h
don't blit too much when copying static box border in OnPaint()
[wxWidgets.git] / utils / HelpGen / src / wxstlac.h
index 9f69f1f26d5b8168181046aa1fcb3a09d2253355..86fa8d0e6c20d6e6157cd79c003864ecf869fea4 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     27/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Aleskandars Gluchovas
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef __WXSTLAC_G__
 #endif
 
 #include <stddef.h>
-#include <sys/types.h>
+#if !defined(__WXMAC__) || defined(__DARWIN__)
+#  include <sys/types.h>
+#endif
 #include <memory.h>
 #include <limits.h>
-#include <new.h>
+/* #include <new.h> */
 
 // the below macro used internally (see actual interface after this macro)
 
 // arguments:
 //
-//         ARG_IS_UNIQUE
-//             ASSOC_CONT_CLASS_NAME
+//      ARG_IS_UNIQUE
+//      ASSOC_CONT_CLASS_NAME
 //
-//         ARG_VALUE_TYPE
+//      ARG_VALUE_TYPE
 //      ARG_KEY_TYPE
 //      ARG_ACTUAL_VALUE_TYPE
-//      
+//
 //      _KEY_NAME
 //      _VALUE_NAME
 //
-//             _X_KEY_NAME
-//             _X_VALUE_NAME
+//      _X_KEY_NAME
+//      _X_VALUE_NAME
 //
 //      _INSERT_METHOD_DEFINITION
 
@@ -58,9 +60,9 @@ ASSOC_CONT_CLASS_NAME\
 protected:\
 \
 public:\
-       typedef ARG_VALUE_TYPE        value_type;\
-       typedef ARG_KEY_TYPE          key_type;\
-       typedef ARG_ACTUAL_VALUE_TYPE actual_value_type;\
+    typedef ARG_VALUE_TYPE        value_type;\
+    typedef ARG_KEY_TYPE          key_type;\
+    typedef ARG_ACTUAL_VALUE_TYPE actual_value_type;\
 \
        typedef value_type*                       pointer;\
        typedef value_type&                       reference;\
@@ -74,14 +76,16 @@ protected:\
 \
        struct tree_node \
        {\
-               tree_node*  mpParent;\
+               tree_node*  m_pParent;\
                tree_node*  mpLeft;\
                tree_node*  mpRight;\
 \
                value_type  mData;\
        };\
 \
+public:\
        typedef tree_node* node_ref_type;\
+protected:\
 \
        node_ref_type   mpRoot;\
        node_ref_type   mpLeftMost;\
@@ -105,16 +109,16 @@ public:\
                        return pNode;\
                }\
                else\
-               if ( pNode->mpParent )\
+               if ( pNode->m_pParent )\
                {\
-                       if ( pNode == pNode->mpParent->mpLeft )\
+                       if ( pNode == pNode->m_pParent->mpLeft )\
 \
-                               return pNode->mpParent;\
+                               return pNode->m_pParent;\
 \
-                       pNode = pNode->mpParent;\
+                       pNode = pNode->m_pParent;\
 \
                        node_ref_type prevNode = pNode;\
-                       pNode = pNode->mpParent;\
+                       pNode = pNode->m_pParent;\
 \
                        while(pNode)\
                        {\
@@ -123,7 +127,7 @@ public:\
                                   ) return pNode;\
 \
                                prevNode = pNode;\
-                               pNode= pNode->mpParent;\
+                               pNode= pNode->m_pParent;\
                        }\
 \
                        return 0;\
@@ -143,15 +147,15 @@ public:\
                        return pNode;\
                }\
                else\
-               if ( pNode->mpParent )\
+               if ( pNode->m_pParent )\
                {\
-                       if ( pNode == pNode->mpParent->mpRight )\
-                               return pNode->mpParent;\
+                       if ( pNode == pNode->m_pParent->mpRight )\
+                               return pNode->m_pParent;\
 \
-                       pNode = pNode->mpParent;\
+                       pNode = pNode->m_pParent;\
 \
                        node_ref_type prevNode = pNode;\
-                       pNode = pNode->mpParent;\
+                       pNode = pNode->m_pParent;\
 \
                        while(pNode)\
                        {\
@@ -160,7 +164,7 @@ public:\
                                   ) return pNode;\
 \
                                prevNode = pNode;\
-                               pNode= pNode->mpParent;\
+                               pNode= pNode->m_pParent;\
                        }\
 \
                        return 0;\
@@ -229,7 +233,7 @@ protected:\
        {\
                node_ref_type pNewNode = AllocNode();\
 \
-               pNewNode->mpParent = \
+               pNewNode->m_pParent = \
                        pNewNode->mpLeft =\
                                pNewNode->mpRight = 0;\
 \
@@ -251,7 +255,7 @@ protected:\
                                : pCurrent->mpRight;\
                }\
     \
-               pNewNode->mpParent = pParent;\
+               pNewNode->m_pParent = pParent;\
 \
            if(pParent)\
 \
@@ -542,15 +546,15 @@ public:\
         else\
             pX = pY->mpRight;\
            \
-        if ( pX ) pX->mpParent = pY->mpParent;\
+        if ( pX ) pX->m_pParent = pY->m_pParent;\
            \
-        if (pY->mpParent)\
+        if (pY->m_pParent)\
            \
-            if (pY == pY->mpParent->mpLeft )\
+            if (pY == pY->m_pParent->mpLeft )\
            \
-                pY->mpParent->mpLeft = pX;\
+                pY->m_pParent->mpLeft = pX;\
                    else\
-                pY->mpParent->mpRight = pX;\
+                pY->m_pParent->mpRight = pX;\
         else\
             mpRoot = pX;\
            \
@@ -560,23 +564,23 @@ public:\
            \
             pY->mpLeft = pZ->mpLeft;\
            \
-            if (pY->mpLeft) pY->mpLeft->mpParent = pY;\
+            if (pY->mpLeft) pY->mpLeft->m_pParent = pY;\
            \
             pY->mpRight = pZ->mpRight;\
            \
             if ( pY->mpRight ) \
                                \
-                               pY->mpRight->mpParent = pY;\
+                               pY->mpRight->m_pParent = pY;\
            \
-            pY->mpParent = pZ->mpParent;\
+            pY->m_pParent = pZ->m_pParent;\
            \
-            if (pZ->mpParent)\
+            if (pZ->m_pParent)\
            \
-                if (pZ == pZ->mpParent->mpLeft)\
+                if (pZ == pZ->m_pParent->mpLeft)\
            \
-                    pZ->mpParent->mpLeft = pY;\
+                    pZ->m_pParent->mpLeft = pY;\
                 else\
-                    pZ->mpParent->mpRight = pY;\
+                    pZ->m_pParent->mpRight = pY;\
             else\
                 mpRoot = pY;\
            \
@@ -599,15 +603,16 @@ public:\
 
 #define ___WXSTL_COMMA ,
 
-#define __DEFINE_MAP(ARG_IS_UNIQUE, KEY_TYPE, VAL_TYPE, FUNCTOR ) __DEFINE_ASOC_CLASS( ARG_IS_UNIQUE,\
+#define __DEFINE_MAP(ARG_IS_UNIQUE, KEY_TYPE, VAL_TYPE, FUNCTOR ) \
+__DEFINE_ASOC_CLASS( ARG_IS_UNIQUE,\
 FUNCTOR,\
 __WXSTLMAP_##KEY_TYPE##VAL_TYPE##ARG_IS_UNIQUE, \
 struct key_value_pair   { KEY_TYPE first ; \
-                                                 VAL_TYPE second;\
-                                                 key_value_pair() {}\
-                                                 key_value_pair( const KEY_TYPE& key ___WXSTL_COMMA const VAL_TYPE& value ) \
-                                                       : first(key) ___WXSTL_COMMA second( value ) {} \
-                                               } , \
+                          VAL_TYPE second;\
+                          key_value_pair() {}\
+                          key_value_pair( const KEY_TYPE& key ___WXSTL_COMMA const VAL_TYPE& value ) \
+                            : first(key) ___WXSTL_COMMA second( value ) {} \
+                         } , \
 KEY_TYPE,\
 VAL_TYPE,\
 mData.first, mData.second, x.first, x.second, \
@@ -626,7 +631,8 @@ inline insert_result_iterator insert( const value_type& x )\
        return result;\
 } )
 
-#define __DEFINE_SET(ARG_IS_UNIQUE, KEY_TYPE, FUNCTOR ) __DEFINE_ASOC_CLASS( ARG_IS_UNIQUE,\
+#define __DEFINE_SET(ARG_IS_UNIQUE, KEY_TYPE, FUNCTOR ) \
+__DEFINE_ASOC_CLASS( ARG_IS_UNIQUE,\
 FUNCTOR,\
 __WXSTLSET_##TYPE##ARG_IS_UNIQUE, \
 KEY_TYPE,\
@@ -656,7 +662,7 @@ inline insert_result_iterator insert( const value_type& x )\
 #define GREATER_THEN_FUNCTOR(TYPE) struct \
 { inline int operator()(const TYPE& x, const TYPE& y ) const { return x > y; } }
 
-// functor argument should be created using the two above macros 
+// functor argument should be created using the two above macros
 // or passing own class with method "operator()(const TYPE&,cosnt TYPE&)" defined in it
 
 #define WXSTL_MAP( KEY_TYPE, VALUE_TYPE, FUNCTOR )      __DEFINE_MAP( 1 ,KEY_TYPE, VALUE_TYPE, FUNCTOR)