iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IGraphicsConstants.h
1/*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#pragma once
12
13#include "IPlugPlatform.h"
14
15BEGIN_IPLUG_NAMESPACE
16BEGIN_IGRAPHICS_NAMESPACE
17
18static constexpr int DEFAULT_FPS = 60;
19
20// If not dirty for this many timer ticks, we call OnGUIIDle.
21// Only looked at if USE_IDLE_CALLS is defined.
22static constexpr int IDLE_TICKS = 20;
23
24static constexpr int DEFAULT_ANIMATION_DURATION = 100;
25
26#ifndef CONTROL_BOUNDS_COLOR
27#define CONTROL_BOUNDS_COLOR COLOR_GREEN
28#endif
29
30static constexpr float PARAM_EDIT_W = 40.f; // TODO: remove?
31static constexpr float PARAM_EDIT_H = 16.f; // TODO: remove?
32
33#define MAX_URL_LEN 256
34#define MAX_NET_ERR_MSG_LEN 1024
35
36static constexpr int MAX_IMG_SCALE = 3;
37static constexpr int DEFAULT_TEXT_ENTRY_LEN = 7;
38static constexpr double DEFAULT_GEARING = 4.0;
39
40static constexpr double DEFAULT_MIN_DRAW_SCALE = 0.5;
41static constexpr double DEFAULT_MAX_DRAW_SCALE = 4.0;
42
43//what is this stuff
44#define TOOLWIN_BORDER_W 6
45#define TOOLWIN_BORDER_H 23
46#define MAX_CLASSNAME_LEN 128
47//
48
49#ifndef GRAYED_ALPHA
50static constexpr float GRAYED_ALPHA = 0.25f;
51#endif
52
53#ifndef DEFAULT_PATH
54static const char* DEFAULT_PATH = "~/Desktop";
55#endif
56
57#ifndef DEFAULT_FONT
58const char* const DEFAULT_FONT = "Roboto-Regular";
59#endif
60
61static constexpr float DEFAULT_TEXT_SIZE = 14.f;
62static constexpr int FONT_LEN = 64;
63
65enum class EBlend
66{
67 SrcOver,
68 SrcIn,
69 SrcOut,
70 SrcAtop,
71 DstOver,
72 DstIn,
73 DstOut,
74 DstAtop,
75 Add,
76 XOR,
77 Default = SrcOver
78};
79
81enum class EFileAction { Open, Save };
82
84enum class EDirection { Vertical, Horizontal };
85
87enum class ETextStyle { Normal, Bold, Italic };
88
90enum class EAlign { Near, Center, Far };
91
93enum class EVAlign { Top, Middle, Bottom };
94
96enum class EOrientation { North, East, South, West };
97
99static const char* kEAlignStrs[3] = { "Near", "Center", "Far" };
100
102static const char* kEVAlignStrs[3] = { "Top", "Middle", "Bottom" };
103
105enum class EGestureType { Unknown, DoubleTap, TripleTap, LongPress1, LongPress2, SwipeLeft, SwipeRight, SwipeUp, SwipeDown, Pinch, Rotate, Pan};
106
108static const char* kGestureTypeStrs[12] = { "Unknown", "DoubleTap", "TripleTap", "LongPress1", "LongPress2", "SwipeLeft", "SwipeRight", "SwipeUp", "SwipeDown", "Pinch", "Rotate", "Pan"};
109
111enum class EGestureState { Unknown, Began, InProcess, Ended };
112
114enum class EUIAppearance { Light, Dark };
115
117enum EVColor
118{
119 kBG = 0, // background: transparent by default
120 kFG, kOFF = kFG, // foreground/OFF states
121 kPR, kON = kPR, // pressed/ON states
122 kFR, // frame: the stroke around a button or knob handle, or border around the outside of the control
123 kHL, // highlight: mouse over and splash click animation
124 kSH, // shadow
125 kX1, // extra1: typically used for indicator tracks on knobs and sliders
126 kX2, // extra2
127 kX3, // extra3
128 kNumVColors
129};
130
132static const char* kVColorStrs[kNumVColors] =
133{
134 "bg",
135 "fg/off ",
136 "pressed/on",
137 "frame",
138 "highlight",
139 "shadow",
140 "extra1",
141 "extra2",
142 "extra3"
143};
144
146enum class EVShape { Rectangle, Ellipse, Triangle, EndsRounded, AllRounded };
147
149enum class EWinding { CW, CCW };
150
152enum class EFillRule { Winding, EvenOdd, Preserve };
153
155enum class ELineCap { Butt, Round, Square };
156
158enum class ELineJoin { Miter, Round, Bevel };
159
161enum class EPatternType { Solid, Linear, Radial, Sweep };
162
164enum class EPatternExtend { None, Pad, Reflect, Repeat };
165
167enum class EColorReplacement { None, Fill, Stroke };
168
170enum class EUIResizerMode { Scale, Size };
171
173enum class ECursor
174{
175 ARROW,
176 IBEAM,
177 WAIT,
178 CROSS,
179 UPARROW,
180 SIZENWSE,
181 SIZENESW,
182 SIZEWE,
183 SIZENS,
184 SIZEALL,
185 INO,
186 HAND,
187 APPSTARTING,
188 HELP
189};
190
192enum class ETouchEvent { Began, Moved, Ended, Cancelled, Invalid };
193
194// This enumeration must match win32 message box options
195enum EMsgBoxType
196{
197 kMB_OK = 0,
198 kMB_OKCANCEL = 1,
199 kMB_YESNOCANCEL = 3,
200 kMB_YESNO = 4,
201 kMB_RETRYCANCEL = 5
202};
203
204// This enumeration must match win32 message box results
205 //If IGraphics::ShowMessageBox can't return inline, it returns kNoResult (e.g. because it requires an asynchronous call)
206enum EMsgBoxResult
207{
208 kNoResult,
209 kOK = 1,
210 kCANCEL = 2,
211 kABORT = 3,
212 kRETRY = 4,
213 kIGNORE = 5,
214 kYES = 6,
215 kNO = 7
216};
217
218static const char* kMessageResultStrs[8] = {"", "OK", "CANCEL", "ABORT", "RETRY", "IGNORE", "YES", "NO"};
219
220END_IGRAPHICS_NAMESPACE
221END_IPLUG_NAMESPACE
Include to get consistently named preprocessor macros for different platforms and logging functionali...