Permalink
Browse files

Initial import

  • Loading branch information...
0 parents commit 11995919e027a352b7065753d92033191c0650e9 @technocoreai committed Mar 31, 2011
@@ -0,0 +1,2 @@
+xcuserdata
+*.xcworkspace
@@ -0,0 +1,251 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 89D0D16313453C1D00B1DFD8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D0D16113453C1D00B1DFD8 /* InfoPlist.strings */; };
+ 89D0D16613453C1D00B1DFD8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D0D16513453C1D00B1DFD8 /* main.m */; };
+ 89D0D17613453C7500B1DFD8 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89D0D17513453C7500B1DFD8 /* AppKit.framework */; };
+ 89D0D17813453C7B00B1DFD8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89D0D17713453C7B00B1DFD8 /* Foundation.framework */; };
+ 89D0D17B13453CAD00B1DFD8 /* PlaintextPasteServiceProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D0D17A13453CAD00B1DFD8 /* PlaintextPasteServiceProvider.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 89D0D15413453C1D00B1DFD8 /* plaintext-paste-service.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "plaintext-paste-service.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 89D0D16013453C1D00B1DFD8 /* plaintext-paste-service-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "plaintext-paste-service-Info.plist"; sourceTree = "<group>"; };
+ 89D0D16213453C1D00B1DFD8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 89D0D16413453C1D00B1DFD8 /* plaintext-paste-service-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "plaintext-paste-service-Prefix.pch"; sourceTree = "<group>"; };
+ 89D0D16513453C1D00B1DFD8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 89D0D17513453C7500B1DFD8 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 89D0D17713453C7B00B1DFD8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 89D0D17913453CAD00B1DFD8 /* PlaintextPasteServiceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaintextPasteServiceProvider.h; sourceTree = "<group>"; };
+ 89D0D17A13453CAD00B1DFD8 /* PlaintextPasteServiceProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlaintextPasteServiceProvider.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 89D0D15113453C1D00B1DFD8 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 89D0D17813453C7B00B1DFD8 /* Foundation.framework in Frameworks */,
+ 89D0D17613453C7500B1DFD8 /* AppKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 89D0D14913453C1D00B1DFD8 = {
+ isa = PBXGroup;
+ children = (
+ 89D0D17713453C7B00B1DFD8 /* Foundation.framework */,
+ 89D0D17513453C7500B1DFD8 /* AppKit.framework */,
+ 89D0D15E13453C1D00B1DFD8 /* plaintext-paste-service */,
+ 89D0D15713453C1D00B1DFD8 /* Frameworks */,
+ 89D0D15513453C1D00B1DFD8 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 89D0D15513453C1D00B1DFD8 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 89D0D15413453C1D00B1DFD8 /* plaintext-paste-service.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 89D0D15713453C1D00B1DFD8 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 89D0D15E13453C1D00B1DFD8 /* plaintext-paste-service */ = {
+ isa = PBXGroup;
+ children = (
+ 89D0D17913453CAD00B1DFD8 /* PlaintextPasteServiceProvider.h */,
+ 89D0D17A13453CAD00B1DFD8 /* PlaintextPasteServiceProvider.m */,
+ 89D0D15F13453C1D00B1DFD8 /* Supporting Files */,
+ );
+ path = "plaintext-paste-service";
+ sourceTree = "<group>";
+ };
+ 89D0D15F13453C1D00B1DFD8 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 89D0D16013453C1D00B1DFD8 /* plaintext-paste-service-Info.plist */,
+ 89D0D16113453C1D00B1DFD8 /* InfoPlist.strings */,
+ 89D0D16413453C1D00B1DFD8 /* plaintext-paste-service-Prefix.pch */,
+ 89D0D16513453C1D00B1DFD8 /* main.m */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 89D0D15313453C1D00B1DFD8 /* plaintext-paste-service */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 89D0D17213453C1D00B1DFD8 /* Build configuration list for PBXNativeTarget "plaintext-paste-service" */;
+ buildPhases = (
+ 89D0D15013453C1D00B1DFD8 /* Sources */,
+ 89D0D15113453C1D00B1DFD8 /* Frameworks */,
+ 89D0D15213453C1D00B1DFD8 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "plaintext-paste-service";
+ productName = "plaintext-paste-service";
+ productReference = 89D0D15413453C1D00B1DFD8 /* plaintext-paste-service.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 89D0D14B13453C1D00B1DFD8 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 89D0D14E13453C1D00B1DFD8 /* Build configuration list for PBXProject "plaintext-paste-service" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 89D0D14913453C1D00B1DFD8;
+ productRefGroup = 89D0D15513453C1D00B1DFD8 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 89D0D15313453C1D00B1DFD8 /* plaintext-paste-service */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 89D0D15213453C1D00B1DFD8 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 89D0D16313453C1D00B1DFD8 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 89D0D15013453C1D00B1DFD8 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 89D0D16613453C1D00B1DFD8 /* main.m in Sources */,
+ 89D0D17B13453CAD00B1DFD8 /* PlaintextPasteServiceProvider.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 89D0D16113453C1D00B1DFD8 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 89D0D16213453C1D00B1DFD8 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 89D0D17013453C1D00B1DFD8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 89D0D17113453C1D00B1DFD8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 89D0D17313453C1D00B1DFD8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "plaintext-paste-service/plaintext-paste-service-Prefix.pch";
+ INFOPLIST_FILE = "plaintext-paste-service/plaintext-paste-service-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 89D0D17413453C1D00B1DFD8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "plaintext-paste-service/plaintext-paste-service-Prefix.pch";
+ INFOPLIST_FILE = "plaintext-paste-service/plaintext-paste-service-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 89D0D14E13453C1D00B1DFD8 /* Build configuration list for PBXProject "plaintext-paste-service" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 89D0D17013453C1D00B1DFD8 /* Debug */,
+ 89D0D17113453C1D00B1DFD8 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 89D0D17213453C1D00B1DFD8 /* Build configuration list for PBXNativeTarget "plaintext-paste-service" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 89D0D17313453C1D00B1DFD8 /* Debug */,
+ 89D0D17413453C1D00B1DFD8 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 89D0D14B13453C1D00B1DFD8 /* Project object */;
+}
@@ -0,0 +1,12 @@
+#import <Foundation/Foundation.h>
+#import <AppKit/AppKit.h>
+
+
+@interface PlaintextPasteServiceProvider : NSObject {
+}
+
+- (void) pastePlaintext: (NSPasteboard *) pboard
+ userData: (NSString *) data
+ error: (NSString **) error;
+
+@end
@@ -0,0 +1,24 @@
+#import "PlaintextPasteServiceProvider.h"
+
+
+@implementation PlaintextPasteServiceProvider
+
+- (void) pastePlaintext: (NSPasteboard *) pboard
+ userData: (NSString *) data
+ error: (NSString **) error
+{
+ NSPasteboard *generalPasteboard = [NSPasteboard generalPasteboard];
+ NSArray *supportedTypes = [NSArray arrayWithObject:NSStringPboardType];
+ NSString *bestType = [generalPasteboard availableTypeFromArray:supportedTypes];
+
+ if (bestType == nil) {
+ *error = @"No text data in the pasteboard";
+ return;
+ }
+
+ NSString *text = [generalPasteboard stringForType:NSStringPboardType];
+ [pboard clearContents];
+ [pboard writeObjects:[NSArray arrayWithObject:text]];
+}
+
+@end
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
@@ -0,0 +1,15 @@
+#import <Foundation/Foundation.h>
+#import "PlaintextPasteServiceProvider.h"
+
+int main (int argc, const char * argv[])
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ PlaintextPasteServiceProvider *provider = [[PlaintextPasteServiceProvider alloc] init];
+ NSRegisterServicesProvider(provider, @"PlaintextPasteServiceProvider");
+
+ [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:60.0]];
+
+ [pool drain];
+ return 0;
+}
@@ -0,0 +1,48 @@
+<?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>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>ru.technocore.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>LSUIElement</key>
+ <true/>
+ <key>NSServices</key>
+ <array>
+ <dict>
+ <key>NSMenuItem</key>
+ <dict>
+ <key>default</key>
+ <string>Paste Plain Text</string>
+ </dict>
+ <key>NSMessage</key>
+ <string>pastePlaintext</string>
+ <key>NSPortName</key>
+ <string>PlaintextPasteServiceProvider</string>
+ <key>NSReturnTypes</key>
+ <array>
+ <string>NSStringPboardType</string>
+ </array>
+ </dict>
+ </array>
+</dict>
+</plist>
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'plaintext-paste-service' target in the 'plaintext-paste-service' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+#endif

0 comments on commit 1199591

Please sign in to comment.