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 int _firstMouseDownButton;
57 CGPoint _lastMouseEventLocation;
59 CPTimeInterval _lastMouseUp;
60 CPTimeInterval _lastMouseDown;
69 CPPlatformPasteboard _platformPasteboard;
105 - (id)initWithContentRect:(CGRect)aRect
111 _contentRect = CGRectMakeCopy(aRect);
119 _platformPasteboard = [CPPlatformPasteboard new];
130 _hasInitializeInstanceWithWindow = YES;
144 return CGRectMakeCopy(_contentRect);
160 frame.origin = CGPointMakeZero();
164 var menuBarHeight = [[CPApp mainMenu] menuBarHeight];
166 frame.origin.y += menuBarHeight;
167 frame.size.height -= menuBarHeight;
178 - (void)setContentRect:(CGRect)aRect
180 if (!aRect || CGRectEqualToRect(_contentRect, aRect))
183 _contentRect = CGRectMakeCopy(aRect);
186 [
self updateNativeContentRect];
195 - (CGPoint)convertBaseToScreen:(CGPoint)aPoint
202 - (CGPoint)convertScreenToBase:(CGPoint)aPoint
212 return _DOMWindow !== NULL && _DOMWindow !== undefined;
218 - (void)deminiaturize:(
id)sender
221 if (_DOMWindow && typeof _DOMWindow[
"cpDeminiaturize"] ===
"function")
222 _DOMWindow.cpDeminiaturize();
226 - (void)miniaturize:(
id)sender
229 if (_DOMWindow && typeof _DOMWindow[
"cpMiniaturize"] ===
"function")
230 _DOMWindow.cpMiniaturize();
234 - (void)moveWindow:(
CPWindow)aWindow fromLevel:(
int)fromLevel toLevel:(
int)toLevel
237 if (!aWindow._isVisible)
240 var fromLayer = [
self layerAtLevel:fromLevel create:NO],
241 toLayer = [
self layerAtLevel:toLevel create:YES];
243 [fromLayer removeWindow:aWindow];
244 [toLayer insertWindow:aWindow atIndex:CPNotFound];
248 - (void)setLevel:(CPInteger)aLevel
253 if (_DOMWindow && _DOMWindow.cpSetLevel)
254 _DOMWindow.cpSetLevel(aLevel);
258 - (void)setHasShadow:(BOOL)shouldHaveShadow
260 _hasShadow = shouldHaveShadow;
263 if (_DOMWindow && _DOMWindow.cpSetHasShadow)
264 _DOMWindow.cpSetHasShadow(shouldHaveShadow);
268 - (void)setShadowStyle:(
int)aStyle
270 _shadowStyle = aStyle;
273 if (_DOMWindow && _DOMWindow.cpSetShadowStyle)
274 _shadowStyle.cpSetShadowStyle(aStyle);
289 _DOMWindow.document &&
290 ([aWindow isFullPlatformWindow]))
292 _DOMWindow.document.title = _title;
302 - (BOOL)_canUpdateContentRect
305 return _shouldUpdateContentRect && _hasInitializeInstanceWithWindow;
308 - (BOOL)_hasInitializeInstanceWithWindow
310 return _hasInitializeInstanceWithWindow;
313 - (void)_setShouldUpdateContentRect:(BOOL)aBoolean
315 _shouldUpdateContentRect = aBoolean;
320 #if PLATFORM(BROWSER)
void setPlatformWindow:(CPPlatformWindow aPlatformWindow)
A mutable key-value pair collection.
An immutable string (collection of characters).
CPInternetExplorerBrowserEngine
void setFullPlatformWindow:(BOOL shouldBeFullPlatformWindow)
function CPBrowserIsEngine(anEngine)