BathyScapheのTitleRulerAppearanceを手軽に変更するツール
Revision | 766318270ba5f4124b20c71759017ea7fe301d66 (tree) |
---|---|
Zeit | 2011-02-22 01:16:05 |
Autor | masakih <masakih@user...> |
Commiter | masakih |
[Mod] 64bit safeに修正
@@ -28,7 +28,7 @@ typedef enum _BSTitleRulerModeType { | ||
28 | 28 | |
29 | 29 | // addtional variables. |
30 | 30 | NSControlTint representControlTint; |
31 | - int representActiveState; // 0: Inactive. 1: Active. | |
31 | + NSInteger representActiveState; // 0: Inactive. 1: Active. | |
32 | 32 | } |
33 | 33 | |
34 | 34 | - (BSTitleRulerAppearance *)appearance; |
@@ -50,7 +50,7 @@ typedef enum _BSTitleRulerModeType { | ||
50 | 50 | - (void)setRepresentControlTint:(NSControlTint)newTint; |
51 | 51 | |
52 | 52 | // 0: Inactive. 1: Active. |
53 | -- (int)representActiveState; | |
54 | -- (void)setRepresentActiveState:(int)newState; | |
53 | +- (NSInteger)representActiveState; | |
54 | +- (void)setRepresentActiveState:(NSInteger)newState; | |
55 | 55 | |
56 | 56 | @end |
@@ -78,7 +78,7 @@ | ||
78 | 78 | |
79 | 79 | - (void)setCurrentMode:(BSTitleRulerModeType)newType |
80 | 80 | { |
81 | - float newThickness; | |
81 | + CGFloat newThickness; | |
82 | 82 | _currentMode = newType; |
83 | 83 | |
84 | 84 | switch(newType) { |
@@ -110,11 +110,11 @@ | ||
110 | 110 | } |
111 | 111 | |
112 | 112 | // 0: Inactive. 1: Active. |
113 | -- (int)representActiveState | |
113 | +- (NSInteger)representActiveState | |
114 | 114 | { |
115 | 115 | return representActiveState; |
116 | 116 | } |
117 | -- (void)setRepresentActiveState:(int)newState | |
117 | +- (void)setRepresentActiveState:(NSInteger)newState | |
118 | 118 | { |
119 | 119 | representActiveState = newState; |
120 | 120 | // [self setNeedsDisplay:YES]; |
@@ -153,7 +153,7 @@ | ||
153 | 153 | alternateButton:NSLocalizedString(@"Replace", @"Replace") |
154 | 154 | otherButton:nil |
155 | 155 | informativeTextWithFormat:information]; |
156 | - int ret = [alert runModal]; | |
156 | + NSInteger ret = [alert runModal]; | |
157 | 157 | if(ret == NSAlertDefaultReturn) { |
158 | 158 | return; |
159 | 159 | } |
@@ -9,7 +9,9 @@ | ||
9 | 9 | |
10 | 10 | @interface NSAppleEventDescriptor(HMCocoaExtention) |
11 | 11 | |
12 | +#ifndef __LP64__ | |
12 | 13 | + (id)descriptorWithFloat:(float)aFloat; |
14 | +#endif | |
13 | 15 | |
14 | 16 | + (id)targetDescriptorWithApplicationIdentifier:(NSString *)identifier; |
15 | 17 | + (id)targetDescriptorWithAppName:(NSString *)appName; |
@@ -13,12 +13,14 @@ static NSString *HMAEDesNotAEExceptionResonFormat = @"Should be call to instance | ||
13 | 13 | |
14 | 14 | @implementation NSAppleEventDescriptor(HMCocoaExtention) |
15 | 15 | |
16 | +#ifndef __LP64__ | |
16 | 17 | + (id)descriptorWithFloat:(float)aFloat |
17 | 18 | { |
18 | 19 | return [NSAppleEventDescriptor descriptorWithDescriptorType:typeShortFloat |
19 | 20 | bytes:&aFloat |
20 | 21 | length:sizeof(aFloat)]; |
21 | 22 | } |
23 | +#endif | |
22 | 24 | |
23 | 25 | + (id)targetDescriptorWithApplicationIdentifier:(NSString *)identifier |
24 | 26 | { |
@@ -11,19 +11,19 @@ | ||
11 | 11 | |
12 | 12 | @implementation NSBezierPath (AMShading) |
13 | 13 | |
14 | -static void linearShadedColor(void *info, const float *in, float *out) | |
14 | +static void linearShadedColor(void *info, const CGFloat *in, CGFloat *out) | |
15 | 15 | { |
16 | - float *colors = info; | |
16 | + CGFloat *colors = info; | |
17 | 17 | *out++ = colors[0] + *in * colors[8]; |
18 | 18 | *out++ = colors[1] + *in * colors[9]; |
19 | 19 | *out++ = colors[2] + *in * colors[10]; |
20 | 20 | *out++ = colors[3] + *in * colors[11]; |
21 | 21 | } |
22 | 22 | |
23 | -static void bilinearShadedColor(void *info, const float *in, float *out) | |
23 | +static void bilinearShadedColor(void *info, const CGFloat *in, CGFloat *out) | |
24 | 24 | { |
25 | - float *colors = info; | |
26 | - float factor = (*in)*2.0; | |
25 | + CGFloat *colors = info; | |
26 | + CGFloat factor = (*in)*2.0; | |
27 | 27 | if (*in > 0.5) { |
28 | 28 | factor = 2-factor; |
29 | 29 | } |
@@ -113,7 +113,7 @@ static void bilinearShadedColor(void *info, const float *in, float *out) | ||
113 | 113 | CGPoint startPoint = {0, 0}; |
114 | 114 | CGPoint endPoint = {0, 0}; |
115 | 115 | CGFunctionRef function; |
116 | - float colors[12]; // pointer to color values | |
116 | + CGFloat colors[12]; // pointer to color values | |
117 | 117 | |
118 | 118 | // get my context |
119 | 119 | CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; |
@@ -141,8 +141,8 @@ static void bilinearShadedColor(void *info, const float *in, float *out) | ||
141 | 141 | // draw gradient |
142 | 142 | colorspace = CGColorSpaceCreateDeviceRGB(); |
143 | 143 | size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace); |
144 | - static const float domain[2] = {0.0, 1.0}; | |
145 | - static const float range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}; | |
144 | + static const CGFloat domain[2] = {0.0, 1.0}; | |
145 | + static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}; | |
146 | 146 | //static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL}; |
147 | 147 | |
148 | 148 | // Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs. |