ASPiK SDK
cdrawdefs.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __cdrawdefs__
6 #define __cdrawdefs__
7 
8 #include "vstguifwd.h"
9 
10 namespace VSTGUI {
11 
12 //-----------
13 // @brief Draw Mode Flags
14 //-----------
15 enum CDrawModeFlags : uint32_t
16 {
17  kAliasing = 0,
18  kAntiAliasing = 1,
19  kNonIntegralMode = 0xF0000000
20 };
21 
22 //-----------
23 // @brief Draw Mode
24 //-----------
25 struct CDrawMode
26 {
27 public:
28  constexpr CDrawMode (uint32_t mode = kAliasing) : mode (mode) {}
29  constexpr CDrawMode (const CDrawMode& m) : mode (m.mode) {}
30 
31  constexpr uint32_t modeIgnoringIntegralMode () const { return (mode & ~kNonIntegralMode); }
32 
33  constexpr bool integralMode () const { return !hasBit (mode, kNonIntegralMode); }
34  constexpr bool aliasing () const { return modeIgnoringIntegralMode () == kAliasing; }
35  constexpr bool antiAliasing () const { return modeIgnoringIntegralMode () == kAntiAliasing; }
36 
37  CDrawMode& operator= (uint32_t m) { mode = m; return *this; }
38 
39  constexpr uint32_t operator() () const { return mode; }
40  constexpr bool operator== (const CDrawMode& m) const { return modeIgnoringIntegralMode () == m.modeIgnoringIntegralMode (); }
41  constexpr bool operator!= (const CDrawMode& m) const { return modeIgnoringIntegralMode () != m.modeIgnoringIntegralMode (); }
42 private:
43  uint32_t mode;
44 };
45 
46 //----------------------------
47 // @brief Text Alignment (Horizontal)
48 //----------------------------
49 enum CHoriTxtAlign
50 {
51  kLeftText = 0,
52  kCenterText,
53  kRightText
54 };
55 
56 //----------------------------
57 // @brief Draw Style
58 //----------------------------
59 enum CDrawStyle
60 {
61  kDrawStroked = 0,
62  kDrawFilled,
63  kDrawFilledAndStroked
64 };
65 
66 }
67 
68 #endif // __cdrawdefs__
Definition: customcontrols.cpp:8
Definition: cdrawdefs.h:25