home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 22.7 KB | 810 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWMaping.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #if defined(FW_PROFILER_CALLS) && defined(__MWERKS__)
- #pragma profile on
- #endif
-
- #ifndef FWMAPING_H
- #include "FWMaping.h"
- #endif
-
- #ifndef FWGDEV_H
- #include "FWGDev.h"
- #endif
-
- #ifndef FWGRUTIL_H
- #include "FWGrUtil.h"
- #endif
-
- #ifndef FWGRGLOB_H
- #include "FWGrGlob.h"
- #endif
-
- #ifndef FWODUTIL_H
- #include "FWODUtil.h"
- #endif
-
- #ifndef FWGRUTIL_H
- #include "FWGrUtil.h"
- #endif
-
- #ifndef FWREGION_H
- #include "FWRegion.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODTransform_xh
- #include <Trnsform.xh>
- #endif
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWGraphics_Mapping
- #endif
-
- //========================================================================================
- // class FW_CMapping
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::FW_CMapping() :
- fMappingMode(FW_kPoint),
- fRecentDevice(NULL),
- fRecentODTransform(NULL),
- fLogicalToContentTransform(NULL),
- fContentToDeviceTransform(NULL),
- fLogicalToDeviceTransform(NULL),
- fHaveTransforms(FALSE)
- // fDeviceOrg and fLogicalOrg are set to 0's by default constructor
- {
- fLogicalExtent.x =
- fLogicalExtent.y =
- fDeviceExtent.x =
- fDeviceExtent.y = FW_kFixedPos1;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::FW_CMapping(FW_EMappingModes mappingMode) :
- fMappingMode(mappingMode),
- fRecentDevice(NULL),
- fRecentODTransform(NULL),
- fLogicalToContentTransform(NULL),
- fContentToDeviceTransform(NULL),
- fLogicalToDeviceTransform(NULL),
- fHaveTransforms(FALSE)
- // fDeviceOrg and fLogicalOrg are set to 0's by default constructor
- {
- fLogicalExtent.x =
- fLogicalExtent.y =
- fDeviceExtent.x =
- fDeviceExtent.y = FW_kFixedPos1;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::FW_CMapping(const FW_CMapping& mapping) :
- fMappingMode(mapping.fMappingMode),
- fRecentDevice(NULL),
- fRecentODTransform(NULL),
- fLogicalToContentTransform(NULL),
- fContentToDeviceTransform(NULL),
- fLogicalToDeviceTransform(NULL),
- fHaveTransforms(FALSE),
- fLogicalExtent(mapping.fLogicalExtent),
- fDeviceExtent(mapping.fDeviceExtent),
- fDeviceOrg(mapping.fDeviceOrg),
- fLogicalOrg(mapping.fLogicalOrg)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::~FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::~FW_CMapping()
- {
- ClearCache(somGetGlobalEnvironment());
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CMapping& FW_CMapping::operator=(const FW_CMapping& mapping)
- {
- if (&mapping != this)
- {
- ClearCache(somGetGlobalEnvironment());
-
- fMappingMode = mapping.fMappingMode;
- fLogicalExtent = mapping.fLogicalExtent;
- fDeviceExtent = mapping.fDeviceExtent;
- fDeviceOrg = mapping.fDeviceOrg;
- fLogicalOrg = mapping.fLogicalOrg;
- }
-
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::operator==
- //----------------------------------------------------------------------------------------
-
- FW_Boolean FW_CMapping::operator==(const FW_CMapping& mapping) const
- {
- return (fMappingMode == mapping.fMappingMode &&
- fLogicalExtent == mapping.fLogicalExtent &&
- fDeviceExtent == mapping.fDeviceExtent &&
- fDeviceOrg == mapping.fDeviceOrg &&
- fLogicalOrg == mapping.fLogicalOrg);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::Reset
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::Reset(Environment* ev)
- {
- ClearCache(ev);
-
- fMappingMode = FW_kPoint;
-
- fLogicalExtent.x =
- fLogicalExtent.y =
- fDeviceExtent.x =
- fDeviceExtent.y = FW_kFixedPos1;
-
- fDeviceOrg = FW_kZeroPoint;
- fLogicalOrg = FW_kZeroPoint;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::SetMappingMode
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::SetMappingMode(Environment* ev, FW_EMappingModes newMappingMode)
- {
- fMappingMode = newMappingMode;
-
- if (fMappingMode == FW_kCustomConstrained)
- SetExtents(ev, fLogicalExtent, fDeviceExtent); // already calls ClearCache
- else
- ClearCache(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::SetExtents
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::SetExtents(Environment* ev,
- const FW_CPoint& logicalExtent,
- const FW_CPoint& deviceExtent)
- {
- fLogicalExtent = logicalExtent;
- fDeviceExtent = deviceExtent;
-
- if (fMappingMode == FW_kCustomConstrained)
- {
- if (fDeviceExtent.x < fDeviceExtent.y)
- fDeviceExtent.y = fDeviceExtent.x;
- else
- fDeviceExtent.x = fDeviceExtent.y;
- }
-
- ClearCache(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::SetDeviceOrigin
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::SetDeviceOrigin(Environment* ev, FW_CFixed x, FW_CFixed y)
- {
- fDeviceOrg.Set(x, y);
- ClearCache(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::SetLogicalOrigin
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::SetLogicalOrigin(Environment* ev, FW_CFixed x, FW_CFixed y)
- {
- fLogicalOrg.Set(x, y);
- ClearCache(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ClearCache
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::ClearCache(Environment* ev)
- {
- if (fRecentDevice != NULL)
- {
- fRecentDevice->Release();
- fRecentDevice = NULL;
- }
-
- if (fRecentODTransform != NULL)
- {
- fRecentODTransform->Release(ev);
- fRecentODTransform = NULL;
- }
-
- if (fLogicalToContentTransform != NULL)
- {
- fLogicalToContentTransform->Release(ev);
- fLogicalToContentTransform = NULL;
- }
-
- if (fContentToDeviceTransform != NULL)
- {
- fContentToDeviceTransform->Release(ev);
- fContentToDeviceTransform = NULL;
- }
-
- if (fLogicalToDeviceTransform != NULL)
- {
- fLogicalToDeviceTransform->Release(ev);
- fLogicalToDeviceTransform = NULL;
- }
-
- fHaveTransforms = FALSE;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::CheckCache
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::CheckCache(
- Environment* ev,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- if (!fHaveTransforms || device != fRecentDevice || transform != fRecentODTransform)
- ((FW_CMapping*) this)->CalcCache(ev, device, transform);
-
- FW_ASSERT(fHaveTransforms);
- FW_ASSERT(fLogicalToContentTransform != NULL);
- FW_ASSERT(fContentToDeviceTransform != NULL);
- FW_ASSERT(fLogicalToDeviceTransform != NULL);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::CalcCache
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::CalcCache(
- Environment* ev,
- FW_CGraphicDevice* device,
- ODTransform* transform)
- {
- // #define LOG_TRANSFORMS
-
- ClearCache(ev);
-
- fRecentDevice = device;
- if(fRecentDevice != NULL)
- {
- fRecentDevice->Acquire();
- }
-
- fRecentODTransform = transform;
- if(fRecentODTransform != NULL)
- {
- #ifdef FW_BUILD_WIN
- fRecentODTransform->IncrementRefCount(ev);
- #endif
- #ifdef FW_BUILD_MAC
- fRecentODTransform->Acquire(ev);
- #endif
- }
-
- ODCanvas* canvas = device != NULL ? device->GetODCanvas() : NULL;
-
- FW_CPoint resScreen;
- #ifdef FW_BUILD_WIN
- HDC hDC = ::GetDC(NULL);
-
- resScreen.x.SetInt(::GetDeviceCaps(hDC, LOGPIXELSX));
- resScreen.y.SetInt(::GetDeviceCaps(hDC, LOGPIXELSY));
-
- ::ReleaseDC(NULL, hDC);
-
- BOOL bWinIsPrinting = canvas != NULL ? canvas->HasPlatformPrintJob(ev, kODWindows) : FALSE;
- #endif
- #ifdef FW_BUILD_MAC
- resScreen.Set(FW_kFixed72, FW_kFixed72);
- #endif
-
- FW_CPoint resDevice = device == NULL ? resScreen : device->GetResolution(ev);
-
- FW_CPoint ptLogicalToContentOffset(-fLogicalOrg.x, -fLogicalOrg.y);
- FW_CPoint ptLogicalToContentScaling;
- FW_CPoint resScale;
-
- switch (fMappingMode)
- {
- case FW_kCentimeter:
- ptLogicalToContentScaling.x = FW_DoubleToFixed(28.346456691);
- ptLogicalToContentScaling.y = FW_DoubleToFixed(28.346456691);
- break;
-
- case FW_kInch:
- ptLogicalToContentScaling.x = FW_kFixed72;
- ptLogicalToContentScaling.y = FW_kFixed72;
- break;
-
- case FW_kPoint:
- // On the Mac:
- // The screen is always assumed to be 72dpi, even though actual
- // resolution may vary (this is the tradition!)
- // On Windows:
- // OpenDoc/Win emulates 72dpi
- ptLogicalToContentScaling.x = FW_kFixedPos1;
- ptLogicalToContentScaling.y = FW_kFixedPos1;
- break;
-
- case FW_kDevice:
- #ifdef FW_BUILD_MAC
- ptLogicalToContentScaling.x = FW_kFixedPos1;
- ptLogicalToContentScaling.y = FW_kFixedPos1;
- #endif
- #ifdef FW_BUILD_WIN
- if (bWinIsPrinting)
- {
- // For printing, preserve the visual image size
- ptLogicalToContentScaling.x = FW_kFixed72 / resScreen.x;
- ptLogicalToContentScaling.y = FW_kFixed72 / resScreen.y;
- }
- else
- {
- // Counter-act OpenDoc's 72 dpi emulation
- ptLogicalToContentScaling.x = FW_kFixed72 / resDevice.x;
- ptLogicalToContentScaling.y = FW_kFixed72 / resDevice.y;
- }
- #endif
- break;
-
- case FW_kCustomConstrained:
- case FW_kCustomUnconstrained:
- resScale.x = FW_kFixed72 / resDevice.x;
- resScale.y = FW_kFixed72 / resDevice.y;
-
- ptLogicalToContentScaling.x =
- FW_WideMultiply(resScale.x, fDeviceExtent.x) / fLogicalExtent.x;
-
- ptLogicalToContentScaling.y =
- FW_WideMultiply(resScale.y, fDeviceExtent.y) / fLogicalExtent.y;
-
- ptLogicalToContentOffset.x =
- FW_WideMultiply(fDeviceOrg.x, FW_kFixed72) / resDevice.x - fLogicalOrg.x * ptLogicalToContentScaling.x;
-
- ptLogicalToContentOffset.y =
- FW_WideMultiply(fDeviceOrg.y, FW_kFixed72) / resDevice.y - fLogicalOrg.y * ptLogicalToContentScaling.y;
-
- break;
- }
-
- // ----- Logical to content transform
- fLogicalToContentTransform = ::FW_NewODTransform(ev, ptLogicalToContentOffset, ptLogicalToContentScaling);
-
- // ----- Content to device transform
- if(transform != NULL)
- {
- #ifdef LOG_TRANSFORMS
- FW_LogTransform(ev, "OD Content ", transform);
- #endif
- fContentToDeviceTransform = ::FW_NewODTransform(ev, transform);
- }
- else
- {
- FW_CPoint scaling;
- #ifdef FW_BUILD_WIN
- if (bWinIsPrinting && fMappingMode == FW_kDevice)
- {
- // Preserve visual image size
- scaling.x = resScreen.x / FW_kFixed72;
- scaling.y = resScreen.y / FW_kFixed72;
- }
- else
- #endif
- {
- scaling.x = resDevice.x / FW_kFixed72;
- scaling.y = resDevice.y / FW_kFixed72;
- }
-
- fContentToDeviceTransform = ::FW_NewODTransform(ev);
- fContentToDeviceTransform->ScaleBy(ev, (ODPoint*) &scaling);
- }
-
- // ------ Logical to device transform -----
- fLogicalToDeviceTransform = ::FW_NewODTransform(ev, fLogicalToContentTransform);
- fLogicalToDeviceTransform->PostCompose(ev, fContentToDeviceTransform);
-
- // ----- Adjust the origin
- CalcOriginOffset(ev, device);
-
- #ifdef LOG_TRANSFORMS
- FW_LogTransform(ev, "Logical -> Content", fLogicalToContentTransform);
- FW_LogTransform(ev, "Content -> Device ", fContentToDeviceTransform);
- FW_LogTransform(ev, "Logical -> Device ", fLogicalToDeviceTransform);
- #endif
-
- fHaveTransforms = TRUE;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::CalcOriginOffset
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::CalcOriginOffset(
- Environment* ev,
- FW_CGraphicDevice* device)
- {
- ODCanvas* canvas = device != NULL ? device->GetODCanvas() : NULL;
- FW_Boolean isPrinting = canvas != NULL &&
- #ifdef FW_BUILD_WIN
- canvas->HasPlatformPrintJob(ev, kODWindows);
- #endif
- #ifdef FW_BUILD_MAC
- canvas->HasPlatformPrintJob(ev, kODQuickDraw);
- #endif
-
- FW_CPoint offset;
- fLogicalToDeviceTransform->GetOffset(ev, (ODPoint*) &offset);
- if ((offset.x || offset.y) && !isPrinting)
- {
- fOriginOffset.Set(offset.x.AsInt() % 8, offset.y.AsInt() % 8);
- offset.x.SetInt(-fOriginOffset.X());
- offset.y.SetInt(-fOriginOffset.Y());
- fLogicalToDeviceTransform->MoveBy(ev, (ODPoint*) &offset);
- }
- else
- {
- fOriginOffset.Set(0, 0);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::GetOriginOffset
- //----------------------------------------------------------------------------------------
-
- FW_SPlatformPoint FW_CMapping::GetOriginOffset(
- Environment* ev,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- return fOriginOffset;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::LogicalToContent
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::LogicalToContent(
- Environment* ev,
- const FW_CPoint& ptFrom,
- FW_CPoint& ptTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ptTo = ptFrom.TransformCopy(ev, fLogicalToContentTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::LogicalToContent
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::LogicalToContent(
- Environment* ev,
- const FW_CRect& rectFrom,
- FW_CRect& rectTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- rectTo = rectFrom.TransformCopy(ev, fLogicalToContentTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::LogicalToContent
- //----------------------------------------------------------------------------------------
-
- ODShape* FW_CMapping::LogicalToContent(
- Environment* ev,
- ODShape* shape,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ODShape* newShape = shape->Copy(ev);
- fLogicalToContentTransform->TransformShape(ev, newShape);
- return newShape;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::LogicalToDevice
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::LogicalToDevice(
- Environment* ev,
- const FW_CPoint& ptFrom,
- FW_SPlatformPoint& ptTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ptTo = ptFrom.TransformCopy(ev, fLogicalToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::LogicalToDevice
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::LogicalToDevice(
- Environment* ev,
- const FW_CRect& rectFrom,
- FW_SPlatformRect& rectTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- rectTo = rectFrom.TransformCopy(ev, fLogicalToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::LogicalToDevice
- //----------------------------------------------------------------------------------------
-
- ODShape* FW_CMapping::LogicalToDevice(
- Environment* ev,
- ODShape* shape,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ODShape* newShape = shape->Copy(ev);
- fLogicalToDeviceTransform->TransformShape(ev, newShape);
- return newShape;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::DeviceToLogical
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::DeviceToLogical(
- Environment* ev,
- const FW_SPlatformPoint& ptFrom,
- FW_CPoint& ptTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- FW_CPoint pt = ptFrom;
- ptTo = pt.InverseTransformCopy(ev, fLogicalToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::DeviceToLogical
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::DeviceToLogical(
- Environment* ev,
- const FW_SPlatformRect& rectFrom,
- FW_CRect& rectTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- FW_CRect rect = rectFrom;
- rectTo = rect.InverseTransformCopy(ev, fLogicalToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::DeviceToLogical
- //----------------------------------------------------------------------------------------
-
- ODShape* FW_CMapping::DeviceToLogical(
- Environment* ev,
- ODShape* shape,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ODShape* newShape = shape->Copy(ev);
- fLogicalToDeviceTransform->InvertShape(ev, newShape);
- return newShape;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::DeviceToContent
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::DeviceToContent(
- Environment* ev,
- const FW_SPlatformPoint& ptFrom,
- FW_CPoint& ptTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- FW_CPoint pt = ptFrom;
- ptTo = pt.InverseTransformCopy(ev, fContentToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::DeviceToContent
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::DeviceToContent(
- Environment* ev,
- const FW_SPlatformRect& rectFrom,
- FW_CRect& rectTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- FW_CRect rect = rectFrom;
- rectTo = rect.InverseTransformCopy(ev, fContentToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::DeviceToContent
- //----------------------------------------------------------------------------------------
-
- ODShape* FW_CMapping::DeviceToContent(
- Environment* ev,
- ODShape* shape,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ODShape* newShape = shape->Copy(ev);
- fContentToDeviceTransform->InvertShape(ev, newShape);
- return newShape;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ContentToLogical
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::ContentToLogical(
- Environment* ev,
- const FW_CPoint& ptFrom,
- FW_CPoint& ptTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ptTo = ptFrom.InverseTransformCopy(ev, fLogicalToContentTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ContentToLogical
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::ContentToLogical(
- Environment* ev,
- const FW_CRect& rectFrom,
- FW_CRect& rectTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- rectTo = rectFrom.InverseTransformCopy(ev, fLogicalToContentTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ContentToLogical
- //----------------------------------------------------------------------------------------
-
- ODShape* FW_CMapping::ContentToLogical(
- Environment* ev,
- ODShape* shape,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ODShape* newShape = shape->Copy(ev);
- fLogicalToContentTransform->InvertShape(ev, newShape);
- return newShape;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ContentToDevice
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::ContentToDevice(
- Environment* ev,
- const FW_CPoint& ptFrom,
- FW_SPlatformPoint& ptTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ptTo = ptFrom.TransformCopy(ev, fContentToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ContentToDevice
- //----------------------------------------------------------------------------------------
-
- void FW_CMapping::ContentToDevice(
- Environment* ev,
- const FW_CRect& rectFrom,
- FW_SPlatformRect& rectTo,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- rectTo = rectFrom.TransformCopy(ev, fContentToDeviceTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::ContentToDevice
- //----------------------------------------------------------------------------------------
-
- ODShape* FW_CMapping::ContentToDevice(
- Environment* ev,
- ODShape* shape,
- FW_CGraphicDevice* device,
- ODTransform* transform) const
- {
- CheckCache(ev, device, transform);
-
- ODShape* newShape = shape->Copy(ev);
- fContentToDeviceTransform->TransformShape(ev, newShape);
- return newShape;
- }
-