1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +00:00

Added hidden internal helper function to access plugin carbon window wrappers

This commit is contained in:
jules 2016-02-17 17:05:17 +00:00
parent 5835bbc363
commit 2343dc153d

View file

@ -40,9 +40,9 @@ class CarbonViewWrapperComponent : public Component,
public:
CarbonViewWrapperComponent()
: ComponentMovementWatcher (this),
carbonWindow (nil),
keepPluginWindowWhenHidden (false),
wrapperWindow (0),
carbonWindow (0),
wrapperWindow (nil),
embeddedView (0),
recursiveResize (false),
repaintChildOnCreation (true)
@ -73,7 +73,7 @@ public:
void createWindow()
{
if (wrapperWindow == 0)
if (wrapperWindow == nil)
{
Rect r;
r.left = (short) getScreenX();
@ -135,7 +135,7 @@ public:
removeView (embeddedView);
embeddedView = 0;
if (wrapperWindow != 0)
if (wrapperWindow != nil)
{
NSWindow* ownerWindow = getOwnerWindow();
@ -147,7 +147,7 @@ public:
RemoveEventHandler (eventHandlerRef);
DisposeWindow (wrapperWindow);
wrapperWindow = 0;
wrapperWindow = nil;
}
}
@ -192,7 +192,7 @@ public:
HIViewSetFrame (embeddedView, &r);
}
if (wrapperWindow != 0)
if (wrapperWindow != nil)
{
jassert (getTopLevelComponent()->getDesktopScaleFactor() == 1.0f);
Rectangle<int> screenBounds (getScreenBounds() * Desktop::getInstance().getGlobalScaleFactor());
@ -316,11 +316,11 @@ public:
return ((CarbonViewWrapperComponent*) userData)->carbonEventHandler (nextHandlerRef, event);
}
NSWindow* carbonWindow;
bool keepPluginWindowWhenHidden;
protected:
WindowRef wrapperWindow;
NSWindow* carbonWindow;
HIViewRef embeddedView;
bool recursiveResize, repaintChildOnCreation;
Time creationTime;
@ -330,4 +330,15 @@ protected:
NSWindow* getOwnerWindow() const { return [((NSView*) getWindowHandle()) window]; }
};
//==============================================================================
// Non-public utility function that hosts can use if they need to get hold of the
// internals of a carbon wrapper window..
void* getCarbonWindow (Component* possibleCarbonComponent)
{
if (CarbonViewWrapperComponent* cv = dynamic_cast<CarbonViewWrapperComponent*> (possibleCarbonComponent))
return cv->carbonWindow;
return nullptr;
}
#endif // JUCE_MAC_CARBONVIEWWRAPPERCOMPONENT_H_INCLUDED