committed by
GitHub
47 changed files with 1836 additions and 1656 deletions
@ -0,0 +1,15 @@ |
|||
//
|
|||
// Created by Dan Walmsley on 04/05/2022.
|
|||
// Copyright (c) 2022 Avalonia. All rights reserved.
|
|||
//
|
|||
|
|||
#ifndef AVALONIA_NATIVE_OSX_INSWINDOWHOLDER_H |
|||
#define AVALONIA_NATIVE_OSX_INSWINDOWHOLDER_H |
|||
|
|||
struct INSWindowHolder |
|||
{ |
|||
virtual AvnWindow* _Nonnull GetNSWindow () = 0; |
|||
virtual AvnView* _Nonnull GetNSView () = 0; |
|||
}; |
|||
|
|||
#endif //AVALONIA_NATIVE_OSX_INSWINDOWHOLDER_H
|
|||
@ -0,0 +1,18 @@ |
|||
//
|
|||
// Created by Dan Walmsley on 04/05/2022.
|
|||
// Copyright (c) 2022 Avalonia. All rights reserved.
|
|||
//
|
|||
|
|||
#ifndef AVALONIA_NATIVE_OSX_IWINDOWSTATECHANGED_H |
|||
#define AVALONIA_NATIVE_OSX_IWINDOWSTATECHANGED_H |
|||
|
|||
struct IWindowStateChanged |
|||
{ |
|||
virtual void WindowStateChanged () = 0; |
|||
virtual void StartStateTransition () = 0; |
|||
virtual void EndStateTransition () = 0; |
|||
virtual SystemDecorations Decorations () = 0; |
|||
virtual AvnWindowState WindowState () = 0; |
|||
}; |
|||
|
|||
#endif //AVALONIA_NATIVE_OSX_IWINDOWSTATECHANGED_H
|
|||
@ -0,0 +1,23 @@ |
|||
//
|
|||
// Created by Dan Walmsley on 04/05/2022.
|
|||
// Copyright (c) 2022 Avalonia. All rights reserved.
|
|||
//
|
|||
|
|||
#ifndef AVALONIA_NATIVE_OSX_RESIZESCOPE_H |
|||
#define AVALONIA_NATIVE_OSX_RESIZESCOPE_H |
|||
|
|||
#include "window.h" |
|||
#include "avalonia-native.h" |
|||
|
|||
class ResizeScope |
|||
{ |
|||
public: |
|||
ResizeScope(AvnView* _Nonnull view, AvnPlatformResizeReason reason); |
|||
|
|||
~ResizeScope(); |
|||
private: |
|||
AvnView* _Nonnull _view; |
|||
AvnPlatformResizeReason _restore; |
|||
}; |
|||
|
|||
#endif //AVALONIA_NATIVE_OSX_RESIZESCOPE_H
|
|||
@ -0,0 +1,17 @@ |
|||
// |
|||
// Created by Dan Walmsley on 04/05/2022. |
|||
// Copyright (c) 2022 Avalonia. All rights reserved. |
|||
// |
|||
|
|||
#import <AppKit/AppKit.h> |
|||
#include "ResizeScope.h" |
|||
|
|||
ResizeScope::ResizeScope(AvnView *view, AvnPlatformResizeReason reason) { |
|||
_view = view; |
|||
_restore = [view getResizeReason]; |
|||
[view setResizeReason:reason]; |
|||
} |
|||
|
|||
ResizeScope::~ResizeScope() { |
|||
[_view setResizeReason:_restore]; |
|||
} |
|||
@ -0,0 +1,119 @@ |
|||
//
|
|||
// Created by Dan Walmsley on 04/05/2022.
|
|||
// Copyright (c) 2022 Avalonia. All rights reserved.
|
|||
//
|
|||
|
|||
#ifndef AVALONIA_NATIVE_OSX_WINDOWBASEIMPL_H |
|||
#define AVALONIA_NATIVE_OSX_WINDOWBASEIMPL_H |
|||
|
|||
#import "rendertarget.h" |
|||
#include "INSWindowHolder.h" |
|||
|
|||
class WindowBaseImpl : public virtual ComObject, |
|||
public virtual IAvnWindowBase, |
|||
public INSWindowHolder { |
|||
private: |
|||
NSCursor *cursor; |
|||
|
|||
public: |
|||
FORWARD_IUNKNOWN() |
|||
|
|||
BEGIN_INTERFACE_MAP() |
|||
INTERFACE_MAP_ENTRY(IAvnWindowBase, IID_IAvnWindowBase) |
|||
END_INTERFACE_MAP() |
|||
|
|||
virtual ~WindowBaseImpl() { |
|||
View = NULL; |
|||
Window = NULL; |
|||
} |
|||
|
|||
AutoFitContentView *StandardContainer; |
|||
AvnView *View; |
|||
AvnWindow *Window; |
|||
ComPtr<IAvnWindowBaseEvents> BaseEvents; |
|||
ComPtr<IAvnGlContext> _glContext; |
|||
NSObject <IRenderTarget> *renderTarget; |
|||
AvnPoint lastPositionSet; |
|||
NSString *_lastTitle; |
|||
|
|||
bool _shown; |
|||
bool _inResize; |
|||
|
|||
WindowBaseImpl(IAvnWindowBaseEvents *events, IAvnGlContext *gl); |
|||
|
|||
virtual HRESULT ObtainNSWindowHandle(void **ret) override; |
|||
|
|||
virtual HRESULT ObtainNSWindowHandleRetained(void **ret) override; |
|||
|
|||
virtual HRESULT ObtainNSViewHandle(void **ret) override; |
|||
|
|||
virtual HRESULT ObtainNSViewHandleRetained(void **ret) override; |
|||
|
|||
virtual AvnWindow *GetNSWindow() override; |
|||
|
|||
virtual AvnView *GetNSView() override; |
|||
|
|||
virtual HRESULT Show(bool activate, bool isDialog) override; |
|||
|
|||
virtual bool ShouldTakeFocusOnShow(); |
|||
|
|||
virtual HRESULT Hide() override; |
|||
|
|||
virtual HRESULT Activate() override; |
|||
|
|||
virtual HRESULT SetTopMost(bool value) override; |
|||
|
|||
virtual HRESULT Close() override; |
|||
|
|||
virtual HRESULT GetClientSize(AvnSize *ret) override; |
|||
|
|||
virtual HRESULT GetFrameSize(AvnSize *ret) override; |
|||
|
|||
virtual HRESULT GetScaling(double *ret) override; |
|||
|
|||
virtual HRESULT SetMinMaxSize(AvnSize minSize, AvnSize maxSize) override; |
|||
|
|||
virtual HRESULT Resize(double x, double y, AvnPlatformResizeReason reason) override; |
|||
|
|||
virtual HRESULT Invalidate(__attribute__((unused)) AvnRect rect) override; |
|||
|
|||
virtual HRESULT SetMainMenu(IAvnMenu *menu) override; |
|||
|
|||
virtual HRESULT BeginMoveDrag() override; |
|||
|
|||
virtual HRESULT BeginResizeDrag(__attribute__((unused)) AvnWindowEdge edge) override; |
|||
|
|||
virtual HRESULT GetPosition(AvnPoint *ret) override; |
|||
|
|||
virtual HRESULT SetPosition(AvnPoint point) override; |
|||
|
|||
virtual HRESULT PointToClient(AvnPoint point, AvnPoint *ret) override; |
|||
|
|||
virtual HRESULT PointToScreen(AvnPoint point, AvnPoint *ret) override; |
|||
|
|||
virtual HRESULT ThreadSafeSetSwRenderedFrame(AvnFramebuffer *fb, IUnknown *dispose) override; |
|||
|
|||
virtual HRESULT SetCursor(IAvnCursor *cursor) override; |
|||
|
|||
virtual void UpdateCursor(); |
|||
|
|||
virtual HRESULT CreateGlRenderTarget(IAvnGlSurfaceRenderTarget **ppv) override; |
|||
|
|||
virtual HRESULT CreateNativeControlHost(IAvnNativeControlHost **retOut) override; |
|||
|
|||
virtual HRESULT SetBlurEnabled(bool enable) override; |
|||
|
|||
virtual HRESULT BeginDragAndDropOperation(AvnDragDropEffects effects, AvnPoint point, |
|||
IAvnClipboard *clipboard, IAvnDndResultCallback *cb, |
|||
void *sourceHandle) override; |
|||
|
|||
virtual bool IsDialog(); |
|||
|
|||
protected: |
|||
virtual NSWindowStyleMask GetStyle(); |
|||
|
|||
void UpdateStyle(); |
|||
|
|||
}; |
|||
|
|||
#endif //AVALONIA_NATIVE_OSX_WINDOWBASEIMPL_H
|
|||
@ -0,0 +1,505 @@ |
|||
// |
|||
// Created by Dan Walmsley on 04/05/2022. |
|||
// Copyright (c) 2022 Avalonia. All rights reserved. |
|||
// |
|||
|
|||
#import <AppKit/AppKit.h> |
|||
#include "common.h" |
|||
#import "window.h" |
|||
#include "menu.h" |
|||
#include "rendertarget.h" |
|||
#include "automation.h" |
|||
#import "WindowBaseImpl.h" |
|||
#import "cursor.h" |
|||
#include "ResizeScope.h" |
|||
|
|||
WindowBaseImpl::WindowBaseImpl(IAvnWindowBaseEvents *events, IAvnGlContext *gl) { |
|||
_shown = false; |
|||
_inResize = false; |
|||
BaseEvents = events; |
|||
_glContext = gl; |
|||
renderTarget = [[IOSurfaceRenderTarget alloc] initWithOpenGlContext:gl]; |
|||
View = [[AvnView alloc] initWithParent:this]; |
|||
StandardContainer = [[AutoFitContentView new] initWithContent:View]; |
|||
|
|||
Window = [[AvnWindow alloc] initWithParent:this]; |
|||
[Window setContentView:StandardContainer]; |
|||
|
|||
lastPositionSet.X = 100; |
|||
lastPositionSet.Y = 100; |
|||
_lastTitle = @""; |
|||
|
|||
[Window setStyleMask:NSWindowStyleMaskBorderless]; |
|||
[Window setBackingType:NSBackingStoreBuffered]; |
|||
|
|||
[Window setOpaque:false]; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::ObtainNSViewHandle(void **ret) { |
|||
START_COM_CALL; |
|||
|
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
*ret = (__bridge void *) View; |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::ObtainNSViewHandleRetained(void **ret) { |
|||
START_COM_CALL; |
|||
|
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
*ret = (__bridge_retained void *) View; |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
AvnWindow *WindowBaseImpl::GetNSWindow() { |
|||
return Window; |
|||
} |
|||
|
|||
AvnView *WindowBaseImpl::GetNSView() { |
|||
return View; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::ObtainNSWindowHandleRetained(void **ret) { |
|||
START_COM_CALL; |
|||
|
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
*ret = (__bridge_retained void *) Window; |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::Show(bool activate, bool isDialog) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
SetPosition(lastPositionSet); |
|||
UpdateStyle(); |
|||
|
|||
[Window setTitle:_lastTitle]; |
|||
|
|||
if (ShouldTakeFocusOnShow() && activate) { |
|||
[Window orderFront:Window]; |
|||
[Window makeKeyAndOrderFront:Window]; |
|||
[Window makeFirstResponder:View]; |
|||
[NSApp activateIgnoringOtherApps:YES]; |
|||
} else { |
|||
[Window orderFront:Window]; |
|||
} |
|||
|
|||
_shown = true; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
bool WindowBaseImpl::ShouldTakeFocusOnShow() { |
|||
return true; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::ObtainNSWindowHandle(void **ret) { |
|||
START_COM_CALL; |
|||
|
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
*ret = (__bridge void *) Window; |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::Hide() { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (Window != nullptr) { |
|||
[Window orderOut:Window]; |
|||
[Window restoreParentWindow]; |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::Activate() { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (Window != nullptr) { |
|||
[Window makeKeyAndOrderFront:nil]; |
|||
[NSApp activateIgnoringOtherApps:YES]; |
|||
} |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::SetTopMost(bool value) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
[Window setLevel:value ? NSFloatingWindowLevel : NSNormalWindowLevel]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::Close() { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (Window != nullptr) { |
|||
auto window = Window; |
|||
Window = nullptr; |
|||
|
|||
try { |
|||
// Seems to throw sometimes on application exit. |
|||
[window close]; |
|||
} |
|||
catch (NSException *) {} |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::GetClientSize(AvnSize *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) |
|||
return E_POINTER; |
|||
|
|||
auto frame = [View frame]; |
|||
ret->Width = frame.size.width; |
|||
ret->Height = frame.size.height; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::GetFrameSize(AvnSize *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) |
|||
return E_POINTER; |
|||
|
|||
auto frame = [Window frame]; |
|||
ret->Width = frame.size.width; |
|||
ret->Height = frame.size.height; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::GetScaling(double *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) |
|||
return E_POINTER; |
|||
|
|||
if (Window == nullptr) { |
|||
*ret = 1; |
|||
return S_OK; |
|||
} |
|||
|
|||
*ret = [Window backingScaleFactor]; |
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::SetMinMaxSize(AvnSize minSize, AvnSize maxSize) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
[Window setMinSize:ToNSSize(minSize)]; |
|||
[Window setMaxSize:ToNSSize(maxSize)]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::Resize(double x, double y, AvnPlatformResizeReason reason) { |
|||
if (_inResize) { |
|||
return S_OK; |
|||
} |
|||
|
|||
_inResize = true; |
|||
|
|||
START_COM_CALL; |
|||
auto resizeBlock = ResizeScope(View, reason); |
|||
|
|||
@autoreleasepool { |
|||
auto maxSize = [Window maxSize]; |
|||
auto minSize = [Window minSize]; |
|||
|
|||
if (x < minSize.width) { |
|||
x = minSize.width; |
|||
} |
|||
|
|||
if (y < minSize.height) { |
|||
y = minSize.height; |
|||
} |
|||
|
|||
if (x > maxSize.width) { |
|||
x = maxSize.width; |
|||
} |
|||
|
|||
if (y > maxSize.height) { |
|||
y = maxSize.height; |
|||
} |
|||
|
|||
@try { |
|||
if (!_shown) { |
|||
BaseEvents->Resized(AvnSize{x, y}, reason); |
|||
} |
|||
|
|||
[Window setContentSize:NSSize{x, y}]; |
|||
[Window invalidateShadow]; |
|||
} |
|||
@finally { |
|||
_inResize = false; |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::Invalidate(__attribute__((unused)) AvnRect rect) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
[View setNeedsDisplayInRect:[View frame]]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::SetMainMenu(IAvnMenu *menu) { |
|||
START_COM_CALL; |
|||
|
|||
auto nativeMenu = dynamic_cast<AvnAppMenu *>(menu); |
|||
|
|||
auto nsmenu = nativeMenu->GetNative(); |
|||
|
|||
[Window applyMenu:nsmenu]; |
|||
|
|||
if ([Window isKeyWindow]) { |
|||
[Window showWindowMenuWithAppMenu]; |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::BeginMoveDrag() { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
auto lastEvent = [View lastMouseDownEvent]; |
|||
|
|||
if (lastEvent == nullptr) { |
|||
return S_OK; |
|||
} |
|||
|
|||
[Window performWindowDragWithEvent:lastEvent]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::BeginResizeDrag(__attribute__((unused)) AvnWindowEdge edge) { |
|||
START_COM_CALL; |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::GetPosition(AvnPoint *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
auto frame = [Window frame]; |
|||
|
|||
ret->X = frame.origin.x; |
|||
ret->Y = frame.origin.y + frame.size.height; |
|||
|
|||
*ret = ConvertPointY(*ret); |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::SetPosition(AvnPoint point) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
lastPositionSet = point; |
|||
[Window setFrameTopLeftPoint:ToNSPoint(ConvertPointY(point))]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::PointToClient(AvnPoint point, AvnPoint *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
point = ConvertPointY(point); |
|||
NSRect convertRect = [Window convertRectFromScreen:NSMakeRect(point.X, point.Y, 0.0, 0.0)]; |
|||
auto viewPoint = NSMakePoint(convertRect.origin.x, convertRect.origin.y); |
|||
|
|||
*ret = [View translateLocalPoint:ToAvnPoint(viewPoint)]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::PointToScreen(AvnPoint point, AvnPoint *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
auto cocoaViewPoint = ToNSPoint([View translateLocalPoint:point]); |
|||
NSRect convertRect = [Window convertRectToScreen:NSMakeRect(cocoaViewPoint.x, cocoaViewPoint.y, 0.0, 0.0)]; |
|||
auto cocoaScreenPoint = NSPointFromCGPoint(NSMakePoint(convertRect.origin.x, convertRect.origin.y)); |
|||
*ret = ConvertPointY(ToAvnPoint(cocoaScreenPoint)); |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::ThreadSafeSetSwRenderedFrame(AvnFramebuffer *fb, IUnknown *dispose) { |
|||
START_COM_CALL; |
|||
|
|||
[View setSwRenderedFrame:fb dispose:dispose]; |
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::SetCursor(IAvnCursor *cursor) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
Cursor *avnCursor = dynamic_cast<Cursor *>(cursor); |
|||
this->cursor = avnCursor->GetNative(); |
|||
UpdateCursor(); |
|||
|
|||
if (avnCursor->IsHidden()) { |
|||
[NSCursor hide]; |
|||
} else { |
|||
[NSCursor unhide]; |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
void WindowBaseImpl::UpdateCursor() { |
|||
if (cursor != nil) { |
|||
[cursor set]; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::CreateGlRenderTarget(IAvnGlSurfaceRenderTarget **ppv) { |
|||
START_COM_CALL; |
|||
|
|||
if (View == NULL) |
|||
return E_FAIL; |
|||
*ppv = [renderTarget createSurfaceRenderTarget]; |
|||
return static_cast<HRESULT>(*ppv == nil ? E_FAIL : S_OK); |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::CreateNativeControlHost(IAvnNativeControlHost **retOut) { |
|||
START_COM_CALL; |
|||
|
|||
if (View == NULL) |
|||
return E_FAIL; |
|||
*retOut = ::CreateNativeControlHost(View); |
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::SetBlurEnabled(bool enable) { |
|||
START_COM_CALL; |
|||
|
|||
[StandardContainer ShowBlur:enable]; |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowBaseImpl::BeginDragAndDropOperation(AvnDragDropEffects effects, AvnPoint point, IAvnClipboard *clipboard, IAvnDndResultCallback *cb, void *sourceHandle) { |
|||
START_COM_CALL; |
|||
|
|||
auto item = TryGetPasteboardItem(clipboard); |
|||
[item setString:@"" forType:GetAvnCustomDataType()]; |
|||
if (item == nil) |
|||
return E_INVALIDARG; |
|||
if (View == NULL) |
|||
return E_FAIL; |
|||
|
|||
auto nsevent = [NSApp currentEvent]; |
|||
auto nseventType = [nsevent type]; |
|||
|
|||
// If current event isn't a mouse one (probably due to malfunctioning user app) |
|||
// attempt to forge a new one |
|||
if (!((nseventType >= NSEventTypeLeftMouseDown && nseventType <= NSEventTypeMouseExited) |
|||
|| (nseventType >= NSEventTypeOtherMouseDown && nseventType <= NSEventTypeOtherMouseDragged))) { |
|||
NSRect convertRect = [Window convertRectToScreen:NSMakeRect(point.X, point.Y, 0.0, 0.0)]; |
|||
auto nspoint = NSMakePoint(convertRect.origin.x, convertRect.origin.y); |
|||
CGPoint cgpoint = NSPointToCGPoint(nspoint); |
|||
auto cgevent = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, cgpoint, kCGMouseButtonLeft); |
|||
nsevent = [NSEvent eventWithCGEvent:cgevent]; |
|||
CFRelease(cgevent); |
|||
} |
|||
|
|||
auto dragItem = [[NSDraggingItem alloc] initWithPasteboardWriter:item]; |
|||
|
|||
auto dragItemImage = [NSImage imageNamed:NSImageNameMultipleDocuments]; |
|||
NSRect dragItemRect = {(float) point.X, (float) point.Y, [dragItemImage size].width, [dragItemImage size].height}; |
|||
[dragItem setDraggingFrame:dragItemRect contents:dragItemImage]; |
|||
|
|||
int op = 0; |
|||
int ieffects = (int) effects; |
|||
if ((ieffects & (int) AvnDragDropEffects::Copy) != 0) |
|||
op |= NSDragOperationCopy; |
|||
if ((ieffects & (int) AvnDragDropEffects::Link) != 0) |
|||
op |= NSDragOperationLink; |
|||
if ((ieffects & (int) AvnDragDropEffects::Move) != 0) |
|||
op |= NSDragOperationMove; |
|||
[View beginDraggingSessionWithItems:@[dragItem] event:nsevent |
|||
source:CreateDraggingSource((NSDragOperation) op, cb, sourceHandle)]; |
|||
return S_OK; |
|||
} |
|||
|
|||
bool WindowBaseImpl::IsDialog() { |
|||
return false; |
|||
} |
|||
|
|||
NSWindowStyleMask WindowBaseImpl::GetStyle() { |
|||
return NSWindowStyleMaskBorderless; |
|||
} |
|||
|
|||
void WindowBaseImpl::UpdateStyle() { |
|||
[Window setStyleMask:GetStyle()]; |
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
//
|
|||
// Created by Dan Walmsley on 04/05/2022.
|
|||
// Copyright (c) 2022 Avalonia. All rights reserved.
|
|||
//
|
|||
|
|||
#ifndef AVALONIA_NATIVE_OSX_WINDOWIMPL_H |
|||
#define AVALONIA_NATIVE_OSX_WINDOWIMPL_H |
|||
|
|||
|
|||
#import "WindowBaseImpl.h" |
|||
#include "IWindowStateChanged.h" |
|||
|
|||
class WindowImpl : public virtual WindowBaseImpl, public virtual IAvnWindow, public IWindowStateChanged |
|||
{ |
|||
private: |
|||
bool _canResize; |
|||
bool _fullScreenActive; |
|||
SystemDecorations _decorations; |
|||
AvnWindowState _lastWindowState; |
|||
AvnWindowState _actualWindowState; |
|||
bool _inSetWindowState; |
|||
NSRect _preZoomSize; |
|||
bool _transitioningWindowState; |
|||
bool _isClientAreaExtended; |
|||
bool _isDialog; |
|||
AvnExtendClientAreaChromeHints _extendClientHints; |
|||
|
|||
FORWARD_IUNKNOWN() |
|||
BEGIN_INTERFACE_MAP() |
|||
INHERIT_INTERFACE_MAP(WindowBaseImpl) |
|||
INTERFACE_MAP_ENTRY(IAvnWindow, IID_IAvnWindow) |
|||
END_INTERFACE_MAP() |
|||
virtual ~WindowImpl() |
|||
{ |
|||
} |
|||
|
|||
ComPtr<IAvnWindowEvents> WindowEvents; |
|||
|
|||
WindowImpl(IAvnWindowEvents* events, IAvnGlContext* gl); |
|||
|
|||
void HideOrShowTrafficLights (); |
|||
|
|||
virtual HRESULT Show (bool activate, bool isDialog) override; |
|||
|
|||
virtual HRESULT SetEnabled (bool enable) override; |
|||
|
|||
virtual HRESULT SetParent (IAvnWindow* parent) override; |
|||
|
|||
void StartStateTransition () override ; |
|||
|
|||
void EndStateTransition () override ; |
|||
|
|||
SystemDecorations Decorations () override ; |
|||
|
|||
AvnWindowState WindowState () override ; |
|||
|
|||
void WindowStateChanged () override ; |
|||
|
|||
bool UndecoratedIsMaximized (); |
|||
|
|||
bool IsZoomed (); |
|||
|
|||
void DoZoom(); |
|||
|
|||
virtual HRESULT SetCanResize(bool value) override; |
|||
|
|||
virtual HRESULT SetDecorations(SystemDecorations value) override; |
|||
|
|||
virtual HRESULT SetTitle (char* utf8title) override; |
|||
|
|||
virtual HRESULT SetTitleBarColor(AvnColor color) override; |
|||
|
|||
virtual HRESULT GetWindowState (AvnWindowState*ret) override; |
|||
|
|||
virtual HRESULT TakeFocusFromChildren () override; |
|||
|
|||
virtual HRESULT SetExtendClientArea (bool enable) override; |
|||
|
|||
virtual HRESULT SetExtendClientAreaHints (AvnExtendClientAreaChromeHints hints) override; |
|||
|
|||
virtual HRESULT GetExtendTitleBarHeight (double*ret) override; |
|||
|
|||
virtual HRESULT SetExtendTitleBarHeight (double value) override; |
|||
|
|||
void EnterFullScreenMode (); |
|||
|
|||
void ExitFullScreenMode (); |
|||
|
|||
virtual HRESULT SetWindowState (AvnWindowState state) override; |
|||
|
|||
virtual bool IsDialog() override; |
|||
|
|||
protected: |
|||
virtual NSWindowStyleMask GetStyle() override; |
|||
}; |
|||
|
|||
#endif //AVALONIA_NATIVE_OSX_WINDOWIMPL_H
|
|||
@ -0,0 +1,540 @@ |
|||
// |
|||
// Created by Dan Walmsley on 04/05/2022. |
|||
// Copyright (c) 2022 Avalonia. All rights reserved. |
|||
// |
|||
|
|||
#import <AppKit/AppKit.h> |
|||
#import "window.h" |
|||
#include "automation.h" |
|||
#include "menu.h" |
|||
#import "WindowImpl.h" |
|||
|
|||
|
|||
WindowImpl::WindowImpl(IAvnWindowEvents *events, IAvnGlContext *gl) : WindowBaseImpl(events, gl) { |
|||
_isClientAreaExtended = false; |
|||
_extendClientHints = AvnDefaultChrome; |
|||
_fullScreenActive = false; |
|||
_canResize = true; |
|||
_decorations = SystemDecorationsFull; |
|||
_transitioningWindowState = false; |
|||
_inSetWindowState = false; |
|||
_lastWindowState = Normal; |
|||
_actualWindowState = Normal; |
|||
WindowEvents = events; |
|||
[Window setCanBecomeKeyAndMain]; |
|||
[Window disableCursorRects]; |
|||
[Window setTabbingMode:NSWindowTabbingModeDisallowed]; |
|||
[Window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; |
|||
} |
|||
|
|||
void WindowImpl::HideOrShowTrafficLights() { |
|||
if (Window == nil) { |
|||
return; |
|||
} |
|||
|
|||
for (id subview in Window.contentView.superview.subviews) { |
|||
if ([subview isKindOfClass:NSClassFromString(@"NSTitlebarContainerView")]) { |
|||
NSView *titlebarView = [subview subviews][0]; |
|||
for (id button in titlebarView.subviews) { |
|||
if ([button isKindOfClass:[NSButton class]]) { |
|||
if (_isClientAreaExtended) { |
|||
auto wantsChrome = (_extendClientHints & AvnSystemChrome) || (_extendClientHints & AvnPreferSystemChrome); |
|||
|
|||
[button setHidden:!wantsChrome]; |
|||
} else { |
|||
[button setHidden:(_decorations != SystemDecorationsFull)]; |
|||
} |
|||
|
|||
[button setWantsLayer:true]; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::Show(bool activate, bool isDialog) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
_isDialog = isDialog; |
|||
WindowBaseImpl::Show(activate, isDialog); |
|||
|
|||
HideOrShowTrafficLights(); |
|||
|
|||
return SetWindowState(_lastWindowState); |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetEnabled(bool enable) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
[Window setEnabled:enable]; |
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetParent(IAvnWindow *parent) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (parent == nullptr) |
|||
return E_POINTER; |
|||
|
|||
auto cparent = dynamic_cast<WindowImpl *>(parent); |
|||
if (cparent == nullptr) |
|||
return E_INVALIDARG; |
|||
|
|||
// If one tries to show a child window with a minimized parent window, then the parent window will be |
|||
// restored but macOS isn't kind enough to *tell* us that, so the window will be left in a non-interactive |
|||
// state. Detect this and explicitly restore the parent window ourselves to avoid this situation. |
|||
if (cparent->WindowState() == Minimized) |
|||
cparent->SetWindowState(Normal); |
|||
|
|||
[Window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; |
|||
[cparent->Window addChildWindow:Window ordered:NSWindowAbove]; |
|||
|
|||
UpdateStyle(); |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
void WindowImpl::StartStateTransition() { |
|||
_transitioningWindowState = true; |
|||
} |
|||
|
|||
void WindowImpl::EndStateTransition() { |
|||
_transitioningWindowState = false; |
|||
} |
|||
|
|||
SystemDecorations WindowImpl::Decorations() { |
|||
return _decorations; |
|||
} |
|||
|
|||
AvnWindowState WindowImpl::WindowState() { |
|||
return _lastWindowState; |
|||
} |
|||
|
|||
void WindowImpl::WindowStateChanged() { |
|||
if (_shown && !_inSetWindowState && !_transitioningWindowState) { |
|||
AvnWindowState state; |
|||
GetWindowState(&state); |
|||
|
|||
if (_lastWindowState != state) { |
|||
if (_isClientAreaExtended) { |
|||
if (_lastWindowState == FullScreen) { |
|||
// we exited fs. |
|||
if (_extendClientHints & AvnOSXThickTitleBar) { |
|||
Window.toolbar = [NSToolbar new]; |
|||
Window.toolbar.showsBaselineSeparator = false; |
|||
} |
|||
|
|||
[Window setTitlebarAppearsTransparent:true]; |
|||
|
|||
[StandardContainer setFrameSize:StandardContainer.frame.size]; |
|||
} else if (state == FullScreen) { |
|||
// we entered fs. |
|||
if (_extendClientHints & AvnOSXThickTitleBar) { |
|||
Window.toolbar = nullptr; |
|||
} |
|||
|
|||
[Window setTitlebarAppearsTransparent:false]; |
|||
|
|||
[StandardContainer setFrameSize:StandardContainer.frame.size]; |
|||
} |
|||
} |
|||
|
|||
_lastWindowState = state; |
|||
_actualWindowState = state; |
|||
WindowEvents->WindowStateChanged(state); |
|||
} |
|||
} |
|||
} |
|||
|
|||
bool WindowImpl::UndecoratedIsMaximized() { |
|||
auto windowSize = [Window frame]; |
|||
auto available = [Window screen].visibleFrame; |
|||
return CGRectEqualToRect(windowSize, available); |
|||
} |
|||
|
|||
bool WindowImpl::IsZoomed() { |
|||
return _decorations == SystemDecorationsFull ? [Window isZoomed] : UndecoratedIsMaximized(); |
|||
} |
|||
|
|||
void WindowImpl::DoZoom() { |
|||
switch (_decorations) { |
|||
case SystemDecorationsNone: |
|||
case SystemDecorationsBorderOnly: |
|||
[Window setFrame:[Window screen].visibleFrame display:true]; |
|||
break; |
|||
|
|||
|
|||
case SystemDecorationsFull: |
|||
[Window performZoom:Window]; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetCanResize(bool value) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
_canResize = value; |
|||
UpdateStyle(); |
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetDecorations(SystemDecorations value) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
auto currentWindowState = _lastWindowState; |
|||
_decorations = value; |
|||
|
|||
if (_fullScreenActive) { |
|||
return S_OK; |
|||
} |
|||
|
|||
UpdateStyle(); |
|||
|
|||
HideOrShowTrafficLights(); |
|||
|
|||
switch (_decorations) { |
|||
case SystemDecorationsNone: |
|||
[Window setHasShadow:NO]; |
|||
[Window setTitleVisibility:NSWindowTitleHidden]; |
|||
[Window setTitlebarAppearsTransparent:YES]; |
|||
|
|||
if (currentWindowState == Maximized) { |
|||
if (!UndecoratedIsMaximized()) { |
|||
DoZoom(); |
|||
} |
|||
} |
|||
break; |
|||
|
|||
case SystemDecorationsBorderOnly: |
|||
[Window setHasShadow:YES]; |
|||
[Window setTitleVisibility:NSWindowTitleHidden]; |
|||
[Window setTitlebarAppearsTransparent:YES]; |
|||
|
|||
if (currentWindowState == Maximized) { |
|||
if (!UndecoratedIsMaximized()) { |
|||
DoZoom(); |
|||
} |
|||
} |
|||
break; |
|||
|
|||
case SystemDecorationsFull: |
|||
[Window setHasShadow:YES]; |
|||
[Window setTitleVisibility:NSWindowTitleVisible]; |
|||
[Window setTitlebarAppearsTransparent:NO]; |
|||
[Window setTitle:_lastTitle]; |
|||
|
|||
if (currentWindowState == Maximized) { |
|||
auto newFrame = [Window contentRectForFrameRect:[Window frame]].size; |
|||
|
|||
[View setFrameSize:newFrame]; |
|||
} |
|||
break; |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetTitle(char *utf8title) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
_lastTitle = [NSString stringWithUTF8String:(const char *) utf8title]; |
|||
[Window setTitle:_lastTitle]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetTitleBarColor(AvnColor color) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
float a = (float) color.Alpha / 255.0f; |
|||
float r = (float) color.Red / 255.0f; |
|||
float g = (float) color.Green / 255.0f; |
|||
float b = (float) color.Blue / 255.0f; |
|||
|
|||
auto nscolor = [NSColor colorWithSRGBRed:r green:g blue:b alpha:a]; |
|||
|
|||
// Based on the titlebar color we have to choose either light or dark |
|||
// OSX doesnt let you set a foreground color for titlebar. |
|||
if ((r * 0.299 + g * 0.587 + b * 0.114) > 186.0f / 255.0f) { |
|||
[Window setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantLight]]; |
|||
} else { |
|||
[Window setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]]; |
|||
} |
|||
|
|||
[Window setTitlebarAppearsTransparent:true]; |
|||
[Window setBackgroundColor:nscolor]; |
|||
} |
|||
|
|||
return S_OK; |
|||
} |
|||
|
|||
HRESULT WindowImpl::GetWindowState(AvnWindowState *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
if (([Window styleMask] & NSWindowStyleMaskFullScreen) == NSWindowStyleMaskFullScreen) { |
|||
*ret = FullScreen; |
|||
return S_OK; |
|||
} |
|||
|
|||
if ([Window isMiniaturized]) { |
|||
*ret = Minimized; |
|||
return S_OK; |
|||
} |
|||
|
|||
if (IsZoomed()) { |
|||
*ret = Maximized; |
|||
return S_OK; |
|||
} |
|||
|
|||
*ret = Normal; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::TakeFocusFromChildren() { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (Window == nil) |
|||
return S_OK; |
|||
if ([Window isKeyWindow]) |
|||
[Window makeFirstResponder:View]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetExtendClientArea(bool enable) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
_isClientAreaExtended = enable; |
|||
|
|||
if (enable) { |
|||
Window.titleVisibility = NSWindowTitleHidden; |
|||
|
|||
[Window setTitlebarAppearsTransparent:true]; |
|||
|
|||
auto wantsTitleBar = (_extendClientHints & AvnSystemChrome) || (_extendClientHints & AvnPreferSystemChrome); |
|||
|
|||
if (wantsTitleBar) { |
|||
[StandardContainer ShowTitleBar:true]; |
|||
} else { |
|||
[StandardContainer ShowTitleBar:false]; |
|||
} |
|||
|
|||
if (_extendClientHints & AvnOSXThickTitleBar) { |
|||
Window.toolbar = [NSToolbar new]; |
|||
Window.toolbar.showsBaselineSeparator = false; |
|||
} else { |
|||
Window.toolbar = nullptr; |
|||
} |
|||
} else { |
|||
Window.titleVisibility = NSWindowTitleVisible; |
|||
Window.toolbar = nullptr; |
|||
[Window setTitlebarAppearsTransparent:false]; |
|||
View.layer.zPosition = 0; |
|||
} |
|||
|
|||
[Window setIsExtended:enable]; |
|||
|
|||
HideOrShowTrafficLights(); |
|||
|
|||
UpdateStyle(); |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetExtendClientAreaHints(AvnExtendClientAreaChromeHints hints) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
_extendClientHints = hints; |
|||
|
|||
SetExtendClientArea(_isClientAreaExtended); |
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::GetExtendTitleBarHeight(double *ret) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (ret == nullptr) { |
|||
return E_POINTER; |
|||
} |
|||
|
|||
*ret = [Window getExtendedTitleBarHeight]; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetExtendTitleBarHeight(double value) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
[StandardContainer SetTitleBarHeightHint:value]; |
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
void WindowImpl::EnterFullScreenMode() { |
|||
_fullScreenActive = true; |
|||
|
|||
[Window setTitle:_lastTitle]; |
|||
[Window toggleFullScreen:nullptr]; |
|||
} |
|||
|
|||
void WindowImpl::ExitFullScreenMode() { |
|||
[Window toggleFullScreen:nullptr]; |
|||
|
|||
_fullScreenActive = false; |
|||
|
|||
SetDecorations(_decorations); |
|||
} |
|||
|
|||
HRESULT WindowImpl::SetWindowState(AvnWindowState state) { |
|||
START_COM_CALL; |
|||
|
|||
@autoreleasepool { |
|||
if (Window == nullptr) { |
|||
return S_OK; |
|||
} |
|||
|
|||
if (_actualWindowState == state) { |
|||
return S_OK; |
|||
} |
|||
|
|||
_inSetWindowState = true; |
|||
|
|||
auto currentState = _actualWindowState; |
|||
_lastWindowState = state; |
|||
|
|||
if (currentState == Normal) { |
|||
_preZoomSize = [Window frame]; |
|||
} |
|||
|
|||
if (_shown) { |
|||
switch (state) { |
|||
case Maximized: |
|||
if (currentState == FullScreen) { |
|||
ExitFullScreenMode(); |
|||
} |
|||
|
|||
lastPositionSet.X = 0; |
|||
lastPositionSet.Y = 0; |
|||
|
|||
if ([Window isMiniaturized]) { |
|||
[Window deminiaturize:Window]; |
|||
} |
|||
|
|||
if (!IsZoomed()) { |
|||
DoZoom(); |
|||
} |
|||
break; |
|||
|
|||
case Minimized: |
|||
if (currentState == FullScreen) { |
|||
ExitFullScreenMode(); |
|||
} else { |
|||
[Window miniaturize:Window]; |
|||
} |
|||
break; |
|||
|
|||
case FullScreen: |
|||
if ([Window isMiniaturized]) { |
|||
[Window deminiaturize:Window]; |
|||
} |
|||
|
|||
EnterFullScreenMode(); |
|||
break; |
|||
|
|||
case Normal: |
|||
if ([Window isMiniaturized]) { |
|||
[Window deminiaturize:Window]; |
|||
} |
|||
|
|||
if (currentState == FullScreen) { |
|||
ExitFullScreenMode(); |
|||
} |
|||
|
|||
if (IsZoomed()) { |
|||
if (_decorations == SystemDecorationsFull) { |
|||
DoZoom(); |
|||
} else { |
|||
[Window setFrame:_preZoomSize display:true]; |
|||
auto newFrame = [Window contentRectForFrameRect:[Window frame]].size; |
|||
|
|||
[View setFrameSize:newFrame]; |
|||
} |
|||
|
|||
} |
|||
break; |
|||
} |
|||
|
|||
_actualWindowState = _lastWindowState; |
|||
WindowEvents->WindowStateChanged(_actualWindowState); |
|||
} |
|||
|
|||
|
|||
_inSetWindowState = false; |
|||
|
|||
return S_OK; |
|||
} |
|||
} |
|||
|
|||
bool WindowImpl::IsDialog() { |
|||
return _isDialog; |
|||
} |
|||
|
|||
NSWindowStyleMask WindowImpl::GetStyle() { |
|||
unsigned long s = NSWindowStyleMaskBorderless; |
|||
|
|||
switch (_decorations) { |
|||
case SystemDecorationsNone: |
|||
s = s | NSWindowStyleMaskFullSizeContentView; |
|||
break; |
|||
|
|||
case SystemDecorationsBorderOnly: |
|||
s = s | NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView; |
|||
break; |
|||
|
|||
case SystemDecorationsFull: |
|||
s = s | NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskBorderless; |
|||
|
|||
if (_canResize) { |
|||
s = s | NSWindowStyleMaskResizable; |
|||
} |
|||
break; |
|||
} |
|||
|
|||
if ([Window parentWindow] == nullptr) { |
|||
s |= NSWindowStyleMaskMiniaturizable; |
|||
} |
|||
|
|||
if (_isClientAreaExtended) { |
|||
s |= NSWindowStyleMaskFullSizeContentView | NSWindowStyleMaskTexturedBackground; |
|||
} |
|||
return s; |
|||
} |
|||
File diff suppressed because it is too large
|
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 557 B |
Loading…
Reference in new issue