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.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
|
2018-04-19 07:53:12 +00:00
|
|
|
|
2023-06-13 18:45:48 +00:00
|
|
|
#include "base/memory/raw_ptr.h"
|
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
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
class NativeWindowMac;
|
|
|
|
|
|
|
|
// Prevents window from resizing during the scope.
|
|
|
|
class ScopedDisableResize {
|
|
|
|
public:
|
2022-06-14 16:24:52 +00:00
|
|
|
ScopedDisableResize() { disable_resize_++; }
|
|
|
|
~ScopedDisableResize() { disable_resize_--; }
|
2018-04-19 07:53:12 +00:00
|
|
|
|
2022-06-14 16:24:52 +00:00
|
|
|
// True if there are 1+ nested ScopedDisableResize objects in the scope
|
|
|
|
static bool IsResizeDisabled() { return disable_resize_ > 0; }
|
2018-04-19 07:53:12 +00:00
|
|
|
|
|
|
|
private:
|
2022-06-14 16:24:52 +00:00
|
|
|
static int disable_resize_;
|
2018-04-19 07:53:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2018-04-24 08:23:08 +00:00
|
|
|
@interface ElectronNSWindow : NativeWidgetMacNSWindow {
|
2018-04-19 07:53:12 +00:00
|
|
|
@private
|
2023-06-13 18:45:48 +00:00
|
|
|
raw_ptr<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;
|
2018-05-02 12:28:28 +00:00
|
|
|
- (id)initWithShell:(electron::NativeWindowMac*)shell
|
|
|
|
styleMask:(NSUInteger)styleMask;
|
2018-05-02 11:43:45 +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;
|
2023-09-11 07:38:10 +00:00
|
|
|
- (BOOL)toggleFullScreenMode:(id)sender;
|
2020-01-13 06:43:00 +00:00
|
|
|
- (NSImage*)_cornerMask;
|
2018-04-19 07:53:12 +00:00
|
|
|
@end
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
|