home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.7 KB | 135 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWGrUtil.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWGRUTIL_H
- #define FWGRUTIL_H
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWCOMMON_H
- #include "FWCommon.h"
- #endif
-
- #ifdef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- // ----- OS layer ----
-
- #ifndef SLGRUTIL_H
- #include "SLGrUtil.h"
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
- #include <Quickdraw.h>
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__WINDOWS__)
- #include <Windows.h>
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__TEXTEDIT__)
- #include <TextEdit.h>
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODShape;
- class ODTransform;
- class FW_CPoint;
- class FW_CRect;
-
- //========================================================================================
- // Global Utilities
- //========================================================================================
-
- // ----- ODShape utilities -----
- //########################################################################################
- // SCpp Hack
- // Work around SCpp 8.0.3 bug - importing overloaded functions doesn't work.
- // Replace overloaded functions with normal functions with different names.
- // Use inline overloaded functions which turn around and call the renamed
- // functions so client code isn't affected.
- //########################################################################################
-
- void FW_OutlineODShape(Environment *ev, ODShape* odShapeToOutline, FW_Fixed outlineSize);
-
- ODShape* FW_CreateLineODShape(Environment *ev,
- const FW_CPoint& firstPoint,
- const FW_CPoint& lastPoint,
- FW_Fixed penSize);
- ODShape* FW_CreateOvalODShape(Environment *ev, const FW_CRect& rect);
- ODShape* FW_CreateRoundRectODShape(Environment *ev, const FW_CRect& rect, const FW_CPoint& ovalSize);
- ODShape* FW_CreateArcODShape(Environment *ev, const FW_CRect& rect, short startAngle, short arcAngle);
- ODShape* FW_CreatePolygonODShape(Environment *ev, long inPointCount, const FW_SPoint* inPoints);
- ODPolygon* FW_CreateODPolygon(Environment *ev, long inPointCount, const FW_SPoint* inPoints);
-
- //========================================================================================
- // Macintosh Utilities
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
-
- inline FW_Boolean FW_MacIsColorPort(GrafPtr grafPort)
- {
- return ((CGrafPtr)grafPort)->portVersion < 0;
- }
-
- inline FW_Boolean FW_MacIsColorPort(CGrafPtr grafPort)
- {
- return (grafPort)->portVersion < 0;
- }
-
- #endif
-
- //========================================================================================
- // class FW_CMacTempPort
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- class FW_CMacTempPort
- {
- public:
- FW_DECLARE_AUTO(FW_CMacTempPort)
-
- FW_CMacTempPort(CGrafPtr tempPort = NULL, GDHandle tempDevice = NULL);
- FW_CMacTempPort(GrafPtr tempPort, GDHandle tempDevice = NULL);
-
- ~FW_CMacTempPort();
-
- private:
-
- void PrivSaveAndSet(CGrafPtr tempPort, GDHandle tempDevice);
-
- CGrafPtr fMacPort;
- GDHandle fGDevice;
- };
- #endif
-
- #endif
-
-