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

  1. //=============================================================================
  2. //
  3. //    Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine.
  4. //        Written by Paul S. McCarthy and Eric Sunshine.
  5. //                All Rights Reserved.
  6. //
  7. //    This notice may not be removed from this source code.
  8. //
  9. //    This object is included in the MiscKit by permission from the authors
  10. //    and its use is governed by the MiscKit license, found in the file
  11. //    "License.rtf" in the MiscKit distribution.  Please refer to that file
  12. //    for a list of all applicable permissions and restrictions.
  13. //    
  14. //=============================================================================
  15. //-----------------------------------------------------------------------------
  16. // MiscGeometry.cc
  17. //
  18. //    *NOTE* The methods in this file were moved here from the interface
  19. //    file in order to work around a bug in the PPC compiler for Rhapsody
  20. //    DR1.  The compiler would crash with an "internal compiler error" each
  21. //    time it got to the code where these methods convert a float to an int.
  22. //    Moving the methods to the implementation file (so that they are no
  23. //    longer inline) keeps the compiler from crashing.
  24. //
  25. //-----------------------------------------------------------------------------
  26. //-----------------------------------------------------------------------------
  27. // $Id: MiscGeometry.cc,v 1.2 98/03/30 09:44:03 sunshine Exp $
  28. // $Log:    MiscGeometry.cc,v $
  29. // Revision 1.2  98/03/30  09:44:03  sunshine
  30. // v138.1: Worked around Rhapsody DR1, PPC "internal compiler error" bug.
  31. // 
  32. // Revision 1.1  96/05/05  10:53:55  sunshine
  33. // Geometric type structures which know their border orientation.
  34. //-----------------------------------------------------------------------------
  35. #ifdef __GNUC__
  36. # pragma implementation
  37. #endif
  38. #import "MiscGeometry.h"
  39.  
  40.  
  41. //-----------------------------------------------------------------------------
  42. // MiscPoint_O
  43. //-----------------------------------------------------------------------------
  44. MiscPoint_O::MiscPoint_O( bool is_horz, NSPoint p ) :
  45.     MiscOrientation(is_horz),x(MiscPixels(p.x)),y(MiscPixels(p.y)) {}
  46. MiscPoint_O::MiscPoint_O( MiscBorderType b, NSPoint p ) :
  47.     MiscOrientation(b),x(MiscPixels(p.x)),y(MiscPixels(p.y)) {}
  48. MiscPoint_O& MiscPoint_O::operator=( NSPoint p )
  49.     { x = MiscPixels( p.x ); y = MiscPixels( p.y ); return *this; }
  50.  
  51.  
  52. //-----------------------------------------------------------------------------
  53. // MiscSize_O
  54. //-----------------------------------------------------------------------------
  55. MiscSize_O::MiscSize_O( bool is_horz, NSSize p ) : MiscOrientation(is_horz),
  56.     width(MiscPixels(p.width)),height(MiscPixels(p.height)) {}
  57. MiscSize_O::MiscSize_O( MiscBorderType b, NSSize p ) : MiscOrientation(b),
  58.     width(MiscPixels(p.width)),height(MiscPixels(p.height)) {}
  59. MiscSize_O& MiscSize_O::operator=( NSSize s )
  60.     { width = MiscPixels( s.width ); height = MiscPixels( s.height );
  61.         return *this; }
  62.