| 
									
										
										
										
											2018-04-19 16:53:12 +09: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 08:34:31 +01:00
										 |  |  | #ifndef ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
 | 
					
						
							|  |  |  | #define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
 | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-13 14:45:48 -04:00
										 |  |  | #include "base/memory/raw_ptr.h"
 | 
					
						
							| 
									
										
										
										
											2019-05-15 15:04:23 -07:00
										 |  |  | #include "components/remote_cocoa/app_shim/native_widget_mac_nswindow.h"
 | 
					
						
							| 
									
										
										
										
											2019-06-19 13:46:59 -07:00
										 |  |  | #include "shell/browser/ui/cocoa/event_dispatching_window.h"
 | 
					
						
							| 
									
										
										
										
											2018-09-06 16:47:31 -07:00
										 |  |  | #include "ui/views/widget/native_widget_mac.h"
 | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace electron { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class NativeWindowMac; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Prevents window from resizing during the scope.
 | 
					
						
							|  |  |  | class ScopedDisableResize { | 
					
						
							|  |  |  |  public: | 
					
						
							| 
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 |  |  |   ScopedDisableResize() { disable_resize_++; } | 
					
						
							|  |  |  |   ~ScopedDisableResize() { disable_resize_--; } | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 |  |  |   // True if there are 1+ nested ScopedDisableResize objects in the scope
 | 
					
						
							|  |  |  |   static bool IsResizeDisabled() { return disable_resize_ > 0; } | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  |  private: | 
					
						
							| 
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 |  |  |   static int disable_resize_; | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace electron
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-24 17:23:08 +09:00
										 |  |  | @interface ElectronNSWindow : NativeWidgetMacNSWindow { | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  |  @private | 
					
						
							| 
									
										
										
										
											2023-06-13 14:45:48 -04:00
										 |  |  |   raw_ptr<electron::NativeWindowMac> shell_; | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | } | 
					
						
							|  |  |  | @property BOOL acceptsFirstMouse; | 
					
						
							|  |  |  | @property BOOL enableLargerThanScreen; | 
					
						
							|  |  |  | @property BOOL disableAutoHideCursor; | 
					
						
							|  |  |  | @property BOOL disableKeyOrMainWindow; | 
					
						
							| 
									
										
										
										
											2021-06-17 02:13:42 +09:00
										 |  |  | @property(nonatomic, retain) NSVisualEffectView* vibrantView; | 
					
						
							| 
									
										
										
										
											2020-01-12 22:43:00 -08:00
										 |  |  | @property(nonatomic, retain) NSImage* cornerMask; | 
					
						
							| 
									
										
										
										
											2018-05-02 21:28:28 +09:00
										 |  |  | - (id)initWithShell:(electron::NativeWindowMac*)shell | 
					
						
							|  |  |  |           styleMask:(NSUInteger)styleMask; | 
					
						
							| 
									
										
										
										
											2018-05-02 20:43:45 +09:00
										 |  |  | - (electron::NativeWindowMac*)shell; | 
					
						
							| 
									
										
										
										
											2018-09-06 16:47:31 -07:00
										 |  |  | - (id)accessibilityFocusedUIElement; | 
					
						
							| 
									
										
										
										
											2018-05-02 21:28:28 +09:00
										 |  |  | - (NSRect)originalContentRectForFrameRect:(NSRect)frameRect; | 
					
						
							| 
									
										
										
										
											2023-09-11 09:38:10 +02:00
										 |  |  | - (BOOL)toggleFullScreenMode:(id)sender; | 
					
						
							| 
									
										
										
										
											2020-01-12 22:43:00 -08:00
										 |  |  | - (NSImage*)_cornerMask; | 
					
						
							| 
									
										
										
										
											2018-04-19 16:53:12 +09:00
										 |  |  | @end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-22 08:34:31 +01:00
										 |  |  | #endif  // ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
 |