JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
iplugview.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : SDK Core
3//
4// Category : SDK GUI Interfaces
5// Filename : pluginterfaces/gui/iplugview.h
6// Created by : Steinberg, 12/2007
7// Description : Plug-in User Interface
8//
9//-----------------------------------------------------------------------------
10// This file is part of a Steinberg SDK. It is subject to the license terms
11// in the LICENSE file found in the top-level directory of this distribution
12// and at www.steinberg.net/sdklicenses.
13// No part of the SDK, including this file, may be copied, modified, propagated,
14// or distributed except according to the terms contained in the LICENSE file.
15//-----------------------------------------------------------------------------
16
17#pragma once
18
21
22namespace Steinberg {
23
24class IPlugFrame;
25
26//------------------------------------------------------------------------
30//------------------------------------------------------------------------
35{
36 ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0)
37 : left (l), top (t), right (r), bottom (b)
38 {
39 }
40
41 int32 left;
42 int32 top;
43 int32 right;
44 int32 bottom;
45
46 //--- ---------------------------------------------------------------------
47 int32 getWidth () const { return right - left; }
48 int32 getHeight () const { return bottom - top; }
49};
50
51SMTG_TYPE_SIZE_CHECK (ViewRect, 16, 16, 16, 16)
52
53//------------------------------------------------------------------------
62const FIDString kPlatformTypeHWND = "HWND";
63
66const FIDString kPlatformTypeHIView = "HIView";
67
70const FIDString kPlatformTypeNSView = "NSView";
71
74const FIDString kPlatformTypeUIView = "UIView";
75
79const FIDString kPlatformTypeX11EmbedWindowID = "X11EmbedWindowID";
80
82//------------------------------------------------------------------------
83
84//------------------------------------------------------------------------
122class IPlugView : public FUnknown
123{
124public:
125//------------------------------------------------------------------------
128 virtual tresult PLUGIN_API isPlatformTypeSupported (FIDString type) = 0;
129
137 virtual tresult PLUGIN_API attached (void* parent, FIDString type) = 0;
138
141 virtual tresult PLUGIN_API removed () = 0;
142
144 virtual tresult PLUGIN_API onWheel (float distance) = 0;
145
153 virtual tresult PLUGIN_API onKeyDown (char16 key, int16 keyCode, int16 modifiers) = 0;
154
160 virtual tresult PLUGIN_API onKeyUp (char16 key, int16 keyCode, int16 modifiers) = 0;
161
163 virtual tresult PLUGIN_API getSize (ViewRect* size) = 0;
164
167 virtual tresult PLUGIN_API onSize (ViewRect* newSize) = 0;
168
170 virtual tresult PLUGIN_API onFocus (TBool state) = 0;
171
173 virtual tresult PLUGIN_API setFrame (IPlugFrame* frame) = 0;
174
176 virtual tresult PLUGIN_API canResize () = 0;
177
180 virtual tresult PLUGIN_API checkSizeConstraint (ViewRect* rect) = 0;
181//------------------------------------------------------------------------
182 static const FUID iid;
183};
184
185DECLARE_CLASS_IID (IPlugView, 0x5BC32507, 0xD06049EA, 0xA6151B52, 0x2B755B29)
186
187//------------------------------------------------------------------------
196class IPlugFrame : public FUnknown
197{
198public:
199//------------------------------------------------------------------------
202 virtual tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* newSize) = 0;
203//------------------------------------------------------------------------
204 static const FUID iid;
205};
206
207DECLARE_CLASS_IID (IPlugFrame, 0x367FAF01, 0xAFA94693, 0x8D4DA2A0, 0xED0882A3)
208
209#if SMTG_OS_LINUX
210//------------------------------------------------------------------------
211namespace Linux {
212
213using TimerInterval = uint64;
214using FileDescriptor = int;
215
216//------------------------------------------------------------------------
223class IEventHandler : public FUnknown
224{
225public:
226 virtual void PLUGIN_API onFDIsSet (FileDescriptor fd) = 0;
227//------------------------------------------------------------------------
228 static const FUID iid;
229};
230DECLARE_CLASS_IID (IEventHandler, 0x561E65C9, 0x13A0496F, 0x813A2C35, 0x654D7983)
231
232//------------------------------------------------------------------------
239class ITimerHandler : public FUnknown
240{
241public:
242 virtual void PLUGIN_API onTimer () = 0;
243//------------------------------------------------------------------------
244 static const FUID iid;
245};
246DECLARE_CLASS_IID (ITimerHandler, 0x10BDD94F, 0x41424774, 0x821FAD8F, 0xECA72CA9)
247
248//------------------------------------------------------------------------
263class IRunLoop : public FUnknown
264{
265public:
266 virtual tresult PLUGIN_API registerEventHandler (IEventHandler* handler, FileDescriptor fd) = 0;
267 virtual tresult PLUGIN_API unregisterEventHandler (IEventHandler* handler) = 0;
268
269 virtual tresult PLUGIN_API registerTimer (ITimerHandler* handler,
270 TimerInterval milliseconds) = 0;
271 virtual tresult PLUGIN_API unregisterTimer (ITimerHandler* handler) = 0;
272//------------------------------------------------------------------------
273 static const FUID iid;
274};
275DECLARE_CLASS_IID (IRunLoop, 0x18C35366, 0x97764F1A, 0x9C5B8385, 0x7A871389)
276
277//------------------------------------------------------------------------
278} // namespace Linux
279
280#endif
281
282//------------------------------------------------------------------------
283} // namespace Steinberg
Handling 16 Byte Globally Unique Identifiers.
Definition funknown.h:241
The basic interface of all interfaces.
Definition funknown.h:375
Callback interface passed to IPlugView.
Definition iplugview.h:197
virtual tresult PLUGIN_API resizeView(IPlugView *view, ViewRect *newSize)=0
Called to inform the host about the resize of a given view.
Plug-in definition of a view.
Definition iplugview.h:123
virtual tresult PLUGIN_API onSize(ViewRect *newSize)=0
Resizes the platform representation of the view to the given rect.
virtual tresult PLUGIN_API canResize()=0
Is view sizable by user.
virtual tresult PLUGIN_API onWheel(float distance)=0
Handling of mouse wheel.
virtual tresult PLUGIN_API removed()=0
The parent window of the view is about to be destroyed.
virtual tresult PLUGIN_API onKeyUp(char16 key, int16 keyCode, int16 modifiers)=0
Handling of keyboard events : Key Up.
virtual tresult PLUGIN_API attached(void *parent, FIDString type)=0
The parent window of the view has been created, the (platform) representation of the view should now ...
virtual tresult PLUGIN_API isPlatformTypeSupported(FIDString type)=0
Is Platform UI Type supported.
virtual tresult PLUGIN_API getSize(ViewRect *size)=0
Returns the size of the platform representation of the view.
virtual tresult PLUGIN_API checkSizeConstraint(ViewRect *rect)=0
On live resize this is called to check if the view can be resized to the given rect,...
virtual tresult PLUGIN_API onKeyDown(char16 key, int16 keyCode, int16 modifiers)=0
Handling of keyboard events : Key Down.
virtual tresult PLUGIN_API onFocus(TBool state)=0
Focus changed message.
virtual tresult PLUGIN_API setFrame(IPlugFrame *frame)=0
Sets IPlugFrame object to allow the plug-in to inform the host about resizing.
typedef int
Graphical rectangle structure.
Definition iplugview.h:35