home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WMETAFIL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
5KB
|
139 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WMetafile
*
*************************************************************************/
#ifndef _WMETAFIL_HPP_INCLUDED
#define _WMETAFIL_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCANVAS_HPP_INCLUDED
# include "wcanvas.hpp"
#endif
enum WMetafileHandle { NULLHMF = 0, LASTHMF = LAST_16TO32BIT };
class WMetafileReference;
class WCMCLASS WMetafile : public WObject {
WDeclareSubclass( WMetafile, WObject );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WMetafile();
WMetafile( const WChar *fileName,
const WChar *pictureTitle=NULL,
const WChar *applicationName=NULL,
const WInfoCanvas *referenceCanvas=NULL,
const WRect *dimensions=NULL );
WMetafile( WMetafileHandle handle, WBool deleteHandle=FALSE );
WMetafile( const WMetafile & metafile );
~WMetafile();
/**********************************************************
* Properties
*********************************************************/
// Handle
WMetafileHandle GetHandle() const;
// Valid
WBool GetValid() const;
/**********************************************************
* Methods
*********************************************************/
// Clear
//
// Calls Close, then deletes the metafile from memory.
void Clear();
// Close
//
// Closes a metafile opened with Create so that no
// further drawing is possible.
WBool Close();
// Copy
//
// Copies a metafile and returns a new WMetafile that
// represents the copy. If no filename is given, an
// in-memory copy is made. Free the returned metafile
// using delete.
WMetafile * Copy( const WChar * fileName=NULL );
// Create
//
// Create a new metafile. If no filename is given,
// the metafile is in-memory. Returns a canvas which
// is used to draw on the metafile. Do not delete the
// canvas. NULL is returned if an error occurred.
WCanvas *Create( const WMetafile & metafile );
WCanvas *Create( WMetafileHandle handle, WBool deleteHandle=FALSE );
WCanvas *Create( const WChar * fileName=NULL,
const WChar * pictureTitle=NULL,
const WChar * applicationName=NULL,
const WInfoCanvas * referenceCanvas=NULL,
const WRect * dimensions=NULL );
// Load
//
// Load an already-existing metafile.
WBool Load( const WChar * fileName );
// Play
//
// Plays a metafile into the given canvas, within the
// bounding rectangle.
WBool Play( const WCanvas & canvas, const WRect & bounds );
/**********************************************************
* Operators
*********************************************************/
WMetafile & operator=( const WMetafile & metafile );
/**********************************************************
* Data members
*********************************************************/
private:
WMetafileReference * _ref;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WMETAFIL_HPP_INCLUDED