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#include "utils/utf8_string.h"
8
9#include <juce_gui_basics/juce_gui_basics.h>
10
11namespace zrythm::plugins
12{
13
22class JuceDocumentPluginHostWindow final
23 : private juce::DocumentWindow,
25{
26public:
27 using CloseHandler = std::function<void ()>;
28
29 JuceDocumentPluginHostWindow (
30 const utils::Utf8String &title,
31 CloseHandler close_handler);
32
39 void
40 setJuceComponentContentNonOwned (juce::Component * content_non_owned) override;
41
47 void setSizeAndCenter (int width, int height) override;
48
54 void setSize (int width, int height) override
55 {
56 juce::DocumentWindow::setSize (width, height);
57 }
58
59 void setVisible (bool shouldBeVisible) override
60 {
61 juce::DocumentWindow::setVisible (shouldBeVisible);
62 }
63
69 WId getEmbedWindowId () const override;
70
71private:
72 void closeButtonPressed () override;
73
74private:
75 CloseHandler close_handler_;
76};
77} // 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:37