iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IPlugPlatformView.h
1 /*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#pragma once
12
13#include "IPlugPlatform.h"
14#include "wdlstring.h"
15#include <functional>
16
17#if defined OS_MAC
18 #define PLATFORM_VIEW NSView
19 #define PLATFORM_RECT NSRect
20 #define MAKERECT NSMakeRect
21#elif defined OS_IOS
22 #define PLATFORM_VIEW UIView
23 #define PLATFORM_RECT CGRect
24 #define MAKERECT CGRectMake
25#elif defined OS_WIN
26 #define PLATFORM_VIEW HWND
27#endif
28
29BEGIN_IPLUG_NAMESPACE
30
33{
34public:
35 IPlatformView(bool opaque = true);
36 virtual ~IPlatformView();
37
38 void* CreatePlatformView(void* pParent, float x, float y, float w, float h, float scale = 1.);
39 void RemovePlatformView();
40
41 void SetChildViewBounds(float x, float y, float w, float h, float scale = 1.);
42
43private:
44 bool mOpaque = true;
45 void* mPlatformView = nullptr;
46};
47
48END_IPLUG_NAMESPACE
Include to get consistently named preprocessor macros for different platforms and logging functionali...
IPlatformView is a base interface for hosting a platform view inside an IPlug plug-in's UI.