1 /**
2 * Definition of IGraphics, which controls the UI from the host point of view.
3 *
4 * Copyright: Copyright Auburn Sounds 2015 and later.
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
6 * Authors: Guillaume Piolat
7 */8 moduledplug.client.graphics;
9 10 importdplug.client.client;
11 importdplug.client.daw;
12 13 enumGraphicsBackend14 {
15 autodetect,
16 win32,
17 carbon,
18 cocoa,
19 x1120 }
21 22 /// Plugin GUI23 interfaceIGraphics24 {
25 nothrow:
26 @nogc:
27 /// Create an UI, return a system-specific handle for the window/view28 abstractvoid* openUI(void* parentInfo,
29 void* controlInfo,
30 IClientclient,
31 GraphicsBackendbackend);
32 33 /// Close that UI.34 abstractvoidcloseUI();
35 36 /// Get the current plugin UI size in logical pixels.37 abstractvoidgetGUISize(int* widthLogicalPixels, int* heightLogicalPixels);
38 39 /// Used by VST3.40 /// Returns: `true` if this is resizeable in terms of logical pixels.41 /// This should succeed even if the UI is closed.42 abstractboolisResizeable();
43 44 /// Used by VST3.45 /// Returns: Maximum valid size that still fits into a `inoutWidth x inoutHeight` rectangle.46 /// When one of the criterion is impossible to satisfy, returning a valid size is preferred.47 /// This should work even if the UI is closed.48 abstractvoidgetMaxSmallerValidSize(int* inoutWidth, int* inoutHeight);
49 50 /// Used by VST3.51 /// Returns: Nearest, valid size in logical pixels, given an input size in logical pixels.52 /// This should work even if the UI is closed.53 /// Hack: Used by FLP format to find minimum and maximum size of window in logical pixels.54 abstractvoidgetNearestValidSize(int* inoutWidth, int* inoutHeight);
55 56 /// Used by VST3.57 /// Tells the native window to resize itself.58 /// Called by the host when it's one resizing the parent window, and wants our window to follow suit.59 /// This is to be forwarded to IWindow.60 /// Returns: `true` if properly resized.61 abstractboolnativeWindowResize(intnewWidthLogicalPixels, intnewHeightLogicalPixels);
62 }
63