home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWGrUtil.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.2 KB  |  120 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWGrUtil.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWGRUTIL_H
  11. #define FWGRUTIL_H
  12.  
  13. #ifndef FWRECT_H
  14. #include "FWRect.h"
  15. #endif
  16.  
  17. // ----- Foundation Layer -----
  18.  
  19. #ifndef FWCOMMON_H
  20. #include "FWCommon.h"
  21. #endif
  22.  
  23. #ifdef FWEXCLIB_H
  24. #include "FWExcLib.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. #ifndef SOM_ODShape_xh
  34. #include <Shape.xh>
  35. #endif
  36.  
  37. // ----- OS layer ----
  38.  
  39. #ifndef SLGRUTIL_H
  40. #include "SLGrUtil.h"
  41. #endif
  42.  
  43. // ----- Macintosh Includes -----
  44.  
  45. #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
  46. #include <Quickdraw.h>
  47. #endif
  48.  
  49. #if defined(FW_BUILD_MAC) && !defined(__WINDOWS__)
  50. #include <Windows.h>
  51. #endif
  52.  
  53. #if defined(FW_BUILD_MAC) && !defined(__TEXTEDIT__)
  54. #include <TextEdit.h>
  55. #endif
  56.  
  57. //========================================================================================
  58. //    Forward Declarations
  59. //========================================================================================
  60.  
  61. class ODShape;
  62. class ODTransform;
  63. class FW_CPoint;
  64. class FW_CRect;
  65.  
  66. //========================================================================================
  67. //    Global Utilities
  68. //========================================================================================
  69.  
  70. // ----- ODShape utilities -----
  71. //########################################################################################
  72. // SCpp Hack
  73. // Work around SCpp 8.0.3 bug - importing overloaded functions doesn't work.
  74. // Replace overloaded functions with normal functions with different names.
  75. // Use inline overloaded functions which turn around and call the renamed
  76. // functions so client code isn't affected.
  77. //########################################################################################
  78.  
  79. void            FW_OutlineODShape(Environment *ev, ODShape* odShapeToOutline, FW_Fixed outlineSize);
  80.  
  81. ODShape*        FW_CreateLineODShape(Environment *ev, 
  82.                                         const FW_CPoint& firstPoint, 
  83.                                         const FW_CPoint& lastPoint,
  84.                                         FW_Fixed penSize);
  85. ODShape*         FW_CreateOvalODShape(Environment *ev, const FW_CRect& rect);
  86. ODShape*         FW_CreateRoundRectODShape(Environment *ev, const FW_CRect& rect, const FW_CPoint& ovalSize);
  87. ODShape*         FW_CreateArcODShape(Environment *ev, const FW_CRect& rect, short startAngle, short arcAngle);
  88.  
  89. //========================================================================================
  90. //    Macintosh Utilities
  91. //========================================================================================
  92.  
  93. #ifdef FW_BUILD_MAC
  94. inline FW_Boolean        FW_MacIsColorPort(GrafPtr grafPort)
  95. {
  96.     return ((CGrafPtr)grafPort)->portVersion < 0;
  97. }
  98. #endif
  99.  
  100. //========================================================================================
  101. //    class FW_CMacTempPort
  102. //========================================================================================
  103.  
  104. #ifdef FW_BUILD_MAC
  105. class FW_CMacTempPort
  106. {
  107. public:
  108.     FW_DECLARE_AUTO(FW_CMacTempPort)
  109.  
  110.     FW_CMacTempPort(GrafPtr tempPort = NULL);
  111.     ~FW_CMacTempPort();
  112.  
  113. private:
  114.     GrafPtr        fMacPort;
  115. };
  116. #endif
  117.  
  118. #endif
  119.  
  120.