More hash->UID name changes.

Reviewed by andrew.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-06-07 16:07:08 -07:00
1 parent c74642b641
commit 6cab77e005
9 files changed
+56 -61

No files matched your search

+27 -27
View File
@@ -72,9 +72,9 @@ CPTableColumnUserResizingMask = 2;
CPView _dataView; // default data view for this column
Object _dataViewData; // cache of data view archives (key=data view hash, value=data view archive)
Object _dataViewForView; // mapping from view instances back to their data view prototype (key=view instance hash, value=data view)
Object _purgableInfosForDataView; // (key=data view hash, value=)
Object _dataViewData; // cache of data view archives (key=data view UID, value=data view archive)
Object _dataViewForView; // mapping from view instances back to their data view prototype (key=view instance UID, value=data view)
Object _purgableInfosForDataView; // (key=data view UID, value=)
}
/*!
@@ -290,10 +290,10 @@ CPTableColumnUserResizingMask;
- (void)setDataView:(CPView <CPCoding>)aView
{
if (_dataView)
_dataViewData[[_dataView hash]] = nil;
_dataViewData[[_dataView UID]] = nil;
_dataView = aView;
_dataViewData[[aView hash]] = [CPKeyedArchiver archivedDataWithRootObject:aView];
_dataViewData[[aView UID]] = [CPKeyedArchiver archivedDataWithRootObject:aView];
}
/*!
@@ -330,42 +330,42 @@ CPTableColumnUserResizingMask;
/*
- (void)_markViewAsPurgable:(CPView)aView
{
var viewHash = [aView hash],
dataViewHash = [_dataViewForView[viewHash] hash];
var viewUID = [aView UID],
dataViewUID = [_dataViewForView[viewUID] UID];
if (!_purgableInfosForDataView[dataViewHash])
_purgableInfosForDataView[dataViewHash] = [CPDictionary dictionary];
if (!_purgableInfosForDataView[dataViewUID])
_purgableInfosForDataView[dataViewUID] = [CPDictionary dictionary];
[_purgableInfosForDataView[dataViewHash] setObject:aView forKey:viewHash];
[_purgableInfosForDataView[dataViewUID] setObject:aView forKey:viewUID];
}
*/
- (void)_markView:(CPView)aView inRow:(unsigned)aRow asPurgable:(BOOL)isPurgable
{
var viewHash = [aView hash],
dataViewHash = [_dataViewForView[viewHash] hash];
var viewUID = [aView UID],
dataViewUID = [_dataViewForView[viewUID] UID];
if (!_purgableInfosForDataView[dataViewHash])
if (!_purgableInfosForDataView[dataViewUID])
{
if (!isPurgable)
return;
_purgableInfosForDataView[dataViewHash] = {};
_purgableInfosForDataView[dataViewUID] = {};
}
if (!isPurgable) {
if (_purgableInfosForDataView[dataViewHash][viewHash])
CPLog.warn("removing unpurgable " + _purgableInfosForDataView[dataViewHash][viewHash]);
delete _purgableInfosForDataView[dataViewHash][viewHash];
if (_purgableInfosForDataView[dataViewUID][viewUID])
CPLog.warn("removing unpurgable " + _purgableInfosForDataView[dataViewUID][viewUID]);
delete _purgableInfosForDataView[dataViewUID][viewUID];
}
else
_purgableInfosForDataView[dataViewHash][viewHash] = PurgableInfoMake(aView, aRow);
_purgableInfosForDataView[dataViewUID][viewUID] = PurgableInfoMake(aView, aRow);
}
- (CPView)_newDataViewForRow:(int)aRowIndex avoidingRows:(CPRange)rows
{
var view = [self dataViewForRow:aRowIndex],
viewHash = [view hash],
purgableInfos = _purgableInfosForDataView[viewHash];
viewUID = [view UID],
purgableInfos = _purgableInfosForDataView[viewUID];
if (purgableInfos)
{
@@ -384,14 +384,14 @@ CPTableColumnUserResizingMask;
}
// if we haven't cached an archive of the data view, do it now
if (!_dataViewData[viewHash])
_dataViewData[viewHash] = [CPKeyedArchiver archivedDataWithRootObject:view];
if (!_dataViewData[viewUID])
_dataViewData[viewUID] = [CPKeyedArchiver archivedDataWithRootObject:view];
// unarchive the data view cache
var newView = [CPKeyedUnarchiver unarchiveObjectWithData:_dataViewData[viewHash]];
var newView = [CPKeyedUnarchiver unarchiveObjectWithData:_dataViewData[viewUID]];
// map the new view's hash to it's data view prototype
_dataViewForView[[newView hash]] = view;
// map the new view's UID to it's data view prototype
_dataViewForView[[newView UID]] = view;
CPLog.warn("creating cell: %s", newView);
@@ -400,9 +400,9 @@ CPTableColumnUserResizingMask;
- (void)_purge
{
for (var viewHash in _purgableInfosForDataView)
for (var viewUID in _purgableInfosForDataView)
{
var purgableInfos = _purgableInfosForDataView[viewHash];
var purgableInfos = _purgableInfosForDataView[viewUID];
for (var key in purgableInfos)
{
+4 -4
View File
@@ -725,7 +725,7 @@ var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth)
- (CPView)viewForItem:(CPToolbarItem)anItem
{
var info = [_itemInfos objectForKey:[anItem hash]];
var info = [_itemInfos objectForKey:[anItem UID]];
if (!info)
return nil;
@@ -735,7 +735,7 @@ var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth)
- (CPTextField)labelForItem:(CPToolbarItem)anItem
{
var info = [_itemInfos objectForKey:[anItem hash]];
var info = [_itemInfos objectForKey:[anItem UID]];
if (!info)
return nil;
@@ -745,7 +745,7 @@ var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth)
- (float)minWidthForItem:(CPToolbarItem)anItem
{
var info = [_itemInfos objectForKey:[anItem hash]];
var info = [_itemInfos objectForKey:[anItem UID]];
if (!info)
return 0;
@@ -814,7 +814,7 @@ var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth)
var minSize = [item minSize],
minWidth = MAX(minSize.width, CGRectGetWidth([label frame]));
[_itemInfos setObject:_CPToolbarItemInfoMake(index, view, label, minWidth) forKey:[item hash]];
[_itemInfos setObject:_CPToolbarItemInfoMake(index, view, label, minWidth) forKey:[item UID]];
_minWidth += minWidth + TOOLBAR_ITEM_MARGIN;
+6 -11
View File
@@ -143,8 +143,6 @@ var DOMElementPrototype = nil,
BOOL _postsBoundsChangedNotifications;
BOOL _inhibitFrameAndBoundsChangedNotifications;
CPString _displayHash;
#if PLATFORM(DOM)
DOMElement _DOMElement;
DOMElement _DOMContentsElement;
@@ -242,8 +240,6 @@ var DOMElementPrototype = nil,
_isHidden = NO;
_hitTests = YES;
_displayHash = [self hash];
#if PLATFORM(DOM)
_DOMElement = DOMElementPrototype.cloneNode(false);
@@ -1535,13 +1531,13 @@ setBoundsOrigin:
- (void)setNeedsDisplayInRect:(CPRect)aRect
{
#if PLATFORM(DOM)
var hash = [[self class] hash],
hasCustomDrawRect = CustomDrawRectViews[hash];
var UID = [[self class] UID],
hasCustomDrawRect = CustomDrawRectViews[UID];
if (!hasCustomDrawRect && typeof hasCustomDrawRect === "undefined")
{
hasCustomDrawRect = [self methodForSelector:@selector(drawRect:)] != [CPView instanceMethodForSelector:@selector(drawRect:)];
CustomDrawRectViews[hash] = hasCustomDrawRect;
CustomDrawRectViews[UID] = hasCustomDrawRect;
}
if (!hasCustomDrawRect)
@@ -1666,13 +1662,13 @@ setBoundsOrigin:
_needsLayout = YES;
#if PLATFORM(DOM)
var hash = [[self class] hash],
hasCustomLayoutSubviews = CustomLayoutSubviewsViews[hash];
var UID = [[self class] UID],
hasCustomLayoutSubviews = CustomLayoutSubviewsViews[UID];
if (hasCustomLayoutSubviews === undefined)
{
hasCustomLayoutSubviews = [self methodForSelector:@selector(layoutSubviews)] != [CPView instanceMethodForSelector:@selector(layoutSubviews)];
CustomLayoutSubviewsViews[hash] = hasCustomLayoutSubviews;
CustomLayoutSubviewsViews[UID] = hasCustomLayoutSubviews;
}
if (!hasCustomLayoutSubviews)
@@ -2256,7 +2252,6 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
//_subviews[index]._superview = self;
}
#endif
_displayHash = [self hash];
if ([aCoder containsValueForKey:CPViewIsHiddenKey])
[self setHidden:[aCoder decodeBoolForKey:CPViewIsHiddenKey]];
+4 -4
View File
@@ -43,7 +43,7 @@ var LoadInfoForCib = {};
{
var cib = [[CPCib alloc] initWithContentsOfURL:anAbsolutePath loadDelegate:self];
LoadInfoForCib[[cib hash]] = { loadDelegate:aDelegate, externalNameTable:aNameTable };
LoadInfoForCib[[cib UID]] = { loadDelegate:aDelegate, externalNameTable:aNameTable };
}
+ (void)loadCibNamed:(CPString)aName owner:(id)anOwner loadDelegate:(id)aDelegate
@@ -59,14 +59,14 @@ var LoadInfoForCib = {};
{
var cib = [[CPCib alloc] initWithCibNamed:aFileName bundle:self loadDelegate:[self class]];
LoadInfoForCib[[cib hash]] = { loadDelegate:aDelegate, externalNameTable:aNameTable };
LoadInfoForCib[[cib UID]] = { loadDelegate:aDelegate, externalNameTable:aNameTable };
}
+ (void)cibDidFinishLoading:(CPCib)aCib
{
var loadInfo = LoadInfoForCib[[aCib hash]];
var loadInfo = LoadInfoForCib[[aCib UID]];
delete LoadInfoForCib[[aCib hash]];
delete LoadInfoForCib[[aCib UID]];
[aCib instantiateCibWithExternalNameTable:loadInfo.externalNameTable];
+2 -2
View File
@@ -16,12 +16,12 @@ var _CPCibConnectorSourceKey = @"_CPCibConnectorSourceKey",
- (void)replaceObjects:(JSObject)replacementObjects
{
var replacement = replacementObjects[[_source hash]];
var replacement = replacementObjects[[_source UID]];
if (replacement !== undefined)
_source = replacement;
replacement = replacementObjects[[_destination hash]];
replacement = replacementObjects[[_destination UID]];
if (replacement !== undefined)
_destination = replacement;
+4 -4
View File
@@ -119,7 +119,7 @@
objectEnumerator = [_visibleWindows objectEnumerator];
while (object = [objectEnumerator nextObject])
[_replacementObjects[[object hash]] makeKeyAndOrderFront:self];
[_replacementObjects[[object UID]] makeKeyAndOrderFront:self];
}
@end
@@ -242,7 +242,7 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
if (instantiatedObject !== object)
{
_replacementObjects[[object hash]] = instantiatedObject;
_replacementObjects[[object UID]] = instantiatedObject;
if ([instantiatedObject isKindOfClass:[CPView class]])
{
@@ -266,7 +266,7 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
- (void)establishConnectionsWithOwner:(id)anOwner topLevelObjects:(CPMutableArray)topLevelObjects
{
_replacementObjects[[_fileOwner hash]] = anOwner;
_replacementObjects[[_fileOwner UID]] = anOwner;
var index = 0,
count = _connections.length;
@@ -287,7 +287,7 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
while (count--)
{
var object = _objectsKeys[count],
instantiatedObject = _replacementObjects[[object hash]];
instantiatedObject = _replacementObjects[[object UID]];
if (instantiatedObject)
object = instantiatedObject;
+3 -3
View File
@@ -779,9 +779,9 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
+ (void)runLoopUpdateLayers
{if (window.oops) {alert(window.latest); objj_debug_print_backtrace();}
window.loop = true;
for (hash in CALayerRegisteredRunLoopUpdates)
for (UID in CALayerRegisteredRunLoopUpdates)
{
var layer = CALayerRegisteredRunLoopUpdates[hash],
var layer = CALayerRegisteredRunLoopUpdates[UID],
mask = layer._runLoopUpdateMask;
if (mask & CALayerDOMUpdateMask)
@@ -813,7 +813,7 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
}
_runLoopUpdateMask |= anUpdateMask;
CALayerRegisteredRunLoopUpdates[[self hash]] = self;
CALayerRegisteredRunLoopUpdates[[self UID]] = self;
}
/*
+5 -5
View File
@@ -104,20 +104,20 @@
#define CPDOMDisplayServerAddView(aView)\
{\
var ___hash = [aView hash];\
if (typeof (CPDOMDisplayServerViewsContext[___hash]) == "undefined")\
var ___UID = [aView UID];\
if (typeof (CPDOMDisplayServerViewsContext[___UID]) == "undefined")\
{\
CPDOMDisplayServerViews[CPDOMDisplayServerViewsCount++] = aView;\
CPDOMDisplayServerViewsContext[___hash] = aView;\
CPDOMDisplayServerViewsContext[___UID] = aView;\
}\
}\
#define CPDOMDisplayServerRemoveView(aView)\
{\
var index = CPDOMDisplayServerViewsContext[[aView hash]];\
var index = CPDOMDisplayServerViewsContext[[aView UID]];\
if (typeof index != "undefined") \
{\
CPDOMDisplayServerViewsContext[[aView hash]];\
CPDOMDisplayServerViewsContext[[aView UID]];\
CPDOMDisplayServerViews[index] = NULL;\
}\
}\
+1 -1
View File
@@ -150,7 +150,7 @@ CPDOMDisplayServerViewsContext = {};
{
var view = views[index];
delete CPDOMDisplayServerViewsContext[[view hash]];
delete CPDOMDisplayServerViewsContext[[view UID]];
[view layoutIfNeeded];
[view displayIfNeeded];