• R/O
  • SSH
  • HTTPS

mani2: Commit


Commit MetaInfo

Revision66 (tree)
Time2009-06-28 21:38:14
Authorhikarin

Log Message

[mani2/cocoa] * renamed layers?DataForUndo to copyLayers?

Change Summary

Incremental Difference

--- trunk/cocoa/Classes/MMLayers.m (revision 65)
+++ trunk/cocoa/Classes/MMLayers.m (revision 66)
@@ -152,7 +152,7 @@
152152 - (void)copyLayer
153153 {
154154 MMLayer *layer = [layerArray objectAtIndex:currentIndex];
155- MMLayer *copiedLayer = [layer copy];
155+ MMLayer *copiedLayer = [layer copyLayer];
156156 [layerArray insertObject:copiedLayer
157157 atIndex:currentIndex];
158158 [copiedLayer release];
@@ -313,13 +313,13 @@
313313 //[self recombine];
314314 }
315315
316-- (MMLayers *)layersDataForUndo
316+- (MMLayers *)copyLayers
317317 {
318318 MMLayers *data = [[MMLayers alloc] init];
319319 for (MMLayer *layer in layerArray) {
320320 // addObjectでメモリ参照が1つ増えるのでリリースしないとメモリーリークが発生する
321321 // 配列にメモリ管理を任せる
322- MMLayer *layerDataForUndo = layer.layerDataForUndo;
322+ MMLayer *layerDataForUndo = [layer copyLayer];
323323 [data->layerArray addObject:layerDataForUndo];
324324 [layerDataForUndo release];
325325 }
@@ -338,7 +338,7 @@
338338 // addObjectでメモリ参照が1つ増えるのでリリースしないとメモリーリークが発生する
339339 // 配列にメモリ管理を任せる
340340 MMLayer *layer = [[MMLayer alloc] initWithSize:size index:i];
341- layer.layerDataForUndo = layerDataForUndo;
341+ [layer setLayerDataForUndo:layerDataForUndo];
342342 [layerArray addObject:layer];
343343 [layer release];
344344 ++i;
--- trunk/cocoa/Classes/MMLayer.h (revision 65)
+++ trunk/cocoa/Classes/MMLayer.h (revision 66)
@@ -49,6 +49,7 @@
4949 size:(CGSize)size
5050 index:(NSUInteger)i;
5151 + (void)disposeCompositeBitmap;
52+- (id)copyLayer;
5253 - (void)drawBitmapFrom:(CGContextRef)source
5354 blendMode:(NSString *)mode;
5455 - (void)drawBitmapTo:(CGContextRef *)dest;
@@ -56,6 +57,7 @@
5657 atPoint:(CGPoint)point;
5758 - (void)setPixelWithColor:(uint32_t)color
5859 atPoint:(CGPoint)point;
60+- (void)setLayerDataForUndo:(MMLayer *)layerData;
5961
6062 @property(readonly) CGSize size;
6163 @property NSUInteger index;
@@ -63,7 +65,6 @@
6365 @property BOOL visible;
6466 @property CGFloat alpha;
6567 @property(assign) CGContextRef bitmap;
66-@property(assign) MMLayer *layerDataForUndo;
6768 @property(retain) NSString *blendMode;
6869
6970 @end
--- trunk/cocoa/Classes/MMLayer.m (revision 65)
+++ trunk/cocoa/Classes/MMLayer.m (revision 66)
@@ -471,7 +471,7 @@
471471 #endif
472472 }
473473
474-- (id)copy
474+- (id)copyLayer
475475 {
476476 MMLayer *layer = [[[self class] alloc] initWithSize:size
477477 index:index];
@@ -524,12 +524,6 @@
524524 CGContextFillRect(bitmap, CGRectMake(point.x, point.y, 1, 1));
525525 }
526526
527-- (MMLayer *)layerDataForUndo
528-{
529- // エイリアス的な役割を働いている
530- return [self copy];
531-}
532-
533527 - (void)setLayerDataForUndo:(MMLayer *)layerData
534528 {
535529 // 単にlayerData(MMLayerクラス)内のプロパティをコピーするだけなので、retainはしない
--- trunk/cocoa/Classes/MMLayers.h (revision 65)
+++ trunk/cocoa/Classes/MMLayers.h (revision 66)
@@ -60,6 +60,8 @@
6060 atPoint:(CGPoint)point;
6161 - (void)setPixelWithColor:(uint32_t)color
6262 atPoint:(CGPoint)point;
63+- (MMLayers *)copyLayers;
64+- (void)setLayersDataForUndo:(MMLayers *)layersData;
6365 - (NSUInteger)count;
6466
6567 @property(readonly) CGSize size;
@@ -68,6 +70,5 @@
6870 @property NSUInteger currentIndex;
6971 @property CGFloat currentLayerAlpha;
7072 @property(assign) NSString *currentLayerBlendMode;
71-@property(assign) MMLayers *layersDataForUndo;
7273
7374 @end
Show on old repository browser