iPlug 2: IPlugPlatformView.h Source File

1

2

3

4

5

6

7

8

9

10

11#pragma once

12

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:

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.