mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-15 21:15:51 +02:00
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:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user