Files
Work/common/SMRECT.HPP
2024-08-07 09:09:36 -04:00

129 lines
2.1 KiB
C++

#ifndef _COMMON_SMALLRECT_HPP_
#define _COMMON_SMALLRECT_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
class SmallRect : private SMALL_RECT
{
public:
SmallRect(void);
SmallRect(const SmallRect &smallRect);
SmallRect(short left,short top,short right,short bottom);
virtual ~SmallRect();
SmallRect &operator=(const SmallRect &someSmallRect);
WORD operator==(const SmallRect &someSmallRect)const;
operator SMALL_RECT&(void);
short left(void)const;
void left(short left);
short top(void)const;
void top(short top);
short right(void)const;
void right(short right);
short bottom(void)const;
void bottom(short bottom);
private:
};
inline
SmallRect::SmallRect(void)
{
SMALL_RECT::Left=0;
SMALL_RECT::Right=0;
SMALL_RECT::Top=0;
SMALL_RECT::Bottom=0;
}
inline
SmallRect::SmallRect(const SmallRect &smallRect)
{
*this=smallRect;
}
inline
SmallRect::SmallRect(short left,short top,short right,short bottom)
{
SMALL_RECT::Left=left;
SMALL_RECT::Top=top;
SMALL_RECT::Right=right;
SMALL_RECT::Bottom=bottom;
}
inline
SmallRect::~SmallRect()
{
}
inline
SmallRect &SmallRect::operator=(const SmallRect &someSmallRect)
{
left(someSmallRect.left());
top(someSmallRect.top());
right(someSmallRect.right());
bottom(someSmallRect.bottom());
return *this;
}
inline
WORD SmallRect::operator==(const SmallRect &someSmallRect)const
{
return (left()==someSmallRect.left()&&
top()==someSmallRect.top()&&
right()==someSmallRect.right()&&
bottom()==someSmallRect.bottom());
}
inline
SmallRect::operator SMALL_RECT&(void)
{
return *this;
}
inline
short SmallRect::left(void)const
{
return SMALL_RECT::Left;
}
inline
void SmallRect::left(short left)
{
SMALL_RECT::Left=left;
}
inline
short SmallRect::top(void)const
{
return SMALL_RECT::Top;
}
inline
void SmallRect::top(short top)
{
SMALL_RECT::Top=top;
}
inline
short SmallRect::right(void)const
{
return SMALL_RECT::Right;
}
inline
void SmallRect::right(short right)
{
SMALL_RECT::Right=right;
}
inline
short SmallRect::bottom(void)const
{
return SMALL_RECT::Bottom;
}
inline
void SmallRect::bottom(short bottom)
{
SMALL_RECT::Bottom=bottom;
}
#endif