### IStatefulGrafPort

  IStatefulGrafPort provides the ability to set the value of the substates individually. The IStatefulGrafPort class provides the ability to set the value of the substates individually. You cannot copy or copy construct objects of this class.

### IStatefulGrafPort - Member Functions and Data by Group

### Constructors & Destructor

Use the functions in this group to construct and destroy objects of class IStatefulGrafPort.

~IStatefulGrafPort

      public:
      virtual ~IStatefulGrafPort()

  Destroys the IStatefulGrafPort object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

IStatefulGrafPort

      public:
      IStatefulGrafPort(IBaseRootGrafPort* root)

  This constructor creates a stateful grafport.
  Use this constructor to create a stateful grafport from a root grafport.

  root
    A pointer to the root grafport.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Accessing the Port

Use the function in this group to access the stateful graphics port.

portForStateUsage

      public:
      virtual const IGrafPort* portForStateUsage() const

  Provides a more efficient way to get access to the port.

Return
  A constant pointer to the grafPort.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Adopting and Releasing a Device Context

Use the functions in this group to assume and release ownership of a device context.

adoptDeviceContext
  Takes over the ownership of a device context without deleting any existing device context.

      public:
      void adoptDeviceContext(IPresSpaceHandle)

  This function adopts ownership of a device context without deleting any existing device context. The device context is orphaned when this IStatefulGrafPort is destroyed.

  hps
    The device context to be adopted.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

orphanDeviceContext

      public:
      IPresSpaceHandle orphanDeviceContext()

  Relinquishes knowledge of, and responsibility for, the device context, returning it to the caller.

Return
  The orphaned device context.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Converting from Pixel to Pointsize

Use the functions in this group to convert coordinates from pixels to points.

pixelToPointSize

      public:
      virtual const IGrafMatrix& pixelToPointSize() const

  Converts from device coordinate which is in pixel to "ideal" coordinate which is in point size (1/72 inch).

Return
  Returns a constant reference to the conversion matrix from pixel size to point size.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Inverting the Device Transformation

Use the function in this group to invert the device transform to the logical coordinate system.

invertedDeviceTransform

      public:
      virtual const IGrafMatrix& invertedDeviceTransform() const

  Device tranformation matrix for inverting coordinates back to logical coordinate system.

Return
  A constant reference to the inverted transformation matrix.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Marking the Graphics State

Use the functions in this group to mark the graphics state as in use or not.

doneWithState

      public:
      virtual void doneWithState() const

  Marks the graphic state as being no longer in use so that changes to the state can be made.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

useState

      public:
      virtual void useState() const

  Marks the graphic state as being in use so that no changes to the state are made until doneWithState is called.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Setting Graphics Port Substate Values

Use the functions in this group to set the graphics port substate bundle, clipping area, and matrix.

setBundle

      public:
      void setBundle(const IGrafBundle& bundle)

  Sets the attribute bundle for this grafPort.

  bundle
    A constant reference to the new attribute bundle.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

setClipArea

      public:
      void setClipArea(const IGArea& clipArea)

  Sets the clipping area for this stateful grafPort.

  clipArea
    A constant reference to the new clipping area

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

setMatrix

      public:
      void
        setMatrix( EMatrixKind matrixKind,
                   const IGrafMatrix& matrix )

  Sets the transformation matrix for this graf port.

  matrixKind
    The matrix type.
  matrix
    A constant reference to the new matrix.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### IStatefulGrafPort - Inherited Member Functions and Data

#### Inherited Public Functions

  IGrafPort

  -     virtual ~IGrafPort()

  -     const IAttributeState* attributes() const

  -     const IGArea* clipArea() const

  -     virtual IGRect2D convertRect(const IRectangle) const

  -     virtual const IPresSpaceHandle& deviceContext()

  -     virtual _XDisplay* display() const

  -     virtual void doneWithState() const = 0

  -     void
          draw( const IGEllipse2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGImage& theImage,
                const IGImage& theMask,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGImage& theImage,
                const IGImage& theMask,
                const IGRect2D& srcBounds )

  -     void
          draw( const IGImage& theImage,
                const IGRect2D& srcBounds,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGPolygon2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGRect2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void draw(const IGPolygon2D& geometry)

  -     void
          draw( const IGLoop2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void draw(const IGEllipse2D& geometry)

  -     void draw(const IGRect2D& geometry)

  -     void draw(const IGCurve2D& geometry)

  -     void draw(const IGLoop2D& geometry)

  -     void draw(const IGImage& geometry)

  -     void draw(const IGArea& geometry)

  -     void
          draw( const IGImage& theImage,
                const IGImage& theMask,
                const IGRect2D& srcBounds,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGImage& theImage,
                const IGRect2D& srcBounds )

  -     void
          draw( const IGArea& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGImage& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void draw(const IGLine2D& geometry)

  -     void draw(const IGImage& geometry, const IGImage& theMask)

  -     IGPoint2D draw(const IGTextRun& geometry)

  -     void
          draw( const IGCurve2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     IGPoint2D
          draw( const IGTextRun& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void draw(const IGPolyline2D& geometry)

  -     void
          draw( const IGLine2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     void
          draw( const IGPolyline2D& geometry,
                const IAttributeState& attributeState,
                const IGrafMatrix& modelMatrix = IGrafMatrix::identity ( ) )

  -     virtual unsigned long drawable() const

  -     virtual void flush()

  -     virtual _XGC* gc() const

  -     const IGrafMatrix* matrix(EMatrixKind) const

  -     const IString* portType() const

  -     virtual void useState() const = 0

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IGrafPort

  -     void adoptOrphanedGrafState(IGrafState* orphan)

  -     IGrafDevice* device()

  -     IGrafPort( IGrafDevice* referencedDevice,
                   IColorMap* colormap = & ( IColorMap::defaultColorMap ( ) ) )

  -     IGrafPort()

  -     void setDevice(IGrafDevice* device)

  -     void setState(IGrafState* state)

  -     const IGrafState* state() const

#### Inherited Protected Data

  - None