37 unsigned _shadowStyle;
39 BOOL _shouldUpdateContentRect;
40 BOOL _hasInitializeInstanceWithWindow;
45 DOMElement _DOMBodyElement;
46 DOMElement _DOMFocusElement;
47 DOMElement _DOMEventGuard;
48 DOMElement _DOMScrollingElement;
49 id _hideDOMScrollingElementTimeout;
51 CPArray _windowLevels;
55 BOOL _mouseDownIsRightClick;
56 CGPoint _lastMouseEventLocation;
58 CPTimeInterval _lastMouseUp;
59 CPTimeInterval _lastMouseDown;
68 CPPlatformPasteboard _platformPasteboard;
74 + (CPSet)visiblePlatformWindows
79 + (BOOL)supportsMultipleInstances
98 - (id)initWithContentRect:(CGRect)aRect
104 _contentRect = CGRectMakeCopy(aRect);
121 _hasInitializeInstanceWithWindow = YES;
133 - (CGRect)contentRect
135 return CGRectMakeCopy(_contentRect);
138 - (CGRect)contentBounds
142 contentBounds.origin = CGPointMakeZero();
144 return contentBounds;
147 - (CGRect)visibleFrame
151 frame.origin = CGPointMakeZero();
155 var menuBarHeight = [[CPApp mainMenu] menuBarHeight];
157 frame.origin.y += menuBarHeight;
158 frame.size.height -= menuBarHeight;
164 - (CGRect)usableContentFrame
169 - (void)setContentRect:(CGRect)aRect
171 if (!aRect || CGRectEqualToRect(_contentRect, aRect))
174 _contentRect = CGRectMakeCopy(aRect);
177 [
self updateNativeContentRect];
181 - (void)updateFromNativeContentRect
186 - (CGPoint)convertBaseToScreen:(CGPoint)aPoint
190 return CGPointMake(aPoint.x + CGRectGetMinX(contentRect), aPoint.y + CGRectGetMinY(contentRect));
193 - (CGPoint)convertScreenToBase:(CGPoint)aPoint
197 return CGPointMake(aPoint.x - CGRectGetMinX(contentRect), aPoint.y - CGRectGetMinY(contentRect));
203 return _DOMWindow !== NULL;
209 - (void)deminiaturize:(
id)sender
212 if (_DOMWindow && typeof _DOMWindow[
"cpDeminiaturize"] ===
"function")
213 _DOMWindow.cpDeminiaturize();
217 - (void)miniaturize:(
id)sender
220 if (_DOMWindow && typeof _DOMWindow[
"cpMiniaturize"] ===
"function")
221 _DOMWindow.cpMiniaturize();
225 - (void)moveWindow:(
CPWindow)aWindow fromLevel:(
int)fromLevel toLevel:(
int)toLevel
228 if (!aWindow._isVisible)
231 var fromLayer = [
self layerAtLevel:fromLevel create:NO],
232 toLayer = [
self layerAtLevel:toLevel create:YES];
234 [fromLayer removeWindow:aWindow];
235 [toLayer insertWindow:aWindow atIndex:CPNotFound];
239 - (void)setLevel:(CPInteger)aLevel
244 if (_DOMWindow && _DOMWindow.cpSetLevel)
245 _DOMWindow.cpSetLevel(aLevel);
249 - (void)setHasShadow:(BOOL)shouldHaveShadow
251 _hasShadow = shouldHaveShadow;
254 if (_DOMWindow && _DOMWindow.cpSetHasShadow)
255 _DOMWindow.cpSetHasShadow(shouldHaveShadow);
259 - (void)setShadowStyle:(
int)aStyle
261 _shadowStyle = aStyle;
264 if (_DOMWindow && _DOMWindow.cpSetShadowStyle)
265 _shadowStyle.cpSetShadowStyle(aStyle);
269 - (BOOL)supportsFullPlatformWindows
280 _DOMWindow.document &&
281 ([aWindow isFullPlatformWindow]))
283 _DOMWindow.document.title = _title;
293 - (BOOL)_canUpdateContentRect
296 return _shouldUpdateContentRect && _hasInitializeInstanceWithWindow;
299 - (BOOL)_hasInitializeInstanceWithWindow
301 return _hasInitializeInstanceWithWindow;
304 - (void)_setShouldUpdateContentRect:(BOOL)aBoolean
306 _shouldUpdateContentRect = aBoolean;
311 #if PLATFORM(BROWSER)