home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / SLGrUtil.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.2 KB  |  75 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLGrUtil.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef SLGRUTIL_H
  11. #define SLGRUTIL_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef SLPTRECT_H
  18. #include "SLPtRect.h"
  19. #endif
  20.  
  21. #ifndef FWFXMATH_H
  22. #include "FWFxMath.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. // Forward Declarations
  27. //========================================================================================
  28.  
  29. struct FW_SPoint;
  30. struct FW_SRect;
  31. class ODShape;
  32.  
  33. //========================================================================================
  34. // Extern C Methods
  35. //========================================================================================
  36.  
  37. // Export or Import functions for CFM-68K [sfu]
  38.  
  39. #if defined(FW_ODFLIB_IMPORT)
  40. #pragma import on
  41. #elif defined(FW_ODFLIB)
  42. #pragma export on
  43. #endif
  44.  
  45. FW_EXTERN_C_BEGIN
  46.  
  47. // ----- Region Code -----
  48. short SL_API         FW_RegionCode(const FW_SPoint& line, const FW_SRect& rect);
  49.  
  50. // ----- Hit testing utilities -----
  51.  
  52. FW_Boolean SL_API     FW_PtInOval(const FW_SRect& ovalRect, const FW_SPoint& test);
  53. FW_Boolean SL_API     FW_PtInRoundRect(const FW_SRect& rect, const FW_SPoint& ovalSize, const FW_SPoint& test);
  54. FW_Boolean SL_API     FW_HitTestLine(const FW_SPoint& pt1, const FW_SPoint& pt2, const FW_SPoint& test, FW_Fixed tolerance);
  55. FW_Boolean SL_API     FW_HitTestPolygon(long pointCount, const FW_SPoint* points, const FW_SPoint& point);
  56.  
  57. // ----- Debugging -----
  58.  
  59. FW_EXPORT void     SL_API    FW_LogPoint(Environment* ev, const char* prompt, const FW_SPoint& point);
  60. FW_EXPORT void     SL_API    FW_LogRect(Environment* ev, const char* prompt, const FW_SRect& rect);
  61. FW_EXPORT void     SL_API    FW_LogShape(Environment* ev, const char* prompt, ODShape* shape);
  62. FW_EXPORT void     SL_API    FW_LogTransform(Environment* ev, const char* prompt, ODTransform* transform);
  63.  
  64. FW_EXTERN_C_END
  65.  
  66. // For CFM-68K [sfu]
  67.  
  68. #if defined(FW_ODFLIB_IMPORT)
  69. #pragma import off
  70. #elif defined(FW_ODFLIB)
  71. #pragma export off
  72. #endif
  73.  
  74. #endif
  75.