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 #pragma once
6 
7 #include "vstguifwd.h"
8 
9 namespace VSTGUI {
10 
11 //-----------
12 // @brief Draw Mode Flags
13 //-----------
14 enum CDrawModeFlags : uint32_t
15 {
16 	/** aliased drawing */
17 	kAliasing = 0,
18 	/** antialised drawing */
19 	kAntiAliasing = 1,
20 	/** do not round coordinates to pixel aligned values */
21 	kNonIntegralMode = 0xF0000000
22 };
23 
24 //-----------
25 // @brief Draw Mode
26 //-----------
27 struct CDrawMode
28 {
29 public:
modeCDrawMode30 	constexpr CDrawMode (uint32_t mode = kAliasing) : mode (mode) {}
CDrawModeCDrawMode31 	constexpr CDrawMode (const CDrawMode& m) : mode (m.mode) {}
32 
modeIgnoringIntegralModeCDrawMode33 	constexpr uint32_t modeIgnoringIntegralMode () const { return (mode & ~kNonIntegralMode); }
34 
integralModeCDrawMode35 	constexpr bool integralMode () const { return !hasBit (mode, kNonIntegralMode); }
aliasingCDrawMode36 	constexpr bool aliasing () const { return modeIgnoringIntegralMode () == kAliasing; }
antiAliasingCDrawMode37 	constexpr bool antiAliasing () const { return modeIgnoringIntegralMode () == kAntiAliasing; }
38 
39 	CDrawMode& operator= (uint32_t m) { mode = m; return *this; }
40 
operatorCDrawMode41 	constexpr uint32_t operator() () const { return mode; }
42 	constexpr bool operator== (const CDrawMode& m) const { return modeIgnoringIntegralMode () == m.modeIgnoringIntegralMode (); }
43 	constexpr bool operator!= (const CDrawMode& m) const { return modeIgnoringIntegralMode () != m.modeIgnoringIntegralMode (); }
44 private:
45 	uint32_t mode;
46 };
47 
48 //----------------------------
49 // @brief Text Alignment (Horizontal)
50 //----------------------------
51 enum CHoriTxtAlign
52 {
53 	kLeftText = 0,
54 	kCenterText,
55 	kRightText
56 };
57 
58 //----------------------------
59 // @brief Draw Style
60 //----------------------------
61 enum CDrawStyle
62 {
63 	kDrawStroked = 0,
64 	kDrawFilled,
65 	kDrawFilledAndStroked
66 };
67 
68 } // VSTGUI
69