3 * Copyright (C) 2014-2022 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef CARLA_PLUGIN_UI_HPP_INCLUDED
19 #define CARLA_PLUGIN_UI_HPP_INCLUDED
21 #include "CarlaUtils.hpp"
23 // -----------------------------------------------------
30 virtual ~Callback() {}
31 virtual void handlePluginUIClosed() = 0;
32 virtual void handlePluginUIResized(uint width
, uint height
) = 0;
35 virtual ~CarlaPluginUI() {}
36 virtual void show() = 0;
37 virtual void hide() = 0;
38 virtual void focus() = 0;
39 virtual void idle() = 0;
40 virtual void setMinimumSize(uint with
, uint height
) = 0;
41 virtual void setSize(uint with
, uint height
, bool forceUpdate
, bool resizeChild
) = 0;
42 virtual void setTitle(const char* title
) = 0;
43 virtual void setChildWindow(void* ptr
) = 0;
44 virtual void setTransientWinId(uintptr_t winId
) = 0;
45 virtual void* getPtr() const noexcept
= 0;
47 virtual void* getDisplay() const noexcept
= 0;
50 #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
51 static bool tryTransientWinIdMatch(uintptr_t pid
, const char* uiTitle
, uintptr_t winId
, bool centerUI
);
55 static CarlaPluginUI
* newCocoa(Callback
*, uintptr_t, bool isStandalone
, bool isResizable
);
58 static CarlaPluginUI
* newWindows(Callback
*, uintptr_t, bool isStandalone
, bool isResizable
);
61 static CarlaPluginUI
* newX11(Callback
*, uintptr_t, bool isStandalone
, bool isResizable
, bool canMonitorChildren
);
70 CarlaPluginUI(Callback
* const cb
,
71 const bool isStandalone
,
72 const bool isResizable
) noexcept
74 fIsStandalone(isStandalone
),
75 fIsResizable(isResizable
),
78 CARLA_DECLARE_NON_COPYABLE(CarlaPluginUI
)
81 // -----------------------------------------------------
83 #endif // CARLA_PLUGIN_UI_HPP_INCLUDED