Skip to content

Commit

Permalink
Merge branch 'master' into fix-adorner-measure
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Walmsley committed Aug 16, 2021
2 parents 641b888 + 1ab3c2a commit 22cf20f
Show file tree
Hide file tree
Showing 254 changed files with 4,841 additions and 1,456 deletions.
3 changes: 2 additions & 1 deletion build/MicroCom.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Inputs="@(AvnComIdl);$(MSBuildThisFileDirectory)../src/tools/MicroComGenerator/**/*.cs"
Outputs="%(AvnComIdl.OutputFile)">
<Message Importance="high" Text="Generating file %(AvnComIdl.OutputFile) from @(AvnComIdl)" />
<Exec Command="dotnet $(MSBuildThisFileDirectory)../src/tools/MicroComGenerator/bin/$(Configuration)/netcoreapp3.1/MicroComGenerator.dll -i @(AvnComIdl) --cs %(AvnComIdl.OutputFile)" LogStandardErrorAsError="true" />
<Exec Command="dotnet &quot;$(MSBuildThisFileDirectory)../src/tools/MicroComGenerator/bin/$(Configuration)/netcoreapp3.1/MicroComGenerator.dll&quot; -i @(AvnComIdl) --cs %(AvnComIdl.OutputFile)"
LogStandardErrorAsError="true" />
<ItemGroup>
<!-- Remove and re-add generated file, this is needed for the clean build -->
<Compile Remove="%(AvnComIdl.OutputFile)"/>
Expand Down
1 change: 1 addition & 0 deletions native/Avalonia.Native/src/OSX/KeyTransform.mm
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
{ 45, "n" },
{ 46, "m" },
{ 47, "." },
{ 48, "\t" },
{ 49, " " },
{ 50, "`" },
{ 51, "" },
Expand Down
6 changes: 6 additions & 0 deletions native/Avalonia.Native/src/OSX/app.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ - (void)application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)ur

_events->FilesOpened(array);
}

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
return _events->TryShutdown() ? NSTerminateNow : NSTerminateCancel;
}

@end

@interface AvnApplication : NSApplication
Expand Down
22 changes: 22 additions & 0 deletions native/Avalonia.Native/src/OSX/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class WindowBaseImpl;
-(void) setSwRenderedFrame: (AvnFramebuffer* _Nonnull) fb dispose: (IUnknown* _Nonnull) dispose;
-(void) onClosed;
-(AvnPixelSize) getPixelSize;
-(AvnPlatformResizeReason) getResizeReason;
-(void) setResizeReason:(AvnPlatformResizeReason)reason;
@end

@interface AutoFitContentView : NSView
Expand All @@ -34,6 +36,7 @@ class WindowBaseImpl;
-(double) getScaling;
-(double) getExtendedTitleBarHeight;
-(void) setIsExtended:(bool)value;
-(bool) isDialog;
@end

struct INSWindowHolder
Expand All @@ -50,4 +53,23 @@ struct IWindowStateChanged
virtual AvnWindowState WindowState () = 0;
};

class ResizeScope
{
public:
ResizeScope(AvnView* _Nonnull view, AvnPlatformResizeReason reason)
{
_view = view;
_restore = [view getResizeReason];
[view setResizeReason:reason];
}

~ResizeScope()
{
[_view setResizeReason:_restore];
}
private:
AvnView* _Nonnull _view;
AvnPlatformResizeReason _restore;
};

#endif /* window_h */
Loading

0 comments on commit 22cf20f

Please sign in to comment.