2018-04-19 07:53:12 +00:00
|
|
|
// Copyright (c) 2018 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
|
|
|
|
#define SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
|
2018-04-19 07:53:12 +00:00
|
|
|
|
2019-05-15 22:04:23 +00:00
|
|
|
#include "components/remote_cocoa/app_shim/native_widget_mac_nswindow.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/ui/cocoa/event_dispatching_window.h"
|
2018-09-06 23:47:31 +00:00
|
|
|
#include "ui/views/widget/native_widget_mac.h"
|
2018-04-19 07:53:12 +00:00
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2018-04-19 07:53:12 +00:00
|
|
|
|
|
|
|
class NativeWindowMac;
|
|
|
|
|
|
|
|
// Prevents window from resizing during the scope.
|
|
|
|
class ScopedDisableResize {
|
|
|
|
public:
|
|
|
|
ScopedDisableResize() { disable_resize_ = true; }
|
|
|
|
~ScopedDisableResize() { disable_resize_ = false; }
|
|
|
|
|
|
|
|
static bool IsResizeDisabled() { return disable_resize_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
static bool disable_resize_;
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2018-04-19 07:53:12 +00:00
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
@interface ElectronNSWindow : NativeWidgetMacNSWindow {
|
2018-04-19 07:53:12 +00:00
|
|
|
@private
|
2019-06-19 21:23:04 +00:00
|
|
|
electron::NativeWindowMac* shell_;
|
2018-04-19 07:53:12 +00:00
|
|
|
}
|
|
|
|
@property BOOL acceptsFirstMouse;
|
|
|
|
@property BOOL enableLargerThanScreen;
|
|
|
|
@property BOOL disableAutoHideCursor;
|
|
|
|
@property BOOL disableKeyOrMainWindow;
|
2021-06-16 17:13:42 +00:00
|
|
|
@property(nonatomic, retain) NSVisualEffectView* vibrantView;
|
2020-01-13 06:43:00 +00:00
|
|
|
@property(nonatomic, retain) NSImage* cornerMask;
|
2019-06-19 21:23:04 +00:00
|
|
|
- (id)initWithShell:(electron::NativeWindowMac*)shell
|
2018-05-02 12:28:28 +00:00
|
|
|
styleMask:(NSUInteger)styleMask;
|
2019-06-19 21:23:04 +00:00
|
|
|
- (electron::NativeWindowMac*)shell;
|
2018-09-06 23:47:31 +00:00
|
|
|
- (id)accessibilityFocusedUIElement;
|
2018-05-02 12:28:28 +00:00
|
|
|
- (NSRect)originalContentRectForFrameRect:(NSRect)frameRect;
|
2018-04-19 07:53:12 +00:00
|
|
|
- (void)toggleFullScreenMode:(id)sender;
|
2020-01-13 06:43:00 +00:00
|
|
|
- (NSImage*)_cornerMask;
|
2018-04-19 07:53:12 +00:00
|
|
|
@end
|
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
|