iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IGraphicsIOS.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 "IGraphics_select.h"
14
15BEGIN_IPLUG_NAMESPACE
16BEGIN_IGRAPHICS_NAMESPACE
17
18extern void GetScreenDimensions(int& width, int& height);
19
20extern float GetScaleForScreen(int width, int height);
21
24class IGraphicsIOS final : public IGRAPHICS_DRAW_CLASS
25{
26public:
27 IGraphicsIOS(IGEditorDelegate& dlg, int w, int h, int fps, float scale);
28 virtual ~IGraphicsIOS();
29
30 void SetBundleID(const char* bundleID) { mBundleID.Set(bundleID); }
31 void SetAppGroupID(const char* appGroupID) { mAppGroupID.Set(appGroupID); }
32
33 void* OpenWindow(void* pWindow) override;
34 void CloseWindow() override;
35 bool WindowIsOpen() override;
36 void PlatformResize(bool parentHasResized) override;
37 void AttachPlatformView(const IRECT& r, void* pView) override;
38 void RemovePlatformView(void* pView) override;
39 void HidePlatformView(void* pView, bool hide) override;
40
41 void GetMouseLocation(float& x, float&y) const override;
42
43 EMsgBoxResult ShowMessageBox(const char* str, const char* title, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler) override;
44 void ForceEndUserEdit() override;
45
46 const char* GetPlatformAPIStr() override;
47
48 void UpdateTooltips() override {};
49
50 void PromptForFile(WDL_String& fileName, WDL_String& path, EFileAction action, const char* ext, IFileDialogCompletionHandlerFunc completionHandler) override;
51 void PromptForDirectory(WDL_String& dir, IFileDialogCompletionHandlerFunc completionHandler) override;
52 bool PromptForColor(IColor& color, const char* str, IColorPickerHandlerFunc func) override;
53
54 void HideMouseCursor(bool hide, bool lock) override {}; // NOOP
55 void MoveMouseCursor(float x, float y) override {}; // NOOP
56
57 bool OpenURL(const char* url, const char* msgWindowTitle, const char* confirmMsg, const char* errMsgOnFailure) override;
58
59 void* GetWindow() override;
60
61 const char* GetBundleID() const override { return mBundleID.Get(); }
62 const char* GetAppGroupID() const override { return mAppGroupID.Get(); }
63
64 static int GetUserOSVersion();
65
66 bool GetTextFromClipboard(WDL_String& str) override;
67 bool SetTextInClipboard(const char* str) override;
68
69 void LaunchBluetoothMidiDialog(float x, float y);
70
71 void AttachGestureRecognizer(EGestureType type) override;
72
73 bool PlatformSupportsMultiTouch() const override { return true; }
74
75 EUIAppearance GetUIAppearance() const override;
76
77protected:
78 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fileNameOrResID) override;
79 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style) override;
80 PlatformFontPtr LoadPlatformFont(const char* fontID, void* pData, int dataSize) override;
81 void CachePlatformFont(const char* fontID, const PlatformFontPtr& font) override;
82
83 IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) override;
84 void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) override;
85
86private:
87 void* mView = nullptr;
88 WDL_String mBundleID;
89 WDL_String mAppGroupID;
90};
91
92END_IGRAPHICS_NAMESPACE
93END_IPLUG_NAMESPACE
Used for choosing a drawing backend.
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
IGraphics platform class for IOS.
Definition: IGraphicsIOS.h:25
A class for setting the contents of a pop up menu.
Used to manage color data, independent of draw class/platform.
Used to manage a rectangular area, independent of draw class/platform.
IText is used to manage font and text/text entry style for a piece of text on the UI,...