Permalink
Browse files

initial-commit

  • Loading branch information...
0 parents commit b79b681ab3c28c64b7380249775166546b1d4331 UncleMiF committed Jun 24, 2011
Showing with 892 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +2 −0 English.lproj/InfoPlist.strings
  3. +47 −0 Info.plist
  4. +37 −0 MethodReplace.h
  5. +42 −0 MethodReplace.m
  6. +39 −0 XcodeColors.h
  7. +360 −0 XcodeColors.m
  8. +321 −0 XcodeColors.xcodeproj/project.pbxproj
  9. +7 −0 XcodeColors_Prefix.pch
  10. +11 −0 install
  11. +2 −0 open
  12. +16 −0 version.plist
  13. +3 −0 xcb-install.pl
@@ -0,0 +1,5 @@
+build
+.svn
+.DS_Store
+*.xcodeproj/xcuserdata
+*.xcodeproj/project.xcworkspace
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+NSHumanReadableCopyright = "© 2010-2011, Deep IT, Uncle MiF";
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>ru.DeepIT.${PRODUCT_NAME}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0.8</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>108</string>
+ <key>LoadAtLaunch</key>
+ <true/>
+ <key>NSPrincipalClass</key>
+ <string>XcodeColors</string>
+ <key>SIMBLTargetApplications</key>
+ <array>
+ <dict>
+ <key>BundleIdentifier</key>
+ <string>com.apple.Xcode</string>
+ </dict>
+ <dict>
+ <key>BundleIdentifier</key>
+ <string>com.apple.dt.Xcode</string>
+ </dict>
+ </array>
+ <key>XCGCReady</key>
+ <true/>
+ <key>XCPluginHasUI</key>
+ <false/>
+ <key>XC4Compatible</key>
+ <true/>
+</dict>
+</plist>
@@ -0,0 +1,37 @@
+// COMMON FILE: Common
+
+//
+// MethodReplace.h
+// XcodeColors
+//
+// Created by Uncle MiF on 9/15/10.
+// Copyright 2010 Deep IT. All rights reserved.
+//
+
+/* The Black Magic begins here */
+#import <objc/runtime.h>
+
+typedef enum { CLASS_METHOD, INSTANCE_METHOD} t_target;
+
+#define ReplaceClassMethod(sourceClassName,sourceSelName,destinationClassName) ReplaceMethod(CLASS_METHOD, [sourceClassName class], @selector(sourceSelName), [destinationClassName class], 0)
+#define ReplaceInstanceMethod(sourceClassName,sourceSelName,destinationClassName) ReplaceMethod(INSTANCE_METHOD, [sourceClassName class], @selector(sourceSelName), [destinationClassName class], 0)
+
+#define DynamicMessage(targetMode,targetClassName,instance,targetSelName,...) \
+do\
+{\
+Method (*get_targetMethod)(Class,SEL) = targetMode == CLASS_METHOD ? class_getClassMethod : class_getInstanceMethod;\
+Method method = get_targetMethod([targetClassName class],@selector(targetSelName));\
+if (method)\
+{\
+IMP imp = method_getImplementation(method);\
+if (imp)\
+imp(instance,@selector(targetSelName),##__VA_ARGS__);\
+}\
+} while(0)
+
+#define DynamicClassMessage(...) DynamicMessage(CLASS_METHOD,##__VA_ARGS__)
+#define DynamicInstanceMessage(...) DynamicMessage(INSTANCE_METHOD,##__VA_ARGS__)
+
+IMP ReplaceMethod(t_target target,
+ Class sourceClass,SEL sourceSel,
+ Class destinationClass,SEL destinationSel);
@@ -0,0 +1,42 @@
+// COMMON FILE: Common
+
+//
+// MethodReplace.m
+// XcodeColors
+//
+// Created by Uncle MiF on 9/15/10.
+// Copyright 2010 Deep IT. All rights reserved.
+//
+
+#import "MethodReplace.h"
+
+IMP ReplaceMethod(t_target target,
+ Class sourceClass,SEL sourceSel,
+ Class destinationClass,SEL destinationSel)
+{
+ if (!sourceSel || !sourceClass || !destinationClass)
+ return nil;
+
+ if (!destinationSel)
+ destinationSel = sourceSel;
+
+ Method (*get_targetMethod)(Class,SEL) = target == CLASS_METHOD ? class_getClassMethod : class_getInstanceMethod;
+
+ Method sourceMethod = get_targetMethod(sourceClass, sourceSel);
+ if (!sourceMethod)
+ return nil;
+
+ IMP prevImplementation = method_getImplementation(sourceMethod);
+
+ Method destinationMethod = get_targetMethod(destinationClass, destinationSel);
+ if (!destinationMethod)
+ return nil;
+
+ IMP newImplementation = method_getImplementation(destinationMethod);
+ if (!newImplementation)
+ return nil;
+
+ method_setImplementation(sourceMethod, newImplementation);
+
+ return prevImplementation;
+}
@@ -0,0 +1,39 @@
+//
+// XcodeColors.h
+// XcodeColors
+//
+// Created by Uncle MiF on 9/13/10.
+// Copyright 2010 Deep IT. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface XcodeColors : NSObject
+
+// Foreground
+
++(NSColor*)blackColor;
++(NSColor*)redColor;
++(NSColor*)greenColor;
++(NSColor*)yellowColor;
++(NSColor*)blueColor;
++(NSColor*)magentaColor;
++(NSColor*)cyanColor;
++(NSColor*)whiteColor;
+
+// Background
+
++(NSColor*)blackBackgroundColor;
++(NSColor*)redBackgroundColor;
++(NSColor*)greenBackgroundColor;
++(NSColor*)yellowBackgroundColor;
++(NSColor*)blueBackgroundColor;
++(NSColor*)magentaBackgroundColor;
++(NSColor*)cyanBackgroundColor;
++(NSColor*)whiteBackgroundColor;
+
+// Plugin
++(void)pluginDidLoad:(id)xcodeDirectCompatibility;
+-(void)registerLaunchSystemDescriptions;
+
+@end
Oops, something went wrong.

0 comments on commit b79b681

Please sign in to comment.