36 ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0)
37 : left (l), top (t), right (r), bottom (b)
47 int32 getWidth ()
const {
return right - left; }
48 int32 getHeight ()
const {
return bottom - top; }
51SMTG_TYPE_SIZE_CHECK (
ViewRect, 16, 16, 16, 16)
62const FIDString kPlatformTypeHWND = "HWND";
66const FIDString kPlatformTypeHIView = "HIView";
70const FIDString kPlatformTypeNSView = "NSView";
74const FIDString kPlatformTypeUIView = "UIView";
79const FIDString kPlatformTypeX11EmbedWindowID = "X11EmbedWindowID";
137 virtual tresult PLUGIN_API
attached (
void* parent, FIDString type) = 0;
144 virtual tresult PLUGIN_API
onWheel (
float distance) = 0;
153 virtual tresult PLUGIN_API
onKeyDown (char16 key, int16 keyCode, int16 modifiers) = 0;
160 virtual tresult PLUGIN_API
onKeyUp (char16 key, int16 keyCode, int16 modifiers) = 0;
170 virtual tresult PLUGIN_API
onFocus (TBool state) = 0;
182 static const FUID iid;
185DECLARE_CLASS_IID (
IPlugView, 0x5BC32507, 0xD06049EA, 0xA6151B52, 0x2B755B29)
204 static const FUID iid;
207DECLARE_CLASS_IID (
IPlugFrame, 0x367FAF01, 0xAFA94693, 0x8D4DA2A0, 0xED0882A3)
213using TimerInterval = uint64;
214using FileDescriptor =
int;
223class IEventHandler :
public FUnknown
226 virtual void PLUGIN_API onFDIsSet (FileDescriptor fd) = 0;
228 static const FUID iid;
230DECLARE_CLASS_IID (IEventHandler, 0x561E65C9, 0x13A0496F, 0x813A2C35, 0x654D7983)
239class ITimerHandler : public FUnknown
242 virtual void PLUGIN_API onTimer () = 0;
244 static const FUID iid;
246DECLARE_CLASS_IID (ITimerHandler, 0x10BDD94F, 0x41424774, 0x821FAD8F, 0xECA72CA9)
263class IRunLoop : public FUnknown
266 virtual tresult PLUGIN_API registerEventHandler (IEventHandler* handler, FileDescriptor fd) = 0;
267 virtual tresult PLUGIN_API unregisterEventHandler (IEventHandler* handler) = 0;
269 virtual tresult PLUGIN_API registerTimer (ITimerHandler* handler,
270 TimerInterval milliseconds) = 0;
271 virtual tresult PLUGIN_API unregisterTimer (ITimerHandler* handler) = 0;
273 static const FUID iid;
275DECLARE_CLASS_IID (IRunLoop, 0x18C35366, 0x97764F1A, 0x9C5B8385, 0x7A871389)
Handling 16 Byte Globally Unique Identifiers.
The basic interface of all interfaces.
Callback interface passed to IPlugView.
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.
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.
Graphical rectangle structure.