raSystem  1.0 bata
raRECT.h
Go to the documentation of this file.
1 #pragma once
2 
3  class RAPI raRECT
4  {
5  public:
6  union
7  {
8  struct
9  {
10  long left;
11  long top;
12  long right;
13  long bottom;
14  };
15  struct
16  {
17  long x1, x2;
18  long y1, y2;
19  };
20  long r[4];
21  };
22  raRECT(void) {}
23  raRECT(const raRECT& _r) : left(_r.left), top(_r.top), right(_r.right), bottom(_r.bottom) {}
24  raRECT(const long& _r) : left(_r), top(_r), right(_r), bottom(_r) {}
25  raRECT(const long& _l, const long& _t, const long& _r, const long& _b) : left(_l), top(_t), right(_r), bottom(_b) {}
26  raRECT(const long* _lpl) : left(_lpl[0]), top(_lpl[1]), right(_lpl[2]), bottom(_lpl[3]) {}
27  raRECT(const RECT rec) : left(rec.left), right(rec.right), top(rec.top), bottom(rec.bottom) {}
28 
29  operator long* () { return (long*)(r); }
30  operator void* () { return (void*)(r); }
31  operator RECT () { RECT rec = {left, top, right, bottom}; return rec; }
32 
33  raRECT operator = (const raRECT& r) { left = r.left; top = r.top; right = r.right; bottom = r.bottom; return *this; }
34  raRECT operator += (const raRECT& r) { left += r.left; top += r.top; right += r.right; bottom += r.bottom; return *this; }
35  raRECT operator -= (const raRECT& r) { left -= r.left; top -= r.top; right -= r.right; bottom -= r.bottom; return *this; }
36  raRECT operator *= (const raRECT& r) { left *= r.left; top *= r.top; right *= r.right; bottom *= r.bottom; return *this; }
37  raRECT operator /= (const raRECT& r) { left /= r.left; top /= r.top; right /= r.right; bottom /= r.bottom; return *this; }
38 
39  raRECT operator = (const long l) { left = l; top = l; right = l; bottom = l; return *this; }
40  raRECT operator += (const long l) { left += l; top += l; right += l; bottom += l; return *this; }
41  raRECT operator -= (const long l) { left -= l; top -= l; right -= l; bottom -= l; return *this; }
42  raRECT operator *= (const long l) { left *= l; top *= l; right *= l; bottom *= l; return *this; }
43  raRECT operator /= (const long l) { left /= l; top /= l; right /= l; bottom /= l; return *this; }
44  };
long top
Definition: raRECT.h:11
long x2
Definition: raRECT.h:17
#define RAPI
Definition: raMain.h:11
long bottom
Definition: raRECT.h:13
raRECT(const long &_r)
Definition: raRECT.h:24
long y2
Definition: raRECT.h:18
raRECT(void)
Definition: raRECT.h:22
raRECT(const long &_l, const long &_t, const long &_r, const long &_b)
Definition: raRECT.h:25
raRECT(const raRECT &_r)
Definition: raRECT.h:23
Definition: raRECT.h:3
raRECT(const long *_lpl)
Definition: raRECT.h:26
raRECT(const RECT rec)
Definition: raRECT.h:27
long left
Definition: raRECT.h:10
long right
Definition: raRECT.h:12