diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-15 17:13:17 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-15 17:13:17 (GMT) |
| commit | 136675b56a8a1862afb41ccee5c14e93e483b964 (patch) | |
| tree | 8f679477c5e1c0984a5cb9c169e339c1ca0d6e0c /src/interface/Border.h | |
| parent | 45563e97e813cfd21724ad1111e5de3e04679e1a (diff) | |
| download | powder-136675b56a8a1862afb41ccee5c14e93e483b964.zip powder-136675b56a8a1862afb41ccee5c14e93e483b964.tar.gz | |
Move style into Component
Diffstat (limited to 'src/interface/Border.h')
| -rw-r--r-- | src/interface/Border.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/interface/Border.h b/src/interface/Border.h new file mode 100644 index 0000000..b5ae505 --- /dev/null +++ b/src/interface/Border.h @@ -0,0 +1,64 @@ +#pragma once +#include "Platform.h" + +namespace ui +{ + + struct Border + { +#if ENABLE_FLOAT_UI +# define BORDER_T float +#else +# define BORDER_T int +#endif + + BORDER_T Top; + BORDER_T Right; + BORDER_T Bottom; + BORDER_T Left; + + Border(BORDER_T all): + Top(all), + Right(all), + Bottom(all), + Left(all) + { + } + + Border(BORDER_T v, BORDER_T h): + Top(v), + Right(h), + Bottom(v), + Left(h) + { + } + + Border(BORDER_T top, BORDER_T right, BORDER_T bottom, BORDER_T left): + Top(top), + Right(right), + Bottom(bottom), + Left(left) + { + } + + inline bool operator == (const Border& v) const + { + return (Top == v.Top || Right == v.Right || Bottom == v.Bottom || Left == v.Left); + } + + inline bool operator != (const Border& v) const + { + return (Top != v.Top || Right != v.Right || Bottom != v.Bottom || Left != v.Left); + } + + inline void operator = (const Border& v) + { + Top = v.Top; + Right = v.Right; + Bottom = v.Bottom; + Left = v.Left; + } + + }; + +} |
