diff --git a/Application_8hpp_source.html b/Application_8hpp_source.html index 50937754..18557a9e 100644 --- a/Application_8hpp_source.html +++ b/Application_8hpp_source.html @@ -101,91 +101,95 @@ $(function() {
30  There's no single/global application instance in DGL, and multiple windows can share the same app instance.
31 
32  In standalone mode an application will automatically quit its event-loop when all its windows are closed.
-
33  */
-
34 class Application
-
35 {
-
36 public:
-
37  /**
-
38  Constructor.
-
39  */
-
40  // NOTE: the default value is not yet passed, so we catch where we use this
-
41  Application(bool isStandalone = true);
-
42 
-
43  /**
-
44  Destructor.
-
45  */
-
46  virtual ~Application();
-
47 
-
48  /**
-
49  Idle function.
-
50  This runs the application event-loop once.
-
51  */
-
52  void idle();
-
53 
-
54  /**
-
55  Run the application event-loop until all Windows are closed.
-
56  idle() is called at regular intervals.
-
57  @note This function is meant for standalones only, *never* call this from plugins.
-
58  */
-
59  void exec(uint idleTimeInMs = 30);
-
60 
-
61  /**
-
62  Quit the application.
-
63  This stops the event-loop and closes all Windows.
-
64  @note This function is meant for standalones only, *never* call this from plugins.
-
65  */
-
66  void quit();
-
67 
-
68  /**
-
69  Check if the application is about to quit.
-
70  Returning true means there's no event-loop running at the moment (or it's just about to stop).
-
71  */
-
72  bool isQuiting() const noexcept;
-
73 
-
74  /**
-
75  Add a callback function to be triggered on every idle cycle.
-
76  You can add more than one, and remove them at anytime with removeIdleCallback().
-
77  Idle callbacks trigger right after OS event handling and Window idle events (within the same cycle).
-
78  There are no guarantees in terms of timing.
-
79  */
-
80  void addIdleCallback(IdleCallback* callback);
-
81 
-
82  /**
-
83  Remove an idle callback previously added via addIdleCallback().
-
84  */
-
85  void removeIdleCallback(IdleCallback* callback);
-
86 
-
87  /**
-
88  Set the class name of the application.
-
89 
-
90  This is a stable identifier for the application, used as the window class/instance name on X11 and Windows.
-
91  It is not displayed to the user, but can be used in scripts and by window managers,
-
92  so it should be the same for every instance of the application, but different from other applications.
+
33 
+
34  Unless stated otherwise, functions within this class are not thread-safe.
+
35  */
+
36 class Application
+
37 {
+
38 public:
+
39  /**
+
40  Constructor.
+
41  */
+
42  // NOTE: the default value is not yet passed, so we catch where we use this
+
43  Application(bool isStandalone = true);
+
44 
+
45  /**
+
46  Destructor.
+
47  */
+
48  virtual ~Application();
+
49 
+
50  /**
+
51  Idle function.
+
52  This runs the application event-loop once.
+
53  */
+
54  void idle();
+
55 
+
56  /**
+
57  Run the application event-loop until all Windows are closed.
+
58  idle() is called at regular intervals.
+
59  @note This function is meant for standalones only, *never* call this from plugins.
+
60  */
+
61  void exec(uint idleTimeInMs = 30);
+
62 
+
63  /**
+
64  Quit the application.
+
65  This stops the event-loop and closes all Windows.
+
66  This function is thread-safe.
+
67  @note This function is meant for standalones only, *never* call this from plugins.
+
68  */
+
69  void quit();
+
70 
+
71  /**
+
72  Check if the application is about to quit.
+
73  Returning true means there's no event-loop running at the moment (or it's just about to stop).
+
74  This function is thread-safe.
+
75  */
+
76  bool isQuiting() const noexcept;
+
77 
+
78  /**
+
79  Add a callback function to be triggered on every idle cycle.
+
80  You can add more than one, and remove them at anytime with removeIdleCallback().
+
81  Idle callbacks trigger right after OS event handling and Window idle events (within the same cycle).
+
82  There are no guarantees in terms of timing, use Window::addIdleCallback for time-relative callbacks.
+
83  */
+
84  void addIdleCallback(IdleCallback* callback);
+
85 
+
86  /**
+
87  Remove an idle callback previously added via addIdleCallback().
+
88  */
+
89  void removeIdleCallback(IdleCallback* callback);
+
90 
+
91  /**
+
92  Set the class name of the application.
93 
-
94  Plugins created with DPF have their class name automatically set based on DGL_NAMESPACE and plugin name.
-
95  */
-
96  void setClassName(const char* name);
-
97 
-
98 private:
-
99  struct PrivateData;
-
100  PrivateData* const pData;
-
101  friend class Window;
-
102 
-
103  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Application)
-
104 };
-
105 
-
106 // --------------------------------------------------------------------------------------------------------------------
-
107 
-
108 END_NAMESPACE_DGL
+
94  This is a stable identifier for the application, used as the window class/instance name on X11 and Windows.
+
95  It is not displayed to the user, but can be used in scripts and by window managers,
+
96  so it should be the same for every instance of the application, but different from other applications.
+
97 
+
98  Plugins created with DPF have their class name automatically set based on DGL_NAMESPACE and plugin name.
+
99  */
+
100  void setClassName(const char* name);
+
101 
+
102 private:
+
103  struct PrivateData;
+
104  PrivateData* const pData;
+
105  friend class Window;
+
106 
+
107  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Application)
+
108 };
109 
-
110 #endif // DGL_APP_HPP_INCLUDED
+
110 // --------------------------------------------------------------------------------------------------------------------
+
111 
+
112 END_NAMESPACE_DGL
+
113 
+
114 #endif // DGL_APP_HPP_INCLUDED
Application::quit
void quit()
Application::removeIdleCallback
void removeIdleCallback(IdleCallback *callback)
Window
Definition: Window.hpp:50
Application::idle
void idle()
Application::isQuiting
bool isQuiting() const noexcept
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
Application::~Application
virtual ~Application()
Application::Application
Application(bool isStandalone=true)
Application::exec
void exec(uint idleTimeInMs=30)
@@ -194,7 +198,7 @@ $(function() {
Application::setClassName
void setClassName(const char *name)
diff --git a/Base64_8hpp_source.html b/Base64_8hpp_source.html index c9f3dee9..5a2d884f 100644 --- a/Base64_8hpp_source.html +++ b/Base64_8hpp_source.html @@ -222,7 +222,7 @@ $(function() { diff --git a/Base_8hpp_source.html b/Base_8hpp_source.html index d61d9a1e..8f5233c9 100644 --- a/Base_8hpp_source.html +++ b/Base_8hpp_source.html @@ -251,7 +251,7 @@ $(function() {
IdleCallback
Definition: Base.hpp:159
diff --git a/Cairo_8hpp_source.html b/Cairo_8hpp_source.html index 6e808728..c8012c13 100644 --- a/Cairo_8hpp_source.html +++ b/Cairo_8hpp_source.html @@ -267,11 +267,11 @@ $(function() {
ImageBaseButton
Definition: ImageBaseWidgets.hpp:51
ImageBaseKnob
Definition: ImageBaseWidgets.hpp:85
GraphicsContext
Definition: Base.hpp:154
-
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:139
+
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:125
CairoImage::loadFromPNG
void loadFromPNG(const char *pngData, uint dataSize) noexcept
Window
Definition: Window.hpp:50
Size< uint >
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
CairoImage::drawAt
void drawAt(const GraphicsContext &context, const Point< int > &pos) override
CairoGraphicsContext
Definition: Cairo.hpp:32
CairoImage::operator=
CairoImage & operator=(const CairoImage &image) noexcept
@@ -286,11 +286,11 @@ $(function() {
CairoBaseWidget::onCairoDisplay
virtual void onCairoDisplay(const CairoGraphicsContext &context)=0
CairoImage::~CairoImage
~CairoImage() override
Point< int >
-
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:190
+
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:176
Widget
Definition: Widget.hpp:53
diff --git a/Color_8hpp_source.html b/Color_8hpp_source.html index 84c7ea5d..65407609 100644 --- a/Color_8hpp_source.html +++ b/Color_8hpp_source.html @@ -137,53 +137,58 @@ $(function() {
66  Color(const Color& color1, const Color& color2, float u) noexcept;
67 
68  /**
-
69  Create a color specified by hue, saturation and lightness.
-
70  Values must in [0..1] range.
-
71  */
-
72  static Color fromHSL(float hue, float saturation, float lightness, float alpha = 1.0f);
-
73 
-
74  /**
-
75  Create a color from a HTML string like "#333" or "#112233".
+
69  Create a new color based on this one but with a different alpha value.
+
70  */
+
71  Color withAlpha(float alpha) noexcept;
+
72 
+
73  /**
+
74  Create a color specified by hue, saturation and lightness.
+
75  Values must in [0..1] range.
76  */
-
77  static Color fromHTML(const char* rgb, float alpha = 1.0f) noexcept;
+
77  static Color fromHSL(float hue, float saturation, float lightness, float alpha = 1.0f);
78 
79  /**
-
80  Linearly interpolate this color against another.
+
80  Create a color from a HTML string like "#333" or "#112233".
81  */
-
82  void interpolate(const Color& other, float u) noexcept;
+
82  static Color fromHTML(const char* rgb, float alpha = 1.0f) noexcept;
83 
84  /**
-
85  Check if this color matches another.
-
86  @note Comparison is done within 8-bit color space.
-
87  */
-
88  bool isEqual(const Color& color, bool withAlpha = true) noexcept;
-
89  bool isNotEqual(const Color& color, bool withAlpha = true) noexcept;
-
90  bool operator==(const Color& color) noexcept;
-
91  bool operator!=(const Color& color) noexcept;
-
92 
-
93  /**
-
94  Fix color bounds if needed.
-
95  */
-
96  void fixBounds() noexcept;
+
85  Linearly interpolate this color against another.
+
86  */
+
87  void interpolate(const Color& other, float u) noexcept;
+
88 
+
89  /**
+
90  Check if this color matches another.
+
91  @note Comparison is done within 8-bit color space.
+
92  */
+
93  bool isEqual(const Color& color, bool withAlpha = true) noexcept;
+
94  bool isNotEqual(const Color& color, bool withAlpha = true) noexcept;
+
95  bool operator==(const Color& color) noexcept;
+
96  bool operator!=(const Color& color) noexcept;
97 
98  /**
-
99  Set this color for use in the next drawing operation for the provided context.
+
99  Fix color bounds if needed.
100  */
-
101  void setFor(const GraphicsContext& context, bool includeAlpha = false);
+
101  void fixBounds() noexcept;
102 
103  /**
-
104  @internal
-
105  Needed for NanoVG compatibility.
-
106  */
-
107  Color(const NVGcolor&) noexcept;
-
108  operator NVGcolor() const noexcept;
-
109 };
-
110 
-
111 // --------------------------------------------------------------------------------------------------------------------
-
112 
-
113 END_NAMESPACE_DGL
-
114 
-
115 #endif // DGL_COLOR_HPP_INCLUDED
+
104  Set this color for use in the next drawing operation for the provided context.
+
105  */
+
106  void setFor(const GraphicsContext& context, bool includeAlpha = false);
+
107 
+
108  /**
+
109  @internal
+
110  Needed for NanoVG compatibility.
+
111  */
+
112  Color(const NVGcolor&) noexcept;
+
113  operator NVGcolor() const noexcept;
+
114 };
+
115 
+
116 // --------------------------------------------------------------------------------------------------------------------
+
117 
+
118 END_NAMESPACE_DGL
+
119 
+
120 #endif // DGL_COLOR_HPP_INCLUDED
Color::fromHSL
static Color fromHSL(float hue, float saturation, float lightness, float alpha=1.0f)
GraphicsContext
Definition: Base.hpp:154
@@ -192,11 +197,12 @@ $(function() {
Color::fromHTML
static Color fromHTML(const char *rgb, float alpha=1.0f) noexcept
Color::Color
Color() noexcept
Color::isEqual
bool isEqual(const Color &color, bool withAlpha=true) noexcept
+
Color::withAlpha
Color withAlpha(float alpha) noexcept
Color::fixBounds
void fixBounds() noexcept
Color
Definition: Color.hpp:31
diff --git a/DistrhoInfo_8hpp_source.html b/DistrhoInfo_8hpp_source.html index b119288c..449c086e 100644 --- a/DistrhoInfo_8hpp_source.html +++ b/DistrhoInfo_8hpp_source.html @@ -695,7 +695,7 @@ $(function() {
String
Definition: String.hpp:30
Parameter::ranges
ParameterRanges ranges
Definition: DistrhoPlugin.hpp:491
Parameter
Definition: DistrhoPlugin.hpp:445
-
UI
Definition: DistrhoUI.hpp:67
+
UI
Definition: DistrhoUI.hpp:71
Plugin::loadProgram
virtual void loadProgram(uint32_t index)=0
ParameterRanges::def
float def
Definition: DistrhoPlugin.hpp:249
Parameter::name
String name
Definition: DistrhoPlugin.hpp:457
@@ -708,7 +708,7 @@ $(function() {
Parameter::hints
uint32_t hints
Definition: DistrhoPlugin.hpp:450
diff --git a/DistrhoPluginLV2_8hpp_source.html b/DistrhoPluginLV2_8hpp_source.html index 83290b3f..3a9e9ee6 100644 --- a/DistrhoPluginLV2_8hpp_source.html +++ b/DistrhoPluginLV2_8hpp_source.html @@ -522,7 +522,7 @@ $(function() {
Plugin::setState
virtual void setState(const char *key, const char *value)=0
diff --git a/DistrhoPluginUtils_8hpp_source.html b/DistrhoPluginUtils_8hpp_source.html index 188c4f7b..ee47186d 100644 --- a/DistrhoPluginUtils_8hpp_source.html +++ b/DistrhoPluginUtils_8hpp_source.html @@ -238,7 +238,7 @@ $(function() {
AudioMidiSyncHelper
Definition: DistrhoPluginUtils.hpp:50
diff --git a/DistrhoPlugin_8hpp_source.html b/DistrhoPlugin_8hpp_source.html index 4156b588..8339cd1f 100644 --- a/DistrhoPlugin_8hpp_source.html +++ b/DistrhoPlugin_8hpp_source.html @@ -1298,7 +1298,7 @@ $(function() {
TimePosition::TimePosition
TimePosition() noexcept
Definition: DistrhoPlugin.hpp:750
diff --git a/DistrhoUI_8hpp_source.html b/DistrhoUI_8hpp_source.html index 8a77b7b2..e497d2f1 100644 --- a/DistrhoUI_8hpp_source.html +++ b/DistrhoUI_8hpp_source.html @@ -119,298 +119,302 @@ $(function() {
48 typedef DGL_NAMESPACE::TopLevelWidget UIWidget;
49 #endif
50 
-
51 START_NAMESPACE_DISTRHO
-
52 
-
53 /* ------------------------------------------------------------------------------------------------------------
-
54  * DPF UI */
-
55 
-
56 /**
-
57  @addtogroup MainClasses
-
58  @{
-
59  */
-
60 
-
61 /**
-
62  DPF UI class from where UI instances are created.
-
63 
-
64  @note You must call setSize during construction,
-
65  @TODO Detailed information about this class.
-
66  */
-
67 class UI : public UIWidget
-
68 {
-
69 public:
-
70  /**
-
71  UI class constructor.
-
72  The UI should be initialized to a default state that matches the plugin side.
-
73  */
-
74  UI(uint width = 0, uint height = 0);
-
75 
-
76  /**
-
77  Destructor.
-
78  */
-
79  virtual ~UI();
-
80 
-
81  /* --------------------------------------------------------------------------------------------------------
-
82  * Host state */
-
83 
-
84  /**
-
85  Check if this UI window is resizable (by the user or window manager).
-
86  There are situations where an UI supports resizing but the plugin host does not, so this could return false.
+
51 START_NAMESPACE_DGL
+
52 class PluginWindow;
+
53 END_NAMESPACE_DGL
+
54 
+
55 START_NAMESPACE_DISTRHO
+
56 
+
57 /* ------------------------------------------------------------------------------------------------------------
+
58  * DPF UI */
+
59 
+
60 /**
+
61  @addtogroup MainClasses
+
62  @{
+
63  */
+
64 
+
65 /**
+
66  DPF UI class from where UI instances are created.
+
67 
+
68  @note You must call setSize during construction,
+
69  @TODO Detailed information about this class.
+
70  */
+
71 class UI : public UIWidget
+
72 {
+
73 public:
+
74  /**
+
75  UI class constructor.
+
76  The UI should be initialized to a default state that matches the plugin side.
+
77  */
+
78  UI(uint width = 0, uint height = 0);
+
79 
+
80  /**
+
81  Destructor.
+
82  */
+
83  virtual ~UI();
+
84 
+
85  /* --------------------------------------------------------------------------------------------------------
+
86  * Host state */
87 
-
88  You might want to add a resize handle for such cases, so the user is still allowed to resize the window.
-
89  (programatically resizing a window is always possible, but the same is not true for the window manager)
-
90  */
-
91  bool isResizable() const noexcept;
-
92 
-
93  /**
-
94  Get the color used for UI background (i.e. window color) in RGBA format.
-
95  Returns 0 by default, in case of error or lack of host support.
+
88  /**
+
89  Check if this UI window is resizable (by the user or window manager).
+
90  There are situations where an UI supports resizing but the plugin host does not, so this could return false.
+
91 
+
92  You might want to add a resize handle for such cases, so the user is still allowed to resize the window.
+
93  (programatically resizing a window is always possible, but the same is not true for the window manager)
+
94  */
+
95  bool isResizable() const noexcept;
96 
-
97  The following example code can be use to extract individual colors:
-
98  ```
-
99  const int red = (bgColor >> 24) & 0xff;
-
100  const int green = (bgColor >> 16) & 0xff;
-
101  const int blue = (bgColor >> 8) & 0xff;
+
97  /**
+
98  Get the color used for UI background (i.e. window color) in RGBA format.
+
99  Returns 0 by default, in case of error or lack of host support.
+
100 
+
101  The following example code can be use to extract individual colors:
102  ```
-
103  */
-
104  uint getBackgroundColor() const noexcept;
-
105 
-
106  /**
-
107  Get the color used for UI foreground (i.e. text color) in RGBA format.
-
108  Returns 0xffffffff by default, in case of error or lack of host support.
+
103  const int red = (bgColor >> 24) & 0xff;
+
104  const int green = (bgColor >> 16) & 0xff;
+
105  const int blue = (bgColor >> 8) & 0xff;
+
106  ```
+
107  */
+
108  uint getBackgroundColor() const noexcept;
109 
-
110  The following example code can be use to extract individual colors:
-
111  ```
-
112  const int red = (fgColor >> 24) & 0xff;
-
113  const int green = (fgColor >> 16) & 0xff;
-
114  const int blue = (fgColor >> 8) & 0xff;
+
110  /**
+
111  Get the color used for UI foreground (i.e. text color) in RGBA format.
+
112  Returns 0xffffffff by default, in case of error or lack of host support.
+
113 
+
114  The following example code can be use to extract individual colors:
115  ```
-
116  */
-
117  uint getForegroundColor() const noexcept;
-
118 
-
119  /**
-
120  Get the current sample rate used in plugin processing.
-
121  @see sampleRateChanged(double)
-
122  */
-
123  double getSampleRate() const noexcept;
-
124 
-
125  /**
-
126  editParameter.
-
127 
-
128  Touch/pressed-down event.
-
129  Lets the host know the user is tweaking a parameter.
-
130  Required in some hosts to record automation.
-
131  */
-
132  void editParameter(uint32_t index, bool started);
-
133 
-
134  /**
-
135  setParameterValue.
-
136 
-
137  Change a parameter value in the Plugin.
-
138  */
-
139  void setParameterValue(uint32_t index, float value);
-
140 
-
141 #if DISTRHO_PLUGIN_WANT_STATE
-
142  /**
-
143  setState.
-
144  @TODO Document this.
-
145  */
-
146  void setState(const char* key, const char* value);
-
147 #endif
-
148 
-
149 #if DISTRHO_PLUGIN_WANT_STATEFILES
-
150  /**
-
151  Request a new file from the host, matching the properties of a state key.@n
-
152  This will use the native host file browser if available, otherwise a DPF built-in file browser is used.@n
-
153  Response will be sent asynchronously to stateChanged, with the matching key and the new file as the value.@n
-
154  It is not possible to know if the action was cancelled by the user.
-
155 
-
156  @return Success if a file-browser was opened, otherwise false.
-
157  @note You cannot request more than one file at a time.
-
158  */
-
159  bool requestStateFile(const char* key);
-
160 #endif
-
161 
-
162 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
-
163  /**
-
164  Send a single MIDI note from the UI to the plugin DSP side.@n
-
165  A note with zero velocity will be sent as note-off (MIDI 0x80), otherwise note-on (MIDI 0x90).
-
166  */
-
167  void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
-
168 #endif
-
169 
-
170 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
-
171  /* --------------------------------------------------------------------------------------------------------
-
172  * Direct DSP access - DO NOT USE THIS UNLESS STRICTLY NECESSARY!! */
-
173 
-
174  /**
-
175  getPluginInstancePointer.
-
176  @TODO Document this.
-
177  */
-
178  void* getPluginInstancePointer() const noexcept;
-
179 #endif
-
180 
-
181 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
-
182  /* --------------------------------------------------------------------------------------------------------
-
183  * External UI helpers */
-
184 
-
185  /**
-
186  Get the bundle path that will be used for the next UI.
-
187  @note: This function is only valid during createUI(),
-
188  it will return null when called from anywhere else.
-
189  */
-
190  static const char* getNextBundlePath() noexcept;
-
191 
-
192  /**
-
193  Get the scale factor that will be used for the next UI.
-
194  @note: This function is only valid during createUI(),
-
195  it will return 1.0 when called from anywhere else.
-
196  */
-
197  static double getNextScaleFactor() noexcept;
-
198 
-
199 # if DISTRHO_PLUGIN_HAS_EMBED_UI
-
200  /**
-
201  Get the Window Id that will be used for the next created window.
-
202  @note: This function is only valid during createUI(),
-
203  it will return 0 when called from anywhere else.
-
204  */
-
205  static uintptr_t getNextWindowId() noexcept;
-
206 # endif
-
207 #endif
-
208 
-
209 protected:
-
210  /* --------------------------------------------------------------------------------------------------------
-
211  * DSP/Plugin Callbacks */
-
212 
-
213  /**
-
214  A parameter has changed on the plugin side.@n
-
215  This is called by the host to inform the UI about parameter changes.
-
216  */
-
217  virtual void parameterChanged(uint32_t index, float value) = 0;
-
218 
-
219 #if DISTRHO_PLUGIN_WANT_PROGRAMS
-
220  /**
-
221  A program has been loaded on the plugin side.@n
-
222  This is called by the host to inform the UI about program changes.
-
223  */
-
224  virtual void programLoaded(uint32_t index) = 0;
-
225 #endif
-
226 
-
227 #if DISTRHO_PLUGIN_WANT_STATE
-
228  /**
-
229  A state has changed on the plugin side.@n
-
230  This is called by the host to inform the UI about state changes.
-
231  */
-
232  virtual void stateChanged(const char* key, const char* value) = 0;
-
233 #endif
-
234 
-
235  /* --------------------------------------------------------------------------------------------------------
-
236  * DSP/Plugin Callbacks (optional) */
-
237 
-
238  /**
-
239  Optional callback to inform the UI about a sample rate change on the plugin side.
-
240  @see getSampleRate()
-
241  */
-
242  virtual void sampleRateChanged(double newSampleRate);
-
243 
-
244 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
-
245  /* --------------------------------------------------------------------------------------------------------
-
246  * UI Callbacks (optional) */
-
247 
-
248  /**
-
249  UI idle function, called to give idle time to the plugin UI directly from the host.
-
250  This is called right after OS event handling and Window idle events (within the same cycle).
-
251  There are no guarantees in terms of timing.
-
252  @see addIdleCallback(IdleCallback*, uint).
-
253  */
-
254  virtual void uiIdle() {}
-
255 
-
256  /**
-
257  Windows focus function, called when the window gains or loses the keyboard focus.
-
258  This function is for plugin UIs to be able to override Window::onFocus(bool, CrossingMode).
+
116  const int red = (fgColor >> 24) & 0xff;
+
117  const int green = (fgColor >> 16) & 0xff;
+
118  const int blue = (fgColor >> 8) & 0xff;
+
119  ```
+
120  */
+
121  uint getForegroundColor() const noexcept;
+
122 
+
123  /**
+
124  Get the current sample rate used in plugin processing.
+
125  @see sampleRateChanged(double)
+
126  */
+
127  double getSampleRate() const noexcept;
+
128 
+
129  /**
+
130  editParameter.
+
131 
+
132  Touch/pressed-down event.
+
133  Lets the host know the user is tweaking a parameter.
+
134  Required in some hosts to record automation.
+
135  */
+
136  void editParameter(uint32_t index, bool started);
+
137 
+
138  /**
+
139  setParameterValue.
+
140 
+
141  Change a parameter value in the Plugin.
+
142  */
+
143  void setParameterValue(uint32_t index, float value);
+
144 
+
145 #if DISTRHO_PLUGIN_WANT_STATE
+
146  /**
+
147  setState.
+
148  @TODO Document this.
+
149  */
+
150  void setState(const char* key, const char* value);
+
151 #endif
+
152 
+
153 #if DISTRHO_PLUGIN_WANT_STATEFILES
+
154  /**
+
155  Request a new file from the host, matching the properties of a state key.@n
+
156  This will use the native host file browser if available, otherwise a DPF built-in file browser is used.@n
+
157  Response will be sent asynchronously to stateChanged, with the matching key and the new file as the value.@n
+
158  It is not possible to know if the action was cancelled by the user.
+
159 
+
160  @return Success if a file-browser was opened, otherwise false.
+
161  @note You cannot request more than one file at a time.
+
162  */
+
163  bool requestStateFile(const char* key);
+
164 #endif
+
165 
+
166 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
+
167  /**
+
168  Send a single MIDI note from the UI to the plugin DSP side.@n
+
169  A note with zero velocity will be sent as note-off (MIDI 0x80), otherwise note-on (MIDI 0x90).
+
170  */
+
171  void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
+
172 #endif
+
173 
+
174 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
+
175  /* --------------------------------------------------------------------------------------------------------
+
176  * Direct DSP access - DO NOT USE THIS UNLESS STRICTLY NECESSARY!! */
+
177 
+
178  /**
+
179  getPluginInstancePointer.
+
180  @TODO Document this.
+
181  */
+
182  void* getPluginInstancePointer() const noexcept;
+
183 #endif
+
184 
+
185 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
+
186  /* --------------------------------------------------------------------------------------------------------
+
187  * External UI helpers */
+
188 
+
189  /**
+
190  Get the bundle path that will be used for the next UI.
+
191  @note: This function is only valid during createUI(),
+
192  it will return null when called from anywhere else.
+
193  */
+
194  static const char* getNextBundlePath() noexcept;
+
195 
+
196  /**
+
197  Get the scale factor that will be used for the next UI.
+
198  @note: This function is only valid during createUI(),
+
199  it will return 1.0 when called from anywhere else.
+
200  */
+
201  static double getNextScaleFactor() noexcept;
+
202 
+
203 # if DISTRHO_PLUGIN_HAS_EMBED_UI
+
204  /**
+
205  Get the Window Id that will be used for the next created window.
+
206  @note: This function is only valid during createUI(),
+
207  it will return 0 when called from anywhere else.
+
208  */
+
209  static uintptr_t getNextWindowId() noexcept;
+
210 # endif
+
211 #endif
+
212 
+
213 protected:
+
214  /* --------------------------------------------------------------------------------------------------------
+
215  * DSP/Plugin Callbacks */
+
216 
+
217  /**
+
218  A parameter has changed on the plugin side.@n
+
219  This is called by the host to inform the UI about parameter changes.
+
220  */
+
221  virtual void parameterChanged(uint32_t index, float value) = 0;
+
222 
+
223 #if DISTRHO_PLUGIN_WANT_PROGRAMS
+
224  /**
+
225  A program has been loaded on the plugin side.@n
+
226  This is called by the host to inform the UI about program changes.
+
227  */
+
228  virtual void programLoaded(uint32_t index) = 0;
+
229 #endif
+
230 
+
231 #if DISTRHO_PLUGIN_WANT_STATE
+
232  /**
+
233  A state has changed on the plugin side.@n
+
234  This is called by the host to inform the UI about state changes.
+
235  */
+
236  virtual void stateChanged(const char* key, const char* value) = 0;
+
237 #endif
+
238 
+
239  /* --------------------------------------------------------------------------------------------------------
+
240  * DSP/Plugin Callbacks (optional) */
+
241 
+
242  /**
+
243  Optional callback to inform the UI about a sample rate change on the plugin side.
+
244  @see getSampleRate()
+
245  */
+
246  virtual void sampleRateChanged(double newSampleRate);
+
247 
+
248 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
+
249  /* --------------------------------------------------------------------------------------------------------
+
250  * UI Callbacks (optional) */
+
251 
+
252  /**
+
253  UI idle function, called to give idle time to the plugin UI directly from the host.
+
254  This is called right after OS event handling and Window idle events (within the same cycle).
+
255  There are no guarantees in terms of timing.
+
256  @see addIdleCallback(IdleCallback*, uint).
+
257  */
+
258  virtual void uiIdle() {}
259 
-
260  The default implementation does nothing.
-
261  */
-
262  virtual void uiFocus(bool focus, DGL_NAMESPACE::CrossingMode mode);
+
260  /**
+
261  Windows focus function, called when the window gains or loses the keyboard focus.
+
262  This function is for plugin UIs to be able to override Window::onFocus(bool, CrossingMode).
263 
-
264  /**
-
265  Window reshape function, called when the window is resized.
-
266  This function is for plugin UIs to be able to override Window::onReshape(uint, uint).
+
264  The default implementation does nothing.
+
265  */
+
266  virtual void uiFocus(bool focus, DGL_NAMESPACE::CrossingMode mode);
267 
-
268  The plugin UI size will be set right after this function.
-
269  The default implementation sets up drawing context where necessary.
-
270 
-
271  You should almost never need to override this function.
-
272  The most common exception is custom OpenGL setup, but only really needed for custom OpenGL drawing code.
-
273  */
-
274  virtual void uiReshape(uint width, uint height);
-
275 
-
276  /**
-
277  Window scale factor function, called when the scale factor changes.
-
278  This function is for plugin UIs to be able to override Window::onScaleFactorChanged(double).
+
268  /**
+
269  Window reshape function, called when the window is resized.
+
270  This function is for plugin UIs to be able to override Window::onReshape(uint, uint).
+
271 
+
272  The plugin UI size will be set right after this function.
+
273  The default implementation sets up drawing context where necessary.
+
274 
+
275  You should almost never need to override this function.
+
276  The most common exception is custom OpenGL setup, but only really needed for custom OpenGL drawing code.
+
277  */
+
278  virtual void uiReshape(uint width, uint height);
279 
-
280  The default implementation does nothing.
-
281  WARNING function needs a proper name
-
282  */
-
283  virtual void uiScaleFactorChanged(double scaleFactor);
-
284 
-
285 # ifndef DGL_FILE_BROWSER_DISABLED
-
286  /**
-
287  Window file selected function, called when a path is selected by the user, as triggered by openFileBrowser().
-
288  This function is for plugin UIs to be able to override Window::onFileSelected(const char*).
-
289 
-
290  This action happens after the user confirms the action, so the file browser dialog will be closed at this point.
-
291  The default implementation does nothing.
-
292 
-
293  If you need to use files as plugin state, please setup and use DISTRHO_PLUGIN_WANT_STATEFILES instead.
-
294  */
-
295  virtual void uiFileBrowserSelected(const char* filename);
-
296 # endif
-
297 
-
298  /* --------------------------------------------------------------------------------------------------------
-
299  * UI Resize Handling, internal */
-
300 
-
301  /**
-
302  OpenGL widget resize function, called when the widget is resized.
-
303  This is overriden here so the host knows when the UI is resized by you.
-
304  @see Widget::onResize(const ResizeEvent&)
-
305  */
-
306  void onResize(const ResizeEvent& ev) override;
-
307 #endif
-
308 
-
309  // -------------------------------------------------------------------------------------------------------
-
310 
-
311 private:
-
312  struct PrivateData;
-
313  PrivateData* const uiData;
-
314  friend class PluginWindow;
-
315  friend class UIExporter;
-
316 
-
317  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UI)
-
318 };
-
319 
-
320 /** @} */
-
321 
-
322 /* ------------------------------------------------------------------------------------------------------------
-
323  * Create UI, entry point */
-
324 
-
325 /**
-
326  @addtogroup EntryPoints
-
327  @{
-
328  */
-
329 
-
330 /**
-
331  createUI.
-
332  @TODO Document this.
-
333  */
-
334 extern UI* createUI();
-
335 
-
336 /** @} */
-
337 
-
338 // -----------------------------------------------------------------------------------------------------------
-
339 
-
340 END_NAMESPACE_DISTRHO
+
280  /**
+
281  Window scale factor function, called when the scale factor changes.
+
282  This function is for plugin UIs to be able to override Window::onScaleFactorChanged(double).
+
283 
+
284  The default implementation does nothing.
+
285  WARNING function needs a proper name
+
286  */
+
287  virtual void uiScaleFactorChanged(double scaleFactor);
+
288 
+
289 # ifndef DGL_FILE_BROWSER_DISABLED
+
290  /**
+
291  Window file selected function, called when a path is selected by the user, as triggered by openFileBrowser().
+
292  This function is for plugin UIs to be able to override Window::onFileSelected(const char*).
+
293 
+
294  This action happens after the user confirms the action, so the file browser dialog will be closed at this point.
+
295  The default implementation does nothing.
+
296 
+
297  If you need to use files as plugin state, please setup and use DISTRHO_PLUGIN_WANT_STATEFILES instead.
+
298  */
+
299  virtual void uiFileBrowserSelected(const char* filename);
+
300 # endif
+
301 
+
302  /* --------------------------------------------------------------------------------------------------------
+
303  * UI Resize Handling, internal */
+
304 
+
305  /**
+
306  OpenGL widget resize function, called when the widget is resized.
+
307  This is overriden here so the host knows when the UI is resized by you.
+
308  @see Widget::onResize(const ResizeEvent&)
+
309  */
+
310  void onResize(const ResizeEvent& ev) override;
+
311 #endif
+
312 
+
313  // -------------------------------------------------------------------------------------------------------
+
314 
+
315 private:
+
316  struct PrivateData;
+
317  PrivateData* const uiData;
+
318  friend class DGL_NAMESPACE::PluginWindow;
+
319  friend class UIExporter;
+
320 
+
321  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UI)
+
322 };
+
323 
+
324 /** @} */
+
325 
+
326 /* ------------------------------------------------------------------------------------------------------------
+
327  * Create UI, entry point */
+
328 
+
329 /**
+
330  @addtogroup EntryPoints
+
331  @{
+
332  */
+
333 
+
334 /**
+
335  createUI.
+
336  @TODO Document this.
+
337  */
+
338 extern UI* createUI();
+
339 
+
340 /** @} */
341 
-
342 #endif // DISTRHO_UI_HPP_INCLUDED
+
342 // -----------------------------------------------------------------------------------------------------------
+
343 
+
344 END_NAMESPACE_DISTRHO
+
345 
+
346 #endif // DISTRHO_UI_HPP_INCLUDED
UI::getNextScaleFactor
static double getNextScaleFactor() noexcept
UI::stateChanged
virtual void stateChanged(const char *key, const char *value)=0
@@ -420,7 +424,7 @@ $(function() {
UI::getBackgroundColor
uint getBackgroundColor() const noexcept
UI::setParameterValue
void setParameterValue(uint32_t index, float value)
UI::isResizable
bool isResizable() const noexcept
-
UI
Definition: DistrhoUI.hpp:67
+
UI
Definition: DistrhoUI.hpp:71
UI::sendNote
void sendNote(uint8_t channel, uint8_t note, uint8_t velocity)
UI::getNextBundlePath
static const char * getNextBundlePath() noexcept
UI::getSampleRate
double getSampleRate() const noexcept
@@ -435,7 +439,7 @@ $(function() {
UI::parameterChanged
virtual void parameterChanged(uint32_t index, float value)=0
diff --git a/DistrhoUtils_8hpp_source.html b/DistrhoUtils_8hpp_source.html index 356d918a..e379a879 100644 --- a/DistrhoUtils_8hpp_source.html +++ b/DistrhoUtils_8hpp_source.html @@ -372,7 +372,7 @@ $(function() { diff --git a/EventHandlers_8hpp_source.html b/EventHandlers_8hpp_source.html index 14919222..06c77a78 100644 --- a/EventHandlers_8hpp_source.html +++ b/EventHandlers_8hpp_source.html @@ -123,38 +123,117 @@ $(function() {
52  bool isCheckable() const noexcept;
53  void setCheckable(bool checkable) noexcept;
54 
-
55  void setCallback(Callback* callback) noexcept;
-
56 
-
57  bool mouseEvent(const Widget::MouseEvent& ev);
-
58  bool motionEvent(const Widget::MotionEvent& ev);
+
55  Point<double> getLastClickPosition() const noexcept;
+
56  Point<double> getLastMotionPosition() const noexcept;
+
57 
+
58  void setCallback(Callback* callback) noexcept;
59 
-
60 protected:
-
61  State getState() const noexcept;
-
62  void clearState() noexcept;
-
63 
-
64  virtual void stateChanged(State state, State oldState);
-
65 
-
66 private:
-
67  struct PrivateData;
-
68  PrivateData* const pData;
-
69 
-
70  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ButtonEventHandler)
-
71 };
-
72 
-
73 // --------------------------------------------------------------------------------------------------------------------
-
74 
-
75 END_NAMESPACE_DGL
-
76 
-
77 #endif // DGL_EVENT_HANDLERS_HPP_INCLUDED
+
60  bool mouseEvent(const Widget::MouseEvent& ev);
+
61  bool motionEvent(const Widget::MotionEvent& ev);
+
62 
+
63 protected:
+
64  State getState() const noexcept;
+
65  void clearState() noexcept;
+
66 
+
67  virtual void stateChanged(State state, State oldState);
+
68 
+
69  void setInternalCallback(Callback* callback) noexcept;
+
70  void triggerUserCallback(SubWidget* widget, int button);
+
71 
+
72 private:
+
73  struct PrivateData;
+
74  PrivateData* const pData;
+
75 
+
76  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ButtonEventHandler)
+
77 };
78 
+
79 // --------------------------------------------------------------------------------------------------------------------
+
80 
+
81 class KnobEventHandler
+
82 {
+
83 public:
+
84  enum Orientation {
+
85  Horizontal,
+
86  Vertical
+
87  };
+
88 
+
89  // NOTE hover not implemented yet
+
90  enum State {
+
91  kKnobStateDefault = 0x0,
+
92  kKnobStateHover = 0x1,
+
93  kKnobStateDragging = 0x2,
+
94  kKnobStateDraggingHover = kKnobStateDragging|kKnobStateHover
+
95  };
+
96 
+
97  class Callback
+
98  {
+
99  public:
+
100  virtual ~Callback() {}
+
101  virtual void knobDragStarted(SubWidget* widget) = 0;
+
102  virtual void knobDragFinished(SubWidget* widget) = 0;
+
103  virtual void knobValueChanged(SubWidget* widget, float value) = 0;
+
104  };
+
105 
+
106  explicit KnobEventHandler(SubWidget* self);
+
107  explicit KnobEventHandler(SubWidget* self, const KnobEventHandler& other);
+
108  KnobEventHandler& operator=(const KnobEventHandler& other);
+
109  ~KnobEventHandler();
+
110 
+
111  // returns raw value, is assumed to be scaled if using log
+
112  float getValue() const noexcept;
+
113 
+
114  // NOTE: value is assumed to be scaled if using log
+
115  void setValue(float value, bool sendCallback = false) noexcept;
+
116 
+
117  // returns 0-1 ranged value, already with log scale as needed
+
118  float getNormalizedValue() const noexcept;
+
119 
+
120  // NOTE: value is assumed to be scaled if using log
+
121  void setDefault(float def) noexcept;
+
122 
+
123  // NOTE: value is assumed to be scaled if using log
+
124  void setRange(float min, float max) noexcept;
+
125 
+
126  void setStep(float step) noexcept;
+
127 
+
128  void setUsingLogScale(bool yesNo) noexcept;
+
129 
+
130  Orientation getOrientation() const noexcept;
+
131  void setOrientation(const Orientation orientation) noexcept;
+
132 
+
133  void setCallback(Callback* callback) noexcept;
+
134 
+
135  bool mouseEvent(const Widget::MouseEvent& ev);
+
136  bool motionEvent(const Widget::MotionEvent& ev);
+
137  bool scrollEvent(const Widget::ScrollEvent& ev);
+
138 
+
139 protected:
+
140  State getState() const noexcept;
+
141 
+
142 private:
+
143  struct PrivateData;
+
144  PrivateData* const pData;
+
145 
+
146  DISTRHO_LEAK_DETECTOR(KnobEventHandler)
+
147 };
+
148 
+
149 // --------------------------------------------------------------------------------------------------------------------
+
150 
+
151 END_NAMESPACE_DGL
+
152 
+
153 #endif // DGL_EVENT_HANDLERS_HPP_INCLUDED
+
154 
ButtonEventHandler::Callback
Definition: EventHandlers.hpp:36
+
Point
Definition: Geometry.hpp:40
SubWidget
Definition: SubWidget.hpp:39
ButtonEventHandler
Definition: EventHandlers.hpp:26
+
KnobEventHandler
Definition: EventHandlers.hpp:81
+
KnobEventHandler::Callback
Definition: EventHandlers.hpp:97
Widget
Definition: Widget.hpp:53
diff --git a/ExternalWindow_8hpp_source.html b/ExternalWindow_8hpp_source.html index dae5e2b7..f513e666 100644 --- a/ExternalWindow_8hpp_source.html +++ b/ExternalWindow_8hpp_source.html @@ -276,7 +276,7 @@ $(function() {
ExternalWindow
Definition: ExternalWindow.hpp:36
diff --git a/Geometry_8hpp_source.html b/Geometry_8hpp_source.html index e649fc00..0eff2847 100644 --- a/Geometry_8hpp_source.html +++ b/Geometry_8hpp_source.html @@ -997,7 +997,7 @@ $(function() {
Line::setEndX
void setEndX(const T &x) noexcept
diff --git a/ImageBaseWidgets_8hpp_source.html b/ImageBaseWidgets_8hpp_source.html index c8eb763f..fc858140 100644 --- a/ImageBaseWidgets_8hpp_source.html +++ b/ImageBaseWidgets_8hpp_source.html @@ -153,167 +153,153 @@ $(function() {
82 // --------------------------------------------------------------------------------------------------------------------
83 
84 template <class ImageType>
-
85 class ImageBaseKnob : public SubWidget
-
86 {
-
87 public:
-
88  enum Orientation {
-
89  Horizontal,
-
90  Vertical
-
91  };
-
92 
-
93  class Callback
-
94  {
-
95  public:
-
96  virtual ~Callback() {}
-
97  virtual void imageKnobDragStarted(ImageBaseKnob* imageKnob) = 0;
-
98  virtual void imageKnobDragFinished(ImageBaseKnob* imageKnob) = 0;
-
99  virtual void imageKnobValueChanged(ImageBaseKnob* imageKnob, float value) = 0;
-
100  };
-
101 
-
102  explicit ImageBaseKnob(Widget* parentWidget, const ImageType& image, Orientation orientation = Vertical) noexcept;
-
103  explicit ImageBaseKnob(const ImageBaseKnob& imageKnob);
-
104  ImageBaseKnob& operator=(const ImageBaseKnob& imageKnob);
-
105  ~ImageBaseKnob() override;
+
85 class ImageBaseKnob : public SubWidget,
+
86  public KnobEventHandler
+
87 {
+
88 public:
+
89  class Callback
+
90  {
+
91  public:
+
92  virtual ~Callback() {}
+
93  virtual void imageKnobDragStarted(ImageBaseKnob* imageKnob) = 0;
+
94  virtual void imageKnobDragFinished(ImageBaseKnob* imageKnob) = 0;
+
95  virtual void imageKnobValueChanged(ImageBaseKnob* imageKnob, float value) = 0;
+
96  };
+
97 
+
98  explicit ImageBaseKnob(Widget* parentWidget, const ImageType& image, Orientation orientation = Vertical) noexcept;
+
99  explicit ImageBaseKnob(const ImageBaseKnob& imageKnob);
+
100  ImageBaseKnob& operator=(const ImageBaseKnob& imageKnob);
+
101  ~ImageBaseKnob() override;
+
102 
+
103  void setCallback(Callback* callback) noexcept;
+
104  void setImageLayerCount(uint count) noexcept;
+
105  void setRotationAngle(int angle);
106 
-
107  float getValue() const noexcept;
-
108 
-
109  void setDefault(float def) noexcept;
-
110  void setRange(float min, float max) noexcept;
-
111  void setStep(float step) noexcept;
-
112  void setValue(float value, bool sendCallback = false) noexcept;
-
113  void setUsingLogScale(bool yesNo) noexcept;
-
114 
-
115  void setCallback(Callback* callback) noexcept;
-
116  void setOrientation(Orientation orientation) noexcept;
-
117  void setRotationAngle(int angle);
-
118 
-
119  void setImageLayerCount(uint count) noexcept;
-
120 
-
121 protected:
-
122  void onDisplay() override;
-
123  bool onMouse(const MouseEvent&) override;
-
124  bool onMotion(const MotionEvent&) override;
-
125  bool onScroll(const ScrollEvent&) override;
-
126 
-
127 private:
-
128  struct PrivateData;
-
129  PrivateData* const pData;
-
130 
-
131  DISTRHO_LEAK_DETECTOR(ImageBaseKnob)
-
132 };
-
133 
-
134 // --------------------------------------------------------------------------------------------------------------------
-
135 
-
136 // note set range and step before setting the value
-
137 
-
138 template <class ImageType>
-
139 class ImageBaseSlider : public SubWidget
-
140 {
-
141 public:
-
142  class Callback
-
143  {
-
144  public:
-
145  virtual ~Callback() {}
-
146  virtual void imageSliderDragStarted(ImageBaseSlider* imageSlider) = 0;
-
147  virtual void imageSliderDragFinished(ImageBaseSlider* imageSlider) = 0;
-
148  virtual void imageSliderValueChanged(ImageBaseSlider* imageSlider, float value) = 0;
-
149  };
-
150 
-
151  explicit ImageBaseSlider(Widget* parentWidget, const ImageType& image) noexcept;
-
152  ~ImageBaseSlider() override;
-
153 
-
154  float getValue() const noexcept;
-
155  void setValue(float value, bool sendCallback = false) noexcept;
-
156  void setDefault(float def) noexcept;
-
157 
-
158  void setStartPos(const Point<int>& startPos) noexcept;
-
159  void setStartPos(int x, int y) noexcept;
-
160  void setEndPos(const Point<int>& endPos) noexcept;
-
161  void setEndPos(int x, int y) noexcept;
-
162 
-
163  void setInverted(bool inverted) noexcept;
-
164  void setRange(float min, float max) noexcept;
-
165  void setStep(float step) noexcept;
-
166 
-
167  void setCallback(Callback* callback) noexcept;
-
168 
-
169 protected:
-
170  void onDisplay() override;
-
171  bool onMouse(const MouseEvent&) override;
-
172  bool onMotion(const MotionEvent&) override;
-
173 
-
174 private:
-
175  struct PrivateData;
-
176  PrivateData* const pData;
-
177 
-
178  // these should not be used
-
179  void setAbsoluteX(int) const noexcept {}
-
180  void setAbsoluteY(int) const noexcept {}
-
181  void setAbsolutePos(int, int) const noexcept {}
-
182  void setAbsolutePos(const Point<int>&) const noexcept {}
-
183 
-
184  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageBaseSlider)
-
185 };
-
186 
-
187 // --------------------------------------------------------------------------------------------------------------------
-
188 
-
189 template <class ImageType>
-
190 class ImageBaseSwitch : public SubWidget
-
191 {
-
192 public:
-
193  class Callback
-
194  {
-
195  public:
-
196  virtual ~Callback() {}
-
197  virtual void imageSwitchClicked(ImageBaseSwitch* imageSwitch, bool down) = 0;
-
198  };
+
107 protected:
+
108  void onDisplay() override;
+
109  bool onMouse(const MouseEvent&) override;
+
110  bool onMotion(const MotionEvent&) override;
+
111  bool onScroll(const ScrollEvent&) override;
+
112 
+
113 private:
+
114  struct PrivateData;
+
115  PrivateData* const pData;
+
116 
+
117  DISTRHO_LEAK_DETECTOR(ImageBaseKnob)
+
118 };
+
119 
+
120 // --------------------------------------------------------------------------------------------------------------------
+
121 
+
122 // note set range and step before setting the value
+
123 
+
124 template <class ImageType>
+
125 class ImageBaseSlider : public SubWidget
+
126 {
+
127 public:
+
128  class Callback
+
129  {
+
130  public:
+
131  virtual ~Callback() {}
+
132  virtual void imageSliderDragStarted(ImageBaseSlider* imageSlider) = 0;
+
133  virtual void imageSliderDragFinished(ImageBaseSlider* imageSlider) = 0;
+
134  virtual void imageSliderValueChanged(ImageBaseSlider* imageSlider, float value) = 0;
+
135  };
+
136 
+
137  explicit ImageBaseSlider(Widget* parentWidget, const ImageType& image) noexcept;
+
138  ~ImageBaseSlider() override;
+
139 
+
140  float getValue() const noexcept;
+
141  void setValue(float value, bool sendCallback = false) noexcept;
+
142  void setDefault(float def) noexcept;
+
143 
+
144  void setStartPos(const Point<int>& startPos) noexcept;
+
145  void setStartPos(int x, int y) noexcept;
+
146  void setEndPos(const Point<int>& endPos) noexcept;
+
147  void setEndPos(int x, int y) noexcept;
+
148 
+
149  void setInverted(bool inverted) noexcept;
+
150  void setRange(float min, float max) noexcept;
+
151  void setStep(float step) noexcept;
+
152 
+
153  void setCallback(Callback* callback) noexcept;
+
154 
+
155 protected:
+
156  void onDisplay() override;
+
157  bool onMouse(const MouseEvent&) override;
+
158  bool onMotion(const MotionEvent&) override;
+
159 
+
160 private:
+
161  struct PrivateData;
+
162  PrivateData* const pData;
+
163 
+
164  // these should not be used
+
165  void setAbsoluteX(int) const noexcept {}
+
166  void setAbsoluteY(int) const noexcept {}
+
167  void setAbsolutePos(int, int) const noexcept {}
+
168  void setAbsolutePos(const Point<int>&) const noexcept {}
+
169 
+
170  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageBaseSlider)
+
171 };
+
172 
+
173 // --------------------------------------------------------------------------------------------------------------------
+
174 
+
175 template <class ImageType>
+
176 class ImageBaseSwitch : public SubWidget
+
177 {
+
178 public:
+
179  class Callback
+
180  {
+
181  public:
+
182  virtual ~Callback() {}
+
183  virtual void imageSwitchClicked(ImageBaseSwitch* imageSwitch, bool down) = 0;
+
184  };
+
185 
+
186  explicit ImageBaseSwitch(Widget* parentWidget, const ImageType& imageNormal, const ImageType& imageDown) noexcept;
+
187  explicit ImageBaseSwitch(const ImageBaseSwitch& imageSwitch) noexcept;
+
188  ImageBaseSwitch& operator=(const ImageBaseSwitch& imageSwitch) noexcept;
+
189  ~ImageBaseSwitch() override;
+
190 
+
191  bool isDown() const noexcept;
+
192  void setDown(bool down) noexcept;
+
193 
+
194  void setCallback(Callback* callback) noexcept;
+
195 
+
196 protected:
+
197  void onDisplay() override;
+
198  bool onMouse(const MouseEvent&) override;
199 
-
200  explicit ImageBaseSwitch(Widget* parentWidget, const ImageType& imageNormal, const ImageType& imageDown) noexcept;
-
201  explicit ImageBaseSwitch(const ImageBaseSwitch& imageSwitch) noexcept;
-
202  ImageBaseSwitch& operator=(const ImageBaseSwitch& imageSwitch) noexcept;
-
203  ~ImageBaseSwitch() override;
-
204 
-
205  bool isDown() const noexcept;
-
206  void setDown(bool down) noexcept;
-
207 
-
208  void setCallback(Callback* callback) noexcept;
-
209 
-
210 protected:
-
211  void onDisplay() override;
-
212  bool onMouse(const MouseEvent&) override;
-
213 
-
214 private:
-
215  struct PrivateData;
-
216  PrivateData* const pData;
-
217 
-
218  DISTRHO_LEAK_DETECTOR(ImageBaseSwitch)
-
219 };
-
220 
-
221 // --------------------------------------------------------------------------------------------------------------------
-
222 
-
223 END_NAMESPACE_DGL
-
224 
-
225 #endif // DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
+
200 private:
+
201  struct PrivateData;
+
202  PrivateData* const pData;
+
203 
+
204  DISTRHO_LEAK_DETECTOR(ImageBaseSwitch)
+
205 };
+
206 
+
207 // --------------------------------------------------------------------------------------------------------------------
+
208 
+
209 END_NAMESPACE_DGL
+
210 
+
211 #endif // DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
ImageBaseAboutWindow::onDisplay
void onDisplay() override
ImageBaseButton
Definition: ImageBaseWidgets.hpp:51
ImageBaseKnob
Definition: ImageBaseWidgets.hpp:85
+
ImageBaseSwitch::onMouse
bool onMouse(const MouseEvent &) override
Widget::ScrollEvent
Definition: Widget.hpp:213
-
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:139
+
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:125
Widget::KeyboardEvent
Definition: Widget.hpp:94
-
SubWidget::setAbsolutePos
void setAbsolutePos(int x, int y) noexcept
Window
Definition: Window.hpp:50
ImageBaseKnob::onScroll
bool onScroll(const ScrollEvent &) override
-
SubWidget::setAbsoluteY
void setAbsoluteY(int y) noexcept
ImageBaseButton::onDisplay
void onDisplay() override
-
SubWidget::setAbsoluteX
void setAbsoluteX(int x) noexcept
ImageBaseKnob::onMouse
bool onMouse(const MouseEvent &) override
ImageBaseAboutWindow::onMouse
bool onMouse(const MouseEvent &) override
Widget::MotionEvent
Definition: Widget.hpp:187
ImageBaseAboutWindow::onKeyboard
bool onKeyboard(const KeyboardEvent &) override
ImageBaseAboutWindow
Definition: ImageBaseWidgets.hpp:29
-
ImageBaseKnob::Callback
Definition: ImageBaseWidgets.hpp:93
+
ImageBaseKnob::Callback
Definition: ImageBaseWidgets.hpp:89
ImageBaseKnob::onDisplay
void onDisplay() override
+
ImageBaseSwitch::onDisplay
void onDisplay() override
+
ImageBaseSlider::onDisplay
void onDisplay() override
ImageBaseButton::onMouse
bool onMouse(const MouseEvent &) override
StandaloneWindow
Definition: StandaloneWindow.hpp:27
ImageBaseKnob::onMotion
bool onMotion(const MotionEvent &) override
@@ -322,15 +308,18 @@ $(function() {
SubWidget
Definition: SubWidget.hpp:39
Widget::MouseEvent
Definition: Widget.hpp:165
ImageBaseButton::onMotion
bool onMotion(const MotionEvent &) override
-
ImageBaseSwitch::Callback
Definition: ImageBaseWidgets.hpp:193
-
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:190
+
ImageBaseSwitch::Callback
Definition: ImageBaseWidgets.hpp:179
+
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:176
ButtonEventHandler
Definition: EventHandlers.hpp:26
+
KnobEventHandler
Definition: EventHandlers.hpp:81
+
ImageBaseSlider::onMotion
bool onMotion(const MotionEvent &) override
TopLevelWidget
Definition: TopLevelWidget.hpp:46
-
ImageBaseSlider::Callback
Definition: ImageBaseWidgets.hpp:142
+
ImageBaseSlider::onMouse
bool onMouse(const MouseEvent &) override
+
ImageBaseSlider::Callback
Definition: ImageBaseWidgets.hpp:128
Widget
Definition: Widget.hpp:53
diff --git a/ImageBase_8hpp_source.html b/ImageBase_8hpp_source.html index 643bfecd..14936bc8 100644 --- a/ImageBase_8hpp_source.html +++ b/ImageBase_8hpp_source.html @@ -245,7 +245,7 @@ $(function() {
ImageBase::draw
void draw(const GraphicsContext &context)
diff --git a/ImageWidgets_8hpp_source.html b/ImageWidgets_8hpp_source.html index 4cd77f45..0a64f8be 100644 --- a/ImageWidgets_8hpp_source.html +++ b/ImageWidgets_8hpp_source.html @@ -113,12 +113,12 @@ $(function() {
ImageBaseButton
Definition: ImageBaseWidgets.hpp:51
ImageBaseKnob
Definition: ImageBaseWidgets.hpp:85
-
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:139
+
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:125
ImageBaseAboutWindow
Definition: ImageBaseWidgets.hpp:29
-
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:190
+
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:176
diff --git a/Image_8hpp_source.html b/Image_8hpp_source.html index a2ac2f1e..c12a631e 100644 --- a/Image_8hpp_source.html +++ b/Image_8hpp_source.html @@ -110,7 +110,7 @@ $(function() {
OpenGLImage
Definition: OpenGL.hpp:176
diff --git a/LeakDetector_8hpp_source.html b/LeakDetector_8hpp_source.html index 2be7bd73..8b004f69 100644 --- a/LeakDetector_8hpp_source.html +++ b/LeakDetector_8hpp_source.html @@ -222,7 +222,7 @@ $(function() {
LeakedObjectDetector::~LeakedObjectDetector
~LeakedObjectDetector() noexcept
Definition: LeakDetector.hpp:86
diff --git a/LibraryUtils_8hpp_source.html b/LibraryUtils_8hpp_source.html index 3bb943dd..d23e1b79 100644 --- a/LibraryUtils_8hpp_source.html +++ b/LibraryUtils_8hpp_source.html @@ -201,7 +201,7 @@ $(function() { diff --git a/Mutex_8hpp_source.html b/Mutex_8hpp_source.html index 7995d618..aea52c95 100644 --- a/Mutex_8hpp_source.html +++ b/Mutex_8hpp_source.html @@ -444,7 +444,7 @@ $(function() {
ScopeTryLocker
Definition: Mutex.hpp:290
diff --git a/NanoVG_8hpp_source.html b/NanoVG_8hpp_source.html index 53424baa..93e16f76 100644 --- a/NanoVG_8hpp_source.html +++ b/NanoVG_8hpp_source.html @@ -1054,7 +1054,7 @@ $(function() {
NanoVG::lineCap
void lineCap(LineCap cap=BUTT)
Size< uint >
Rectangle
Definition: Geometry.hpp:30
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
NanoVG::fontSize
void fontSize(float size)
NanoVG::strokeColor
void strokeColor(const Color &color)
NanoVG::loadSharedResources
virtual bool loadSharedResources()
@@ -1131,7 +1131,7 @@ $(function() {
Widget
Definition: Widget.hpp:53
diff --git a/OpenGL_8hpp_source.html b/OpenGL_8hpp_source.html index 51010f15..c6d5e5d9 100644 --- a/OpenGL_8hpp_source.html +++ b/OpenGL_8hpp_source.html @@ -366,7 +366,7 @@ $(function() {
ImageBaseButton
Definition: ImageBaseWidgets.hpp:51
ImageBaseKnob
Definition: ImageBaseWidgets.hpp:85
GraphicsContext
Definition: Base.hpp:154
-
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:139
+
ImageBaseSlider
Definition: ImageBaseWidgets.hpp:125
OpenGLImage::operator=
OpenGLImage & operator=(const OpenGLImage &image) noexcept
OpenGLImage::loadFromMemory
void loadFromMemory(const char *rawData, const Size< uint > &size, ImageFormat format=kImageFormatBGRA) noexcept override
Size< uint >
@@ -379,11 +379,11 @@ $(function() {
Point< int >
OpenGLImage::drawAt
void drawAt(const GraphicsContext &context, const Point< int > &pos) override
OpenGLImage::getType
DISTRHO_DEPRECATED GLenum getType() const noexcept
Definition: OpenGL.hpp:274
-
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:190
+
ImageBaseSwitch
Definition: ImageBaseWidgets.hpp:176
OpenGLImage
Definition: OpenGL.hpp:176
diff --git a/RingBuffer_8hpp_source.html b/RingBuffer_8hpp_source.html index 5253dc2a..bc0d7750 100644 --- a/RingBuffer_8hpp_source.html +++ b/RingBuffer_8hpp_source.html @@ -862,7 +862,7 @@ $(function() {
RingBufferControl::readCustomType
bool readCustomType(T &type) noexcept
Definition: RingBuffer.hpp:364
diff --git a/ScopedPointer_8hpp_source.html b/ScopedPointer_8hpp_source.html index 0dd282f3..cd56f23e 100644 --- a/ScopedPointer_8hpp_source.html +++ b/ScopedPointer_8hpp_source.html @@ -318,7 +318,7 @@ $(function() {
ScopedPointer::swapWith
void swapWith(ScopedPointer< ObjectType > &other) noexcept
Definition: ScopedPointer.hpp:167
diff --git a/ScopedSafeLocale_8hpp_source.html b/ScopedSafeLocale_8hpp_source.html index 3db29e86..4c30dcf1 100644 --- a/ScopedSafeLocale_8hpp_source.html +++ b/ScopedSafeLocale_8hpp_source.html @@ -209,7 +209,7 @@ $(function() {
ScopedSafeLocale
Definition: ScopedSafeLocale.hpp:57
diff --git a/Sleep_8hpp_source.html b/Sleep_8hpp_source.html index 00d32930..f8ce58b2 100644 --- a/Sleep_8hpp_source.html +++ b/Sleep_8hpp_source.html @@ -140,7 +140,7 @@ $(function() { diff --git a/StandaloneWindow_8hpp_source.html b/StandaloneWindow_8hpp_source.html index 090640e7..891789bb 100644 --- a/StandaloneWindow_8hpp_source.html +++ b/StandaloneWindow_8hpp_source.html @@ -154,7 +154,7 @@ $(function() {
Window
Definition: Window.hpp:50
Window::getScaleFactor
double getScaleFactor() const noexcept
Size< uint >
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
StandaloneWindow::isVisible
bool isVisible() const noexcept
Definition: StandaloneWindow.hpp:48
Window::repaint
void repaint() noexcept
Window::getWidth
uint getWidth() const noexcept
@@ -175,7 +175,7 @@ $(function() {
Window::hide
void hide()
diff --git a/String_8hpp_source.html b/String_8hpp_source.html index b7f52982..71ced5bc 100644 --- a/String_8hpp_source.html +++ b/String_8hpp_source.html @@ -1034,7 +1034,7 @@ $(function() {
ScopedSafeLocale
Definition: ScopedSafeLocale.hpp:57
diff --git a/SubWidget_8hpp_source.html b/SubWidget_8hpp_source.html index ae5fce53..0f7991ac 100644 --- a/SubWidget_8hpp_source.html +++ b/SubWidget_8hpp_source.html @@ -275,7 +275,7 @@ $(function() {
SubWidget::~SubWidget
virtual ~SubWidget()
diff --git a/Thread_8hpp_source.html b/Thread_8hpp_source.html index 1084fbc1..d54a5489 100644 --- a/Thread_8hpp_source.html +++ b/Thread_8hpp_source.html @@ -411,7 +411,7 @@ $(function() {
Thread
Definition: Thread.hpp:33
diff --git a/TopLevelWidget_8hpp_source.html b/TopLevelWidget_8hpp_source.html index fee073ce..8d774ed9 100644 --- a/TopLevelWidget_8hpp_source.html +++ b/TopLevelWidget_8hpp_source.html @@ -200,9 +200,9 @@ $(function() {
Window
Definition: Window.hpp:50
Size< uint >
Rectangle
Definition: Geometry.hpp:30
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
TopLevelWidget::getWindow
Window & getWindow() const noexcept
-
UI
Definition: DistrhoUI.hpp:67
+
UI
Definition: DistrhoUI.hpp:71
TopLevelWidget::~TopLevelWidget
virtual ~TopLevelWidget()
TopLevelWidget::setSize
void setSize(uint width, uint height)
TopLevelWidget::setHeight
void setHeight(uint height)
@@ -212,7 +212,7 @@ $(function() {
Widget
Definition: Widget.hpp:53
diff --git a/VstGuiWidget_8hpp_source.html b/VstGuiWidget_8hpp_source.html index 548ac9b8..b9469322 100644 --- a/VstGuiWidget_8hpp_source.html +++ b/VstGuiWidget_8hpp_source.html @@ -193,7 +193,7 @@ $(function() {
VstGuiStandaloneWindow
Definition: VstGuiWidget.hpp:35
diff --git a/Vulkan_8hpp_source.html b/Vulkan_8hpp_source.html index 0ac4db46..31779256 100644 --- a/Vulkan_8hpp_source.html +++ b/Vulkan_8hpp_source.html @@ -186,7 +186,7 @@ $(function() {
VulkanImage::VulkanImage
VulkanImage()
diff --git a/Widget_8hpp_source.html b/Widget_8hpp_source.html index 61068c06..b490cb1b 100644 --- a/Widget_8hpp_source.html +++ b/Widget_8hpp_source.html @@ -137,7 +137,7 @@ $(function() {
66  uint flags;
67  uint time;
68 
-
69  /** Constuctor */
+
69  /** Constructor */
70  BaseEvent() noexcept : mod(0x0), flags(0x0), time(0) {}
71  /** Destuctor */
72  virtual ~BaseEvent() noexcept {}
@@ -167,7 +167,7 @@ $(function() {
96  uint key;
97  uint keycode;
98 
-
99  /** Constuctor */
+
99  /** Constructor */
100  KeyboardEvent() noexcept
101  : BaseEvent(),
102  press(false),
@@ -189,7 +189,7 @@ $(function() {
118  bool press;
119  Key key;
120 
-
121  /** Constuctor */
+
121  /** Constructor */
122  SpecialEvent() noexcept
123  : BaseEvent(),
124  press(false),
@@ -216,7 +216,7 @@ $(function() {
145  uint character;
146  char string[8];
147 
-
148  /** Constuctor */
+
148  /** Constructor */
149  CharacterInputEvent() noexcept
150  : BaseEvent(),
151  keycode(0),
@@ -239,7 +239,7 @@ $(function() {
168  Point<double> pos;
169  Point<double> absolutePos;
170 
-
171  /** Constuctor */
+
171  /** Constructor */
172  MouseEvent() noexcept
173  : BaseEvent(),
174  button(0),
@@ -259,7 +259,7 @@ $(function() {
188  Point<double> pos;
189  Point<double> absolutePos;
190 
-
191  /** Constuctor */
+
191  /** Constructor */
192  MotionEvent() noexcept
193  : BaseEvent(),
194  pos(0.0, 0.0),
@@ -287,7 +287,7 @@ $(function() {
216  Point<double> delta;
217  ScrollDirection direction;
218 
-
219  /** Constuctor */
+
219  /** Constructor */
220  ScrollEvent() noexcept
221  : BaseEvent(),
222  pos(0.0, 0.0),
@@ -306,7 +306,7 @@ $(function() {
235  Size<uint> size;
236  Size<uint> oldSize;
237 
-
238  /** Constuctor */
+
238  /** Constructor */
239  ResizeEvent() noexcept
240  : size(0, 0),
241  oldSize(0, 0) {}
@@ -322,7 +322,7 @@ $(function() {
251  Point<int> pos;
252  Point<int> oldPos;
253 
-
254  /** Constuctor */
+
254  /** Constructor */
255  PositionChangedEvent() noexcept
256  : pos(0, 0),
257  oldPos(0, 0) {}
@@ -527,7 +527,7 @@ $(function() {
Widget::CharacterInputEvent
Definition: Widget.hpp:143
Widget::onKeyboard
virtual bool onKeyboard(const KeyboardEvent &)
Size< uint >
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
Widget::ResizeEvent::ResizeEvent
ResizeEvent() noexcept
Definition: Widget.hpp:239
Widget::MotionEvent
Definition: Widget.hpp:187
Widget::show
void show()
@@ -570,7 +570,7 @@ $(function() {
Widget::getGraphicsContext
const GraphicsContext & getGraphicsContext() const noexcept
diff --git a/Window_8hpp_source.html b/Window_8hpp_source.html index 0354ccb1..d16e17d1 100644 --- a/Window_8hpp_source.html +++ b/Window_8hpp_source.html @@ -158,14 +158,14 @@ $(function() {
87  /** Whether to show list of places (bookmarks) */
88  ButtonState showPlaces;
89 
-
90  /** Constuctor for default values */
+
90  /** Constructor for default values */
91  Buttons()
92  : listAllFiles(kButtonVisibleChecked),
93  showHidden(kButtonVisibleUnchecked),
94  showPlaces(kButtonVisibleUnchecked) {}
95  } buttons;
96 
-
97  /** Constuctor for default values */
+
97  /** Constructor for default values */
98  FileBrowserOptions()
99  : startDir(nullptr),
100  title(nullptr),
@@ -176,341 +176,365 @@ $(function() {
105 #endif // DGL_FILE_BROWSER_DISABLED
106 
107  /**
-
108  Constructor for a regular, standalone window.
-
109  */
-
110  explicit Window(Application& app);
+
108  Window graphics context as a scoped struct.
+
109  This class gives graphics context drawing time to a window's widgets.
+
110  Typically used for allowing OpenGL drawing operations during a window + widget constructor.
111 
-
112  /**
-
113  Constructor for a modal window, by having another window as its parent.
-
114  The Application instance must be the same between the 2 windows.
-
115  */
-
116  explicit Window(Application& app, Window& parent);
-
117 
-
118  /**
-
119  Constructor for an embed Window without known size,
-
120  typically used in modules or plugins that run inside another host.
-
121  */
-
122  explicit Window(Application& app,
-
123  uintptr_t parentWindowHandle,
-
124  double scaleFactor,
-
125  bool resizable);
-
126 
-
127  /**
-
128  Constructor for an embed Window with known size,
-
129  typically used in modules or plugins that run inside another host.
-
130  */
-
131  explicit Window(Application& app,
-
132  uintptr_t parentWindowHandle,
-
133  uint width,
-
134  uint height,
-
135  double scaleFactor,
-
136  bool resizable);
-
137 
-
138  /**
-
139  Destructor.
-
140  */
-
141  virtual ~Window();
-
142 
-
143  /**
-
144  Whether this Window is embed into another (usually not DGL-controlled) Window.
-
145  */
-
146  bool isEmbed() const noexcept;
-
147 
-
148  /**
-
149  Check if this window is visible / mapped.
-
150  Invisible windows do not receive events except resize.
-
151  @see setVisible(bool)
+
112  Unless you are subclassing the Window or StandaloneWindow classes, you do not need to care.
+
113  In such cases you will need to use this struct as a way to get a valid OpenGL context.
+
114  For example in a standalone application:
+
115  ```
+
116  int main()
+
117  {
+
118  Application app;
+
119  Window win(app);
+
120  ScopedPointer<MyCustomTopLevelWidget> widget;
+
121  {
+
122  const ScopedGraphicsContext sgc(win);
+
123  widget = new MyCustomTopLevelWidget(win);
+
124  }
+
125  app.exec();
+
126  return 0;
+
127  }
+
128  ```
+
129 
+
130  This struct is necessary because we cannot automatically make the window leave the OpenGL context in custom code.
+
131  We must always cleanly enter and leave the OpenGL context.
+
132  In order to avoid messing up the global host context, this class is used around widget creation.
+
133  */
+
134  class ScopedGraphicsContext
+
135  {
+
136  Window& window;
+
137  public:
+
138  explicit ScopedGraphicsContext(Window& window);
+
139  ~ScopedGraphicsContext();
+
140  DISTRHO_DECLARE_NON_COPYABLE(ScopedGraphicsContext)
+
141  DISTRHO_PREVENT_HEAP_ALLOCATION
+
142  };
+
143 
+
144  /**
+
145  Constructor for a regular, standalone window.
+
146  */
+
147  explicit Window(Application& app);
+
148 
+
149  /**
+
150  Constructor for a modal window, by having another window as its parent.
+
151  The Application instance must be the same between the 2 windows.
152  */
-
153  bool isVisible() const noexcept;
+
153  explicit Window(Application& app, Window& parent);
154 
155  /**
-
156  Set windows visible (or not) according to @a visible.
-
157  Only valid for standalones, embed windows are always visible.
-
158  @see isVisible(), hide(), show()
-
159  */
-
160  void setVisible(bool visible);
-
161 
-
162  /**
-
163  Show window.
-
164  This is the same as calling setVisible(true).
-
165  @see isVisible(), setVisible(bool)
-
166  */
-
167  void show();
-
168 
-
169  /**
-
170  Hide window.
-
171  This is the same as calling setVisible(false).
-
172  @see isVisible(), setVisible(bool)
-
173  */
-
174  void hide();
-
175 
-
176  /**
-
177  Hide window and notify application of a window close event.
-
178  The application event-loop will stop when all windows have been closed.
-
179  For standalone windows only, has no effect if window is embed.
-
180  @see isEmbed()
-
181 
-
182  @note It is possible to hide the window while not stopping the event-loop.
-
183  A closed window is always hidden, but the reverse is not always true.
-
184  */
-
185  void close();
-
186 
-
187  /**
-
188  Check if this window is resizable (by the user or window manager).
-
189  @see setResizable
-
190  */
-
191  bool isResizable() const noexcept;
-
192 
-
193  /**
-
194  Set window as resizable (by the user or window manager).
-
195  It is always possible to resize a window programmatically, which is not the same as the user being allowed to it.
-
196  @note This function does nothing for plugins, where the resizable state is set via macro.
-
197  @see DISTRHO_UI_USER_RESIZABLE
-
198  */
-
199  void setResizable(bool resizable);
-
200 
-
201  /**
-
202  Get width.
+
156  Constructor for an embed Window without known size,
+
157  typically used in modules or plugins that run inside another host.
+
158  */
+
159  explicit Window(Application& app,
+
160  uintptr_t parentWindowHandle,
+
161  double scaleFactor,
+
162  bool resizable);
+
163 
+
164  /**
+
165  Constructor for an embed Window with known size,
+
166  typically used in modules or plugins that run inside another host.
+
167  */
+
168  explicit Window(Application& app,
+
169  uintptr_t parentWindowHandle,
+
170  uint width,
+
171  uint height,
+
172  double scaleFactor,
+
173  bool resizable);
+
174 
+
175  /**
+
176  Destructor.
+
177  */
+
178  virtual ~Window();
+
179 
+
180  /**
+
181  Whether this Window is embed into another (usually not DGL-controlled) Window.
+
182  */
+
183  bool isEmbed() const noexcept;
+
184 
+
185  /**
+
186  Check if this window is visible / mapped.
+
187  Invisible windows do not receive events except resize.
+
188  @see setVisible(bool)
+
189  */
+
190  bool isVisible() const noexcept;
+
191 
+
192  /**
+
193  Set windows visible (or not) according to @a visible.
+
194  Only valid for standalones, embed windows are always visible.
+
195  @see isVisible(), hide(), show()
+
196  */
+
197  void setVisible(bool visible);
+
198 
+
199  /**
+
200  Show window.
+
201  This is the same as calling setVisible(true).
+
202  @see isVisible(), setVisible(bool)
203  */
-
204  uint getWidth() const noexcept;
+
204  void show();
205 
206  /**
-
207  Get height.
-
208  */
-
209  uint getHeight() const noexcept;
-
210 
-
211  /**
-
212  Get size.
-
213  */
-
214  Size<uint> getSize() const noexcept;
-
215 
-
216  /**
-
217  Set width.
-
218  */
-
219  void setWidth(uint width);
-
220 
-
221  /**
-
222  Set height.
-
223  */
-
224  void setHeight(uint height);
-
225 
-
226  /**
-
227  Set size using @a width and @a height values.
-
228  */
-
229  void setSize(uint width, uint height);
-
230 
-
231  /**
-
232  Set size.
-
233  */
-
234  void setSize(const Size<uint>& size);
-
235 
-
236  /**
-
237  Get the title of the window previously set with setTitle().
-
238  */
-
239  const char* getTitle() const noexcept;
-
240 
-
241  /**
-
242  Set the title of the window, typically displayed in the title bar or in window switchers.
-
243 
-
244  This only makes sense for non-embedded windows.
+
207  Hide window.
+
208  This is the same as calling setVisible(false).
+
209  @see isVisible(), setVisible(bool)
+
210  */
+
211  void hide();
+
212 
+
213  /**
+
214  Hide window and notify application of a window close event.
+
215  The application event-loop will stop when all windows have been closed.
+
216  For standalone windows only, has no effect if window is embed.
+
217  @see isEmbed()
+
218 
+
219  @note It is possible to hide the window while not stopping the event-loop.
+
220  A closed window is always hidden, but the reverse is not always true.
+
221  */
+
222  void close();
+
223 
+
224  /**
+
225  Check if this window is resizable (by the user or window manager).
+
226  @see setResizable
+
227  */
+
228  bool isResizable() const noexcept;
+
229 
+
230  /**
+
231  Set window as resizable (by the user or window manager).
+
232  It is always possible to resize a window programmatically, which is not the same as the user being allowed to it.
+
233  @note This function does nothing for plugins, where the resizable state is set via macro.
+
234  @see DISTRHO_UI_USER_RESIZABLE
+
235  */
+
236  void setResizable(bool resizable);
+
237 
+
238  /**
+
239  Get width.
+
240  */
+
241  uint getWidth() const noexcept;
+
242 
+
243  /**
+
244  Get height.
245  */
-
246  void setTitle(const char* title);
+
246  uint getHeight() const noexcept;
247 
248  /**
-
249  Check if key repeat events are ignored.
+
249  Get size.
250  */
-
251  bool isIgnoringKeyRepeat() const noexcept;
+
251  Size<uint> getSize() const noexcept;
252 
253  /**
-
254  Set to ignore (or not) key repeat events according to @a ignore.
+
254  Set width.
255  */
-
256  void setIgnoringKeyRepeat(bool ignore) noexcept;
+
256  void setWidth(uint width);
257 
258  /**
-
259  Add a callback function to be triggered on every idle cycle or on a specific timer frequency.
-
260  You can add more than one, and remove them at anytime with removeIdleCallback().
-
261  This can be used to perform some action at a regular interval with relatively low frequency.
+
259  Set height.
+
260  */
+
261  void setHeight(uint height);
262 
-
263  If providing a timer frequency, there are a few things to note:
-
264  1. There is a platform-specific limit to the number of supported timers, and overhead associated with each,
-
265  so you should create only a few timers and perform several tasks in one if necessary.
-
266  2. This timer frequency is not guaranteed to have a resolution better than 10ms
-
267  (the maximum timer resolution on Windows) and may be rounded up if it is too short.
-
268  On X11 and MacOS, a resolution of about 1ms can usually be relied on.
-
269  */
-
270  bool addIdleCallback(IdleCallback* callback, uint timerFrequencyInMs = 0);
-
271 
-
272  /**
-
273  Remove an idle callback previously added via addIdleCallback().
-
274  */
-
275  bool removeIdleCallback(IdleCallback* callback);
-
276 
-
277  /**
-
278  Get the application associated with this window.
-
279  */
-
280  Application& getApp() const noexcept;
-
281 
-
282  /**
-
283  Get the graphics context associated with this window.
-
284  GraphicsContext is an empty struct and needs to be casted into a different type in order to be usable,
-
285  for example GraphicsContext.
-
286  @see CairoSubWidget, CairoTopLevelWidget
+
263  /**
+
264  Set size using @a width and @a height values.
+
265  */
+
266  void setSize(uint width, uint height);
+
267 
+
268  /**
+
269  Set size.
+
270  */
+
271  void setSize(const Size<uint>& size);
+
272 
+
273  /**
+
274  Get the title of the window previously set with setTitle().
+
275  */
+
276  const char* getTitle() const noexcept;
+
277 
+
278  /**
+
279  Set the title of the window, typically displayed in the title bar or in window switchers.
+
280 
+
281  This only makes sense for non-embedded windows.
+
282  */
+
283  void setTitle(const char* title);
+
284 
+
285  /**
+
286  Check if key repeat events are ignored.
287  */
-
288  const GraphicsContext& getGraphicsContext() const noexcept;
+
288  bool isIgnoringKeyRepeat() const noexcept;
289 
290  /**
-
291  Get the "native" window handle.
-
292  Returned value depends on the platform:
-
293  - HaikuOS: This is a pointer to a `BView`.
-
294  - MacOS: This is a pointer to an `NSView*`.
-
295  - Windows: This is a `HWND`.
-
296  - Everything else: This is an [X11] `Window`.
-
297  */
-
298  uintptr_t getNativeWindowHandle() const noexcept;
+
291  Set to ignore (or not) key repeat events according to @a ignore.
+
292  */
+
293  void setIgnoringKeyRepeat(bool ignore) noexcept;
+
294 
+
295  /**
+
296  Add a callback function to be triggered on every idle cycle or on a specific timer frequency.
+
297  You can add more than one, and remove them at anytime with removeIdleCallback().
+
298  This can be used to perform some action at a regular interval with relatively low frequency.
299 
-
300  /**
-
301  Get the scale factor requested for this window.
-
302  This is purely informational, and up to developers to choose what to do with it.
-
303 
-
304  If you do not want to deal with this yourself,
-
305  consider using setGeometryConstraints() where you can specify to automatically scale the window contents.
-
306  @see setGeometryConstraints
-
307  */
-
308  double getScaleFactor() const noexcept;
-
309 
-
310  /**
-
311  Grab the keyboard input focus.
-
312  */
-
313  void focus();
-
314 
-
315 #ifndef DGL_FILE_BROWSER_DISABLED
-
316  /**
-
317  Open a file browser dialog with this window as parent.
-
318  A few options can be specified to setup the dialog.
-
319 
-
320  If a path is selected, onFileSelected() will be called with the user chosen path.
-
321  If the user cancels or does not pick a file, onFileSelected() will be called with nullptr as filename.
-
322 
-
323  This function does not block the event loop.
+
300  If providing a timer frequency, there are a few things to note:
+
301  1. There is a platform-specific limit to the number of supported timers, and overhead associated with each,
+
302  so you should create only a few timers and perform several tasks in one if necessary.
+
303  2. This timer frequency is not guaranteed to have a resolution better than 10ms
+
304  (the maximum timer resolution on Windows) and may be rounded up if it is too short.
+
305  On X11 and MacOS, a resolution of about 1ms can usually be relied on.
+
306  */
+
307  bool addIdleCallback(IdleCallback* callback, uint timerFrequencyInMs = 0);
+
308 
+
309  /**
+
310  Remove an idle callback previously added via addIdleCallback().
+
311  */
+
312  bool removeIdleCallback(IdleCallback* callback);
+
313 
+
314  /**
+
315  Get the application associated with this window.
+
316  */
+
317  Application& getApp() const noexcept;
+
318 
+
319  /**
+
320  Get the graphics context associated with this window.
+
321  GraphicsContext is an empty struct and needs to be casted into a different type in order to be usable,
+
322  for example GraphicsContext.
+
323  @see CairoSubWidget, CairoTopLevelWidget
324  */
-
325  bool openFileBrowser(const FileBrowserOptions& options);
-
326 #endif
-
327 
-
328  /**
-
329  Request repaint of this window, for the entire area.
-
330  */
-
331  void repaint() noexcept;
-
332 
-
333  /**
-
334  Request partial repaint of this window, with bounds according to @a rect.
-
335  */
-
336  void repaint(const Rectangle<uint>& rect) noexcept;
-
337 
-
338  /**
-
339  Run this window as a modal, blocking input events from the parent.
-
340  Only valid for windows that have been created with another window as parent (as passed in the constructor).
-
341  Can optionally block-wait, but such option is only available if the application is running as standalone.
-
342  */
-
343  void runAsModal(bool blockWait = false);
-
344 
-
345  /**
-
346  Set geometry constraints for the Window when resized by the user, and optionally scale contents automatically.
-
347  */
-
348  void setGeometryConstraints(uint minimumWidth,
-
349  uint minimumHeight,
-
350  bool keepAspectRatio = false,
-
351  bool automaticallyScale = false);
-
352 
-
353  /** DEPRECATED Use isIgnoringKeyRepeat(). */
-
354  DISTRHO_DEPRECATED_BY("isIgnoringKeyRepeat()")
-
355  inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); }
+
325  const GraphicsContext& getGraphicsContext() const noexcept;
+
326 
+
327  /**
+
328  Get the "native" window handle.
+
329  Returned value depends on the platform:
+
330  - HaikuOS: This is a pointer to a `BView`.
+
331  - MacOS: This is a pointer to an `NSView*`.
+
332  - Windows: This is a `HWND`.
+
333  - Everything else: This is an [X11] `Window`.
+
334  */
+
335  uintptr_t getNativeWindowHandle() const noexcept;
+
336 
+
337  /**
+
338  Get the scale factor requested for this window.
+
339  This is purely informational, and up to developers to choose what to do with it.
+
340 
+
341  If you do not want to deal with this yourself,
+
342  consider using setGeometryConstraints() where you can specify to automatically scale the window contents.
+
343  @see setGeometryConstraints
+
344  */
+
345  double getScaleFactor() const noexcept;
+
346 
+
347  /**
+
348  Grab the keyboard input focus.
+
349  */
+
350  void focus();
+
351 
+
352 #ifndef DGL_FILE_BROWSER_DISABLED
+
353  /**
+
354  Open a file browser dialog with this window as parent.
+
355  A few options can be specified to setup the dialog.
356 
-
357  /** DEPRECATED Use getScaleFactor(). */
-
358  DISTRHO_DEPRECATED_BY("getScaleFactor()")
-
359  inline double getScaling() const noexcept { return getScaleFactor(); }
-
360 
-
361  /** DEPRECATED Use runAsModal(bool). */
-
362  DISTRHO_DEPRECATED_BY("runAsModal(bool)")
-
363  inline void exec(bool blockWait = false) { runAsModal(blockWait); }
-
364 
-
365  // TESTING, DO NOT USE
-
366  void leaveContext();
-
367 
-
368 protected:
-
369  /**
-
370  A function called when the window is attempted to be closed.
-
371  Returning true closes the window, which is the default behaviour.
-
372  Override this method and return false to prevent the window from being closed by the user.
-
373 
-
374  This method is not used for embed windows, and not even made available in DISTRHO_NAMESPACE::UI.
-
375  For embed windows, closing is handled by the host/parent process and we have no control over it.
-
376  As such, a close action on embed windows will always succeed and cannot be cancelled.
-
377  */
-
378  virtual bool onClose();
-
379 
-
380  /**
-
381  A function called when the window gains or loses the keyboard focus.
-
382  The default implementation does nothing.
-
383  */
-
384  virtual void onFocus(bool focus, CrossingMode mode);
-
385 
-
386  /**
-
387  A function called when the window is resized.
-
388  If there is a top-level widget associated with this window, its size will be set right after this function.
-
389  The default implementation sets up drawing context where necessary.
-
390  */
-
391  virtual void onReshape(uint width, uint height);
-
392 
-
393  /**
-
394  A function called when scale factor requested for this window changes.
-
395  The default implementation does nothing.
-
396  WARNING function needs a proper name
-
397  */
-
398  virtual void onScaleFactorChanged(double scaleFactor);
-
399 
-
400 #ifndef DGL_FILE_BROWSER_DISABLED
-
401  /**
-
402  A function called when a path is selected by the user, as triggered by openFileBrowser().
-
403  This action happens after the user confirms the action, so the file browser dialog will be closed at this point.
-
404  The default implementation does nothing.
-
405  */
-
406  virtual void onFileSelected(const char* filename);
+
357  If a path is selected, onFileSelected() will be called with the user chosen path.
+
358  If the user cancels or does not pick a file, onFileSelected() will be called with nullptr as filename.
+
359 
+
360  This function does not block the event loop.
+
361  */
+
362  bool openFileBrowser(const FileBrowserOptions& options);
+
363 #endif
+
364 
+
365  /**
+
366  Request repaint of this window, for the entire area.
+
367  */
+
368  void repaint() noexcept;
+
369 
+
370  /**
+
371  Request partial repaint of this window, with bounds according to @a rect.
+
372  */
+
373  void repaint(const Rectangle<uint>& rect) noexcept;
+
374 
+
375  /**
+
376  Run this window as a modal, blocking input events from the parent.
+
377  Only valid for windows that have been created with another window as parent (as passed in the constructor).
+
378  Can optionally block-wait, but such option is only available if the application is running as standalone.
+
379  */
+
380  void runAsModal(bool blockWait = false);
+
381 
+
382  /**
+
383  Set geometry constraints for the Window when resized by the user, and optionally scale contents automatically.
+
384  */
+
385  void setGeometryConstraints(uint minimumWidth,
+
386  uint minimumHeight,
+
387  bool keepAspectRatio = false,
+
388  bool automaticallyScale = false);
+
389 
+
390  /** DEPRECATED Use isIgnoringKeyRepeat(). */
+
391  DISTRHO_DEPRECATED_BY("isIgnoringKeyRepeat()")
+
392  inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); }
+
393 
+
394  /** DEPRECATED Use getScaleFactor(). */
+
395  DISTRHO_DEPRECATED_BY("getScaleFactor()")
+
396  inline double getScaling() const noexcept { return getScaleFactor(); }
+
397 
+
398  /** DEPRECATED Use runAsModal(bool). */
+
399  DISTRHO_DEPRECATED_BY("runAsModal(bool)")
+
400  inline void exec(bool blockWait = false) { runAsModal(blockWait); }
+
401 
+
402 protected:
+
403  /**
+
404  A function called when the window is attempted to be closed.
+
405  Returning true closes the window, which is the default behaviour.
+
406  Override this method and return false to prevent the window from being closed by the user.
407 
-
408  /** DEPRECATED Use onFileSelected(). */
-
409  DISTRHO_DEPRECATED_BY("onFileSelected(const char*)")
-
410  inline virtual void fileBrowserSelected(const char* filename) { return onFileSelected(filename); }
-
411 #endif
-
412 
-
413 private:
-
414  struct PrivateData;
-
415  PrivateData* const pData;
-
416  friend class Application;
-
417  friend class TopLevelWidget;
-
418 
-
419  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window);
-
420 };
-
421 
-
422 // -----------------------------------------------------------------------
-
423 
-
424 END_NAMESPACE_DGL
-
425 
-
426 /* TODO
-
427  * add eventcrossing/enter-leave event
-
428  */
-
429 #if 0
-
430 protected:
-
431  bool handlePluginKeyboard(const bool press, const uint key);
-
432  bool handlePluginSpecial(const bool press, const Key key);
-
433 #endif
-
434 
-
435 // -----------------------------------------------------------------------
-
436 
-
437 #endif // DGL_WINDOW_HPP_INCLUDED
+
408  This method is not used for embed windows, and not even made available in DISTRHO_NAMESPACE::UI.
+
409  For embed windows, closing is handled by the host/parent process and we have no control over it.
+
410  As such, a close action on embed windows will always succeed and cannot be cancelled.
+
411  */
+
412  virtual bool onClose();
+
413 
+
414  /**
+
415  A function called when the window gains or loses the keyboard focus.
+
416  The default implementation does nothing.
+
417  */
+
418  virtual void onFocus(bool focus, CrossingMode mode);
+
419 
+
420  /**
+
421  A function called when the window is resized.
+
422  If there is a top-level widget associated with this window, its size will be set right after this function.
+
423  The default implementation sets up drawing context where necessary.
+
424  */
+
425  virtual void onReshape(uint width, uint height);
+
426 
+
427  /**
+
428  A function called when scale factor requested for this window changes.
+
429  The default implementation does nothing.
+
430  WARNING function needs a proper name
+
431  */
+
432  virtual void onScaleFactorChanged(double scaleFactor);
+
433 
+
434 #ifndef DGL_FILE_BROWSER_DISABLED
+
435  /**
+
436  A function called when a path is selected by the user, as triggered by openFileBrowser().
+
437  This action happens after the user confirms the action, so the file browser dialog will be closed at this point.
+
438  The default implementation does nothing.
+
439  */
+
440  virtual void onFileSelected(const char* filename);
+
441 
+
442  /** DEPRECATED Use onFileSelected(). */
+
443  DISTRHO_DEPRECATED_BY("onFileSelected(const char*)")
+
444  inline virtual void fileBrowserSelected(const char* filename) { return onFileSelected(filename); }
+
445 #endif
+
446 
+
447 private:
+
448  struct PrivateData;
+
449  PrivateData* const pData;
+
450  friend class Application;
+
451  friend class PluginWindow;
+
452  friend class TopLevelWidget;
+
453 
+
454  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window);
+
455 };
+
456 
+
457 // -----------------------------------------------------------------------
+
458 
+
459 END_NAMESPACE_DGL
+
460 
+
461 #endif // DGL_WINDOW_HPP_INCLUDED
Window::runAsModal
void runAsModal(bool blockWait=false)
Window::isResizable
bool isResizable() const noexcept
Window::FileBrowserOptions::title
const char * title
Definition: Window.hpp:72
-
Window::fileBrowserSelected
virtual void fileBrowserSelected(const char *filename)
Definition: Window.hpp:410
+
Window::fileBrowserSelected
virtual void fileBrowserSelected(const char *filename)
Definition: Window.hpp:444
Window::setHeight
void setHeight(uint height)
Window::onFocus
virtual void onFocus(bool focus, CrossingMode mode)
Window::FileBrowserOptions::startDir
const char * startDir
Definition: Window.hpp:70
@@ -531,7 +555,7 @@ $(function() {
Window::~Window
virtual ~Window()
Size
Definition: Geometry.hpp:132
Rectangle
Definition: Geometry.hpp:30
-
Application
Definition: Application.hpp:34
+
Application
Definition: Application.hpp:36
Window::repaint
void repaint() noexcept
Window::getWidth
uint getWidth() const noexcept
Window::onClose
virtual bool onClose()
@@ -541,7 +565,7 @@ $(function() {
Window::addIdleCallback
bool addIdleCallback(IdleCallback *callback, uint timerFrequencyInMs=0)
Window::onReshape
virtual void onReshape(uint width, uint height)
Window::setVisible
void setVisible(bool visible)
-
Window::getIgnoringKeyRepeat
bool getIgnoringKeyRepeat() const noexcept
Definition: Window.hpp:355
+
Window::getIgnoringKeyRepeat
bool getIgnoringKeyRepeat() const noexcept
Definition: Window.hpp:392
Window::setWidth
void setWidth(uint width)
Window::setSize
void setSize(uint width, uint height)
Window::isEmbed
bool isEmbed() const noexcept
@@ -550,12 +574,12 @@ $(function() {
Window::Window
Window(Application &app)
Window::FileBrowserOptions
Definition: Window.hpp:58
Window::getApp
Application & getApp() const noexcept
-
Window::exec
void exec(bool blockWait=false)
Definition: Window.hpp:363
+
Window::exec
void exec(bool blockWait=false)
Definition: Window.hpp:400
Window::FileBrowserOptions::ButtonState
ButtonState
Definition: Window.hpp:63
Window::removeIdleCallback
bool removeIdleCallback(IdleCallback *callback)
IdleCallback
Definition: Base.hpp:159
Window::FileBrowserOptions::Buttons::showPlaces
ButtonState showPlaces
Definition: Window.hpp:88
-
Window::getScaling
double getScaling() const noexcept
Definition: Window.hpp:359
+
Window::getScaling
double getScaling() const noexcept
Definition: Window.hpp:396
Window::getSize
Size< uint > getSize() const noexcept
Window::focus
void focus()
Window::setResizable
void setResizable(bool resizable)
@@ -563,12 +587,13 @@ $(function() {
Window::isIgnoringKeyRepeat
bool isIgnoringKeyRepeat() const noexcept
Window::getHeight
uint getHeight() const noexcept
Window::FileBrowserOptions::Buttons::Buttons
Buttons()
Definition: Window.hpp:91
+
Window::ScopedGraphicsContext
Definition: Window.hpp:134
TopLevelWidget
Definition: TopLevelWidget.hpp:46
Window::close
void close()
Window::hide
void hide()
diff --git a/annotated.html b/annotated.html index fd196545..bd320feb 100644 --- a/annotated.html +++ b/annotated.html @@ -94,68 +94,71 @@ $(function() {  CCallback  CImageBaseSwitch  CCallback - CLeakedObjectDetector - CLine - CMidiEvent - CMutex - CNanoBaseWidget - CNanoImage - CNanoVG - CGlyphPosition - CPaint - CTextRow - COpenGLGraphicsContext - COpenGLImage - CParameter - CParameterEnumerationValue - CParameterEnumerationValues - CParameterRanges - CPlugin - CPoint - CPortGroup - CRectangle - CRecursiveMutex - CRingBufferControl - CScopedPointer - CScopedSafeLocale - CScopeLocker - CScopeTryLocker - CScopeUnlocker - CSignal - CSize - CSmallStackBuffer - CSmallStackRingBuffer - CStandaloneWindow - CString - CSubWidget - CThread - CTimePosition - CBarBeatTick - CTopLevelWidget - CTriangle - CUI - CVstGuiStandaloneWindow - CVulkanGraphicsContext - CVulkanImage - CWidget - CBaseEvent - CCharacterInputEvent - CKeyboardEvent - CMotionEvent - CMouseEvent - CPositionChangedEvent - CResizeEvent - CScrollEvent - CSpecialEvent - CWindow - CFileBrowserOptions - CButtons + CKnobEventHandler + CCallback + CLeakedObjectDetector + CLine + CMidiEvent + CMutex + CNanoBaseWidget + CNanoImage + CNanoVG + CGlyphPosition + CPaint + CTextRow + COpenGLGraphicsContext + COpenGLImage + CParameter + CParameterEnumerationValue + CParameterEnumerationValues + CParameterRanges + CPlugin + CPoint + CPortGroup + CRectangle + CRecursiveMutex + CRingBufferControl + CScopedPointer + CScopedSafeLocale + CScopeLocker + CScopeTryLocker + CScopeUnlocker + CSignal + CSize + CSmallStackBuffer + CSmallStackRingBuffer + CStandaloneWindow + CString + CSubWidget + CThread + CTimePosition + CBarBeatTick + CTopLevelWidget + CTriangle + CUI + CVstGuiStandaloneWindow + CVulkanGraphicsContext + CVulkanImage + CWidget + CBaseEvent + CCharacterInputEvent + CKeyboardEvent + CMotionEvent + CMouseEvent + CPositionChangedEvent + CResizeEvent + CScrollEvent + CSpecialEvent + CWindow + CFileBrowserOptions + CButtons + CScopedGraphicsContext diff --git a/classApplication-members.html b/classApplication-members.html index 3d699cb8..9c32fecc 100644 --- a/classApplication-members.html +++ b/classApplication-members.html @@ -81,7 +81,7 @@ $(function() { diff --git a/classApplication.html b/classApplication.html index ae355ee2..fe47caf7 100644 --- a/classApplication.html +++ b/classApplication.html @@ -102,7 +102,8 @@ class Window

Detailed Description

Base DGL Application class.

One application instance is required for creating a window. There's no single/global application instance in DGL, and multiple windows can share the same app instance.

-

In standalone mode an application will automatically quit its event-loop when all its windows are closed.

+

In standalone mode an application will automatically quit its event-loop when all its windows are closed.

+

Unless stated otherwise, functions within this class are not thread-safe.

Constructor & Destructor Documentation

◆ Application()

@@ -201,7 +202,7 @@ class Window
-

Quit the application. This stops the event-loop and closes all Windows.

Note
This function is meant for standalones only, never call this from plugins.
+

Quit the application. This stops the event-loop and closes all Windows. This function is thread-safe.

Note
This function is meant for standalones only, never call this from plugins.
@@ -227,7 +228,7 @@ class Window
-

Check if the application is about to quit. Returning true means there's no event-loop running at the moment (or it's just about to stop).

+

Check if the application is about to quit. Returning true means there's no event-loop running at the moment (or it's just about to stop). This function is thread-safe.

@@ -246,7 +247,7 @@ class Window
-

Add a callback function to be triggered on every idle cycle. You can add more than one, and remove them at anytime with removeIdleCallback(). Idle callbacks trigger right after OS event handling and Window idle events (within the same cycle). There are no guarantees in terms of timing.

+

Add a callback function to be triggered on every idle cycle. You can add more than one, and remove them at anytime with removeIdleCallback(). Idle callbacks trigger right after OS event handling and Window idle events (within the same cycle). There are no guarantees in terms of timing, use Window::addIdleCallback for time-relative callbacks.

@@ -296,7 +297,7 @@ class Window diff --git a/classAudioMidiSyncHelper-members.html b/classAudioMidiSyncHelper-members.html index 9601aa26..1aa7db96 100644 --- a/classAudioMidiSyncHelper-members.html +++ b/classAudioMidiSyncHelper-members.html @@ -77,7 +77,7 @@ $(function() { diff --git a/classAudioMidiSyncHelper.html b/classAudioMidiSyncHelper.html index 6a646be8..c4c14231 100644 --- a/classAudioMidiSyncHelper.html +++ b/classAudioMidiSyncHelper.html @@ -214,7 +214,7 @@ uint32_t midiEventCount
AudioMidiSyncHelper
Definition: DistrhoPluginUtils.hpp:50
diff --git a/classButtonEventHandler-members.html b/classButtonEventHandler-members.html index b43c467b..f57454af 100644 --- a/classButtonEventHandler-members.html +++ b/classButtonEventHandler-members.html @@ -70,6 +70,8 @@ $(function() { + + @@ -84,13 +86,15 @@ $(function() { - - + + + +
ButtonEventHandler(SubWidget *self) (defined in ButtonEventHandler)ButtonEventHandlerexplicit
clearState() noexcept (defined in ButtonEventHandler)ButtonEventHandlerprotected
getLastClickPosition() const noexcept (defined in ButtonEventHandler)ButtonEventHandler
getLastMotionPosition() const noexcept (defined in ButtonEventHandler)ButtonEventHandler
getState() const noexcept (defined in ButtonEventHandler)ButtonEventHandlerprotected
isActive() noexcept (defined in ButtonEventHandler)ButtonEventHandler
isCheckable() const noexcept (defined in ButtonEventHandler)ButtonEventHandler
setCallback(Callback *callback) noexcept (defined in ButtonEventHandler)ButtonEventHandler
setCheckable(bool checkable) noexcept (defined in ButtonEventHandler)ButtonEventHandler
setChecked(bool checked, bool sendCallback) noexcept (defined in ButtonEventHandler)ButtonEventHandler
State enum name (defined in ButtonEventHandler)ButtonEventHandler
stateChanged(State state, State oldState) (defined in ButtonEventHandler)ButtonEventHandlerprotectedvirtual
setInternalCallback(Callback *callback) noexcept (defined in ButtonEventHandler)ButtonEventHandlerprotected
State enum name (defined in ButtonEventHandler)ButtonEventHandler
stateChanged(State state, State oldState) (defined in ButtonEventHandler)ButtonEventHandlerprotectedvirtual
triggerUserCallback(SubWidget *widget, int button) (defined in ButtonEventHandler)ButtonEventHandlerprotected
~ButtonEventHandler() (defined in ButtonEventHandler)ButtonEventHandler
diff --git a/classButtonEventHandler.html b/classButtonEventHandler.html index 9c89e063..b8c8ac2c 100644 --- a/classButtonEventHandler.html +++ b/classButtonEventHandler.html @@ -118,6 +118,12 @@ bool isCheckable () co void setCheckable (bool checkable) noexcept   + +Point< double > getLastClickPosition () const noexcept +  + +Point< double > getLastMotionPosition () const noexcept +  void setCallback (Callback *callback) noexcept   @@ -139,6 +145,12 @@ void clearState () noe virtual void stateChanged (State state, State oldState)   + +void setInternalCallback (Callback *callback) noexcept +  + +void triggerUserCallback (SubWidget *widget, int button) + 
The documentation for this class was generated from the following file: