Rename win32-editor.h -> editor.h

Since I no longer intent to do separate X11 handling on the plugin side
This commit is contained in:
Robbert van der Helm
2020-03-17 21:37:53 +01:00
parent 1c17513936
commit e2d8c0883f
4 changed files with 5 additions and 4 deletions
+47
View File
@@ -0,0 +1,47 @@
#define NOMINMAX
#define NOSERVICE
#define NOMCX
#define NOIMM
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <memory>
#include <optional>
#include <string>
/**
* A wrapper around the win32 windowing API to create and destroy editor
* windows. A VST plugin can embed itself in that window, and we can then later
* embed the window in a VST host provided X11 window.
*/
class Win32Editor {
public:
/**
* @param window_class_name The name for the window class for editor
* windows.
*/
Win32Editor(std::string window_class_name);
/**
* Open a window and return a handle to the new Win32 window that can be
* used by the hosted VST plugin.
*/
HWND open();
void close();
/**
* Return the X11 window handle for the window if it's currently open.
*/
std::optional<intptr_t> get_x11_handle();
private:
ATOM window_class;
/**
* A pointer to the currently active window. Will be a null pointer if no
* window is active.
*/
std::optional<
std::unique_ptr<std::remove_pointer_t<HWND>, decltype(&DestroyWindow)>>
window_handle;
};