00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXSIZE_H
00025 #define FXSIZE_H
00026
00027
00028 namespace FX {
00029
00030
00031 class FXAPI FXSize {
00032 public:
00033 FXshort w;
00034 FXshort h;
00035 public:
00036
00037
00038 FXSize(){ }
00039 FXSize(const FXSize& s):w(s.w),h(s.h){ }
00040 FXSize(FXshort ww,FXshort hh):w(ww),h(hh){ }
00041
00042
00043 friend FXAPI FXbool operator==(const FXSize& s,const FXSize& t){ return s.w==t.w && s.h==t.h; }
00044 friend FXAPI FXbool operator!=(const FXSize& s,const FXSize& t){ return s.w!=t.w || s.h!=t.h; }
00045
00046
00047 FXSize& operator=(const FXSize& s){ w=s.w; h=s.h; return *this; }
00048
00049
00050 FXSize& operator+=(const FXSize& s){ w+=s.w; h+=s.h; return *this; }
00051 FXSize& operator-=(const FXSize& s){ w-=s.w; h-=s.h; return *this; }
00052 FXSize& operator*=(FXshort c){ w*=c; h*=c; return *this; }
00053 FXSize& operator/=(FXshort c){ w/=c; h/=c; return *this; }
00054
00055
00056 FXSize operator-(){ return FXSize(-w,-h); }
00057
00058
00059 friend FXAPI FXSize operator+(const FXSize& s,const FXSize& t){ return FXSize(s.w+t.w,s.h+t.h); }
00060 friend FXAPI FXSize operator-(const FXSize& s,const FXSize& t){ return FXSize(s.w-t.w,s.h-t.h); }
00061 friend FXAPI FXSize operator*(const FXSize& s,FXshort c){ return FXSize(s.w*c,s.h*c); }
00062 friend FXAPI FXSize operator*(FXshort c,const FXSize& s){ return FXSize(c*s.w,c*s.h); }
00063 friend FXAPI FXSize operator/(const FXSize& s,FXshort c){ return FXSize(s.w/c,s.h/c); }
00064 friend FXAPI FXSize operator/(FXshort c,const FXSize& s){ return FXSize(c/s.w,c/s.h); }
00065
00066
00067 friend FXAPI FXStream& operator<<(FXStream& store,const FXSize& s);
00068
00069
00070 friend FXAPI FXStream& operator>>(FXStream& store,FXSize& s);
00071 };
00072
00073 }
00074
00075 #endif