diff --git a/client/osx-ui/DJRandomUploader.xcodeproj/project.pbxproj b/client/osx-ui/DJRandomUploader.xcodeproj/project.pbxproj index 2e791e161a99fb282021fa663d16dd301b2027e9..30ec2f221cdca3f9481b4910ec356aa94c09b783 100644 --- a/client/osx-ui/DJRandomUploader.xcodeproj/project.pbxproj +++ b/client/osx-ui/DJRandomUploader.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 719C6F9C14E711B300FE7277 /* YAJL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 719C6F9914E7109600FE7277 /* YAJL.framework */; }; + 719C6FA114E7218500FE7277 /* YAJL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 719C6F9914E7109600FE7277 /* YAJL.framework */; }; AB34DD96144ACEE000E506F0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB34DD95144ACEE000E506F0 /* Cocoa.framework */; }; AB34DDA0144ACEE000E506F0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB34DD9E144ACEE000E506F0 /* InfoPlist.strings */; }; AB34DDA3144ACEE000E506F0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AB34DDA2144ACEE000E506F0 /* main.m */; }; @@ -14,26 +16,26 @@ AB34DDA9144ACEE000E506F0 /* DJRandomUploaderAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB34DDA8144ACEE000E506F0 /* DJRandomUploaderAppDelegate.m */; }; AB34DDAC144ACEE000E506F0 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB34DDAA144ACEE000E506F0 /* MainMenu.xib */; }; AB34DDB7144AF4CA00E506F0 /* ProcessController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB34DDB6144AF4CA00E506F0 /* ProcessController.m */; }; - AB34DDB9144B0CDC00E506F0 /* YAJL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB34DDB8144B0CDC00E506F0 /* YAJL.framework */; }; - AB34DDBB144B0D4100E506F0 /* YAJL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = AB34DDB8144B0CDC00E506F0 /* YAJL.framework */; }; ABAF27DB144B4F3C00A1F4DF /* pirate-icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = ABAF27DA144B4F3C00A1F4DF /* pirate-icon.icns */; }; ABAF27DD144B51D500A1F4DF /* pirate-icon-22px.png in Resources */ = {isa = PBXBuildFile; fileRef = ABAF27DC144B51D500A1F4DF /* pirate-icon-22px.png */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - AB34DDBA144B0D2D00E506F0 /* CopyFiles */ = { + 719C6FA014E7217900FE7277 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - AB34DDBB144B0D4100E506F0 /* YAJL.framework in CopyFiles */, + 719C6FA114E7218500FE7277 /* YAJL.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 719C6F9914E7109600FE7277 /* YAJL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAJL.framework; path = DJRandomUploader/Frameworks/YAJL.framework; sourceTree = "<group>"; }; + 719C6F9F14E7144B00FE7277 /* fix-app.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "fix-app.sh"; sourceTree = "<group>"; }; AB34DD91144ACEE000E506F0 /* DJRandomUploader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DJRandomUploader.app; sourceTree = BUILT_PRODUCTS_DIR; }; AB34DD95144ACEE000E506F0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; AB34DD98144ACEE000E506F0 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -60,19 +62,30 @@ buildActionMask = 2147483647; files = ( AB34DD96144ACEE000E506F0 /* Cocoa.framework in Frameworks */, - AB34DDB9144B0CDC00E506F0 /* YAJL.framework in Frameworks */, + 719C6F9C14E711B300FE7277 /* YAJL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 719C6F9E14E7144B00FE7277 /* scripts */ = { + isa = PBXGroup; + children = ( + 719C6F9F14E7144B00FE7277 /* fix-app.sh */, + ); + name = scripts; + path = DJRandomUploader/scripts; + sourceTree = "<group>"; + }; AB34DD86144ACEE000E506F0 = { isa = PBXGroup; children = ( + 719C6F9914E7109600FE7277 /* YAJL.framework */, AB34DD9B144ACEE000E506F0 /* DJRandomUploader */, AB34DD94144ACEE000E506F0 /* Frameworks */, AB34DD92144ACEE000E506F0 /* Products */, + 719C6F9E14E7144B00FE7277 /* scripts */, ); sourceTree = "<group>"; }; @@ -141,7 +154,8 @@ AB34DD8D144ACEE000E506F0 /* Sources */, AB34DD8E144ACEE000E506F0 /* Frameworks */, AB34DD8F144ACEE000E506F0 /* Resources */, - AB34DDBA144B0D2D00E506F0 /* CopyFiles */, + 719C6FA014E7217900FE7277 /* CopyFiles */, + 719C6F9D14E7135E00FE7277 /* ShellScript */, ); buildRules = ( ); @@ -157,6 +171,9 @@ /* Begin PBXProject section */ AB34DD88144ACEE000E506F0 /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; buildConfigurationList = AB34DD8B144ACEE000E506F0 /* Build configuration list for PBXProject "DJRandomUploader" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; @@ -189,6 +206,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 719C6F9D14E7135E00FE7277 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 12; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "${PROJECT_DIR}/${PRODUCT_NAME}/scripts/fix-app.sh"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ AB34DD8D144ACEE000E506F0 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -266,10 +299,11 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "\"$(SRCROOT)/Frameworks\"", + "\"$(SRCROOT)/DJRandomUploader/Frameworks\"", ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -277,6 +311,7 @@ GCC_PREFIX_HEADER = "DJRandomUploader/DJRandomUploader-Prefix.pch"; INFOPLIST_FILE = "DJRandomUploader/DJRandomUploader-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = DJRandomUploader; WRAPPER_EXTENSION = app; @@ -287,17 +322,19 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "\"$(SRCROOT)/Frameworks\"", + "\"$(SRCROOT)/DJRandomUploader/Frameworks\"", ); GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DJRandomUploader/DJRandomUploader-Prefix.pch"; INFOPLIST_FILE = "DJRandomUploader/DJRandomUploader-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = DJRandomUploader; SKIP_INSTALL = NO; diff --git a/client/osx-ui/DJRandomUploader/DJRandomUploader-Info.plist b/client/osx-ui/DJRandomUploader/DJRandomUploader-Info.plist index 1e652899c0cee29e8b26bf49313e7645fab115eb..abbb7fcfb19833a3688c6bf7c998e6cb8cfece56 100644 --- a/client/osx-ui/DJRandomUploader/DJRandomUploader-Info.plist +++ b/client/osx-ui/DJRandomUploader/DJRandomUploader-Info.plist @@ -21,7 +21,7 @@ <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> - <string>0.2.5</string> + <string>0.2.6</string> <key>LSApplicationCategoryType</key> <string>public.app-category.music</string> <key>LSMinimumSystemVersion</key> diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Headers b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Headers new file mode 120000 index 0000000000000000000000000000000000000000..a177d2a6b92600696030834c319f5e1434f9ee6a --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Resources b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Resources new file mode 120000 index 0000000000000000000000000000000000000000..953ee36f3bb709faf58a351e0b33c353e337c0a2 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/NSBundle+YAJL.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/NSBundle+YAJL.h new file mode 100644 index 0000000000000000000000000000000000000000..4b8a41be961ddf3acca6e70a9caa4d53280ba080 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/NSBundle+YAJL.h @@ -0,0 +1,62 @@ +// +// NSBundle+YAJL.h +// YAJL +// +// Created by Gabriel Handford on 7/23/09. +// Copyright 2009. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "YAJLParser.h" + +/*! + Utilities for loading JSON from resource bundles. + + @code + id JSONValue = [[NSBundle mainBundle] yajl_JSONFromResource:@"kegs.json"]; + @endcode + */ +@interface NSBundle(YAJL) + +/*! + Load JSON from bundle. + @param resource Resource name with extension, for example, file.json + @throws YAJLParserException On parse error + */ +- (id)yajl_JSONFromResource:(NSString *)resource; + +/*! + Load JSON from bundle. + @param resource Resource name with extension, for example, file.json + @param options Parser options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + + @param error Out error + @result JSON value (NSArray, NSDictionary) or nil if errored + */ +- (id)yajl_JSONFromResource:(NSString *)resource options:(YAJLParserOptions)options error:(NSError **)error; + +@end diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/NSObject+YAJL.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/NSObject+YAJL.h new file mode 100644 index 0000000000000000000000000000000000000000..e2a49dae538e5f6aa488e2bdc5b9c80be4d1144a --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/NSObject+YAJL.h @@ -0,0 +1,154 @@ +// +// NSObject+YAJL.h +// YAJL +// +// Created by Gabriel Handford on 7/23/09. +// Copyright 2009. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "YAJLGen.h" +#import "YAJLParser.h" + +/*! + Generate JSON string from NSArray, NSDictionary or custom object or parse JSON from NSString or custom object. + + Parse JSON: + @code + NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"]; + NSArray *arrayFromData = [JSONData yajl_JSON]; + + NSString *JSONString = @"[\"Test\"]"; + NSArray *arrayFromString = [JSONString yajl_JSON]; + + // With options and out error + NSError *error = nil; + NSArray *arrayFromString = [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:&error]; + @endcode + + Generate JSON: + @code + NSDictionary *dict = [NSDictionary dictionaryWithObject:@"value" forKey:@"key"]; + NSString *JSONString = [dict yajl_JSONString]; + + // Beautified with custon indent string + NSArray *array = [NSArray arrayWithObjects:@"value1", @"value2", nil]; + NSString *JSONString = [dict yajl_JSONStringWithOptions:YAJLGenOptionsBeautify indentString:@" "]; + @endcode + */ +@interface NSObject(YAJL) + +#pragma mark Gen + +/*! + Create JSON string from object. + Supported objects include: NSArray, NSDictionary, NSNumber, NSString, NSNull + To override JSON value to encode (or support custom objects), implement (id)JSON; See YAJLCoding in YAJLGen.h + @throws YAJLGenInvalidObjectException If object is invalid + @result JSON String + */ +- (NSString *)yajl_JSONString; + +/*! + Create JSON string from object. + Supported objects include: NSArray, NSDictionary, NSNumber, NSString, NSNull + To override JSON value to encode (or support custom objects), implement (id)JSON; See YAJLCoding in YAJLGen.h + @throws YAJLGenInvalidObjectException If object is invalid + @param options + - YAJLGenOptionsNone: No options + - YAJLGenOptionsBeautify: Beautifiy JSON output + - YAJLGenOptionsIgnoreUnknownTypes: Ignore unknown types (will use null value) + - YAJLGenOptionsIncludeUnsupportedTypes: Handle non-JSON types (including NSDate, NSData, NSURL) + + @param indentString + @result JSON String + */ +- (NSString *)yajl_JSONStringWithOptions:(YAJLGenOptions)options indentString:(NSString *)indentString; + + +#pragma mark Parsing + +/*! + Parse JSON (NSString or NSData or dataUsingEncoding:). + @result JSON object + @throws YAJLParserException If a parse error occured + @throws YAJLParsingUnsupportedException If not NSData or doesn't respond to dataUsingEncoding: + + @code + NSString *JSONString = @"{'foo':['bar', true]}"; + id JSONValue = [JSONString yajl_JSON]; + + NSData *JSONData = ...; + id JSONValue = [JSONData yajl_JSON]; + @endcode + */ +- (id)yajl_JSON; + +/*! + Parse JSON (NSString or NSData or dataUsingEncoding:) with out error. + + If an error occurs, the returned object will be the current state of the object when + the error occurred. + + @param error Error to set if we failed to parse + @result JSON object + @throws YAJLParserException If a parse error occured + @throws YAJLParsingUnsupportedException If not NSData or doesn't respond to dataUsingEncoding: + + @code + NSString *JSONString = @"{'foo':['bar', true]}"; + NSError *error = nil; + [JSONString yajl_JSON:error]; + if (error) ...; + @endcode + */ +- (id)yajl_JSON:(NSError **)error; + +/*! + Parse JSON (NSString or NSData or dataUsingEncoding:) with options and out error. + + If an error occurs, the returned object will be the current state of the object when + the error occurred. + + @param options Parse options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + + @param error Error to set if we failed to parse + @result JSON object + @throws YAJLParserException If a parse error occured + @throws YAJLParsingUnsupportedException If not NSData or doesn't respond to dataUsingEncoding: + + @code + NSString *JSONString = @"{'foo':['bar', true]} // comment"; + NSError *error = nil; + [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:error]; + if (error) ...; + @endcode + */ +- (id)yajl_JSONWithOptions:(YAJLParserOptions)options error:(NSError **)error; + +@end + diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJL.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJL.h new file mode 100644 index 0000000000000000000000000000000000000000..53348630fbc5fe2883137caa84709820c98f2262 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJL.h @@ -0,0 +1,212 @@ +// +// YAJL.h +// YAJL +// +// Created by Gabriel Handford on 7/23/09. +// Copyright 2009. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "YAJLParser.h" +#import "YAJLDocument.h" +#import "YAJLGen.h" +#import "NSObject+YAJL.h" +#import "NSBundle+YAJL.h" + +/*! + @mainpage YAJL + + The YAJL framework is an Objective-C wrapper around the http://lloyd.github.com/yajl/ SAX-style JSON parser. + + @section Links + + Source: http://github.com/gabriel/yajl-objc + + View docs online: http://gabriel.github.com/yajl-objc/ + + YAJL C docs: http://lloyd.github.com/yajl/ + + @section Usage Usage + + To use the framework (for Mac OS X or iOS): + + @code + // For Mac OS X + #import <YAJL/YAJL.h> + // For iOS + #import <YAJLiOS/YAJL.h> + @endcode + + @section Examples Examples + + @subsection Example1 To parse JSON from NSData + + @code + NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"]; + NSArray *arrayFromData = [JSONData yajl_JSON]; + @endcode + + @subsection Example2 To parse JSON from NSString + + @code + NSString *JSONString = @"[1, 2, 3]"; + NSArray *arrayFromString = [JSONString yajl_JSON]; + @endcode + + @subsection Example2 To parse JSON from NSString with error and comments + + @code + // With options and out error + NSString *JSONString = @"[1, 2, 3] // Allow comments"; + NSError *error = nil; + NSArray *arrayFromString = [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:&error]; + @endcode + + @subsection Example3 To generate JSON from an object, NSArray, NSDictionary, etc. + + @code + NSDictionary *dict = [NSDictionary dictionaryWithObject:@"value" forKey:@"key"]; + NSString *JSONString = [dict yajl_JSONString]; + @endcode + + @subsection Example4 To generate JSON from an object, beautified with custom indent + + @code + // Beautified with custon indent string + NSArray *array = [NSArray arrayWithObjects:@"value1", @"value2", nil]; + NSString *JSONString = [dict yajl_JSONStringWithOptions:YAJLGenOptionsBeautify indentString:@" "]; + @endcode + + @subsection Example5 To use the streaming (or SAX style) parser, use YAJLParser + + @code + NSData *data = [NSData dataWithContentsOfFile:@"example.json"]; + + YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments]; + parser.delegate = self; + [parser parse:data]; + if (parser.parserError) + NSLog(@"Error:\n%@", parser.parserError); + + parser.delegate = nil; + [parser release]; + + // Include delegate methods from YAJLParserDelegate + - (void)parserDidStartDictionary:(YAJLParser *)parser { } + - (void)parserDidEndDictionary:(YAJLParser *)parser { } + + - (void)parserDidStartArray:(YAJLParser *)parser { } + - (void)parserDidEndArray:(YAJLParser *)parser { } + + - (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key { } + - (void)parser:(YAJLParser *)parser didAdd:(id)value { } + @endcode + + @subsection ParserOptions Parser Options + + There are options when parsing that can be specified with YAJLParser#initWithParserOptions:. + + - YAJLParserOptionsAllowComments: Allows comments in JSON + - YAJLParserOptionsCheckUTF8: Will verify UTF-8 + - YAJLParserOptionsStrictPrecision: Will force strict precision and return integer overflow error, if number is greater than long long. + + @subsection Example6 Parsing as data becomes available + + @code + YAJLParser *parser = [[[YAJLParser alloc] init] autorelease]; + parser.delegate = self; + + // A chunk of data comes... + YAJLParserStatus status = [parser parse:chunk1]; + // 'status' should be YAJLParserStatusInsufficientData, if its not finished + if (parser.parserError) + NSLog(@"Error:\n%@", parser.parserError); + + // Another chunk of data comes... + YAJLParserStatus status = [parser parse:chunk2]; + // 'status' should be YAJLParserStatusOK if its finished + if (parser.parserError) + NSLog(@"Error:\n%@", parser.parserError); + @endcode + + @subsection Example7 Document style parsing + + To use the document style, use YAJLDocument. Usage should be very similar to NSXMLDocument. + + @code + NSData *data = [NSData dataWithContentsOfFile:@"example.json"]; + NSError *error = nil; + YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:&error]; + // Access root element at document.root + NSLog(@"Root: %@", document.root); + [document release]; + @endcode + + @subsection Example8 Document style parsing as data becomes available + + @code + YAJLDocument *document = [[YAJLDocument alloc] init]; + document.delegate = self; + + NSError *error = nil; + [document parse:chunk1 error:error]; + [document parse:chunk2 error:error]; + + // You can access root element at document.root + NSLog(@"Root: %@", document.root); + [document release]; + + // Or via the YAJLDocumentDelegate delegate methods + + - (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict { } + - (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array { } + - (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array { } + - (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict { } + @endcode + + @subsection Example9 Load JSON from Bundle + + @code + id JSONValue = [[NSBundle mainBundle] yajl_JSONFromResource:@"kegs.json"]; + @endcode + + @section CustomizedEncoding Customized Encoding + + To implement JSON encodable value for custom objects or override for existing objects, implement <tt>- (id)JSON;</tt> + + For example: + + @code + @interface CustomObject : NSObject + @end + + @implementation CustomObject + + - (id)JSON { + return [NSArray arrayWithObject:[NSNumber numberWithInteger:1]]; + } + + @end + @endcode + + */ \ No newline at end of file diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLDocument.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLDocument.h new file mode 100644 index 0000000000000000000000000000000000000000..7890665a71d774c996d2d5c32314dd701b5b9610 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLDocument.h @@ -0,0 +1,196 @@ +// +// YAJLDecoder.h +// YAJL +// +// Created by Gabriel Handford on 3/1/09. +// Copyright 2009. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + + +#include "YAJLParser.h" + +typedef enum { + YAJLDecoderCurrentTypeNone, + YAJLDecoderCurrentTypeArray, + YAJLDecoderCurrentTypeDict +} YAJLDecoderCurrentType; + +extern NSInteger YAJLDocumentStackCapacity; + +@class YAJLDocument; + +/*! + YAJLDocument delegate notified when objects are added. + */ +@protocol YAJLDocumentDelegate <NSObject> +@optional +/*! + Did add dictionary. + @param document Sender + @param dict Dictionary that was added + */ +- (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict; + +/*! + Did add array. + @param document Sender + @param array Array that was added + */ +- (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array; + +/*! + Did add object to array. + @param document Sender + @param object Object added + @param array Array objct was added to + */ +- (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array; + +/*! + Did set object for key on dictionary. + @param document Sender + @param object Object that was set + @param key Key + @param dict Dictionary object was set for key on + */ +- (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict; +@end + +/*! + JSON document interface. + + @code + NSData *data = [NSData dataWithContentsOfFile:@"example.json"]; + NSError *error = nil; + YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:&error]; + // Access root element at document.root + NSLog(@"Root: %@", document.root); + [document release]; + @endcode + + Example for streaming: + @code + YAJLDocument *document = [[YAJLDocument alloc] init]; + document.delegate = self; + + NSError *error = nil; + [document parse:chunk1 error:error]; + [document parse:chunk2 error:error]; + + // You can access root element at document.root + NSLog(@"Root: %@", document.root); + [document release]; + + // Or via the YAJLDocumentDelegate delegate methods + + - (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict { } + - (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array { } + - (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array { } + - (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict { } + @endcode + */ +@interface YAJLDocument : NSObject <YAJLParserDelegate> { + + id root_; // NSArray or NSDictionary + YAJLParser *parser_; + + // TODO(gabe): This should be __weak + id<YAJLDocumentDelegate> delegate_; + + __weak NSMutableDictionary *dict_; // weak; if map in progress, points to the current map + __weak NSMutableArray *array_; // weak; If array in progress, points the current array + __weak NSString *key_; // weak; If map in progress, points to current key + + NSMutableArray *stack_; + NSMutableArray *keyStack_; + + YAJLDecoderCurrentType currentType_; + + YAJLParserStatus parserStatus_; + +} + +@property (readonly, nonatomic) id root; //! The root element of the document, either NSArray or NSDictionary +@property (readonly, nonatomic) YAJLParserStatus parserStatus; //! The current status of parsing +@property (assign, nonatomic) id<YAJLDocumentDelegate> delegate; //! Delegate + +/*! + Create document from data. + @param data Data to parse + @param parserOptions Parse options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + @param error Error to set on failure + */ +- (id)initWithData:(NSData *)data parserOptions:(YAJLParserOptions)parserOptions error:(NSError **)error; + +/*! + Create document from data. + @param data Data to parse + @param parserOptions Parse options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + @param capacity Initial capacity for NSArray and NSDictionary objects (Defaults to 20) + @param error Error to set on failure + */ +- (id)initWithData:(NSData *)data parserOptions:(YAJLParserOptions)parserOptions capacity:(NSInteger)capacity error:(NSError **)error; + +/*! + Create empty document with parser options. + @param parserOptions Parse options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + */ +- (id)initWithParserOptions:(YAJLParserOptions)parserOptions; + +/*! + Create empty document with parser options. + @param parserOptions Parse options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + @param capacity Initial capacity for NSArray and NSDictionary objects (Defaults to 20) + */ +- (id)initWithParserOptions:(YAJLParserOptions)parserOptions capacity:(NSInteger)capacity; + +/*! + Parse data. + @param data Data to parse + @param error Out error to set on failure + @result Parser status + - YAJLParserStatusNone: No status + - YAJLParserStatusOK: Parsed OK + - YAJLParserStatusInsufficientData: There was insufficient data + - YAJLParserStatusError: Parser errored + */ +- (YAJLParserStatus)parse:(NSData *)data error:(NSError **)error; + +@end diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLGen.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLGen.h new file mode 100644 index 0000000000000000000000000000000000000000..ef8eed2ae02b58b060c5525d6ec6d9c2a461ef4d --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLGen.h @@ -0,0 +1,171 @@ +// +// YAJLGen.h +// YAJL +// +// Created by Gabriel Handford on 7/19/09. +// Copyright 2009. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#include "yajl_gen.h" + + +extern NSString *const YAJLGenInvalidObjectException; //! Exception type if we encounter invalid object + +//! JSON generate options +enum YAJLGenOptions { + YAJLGenOptionsNone = 0, //!< No options + YAJLGenOptionsBeautify = 1 << 0, //!< Beautifiy JSON output + YAJLGenOptionsIgnoreUnknownTypes = 1 << 1, //!< Ignore unknown types (will use null value) + YAJLGenOptionsIncludeUnsupportedTypes = 1 << 2, //!< Handle non-JSON types (including NSDate, NSData, NSURL) +}; +typedef NSUInteger YAJLGenOptions; + +/*! + YAJL JSON string generator. + Supports the following types: + - NSArray + - NSDictionary + - NSString + - NSNumber + - NSNull + + We also support the following types (if using YAJLGenOptionsIncludeUnsupportedTypes option), + by converting to JSON supported types: + - NSDate: number representing number of milliseconds since (1970) epoch + - NSData: Base64 encoded string + - NSURL: URL (absolute) string + */ +@interface YAJLGen : NSObject { + yajl_gen gen_; + + YAJLGenOptions genOptions_; +} + +/*! + JSON generator with options. + @param genOptions Generate options + - YAJLGenOptionsNone: No options + - YAJLGenOptionsBeautify: Beautifiy JSON output + - YAJLGenOptionsIgnoreUnknownTypes: Ignore unknown types (will use null value) + - YAJLGenOptionsIncludeUnsupportedTypes: Handle non-JSON types (including NSDate, NSData, NSURL) + + @param indentString String for indentation + */ +- (id)initWithGenOptions:(YAJLGenOptions)genOptions indentString:(NSString *)indentString; + +/*! + Write JSON for object to buffer. + @param obj Supported or custom object + */ +- (void)object:(id)obj; + +/*! + Write null value to buffer. + */ +- (void)null; + +/*! + Write bool value to buffer. + @param b Output true or false + */ +- (void)bool:(BOOL)b; + +/*! + Write numeric value to buffer. + @param number Numeric value + */ +- (void)number:(NSNumber *)number; + +/*! + Write string value to buffer. + @param s String value + */ +- (void)string:(NSString *)s; + +/*! + Write dictionary start ('{') to buffer. + */ +- (void)startDictionary; + +/*! + Write dictionary end ('}') to buffer. + */ +- (void)endDictionary; + +/*! + Write array start ('[') to buffer. + */ +- (void)startArray; + +/*! + Write array end (']') to buffer. + */ +- (void)endArray; + +/*! + Clear JSON buffer. + */ +- (void)clear; + +/*! + Get current JSON buffer. + */ +- (NSString *)buffer; + +@end + + +/*! + Custom objects can support manual JSON encoding. + + @code + @interface CustomObject : NSObject + @end + + @implementation CustomObject + + - (id)JSON { + return [NSArray arrayWithObject:[NSNumber numberWithInteger:1]]; + } + + @end + @endcode + + And then: + + @code + CustomObject *customObject = [[CustomObject alloc] init]; + NSString *JSONString = [customObject yajl_JSON]; + // JSONString == "[1]"; + @endcode + */ +@protocol YAJLCoding <NSObject> + +/*! + Provide custom and/or encodable object to parse to JSON string. + @result Object encodable as JSON such as NSDictionary, NSArray, etc + */ +- (id)JSON; + +@end diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLParser.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLParser.h new file mode 100644 index 0000000000000000000000000000000000000000..7db511c9fd5ce40a9b48acbc95770d46c297e4c9 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/YAJLParser.h @@ -0,0 +1,181 @@ +// +// YAJLParser.h +// YAJL +// +// Created by Gabriel Handford on 6/14/09. +// Copyright 2009. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + + +#include "yajl_parse.h" + + +extern NSString *const YAJLErrorDomain; //! Error domain for YAJL +extern NSString *const YAJLParserException; //! Generic parse exception +extern NSString *const YAJLParsingUnsupportedException; //! Parsing unsupported exception + +extern NSString *const YAJLParserValueKey; //! Key in NSError userInfo for value we errored on + +//! Parser error codes +enum YAJLParserErrorCode { + YAJLParserErrorCodeAllocError = -1000, //!< Alloc error + YAJLParserErrorCodeDoubleOverflow = -1001, //!< Double overflow + YAJLParserErrorCodeIntegerOverflow = -1002 //!< Integer overflow +}; +typedef NSInteger YAJLParserErrorCode; //! Parser error codes + +//! Parser options +enum YAJLParserOptions { + YAJLParserOptionsNone = 0, //!< No options + YAJLParserOptionsAllowComments = 1 << 0, //!< Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + YAJLParserOptionsCheckUTF8 = 1 << 1, //!< Invalid UTF8 strings will cause a parse error + YAJLParserOptionsStrictPrecision = 1 << 2, //!< If YES will force strict precision and return integer overflow error +}; +typedef NSUInteger YAJLParserOptions; //! Parser options + +//! Parser status +enum { + YAJLParserStatusNone = 0, //!< No status + YAJLParserStatusOK = 1, //!< Parsed OK + YAJLParserStatusInsufficientData = 2, //!< There was insufficient data + YAJLParserStatusError = 3 //!< Parser errored +}; +typedef NSUInteger YAJLParserStatus; //!< Status of the last parse event + + +@class YAJLParser; + +/*! + Delegate for YAJL JSON parser. + */ +@protocol YAJLParserDelegate <NSObject> + +/*! + Parser did start dictionary. + @param parser Sender + */ +- (void)parserDidStartDictionary:(YAJLParser *)parser; + +/*! + Parser did end dictionary. + @param parser Sender + */ +- (void)parserDidEndDictionary:(YAJLParser *)parser; + +/*! + Parser did start array. + @param parser Sender + */ +- (void)parserDidStartArray:(YAJLParser *)parser; + +/*! + Parser did end array. + @param parser Sender + */ +- (void)parserDidEndArray:(YAJLParser *)parser; + +/*! + Parser did map key. + @param parser Sender + @param key Key that was mapped + */ +- (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key; + +/*! + Did add value. + @param parser Sender + @param value Value of type NSNull, NSString or NSNumber + */ +- (void)parser:(YAJLParser *)parser didAdd:(id)value; + +@end + +/*! + JSON parser. + + @code + NSData *data = [NSData dataWithContentsOfFile:@"example.json"]; + + YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments]; + parser.delegate = self; + [parser parse:data]; + if (parser.parserError) { + NSLog(@"Error:\n%@", parser.parserError); + } + + parser.delegate = nil; + [parser release]; + + // Include delegate methods from YAJLParserDelegate + - (void)parserDidStartDictionary:(YAJLParser *)parser { } + - (void)parserDidEndDictionary:(YAJLParser *)parser { } + + - (void)parserDidStartArray:(YAJLParser *)parser { } + - (void)parserDidEndArray:(YAJLParser *)parser { } + + - (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key { } + - (void)parser:(YAJLParser *)parser didAdd:(id)value { } + @endcode + */ +@interface YAJLParser : NSObject { + + yajl_handle handle_; + + __weak id <YAJLParserDelegate> delegate_; // weak + + YAJLParserOptions parserOptions_; + + NSError *parserError_; +} + +@property (assign, nonatomic) __weak id <YAJLParserDelegate> delegate; +@property (readonly, retain, nonatomic) NSError *parserError; +@property (readonly, nonatomic) YAJLParserOptions parserOptions; + +/*! + Create parser with data and options. + @param parserOptions Parser options + - YAJLParserOptionsNone: No options + - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) + - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error + - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error + */ +- (id)initWithParserOptions:(YAJLParserOptions)parserOptions; + +/*! + Parse data. + + If streaming, you can call parse multiple times as long as + previous calls return YAJLParserStatusInsufficientData. + + @param data + @result Parser status + - YAJLParserStatusNone: No status + - YAJLParserStatusOK: Parsed OK + - YAJLParserStatusInsufficientData: There was insufficient data + - YAJLParserStatusError: Parser errored + */ +- (YAJLParserStatus)parse:(NSData *)data; + +@end diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_common.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_common.h new file mode 100644 index 0000000000000000000000000000000000000000..a227debbd1c1373937d4db2c497033eb337955b2 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_common.h @@ -0,0 +1,85 @@ +/* + * Copyright 2010, Lloyd Hilaiel. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. Neither the name of Lloyd Hilaiel nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __YAJL_COMMON_H__ +#define __YAJL_COMMON_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define YAJL_MAX_DEPTH 128 + +/* msft dll export gunk. To build a DLL on windows, you + * must define WIN32, YAJL_SHARED, and YAJL_BUILD. To use a shared + * DLL, you must define YAJL_SHARED and WIN32 */ +#if defined(WIN32) && defined(YAJL_SHARED) +# ifdef YAJL_BUILD +# define YAJL_API __declspec(dllexport) +# else +# define YAJL_API __declspec(dllimport) +# endif +#else +# define YAJL_API +#endif + +/** pointer to a malloc function, supporting client overriding memory + * allocation routines */ +typedef void * (*yajl_malloc_func)(void *ctx, unsigned int sz); + +/** pointer to a free function, supporting client overriding memory + * allocation routines */ +typedef void (*yajl_free_func)(void *ctx, void * ptr); + +/** pointer to a realloc function which can resize an allocation. */ +typedef void * (*yajl_realloc_func)(void *ctx, void * ptr, unsigned int sz); + +/** A structure which can be passed to yajl_*_alloc routines to allow the + * client to specify memory allocation functions to be used. */ +typedef struct +{ + /** pointer to a function that can allocate uninitialized memory */ + yajl_malloc_func malloc; + /** pointer to a function that can resize memory allocations */ + yajl_realloc_func realloc; + /** pointer to a function that can free memory allocated using + * reallocFunction or mallocFunction */ + yajl_free_func free; + /** a context pointer that will be passed to above allocation routines */ + void * ctx; +} yajl_alloc_funcs; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_gen.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_gen.h new file mode 100644 index 0000000000000000000000000000000000000000..a3fbd4cdda4a79f67267b58f9b1e97a96aa21010 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_gen.h @@ -0,0 +1,159 @@ +/* + * Copyright 2010, Lloyd Hilaiel. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. Neither the name of Lloyd Hilaiel nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file yajl_gen.h + * Interface to YAJL's JSON generation facilities. + */ + +#include <yajl/yajl_common.h> + +#ifndef __YAJL_GEN_H__ +#define __YAJL_GEN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + /** generator status codes */ + typedef enum { + /** no error */ + yajl_gen_status_ok = 0, + /** at a point where a map key is generated, a function other than + * yajl_gen_string was called */ + yajl_gen_keys_must_be_strings, + /** YAJL's maximum generation depth was exceeded. see + * YAJL_MAX_DEPTH */ + yajl_max_depth_exceeded, + /** A generator function (yajl_gen_XXX) was called while in an error + * state */ + yajl_gen_in_error_state, + /** A complete JSON document has been generated */ + yajl_gen_generation_complete, + /** yajl_gen_double was passed an invalid floating point value + * (infinity or NaN). */ + yajl_gen_invalid_number, + /** A print callback was passed in, so there is no internal + * buffer to get from */ + yajl_gen_no_buf + } yajl_gen_status; + + /** an opaque handle to a generator */ + typedef struct yajl_gen_t * yajl_gen; + + /** a callback used for "printing" the results. */ + typedef void (*yajl_print_t)(void * ctx, + const char * str, + unsigned int len); + + /** configuration structure for the generator */ + typedef struct { + /** generate indented (beautiful) output */ + unsigned int beautify; + /** an opportunity to define an indent string. such as \\t or + * some number of spaces. default is four spaces ' '. This + * member is only relevant when beautify is true */ + const char * indentString; + } yajl_gen_config; + + /** allocate a generator handle + * \param config a pointer to a structure containing parameters which + * configure the behavior of the json generator + * \param allocFuncs an optional pointer to a structure which allows + * the client to overide the memory allocation + * used by yajl. May be NULL, in which case + * malloc/free/realloc will be used. + * + * \returns an allocated handle on success, NULL on failure (bad params) + */ + YAJL_API yajl_gen yajl_gen_alloc(const yajl_gen_config * config, + const yajl_alloc_funcs * allocFuncs); + + /** allocate a generator handle that will print to the specified + * callback rather than storing the results in an internal buffer. + * \param callback a pointer to a printer function. May be NULL + * in which case, the results will be store in an + * internal buffer. + * \param config a pointer to a structure containing parameters + * which configure the behavior of the json + * generator. + * \param allocFuncs an optional pointer to a structure which allows + * the client to overide the memory allocation + * used by yajl. May be NULL, in which case + * malloc/free/realloc will be used. + * \param ctx a context pointer that will be passed to the + * printer callback. + * + * \returns an allocated handle on success, NULL on failure (bad params) + */ + YAJL_API yajl_gen yajl_gen_alloc2(const yajl_print_t callback, + const yajl_gen_config * config, + const yajl_alloc_funcs * allocFuncs, + void * ctx); + + /** free a generator handle */ + YAJL_API void yajl_gen_free(yajl_gen handle); + + YAJL_API yajl_gen_status yajl_gen_integer(yajl_gen hand, long int number); + /** generate a floating point number. number may not be infinity or + * NaN, as these have no representation in JSON. In these cases the + * generator will return 'yajl_gen_invalid_number' */ + YAJL_API yajl_gen_status yajl_gen_double(yajl_gen hand, double number); + YAJL_API yajl_gen_status yajl_gen_number(yajl_gen hand, + const char * num, + unsigned int len); + YAJL_API yajl_gen_status yajl_gen_string(yajl_gen hand, + const unsigned char * str, + unsigned int len); + YAJL_API yajl_gen_status yajl_gen_null(yajl_gen hand); + YAJL_API yajl_gen_status yajl_gen_bool(yajl_gen hand, int boolean); + YAJL_API yajl_gen_status yajl_gen_map_open(yajl_gen hand); + YAJL_API yajl_gen_status yajl_gen_map_close(yajl_gen hand); + YAJL_API yajl_gen_status yajl_gen_array_open(yajl_gen hand); + YAJL_API yajl_gen_status yajl_gen_array_close(yajl_gen hand); + + /** access the null terminated generator buffer. If incrementally + * outputing JSON, one should call yajl_gen_clear to clear the + * buffer. This allows stream generation. */ + YAJL_API yajl_gen_status yajl_gen_get_buf(yajl_gen hand, + const unsigned char ** buf, + unsigned int * len); + + /** clear yajl's output buffer, but maintain all internal generation + * state. This function will not "reset" the generator state, and is + * intended to enable incremental JSON outputing. */ + YAJL_API void yajl_gen_clear(yajl_gen hand); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_parse.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_parse.h new file mode 100644 index 0000000000000000000000000000000000000000..1cbd930233244c0dc454850fd15c3de28c018fc2 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_parse.h @@ -0,0 +1,193 @@ +/* + * Copyright 2010, Lloyd Hilaiel. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. Neither the name of Lloyd Hilaiel nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file yajl_parse.h + * Interface to YAJL's JSON parsing facilities. + */ + +#include <yajl/yajl_common.h> + +#ifndef __YAJL_PARSE_H__ +#define __YAJL_PARSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + /** error codes returned from this interface */ + typedef enum { + /** no error was encountered */ + yajl_status_ok, + /** a client callback returned zero, stopping the parse */ + yajl_status_client_canceled, + /** The parse cannot yet complete because more json input text + * is required, call yajl_parse with the next buffer of input text. + * (pertinent only when stream parsing) */ + yajl_status_insufficient_data, + /** An error occured during the parse. Call yajl_get_error for + * more information about the encountered error */ + yajl_status_error + } yajl_status; + + /** attain a human readable, english, string for an error */ + YAJL_API const char * yajl_status_to_string(yajl_status code); + + /** an opaque handle to a parser */ + typedef struct yajl_handle_t * yajl_handle; + + /** yajl is an event driven parser. this means as json elements are + * parsed, you are called back to do something with the data. The + * functions in this table indicate the various events for which + * you will be called back. Each callback accepts a "context" + * pointer, this is a void * that is passed into the yajl_parse + * function which the client code may use to pass around context. + * + * All callbacks return an integer. If non-zero, the parse will + * continue. If zero, the parse will be canceled and + * yajl_status_client_canceled will be returned from the parse. + * + * Note about handling of numbers: + * yajl will only convert numbers that can be represented in a double + * or a long int. All other numbers will be passed to the client + * in string form using the yajl_number callback. Furthermore, if + * yajl_number is not NULL, it will always be used to return numbers, + * that is yajl_integer and yajl_double will be ignored. If + * yajl_number is NULL but one of yajl_integer or yajl_double are + * defined, parsing of a number larger than is representable + * in a double or long int will result in a parse error. + */ + typedef struct { + int (* yajl_null)(void * ctx); + int (* yajl_boolean)(void * ctx, int boolVal); + int (* yajl_integer)(void * ctx, long integerVal); + int (* yajl_double)(void * ctx, double doubleVal); + /** A callback which passes the string representation of the number + * back to the client. Will be used for all numbers when present */ + int (* yajl_number)(void * ctx, const char * numberVal, + unsigned int numberLen); + + /** strings are returned as pointers into the JSON text when, + * possible, as a result, they are _not_ null padded */ + int (* yajl_string)(void * ctx, const unsigned char * stringVal, + unsigned int stringLen); + + int (* yajl_start_map)(void * ctx); + int (* yajl_map_key)(void * ctx, const unsigned char * key, + unsigned int stringLen); + int (* yajl_end_map)(void * ctx); + + int (* yajl_start_array)(void * ctx); + int (* yajl_end_array)(void * ctx); + } yajl_callbacks; + + /** configuration structure for the generator */ + typedef struct { + /** if nonzero, javascript style comments will be allowed in + * the json input, both slash star and slash slash */ + unsigned int allowComments; + /** if nonzero, invalid UTF8 strings will cause a parse + * error */ + unsigned int checkUTF8; + } yajl_parser_config; + + /** allocate a parser handle + * \param callbacks a yajl callbacks structure specifying the + * functions to call when different JSON entities + * are encountered in the input text. May be NULL, + * which is only useful for validation. + * \param config configuration parameters for the parse. + * \param ctx a context pointer that will be passed to callbacks. + */ + YAJL_API yajl_handle yajl_alloc(const yajl_callbacks * callbacks, + const yajl_parser_config * config, + const yajl_alloc_funcs * allocFuncs, + void * ctx); + + /** free a parser handle */ + YAJL_API void yajl_free(yajl_handle handle); + + /** Parse some json! + * \param hand - a handle to the json parser allocated with yajl_alloc + * \param jsonText - a pointer to the UTF8 json text to be parsed + * \param jsonTextLength - the length, in bytes, of input text + */ + YAJL_API yajl_status yajl_parse(yajl_handle hand, + const unsigned char * jsonText, + unsigned int jsonTextLength); + + /** Parse any remaining buffered json. + * Since yajl is a stream-based parser, without an explicit end of + * input, yajl sometimes can't decide if content at the end of the + * stream is valid or not. For example, if "1" has been fed in, + * yajl can't know whether another digit is next or some character + * that would terminate the integer token. + * + * \param hand - a handle to the json parser allocated with yajl_alloc + */ + YAJL_API yajl_status yajl_parse_complete(yajl_handle hand); + + /** get an error string describing the state of the + * parse. + * + * If verbose is non-zero, the message will include the JSON + * text where the error occured, along with an arrow pointing to + * the specific char. + * + * \returns A dynamically allocated string will be returned which should + * be freed with yajl_free_error + */ + YAJL_API unsigned char * yajl_get_error(yajl_handle hand, int verbose, + const unsigned char * jsonText, + unsigned int jsonTextLength); + + /** + * get the amount of data consumed from the last chunk passed to YAJL. + * + * In the case of a successful parse this can help you understand if + * the entire buffer was consumed (which will allow you to handle + * "junk at end of input". + * + * In the event an error is encountered during parsing, this function + * affords the client a way to get the offset into the most recent + * chunk where the error occured. 0 will be returned if no error + * was encountered. + */ + YAJL_API unsigned int yajl_get_bytes_consumed(yajl_handle hand); + + /** free an error returned from yajl_get_error */ + YAJL_API void yajl_free_error(yajl_handle hand, unsigned char * str); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_version.h b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_version.h new file mode 100644 index 0000000000000000000000000000000000000000..e3e8d09952c56dc87684bfdd45c2d1da6d6f7508 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Headers/yajl_version.h @@ -0,0 +1,23 @@ +#ifndef YAJL_VERSION_H_ +#define YAJL_VERSION_H_ + +#include <yajl/yajl_common.h> + +#define YAJL_MAJOR 1 +#define YAJL_MINOR 0 +#define YAJL_MICRO 11 + +#define YAJL_VERSION ((YAJL_MAJOR * 10000) + (YAJL_MINOR * 100) + YAJL_MICRO) + +#ifdef __cplusplus +extern "C" { +#endif + +extern int YAJL_API yajl_version(void); + +#ifdef __cplusplus +} +#endif + +#endif /* YAJL_VERSION_H_ */ + diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..dea12de4cad936a6204d4da70d2ca96aef900b31 Binary files /dev/null and b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings differ diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Resources/Info.plist b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000000000000000000000000000000000000..709781bf6379f7871b7026dae919a9be25769f8c --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,22 @@ +<?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>YAJL</string> + <key>CFBundleIdentifier</key> + <string>me.rel.YAJL</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>YAJL</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleSignature</key> + <string>GABE</string> + <key>CFBundleVersion</key> + <string>0.2.26</string> +</dict> +</plist> diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/YAJL b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/YAJL new file mode 100755 index 0000000000000000000000000000000000000000..3e2c0b3214f5a846b61e50e531c557dbd783876a Binary files /dev/null and b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/A/YAJL differ diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/Current b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/Current new file mode 120000 index 0000000000000000000000000000000000000000..8c7e5a667f1b771847fe88c01c3de34413a1b220 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/YAJL b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/YAJL new file mode 120000 index 0000000000000000000000000000000000000000..faa10c283449176b677e529482ad6b28246d28f6 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/Frameworks/YAJL.framework/YAJL @@ -0,0 +1 @@ +Versions/Current/YAJL \ No newline at end of file diff --git a/client/osx-ui/DJRandomUploader/ProcessController.m b/client/osx-ui/DJRandomUploader/ProcessController.m index 32e3408ac49c8e3ac367f5d8504b16ef607de503..a16033daabb0bd19478d09efcabd6f6d6df2963b 100644 --- a/client/osx-ui/DJRandomUploader/ProcessController.m +++ b/client/osx-ui/DJRandomUploader/ProcessController.m @@ -70,8 +70,8 @@ if (![musicDir isEqualToString:curMusicFolder] || ![apiKey isEqualToString:curApiKey] || ![bwLimit isEqualToNumber:curBwLimit]) { - curMusicFolder = musicDir; - curApiKey = apiKey; + curMusicFolder = [musicDir retain]; + curApiKey = [apiKey retain]; curBwLimit = [bwLimit retain]; [self reloadProcess]; } diff --git a/client/osx-ui/DJRandomUploader/scripts/fix-app.sh b/client/osx-ui/DJRandomUploader/scripts/fix-app.sh new file mode 100755 index 0000000000000000000000000000000000000000..84d277f31b373c3b4095cb9c7f7149d415c06818 --- /dev/null +++ b/client/osx-ui/DJRandomUploader/scripts/fix-app.sh @@ -0,0 +1,79 @@ +#!/bin/bash -e + +PYTHON=${PYTHON:-python} + +app_path="${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/../.." +if [ ! -d "${app_path}" ]; then + echo "Usage: fix-app <PATH OF THE .app BUNDLE>" 1>&2 + exit 1 +fi + +# Create Py2app bundle. +src_path="${PROJECT_DIR}/.." +(cd "${src_path}" ; ${PYTHON} setup.py py2app) >/dev/null || exit 1 +py2app_dir="${src_path}/dist/djrandom-client.app" + +for dirname in MacOS Resources Frameworks +do + echo "rsyncing ${app_path}/Contents/${dirname}" 1>&2 + rsync -av "${py2app_dir}/Contents/${dirname}/" \ + "${app_path}/Contents/${dirname}/" +done + +write_plist_snippet() { +cat <<EOF +<key>PyMainFileNames</key> +<array> +<string>__boot__</string> +</array> +<key>PyOptions</key> +<dict> +<key>alias</key> +<false/> +<key>argv_emulation</key> +<false/> +<key>no_chdir</key> +<false/> +<key>optimize</key> +<integer>0</integer> +<key>prefer_ppc</key> +<false/> +<key>site_packages</key> +<false/> +<key>use_pythonpath</key> +<false/> +</dict> +<key>PyResourcePackages</key> +<array> +</array> +<key>PyRuntimeLocations</key> +<array> +<string>@executable_path/../Frameworks/Python.framework/Versions/2.7/Python</string> +</array> +<key>PythonInfoDict</key> +<dict> +<key>PythonExecutable</key> +<string>/usr/bin/python</string> +<key>PythonLongVersion</key> +<string>2.7.1 (r271:86832, Jul 31 2011, 19:30:53) +[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]</string> +<key>PythonShortVersion</key> +<string>2.7</string> +<key>py2app</key> +<dict> +<key>alias</key> +<false/> +<key>template</key> +<string>app</string> +<key>version</key> +<string>0.5.3</string> +</dict> +</dict> +EOF +} + + +plistfile="${app_path}/Contents/Info.plist" +(len=$(wc -l "${plistfile}" | awk '{print $1}'); head -n $(($len - 2)) "${plistfile}" ; write_plist_snippet ; tail -2 "${plistfile}") > "${plistfile}.tmp" +mv -f "${plistfile}.tmp" "${plistfile}" + diff --git a/client/osx-ui/fix-app b/client/osx-ui/fix-app deleted file mode 100755 index da187fd6411d69ef3ead6d14b8b183df36c569ee..0000000000000000000000000000000000000000 --- a/client/osx-ui/fix-app +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -e - -PYTHON=${PYTHON:-python} - -app_path="$1" -if [ -z "${app_path}" ]; then - echo "Usage: fix-app <PATH OF THE .app BUNDLE>" 1>&2 - exit 1 -fi - -# Create Py2app bundle. -(cd .. ; ${PYTHON} setup.py py2app) -py2app_dir=../dist/djrandom-client.app -out_dir="./DJRandomUploader-$(date +%Y%m%d%H%M).app" - -rsync -a ${app_path}/ ${out_dir}/ -rsync -a ${py2app_dir}/Contents/MacOS/ \ - ${out_dir}/Contents/MacOS/ -rsync -a ${py2app_dir}/Contents/Resources/ \ - ${out_dir}/Contents/Resources/ -rsync -a ${py2app_dir}/Contents/Frameworks/ \ - ${out_dir}/Contents/Frameworks/ - -./fix-plist ${out_dir}/Contents/Info.plist - diff --git a/client/osx-ui/fix-plist b/client/osx-ui/fix-plist deleted file mode 100755 index 46cd8713f4f4274de7c592922b6f27683a441fde..0000000000000000000000000000000000000000 --- a/client/osx-ui/fix-plist +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -plistfile=${1:-DJRandomUploader.app/Contents/Info.plist} - -(len=$(wc -l ${plistfile} | awk '{print $1}'); head -n $(($len - 2)) ${plistfile} ; cat python-info-plist-add ; tail -2 ${plistfile}) > ${plistfile}.tmp -mv -f ${plistfile}.tmp ${plistfile} - diff --git a/client/osx-ui/python-info-plist-add b/client/osx-ui/python-info-plist-add deleted file mode 100644 index e8d9c21f1f12632ea22bfb01416dfe2130b8ea0c..0000000000000000000000000000000000000000 --- a/client/osx-ui/python-info-plist-add +++ /dev/null @@ -1,47 +0,0 @@ - <key>PyMainFileNames</key> - <array> - <string>__boot__</string> - </array> - <key>PyOptions</key> - <dict> - <key>alias</key> - <false/> - <key>argv_emulation</key> - <false/> - <key>no_chdir</key> - <false/> - <key>optimize</key> - <integer>0</integer> - <key>prefer_ppc</key> - <false/> - <key>site_packages</key> - <false/> - <key>use_pythonpath</key> - <false/> - </dict> - <key>PyResourcePackages</key> - <array> - </array> - <key>PyRuntimeLocations</key> - <array> - <string>@executable_path/../Frameworks/Python.framework/Versions/2.6/Python</string> - </array> - <key>PythonInfoDict</key> - <dict> - <key>PythonExecutable</key> - <string>/usr/bin/python2.6</string> - <key>PythonLongVersion</key> - <string>2.6.1 (r261:67515, Jun 24 2010, 21:47:49) -[GCC 4.2.1 (Apple Inc. build 5646)]</string> - <key>PythonShortVersion</key> - <string>2.6</string> - <key>py2app</key> - <dict> - <key>alias</key> - <false/> - <key>template</key> - <string>app</string> - <key>version</key> - <string>0.4.2</string> - </dict> - </dict>