home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / YellowBox / Kits / MiscTableScroll-138.1 / Palettes / MiscTableScroll / Framework / MiscTableUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-31  |  2.5 KB  |  66 lines

  1. #ifndef __MiscTableUtil_h
  2. #define __MiscTableUtil_h
  3. //=============================================================================
  4. //
  5. //    Copyright (C) 1995-1998 by Paul S. McCarthy and Eric Sunshine.
  6. //        Written by Paul S. McCarthy and Eric Sunshine.
  7. //                All Rights Reserved.
  8. //
  9. //    This notice may not be removed from this source code.
  10. //
  11. //    This object is included in the MiscKit by permission from the authors
  12. //    and its use is governed by the MiscKit license, found in the file
  13. //    "License.rtf" in the MiscKit distribution.  Please refer to that file
  14. //    for a list of all applicable permissions and restrictions.
  15. //    
  16. //=============================================================================
  17. //-----------------------------------------------------------------------------
  18. // MiscTableUtil.h
  19. //
  20. //    Common inline functions used by the MiscTableScroll object.
  21. //
  22. //-----------------------------------------------------------------------------
  23. //-----------------------------------------------------------------------------
  24. // $Id: MiscTableUtil.h,v 1.4 98/03/29 23:57:54 sunshine Exp $
  25. // $Log:    MiscTableUtil.h,v $
  26. //  Revision 1.4  98/03/29  23:57:54  sunshine
  27. //  v138.1: #import was missing "MiscTableScroll/" for public header.
  28. //  
  29. //  Revision 1.3  98/03/22  13:13:55  sunshine
  30. //  v133.1: Eliminated data-sizing.
  31. //  
  32. //  Revision 1.2  97/11/23  07:39:45  sunshine
  33. //  v130.1: Added MISC_ENUM_CHECK.
  34. //-----------------------------------------------------------------------------
  35. #include <MiscTableScroll/MiscTableTypes.h>
  36. #include "bool.h"
  37. extern "Objective-C" {
  38. #import <Foundation/NSException.h>
  39. }
  40.  
  41. inline MiscBorderType otherBorder( MiscBorderType t )
  42.     { return (t == MISC_COL_BORDER) ? MISC_ROW_BORDER : MISC_COL_BORDER; }
  43.  
  44. inline bool isFixed( MiscTableSizing x )
  45.     { return x == MISC_NUSER_NSPRINGY_SIZING; }
  46.  
  47. inline bool isSpringy( MiscTableSizing x )
  48.     { return (((int)x) & MISC_SIZING_SPRINGY_BIT) != 0; }
  49.  
  50. inline bool isSizeable( MiscTableSizing x )
  51.     { return (((int)x) & MISC_SIZING_USER_BIT) != 0; }
  52.  
  53. inline MiscTableSizing setAttribute( MiscTableSizing x, int bit, bool b )
  54.     { return (MiscTableSizing) (b ? ((int)x | bit) : ((int)x & ~bit)); }
  55.  
  56. inline MiscTableSizing setSpringy( MiscTableSizing x, bool b )
  57.     { return setAttribute( x, MISC_SIZING_SPRINGY_BIT, b ); }
  58.  
  59. inline MiscTableSizing setSizeable( MiscTableSizing x, bool b )
  60.     { return setAttribute( x, MISC_SIZING_USER_BIT, b ); }
  61.  
  62. #define    MISC_ENUM_CHECK(E,N)\
  63.     NSCParameterAssert((unsigned int)(E) <= (unsigned int)(N))
  64.  
  65. #endif    // __MiscTableUtil_h
  66.