Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
plugin_host_window.h
1// SPDX-FileCopyrightText: © 2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "plugins/iplugin_host_window.h"
7
8namespace zrythm::plugins
9{
10
19class JuceDocumentPluginHostWindow final
20 : private juce::DocumentWindow,
22{
23public:
24 using CloseHandler = std::function<void ()>;
25
26 JuceDocumentPluginHostWindow (
27 const utils::Utf8String &title,
28 CloseHandler close_handler);
29
36 void
37 setJuceComponentContentNonOwned (juce::Component * content_non_owned) override;
38
44 void setSizeAndCenter (int width, int height) override;
45
51 void setSize (int width, int height) override
52 {
53 juce::DocumentWindow::setSize (width, height);
54 }
55
56 void setVisible (bool shouldBeVisible) override
57 {
58 juce::DocumentWindow::setVisible (shouldBeVisible);
59 }
60
66 WId getEmbedWindowId () const override;
67
68private:
69 void closeButtonPressed () override;
70
71private:
72 CloseHandler close_handler_;
73};
74} // namespace zrythm::plugins
Interface for top-level plugin hosting windows.
void setSize(int width, int height) override
Set the window size without centering.
WId getEmbedWindowId() const override
Gets a native window handle to embed in.
void setSizeAndCenter(int width, int height) override
Sets the window size and centers it on the screen.
void setJuceComponentContentNonOwned(juce::Component *content_non_owned) override
Sets the JUCE component (normally a juce editor component) as the child of this window.
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38