home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WSIZE.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
4KB
|
142 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WSize --
*
*************************************************************************/
#ifndef _WSIZE_HPP_INCLUDED
#define _WSIZE_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WDEF_HPP_INCLUDED
# include "wdef.hpp"
#endif
#ifndef _WINDEF_
#ifndef _WIN16
typedef struct tagSIZE {
WInt cx;
WInt cy;
} SIZE, *PSIZE, *LPSIZE;
typedef SIZE SIZEL;
typedef SIZE *PSIZEL, *LPSIZEL;
#else
typedef struct tagSIZE {
WLong cx;
WLong cy;
} SIZE, *PSIZE, *LPSIZE;
typedef SIZE SIZEL;
typedef SIZE *PSIZEL, *LPSIZEL;
#endif
#endif
class WCMCLASS WSize {
/**********************************************************
* Data members
*********************************************************/
public:
WInt w;
WInt h;
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WSize() { w = h = 0; }
WSize( WInt nw, WInt nh ) { w = nw; h = nh; }
WSize( const WSize & o ) { w = o.w; h = o.h; }
WSize( const SIZE & o ); // WCMINLINE
// Note: no destructor is defined and none will be generated
// because the class has simple types as data and no virtual
// functions and does not inherit from anyone.
/**********************************************************
* Properties
*********************************************************/
// SIZE
SIZE GetSIZE() const; // WCMINLINE
void SetSIZE( const SIZE & s ); // WCMINLINE
/**********************************************************
* Methods
*********************************************************/
// Create
void Create() { w = h = 0; }
void Create( WInt nw, WInt nh ) { w = nw; h = nh; }
void Create( const WSize & o ) { w = o.w; h = o.h; }
void Create( const SIZE & o ); // WCMINLINE
// Offset
void Offset( WInt nw, WInt nh ); // WCMINLINE
void Offset( const WSize & sz ); // WCMINLINE
/**********************************************************
* Operators
*********************************************************/
// == operator
int operator==( const WSize & o ) const; // WCMINLINE
// != operator
int operator!=( const WSize & o ) const; // WCMINLINE
// = operator
WSize & operator=( const WSize & o )
{ w = o.w; h = o.h; return *this; }
WSize & operator=( const SIZE & o ); // WCMINLINE
// +, - operator
WSize operator+( const WSize & o ); // WCMINLINE
WSize operator-( const WSize & o ); // WCMINLINE
// +=, -= operator
WSize & operator+=( const WSize & o ); // WCMINLINE
WSize & operator-=( const WSize & o ); // WCMINLINE
};
#ifdef WCM_ENABLE_INLINES
#ifndef WCM_NO_WSIZE_INLINES
#define WCMINLINE inline
#include "wsize.inl"
#endif
#endif
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WSIZE_HPP_INCLUDED