mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-23 15:05:52 +00:00
AppKit: DOM platform window category ungated (Increment B)
- CPWindow.j: the PLATFORM(BROWSER) import gate removed; the CPPlatformWindow (DOM) category now loads under both targets - category _init restructured: DOM setup (window capture, pasteboard, registration) behind CPDOMAvailable; CommonJS branch initializes the same state as the base class - SCROLLWHEEL_LINE_PIXELS converted from #define to a file-scope variable; its only uses are within this file - load-time audit: file-scope statements are DOM-free; the single typeof-guarded document reference takes its no-DOM branch under Node - work-in-progress towards complete removal of CPP directives
This commit is contained in:
1 parent
5b852ca765
commit
bfbc522721
2 files changed
+18
-13
No files matched your search
@@ -30,9 +30,7 @@
|
||||
@import "CPDragServer.j"
|
||||
@import "CPEvent.j"
|
||||
@import "CPPlatformWindow.j"
|
||||
#if PLATFORM(BROWSER)
|
||||
@import "CPPlatformWindow+DOM.j"
|
||||
#endif
|
||||
@import "CPResponder.j"
|
||||
@import "CPScreen.j"
|
||||
@import "CPText.j"
|
||||
|
||||
@@ -246,9 +246,7 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
// When scrolling with an old-style scroll wheel with discete steps ('clicks'), the scroll amount can indicate how many "lines" to
|
||||
// scroll.
|
||||
#define SCROLLWHEEL_LINE_PIXELS 6.0
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
var SCROLLWHEEL_LINE_PIXELS = 6.0;
|
||||
|
||||
@implementation CPPlatformWindow (DOM)
|
||||
|
||||
@@ -258,16 +256,26 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
if (self)
|
||||
{
|
||||
_DOMWindow = window;
|
||||
_contentRect = CGRectMakeZero();
|
||||
if (CPDOMAvailable)
|
||||
{
|
||||
_DOMWindow = window;
|
||||
_contentRect = CGRectMakeZero();
|
||||
|
||||
_windowLevels = [];
|
||||
_windowLayers = @{};
|
||||
_windowLevels = [];
|
||||
_windowLayers = @{};
|
||||
|
||||
_platformPasteboard = [CPPlatformPasteboard new];
|
||||
_platformPasteboard = [CPPlatformPasteboard new];
|
||||
|
||||
[self registerDOMWindow];
|
||||
[self updateFromNativeContentRect];
|
||||
[self registerDOMWindow];
|
||||
[self updateFromNativeContentRect];
|
||||
}
|
||||
else
|
||||
{
|
||||
_contentRect = CGRectMakeZero();
|
||||
|
||||
_windowLevels = [];
|
||||
_windowLayers = @{};
|
||||
}
|
||||
|
||||
_charCodes = {};
|
||||
|
||||
@@ -1928,7 +1936,6 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
}
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
||||
var CPEventClass = [CPEvent class];
|
||||
|
||||
|
||||
Reference in new issue
Block a user