• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BathyScapheのTitleRulerAppearanceを手軽に変更するツール


Commit MetaInfo

Révision766318270ba5f4124b20c71759017ea7fe301d66 (tree)
l'heure2011-02-22 01:16:05
Auteurmasakih <masakih@user...>
Commitermasakih

Message de Log

[Mod] 64bit safeに修正

Change Summary

Modification

--- a/BSCSTitleRulerImitation.h
+++ b/BSCSTitleRulerImitation.h
@@ -28,7 +28,7 @@ typedef enum _BSTitleRulerModeType {
2828
2929 // addtional variables.
3030 NSControlTint representControlTint;
31- int representActiveState; // 0: Inactive. 1: Active.
31+ NSInteger representActiveState; // 0: Inactive. 1: Active.
3232 }
3333
3434 - (BSTitleRulerAppearance *)appearance;
@@ -50,7 +50,7 @@ typedef enum _BSTitleRulerModeType {
5050 - (void)setRepresentControlTint:(NSControlTint)newTint;
5151
5252 // 0: Inactive. 1: Active.
53-- (int)representActiveState;
54-- (void)setRepresentActiveState:(int)newState;
53+- (NSInteger)representActiveState;
54+- (void)setRepresentActiveState:(NSInteger)newState;
5555
5656 @end
--- a/BSCSTitleRulerImitation.m
+++ b/BSCSTitleRulerImitation.m
@@ -78,7 +78,7 @@
7878
7979 - (void)setCurrentMode:(BSTitleRulerModeType)newType
8080 {
81- float newThickness;
81+ CGFloat newThickness;
8282 _currentMode = newType;
8383
8484 switch(newType) {
@@ -110,11 +110,11 @@
110110 }
111111
112112 // 0: Inactive. 1: Active.
113-- (int)representActiveState
113+- (NSInteger)representActiveState
114114 {
115115 return representActiveState;
116116 }
117-- (void)setRepresentActiveState:(int)newState
117+- (void)setRepresentActiveState:(NSInteger)newState
118118 {
119119 representActiveState = newState;
120120 // [self setNeedsDisplay:YES];
--- a/BSTRADocument.m
+++ b/BSTRADocument.m
@@ -153,7 +153,7 @@
153153 alternateButton:NSLocalizedString(@"Replace", @"Replace")
154154 otherButton:nil
155155 informativeTextWithFormat:information];
156- int ret = [alert runModal];
156+ NSInteger ret = [alert runModal];
157157 if(ret == NSAlertDefaultReturn) {
158158 return;
159159 }
--- a/NSAppleEventDescriptor-Extensions.h
+++ b/NSAppleEventDescriptor-Extensions.h
@@ -9,7 +9,9 @@
99
1010 @interface NSAppleEventDescriptor(HMCocoaExtention)
1111
12+#ifndef __LP64__
1213 + (id)descriptorWithFloat:(float)aFloat;
14+#endif
1315
1416 + (id)targetDescriptorWithApplicationIdentifier:(NSString *)identifier;
1517 + (id)targetDescriptorWithAppName:(NSString *)appName;
--- a/NSAppleEventDescriptor-Extensions.m
+++ b/NSAppleEventDescriptor-Extensions.m
@@ -13,12 +13,14 @@ static NSString *HMAEDesNotAEExceptionResonFormat = @"Should be call to instance
1313
1414 @implementation NSAppleEventDescriptor(HMCocoaExtention)
1515
16+#ifndef __LP64__
1617 + (id)descriptorWithFloat:(float)aFloat
1718 {
1819 return [NSAppleEventDescriptor descriptorWithDescriptorType:typeShortFloat
1920 bytes:&aFloat
2021 length:sizeof(aFloat)];
2122 }
23+#endif
2224
2325 + (id)targetDescriptorWithApplicationIdentifier:(NSString *)identifier
2426 {
--- a/NSBezierPath_AMShading.m
+++ b/NSBezierPath_AMShading.m
@@ -11,19 +11,19 @@
1111
1212 @implementation NSBezierPath (AMShading)
1313
14-static void linearShadedColor(void *info, const float *in, float *out)
14+static void linearShadedColor(void *info, const CGFloat *in, CGFloat *out)
1515 {
16- float *colors = info;
16+ CGFloat *colors = info;
1717 *out++ = colors[0] + *in * colors[8];
1818 *out++ = colors[1] + *in * colors[9];
1919 *out++ = colors[2] + *in * colors[10];
2020 *out++ = colors[3] + *in * colors[11];
2121 }
2222
23-static void bilinearShadedColor(void *info, const float *in, float *out)
23+static void bilinearShadedColor(void *info, const CGFloat *in, CGFloat *out)
2424 {
25- float *colors = info;
26- float factor = (*in)*2.0;
25+ CGFloat *colors = info;
26+ CGFloat factor = (*in)*2.0;
2727 if (*in > 0.5) {
2828 factor = 2-factor;
2929 }
@@ -113,7 +113,7 @@ static void bilinearShadedColor(void *info, const float *in, float *out)
113113 CGPoint startPoint = {0, 0};
114114 CGPoint endPoint = {0, 0};
115115 CGFunctionRef function;
116- float colors[12]; // pointer to color values
116+ CGFloat colors[12]; // pointer to color values
117117
118118 // get my context
119119 CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
@@ -141,8 +141,8 @@ static void bilinearShadedColor(void *info, const float *in, float *out)
141141 // draw gradient
142142 colorspace = CGColorSpaceCreateDeviceRGB();
143143 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};
146146 //static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL};
147147
148148 // Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs.