Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 9e444100737bf097702ed6b7a9a3a127bba7dc5e @abiggerdog committed Feb 8, 2010
Showing with 24,867 additions and 0 deletions.
  1. +86 −0 README.rtf
  2. BIN amazon_s3_controller_command_line
  3. BIN dslr_controller_comand_line
  4. BIN kitskam.dmg
  5. +85 −0 kitskam/AmazonS3UploadCommandLineController.h
  6. +179 −0 kitskam/AmazonS3UploadCommandLineController.m
  7. +49 −0 kitskam/AppSettings.h
  8. +29 −0 kitskam/AppSettings.m
  9. +69 −0 kitskam/CommandLineController.h
  10. +353 −0 kitskam/CommandLineController.m
  11. +93 −0 kitskam/DSLRCommandLineController.h
  12. +207 −0 kitskam/DSLRCommandLineController.m
  13. BIN kitskam/English.lproj/InfoPlist.strings
  14. +2,636 −0 kitskam/English.lproj/MainMenu.xib
  15. +28 −0 kitskam/Info.plist
  16. +86 −0 kitskam/JSON/SBJsonBase.h
  17. +78 −0 kitskam/JSON/SBJsonBase.m
  18. +86 −0 kitskam/JSON/SBJsonParser.h
  19. +475 −0 kitskam/JSON/SBJsonParser.m
  20. +128 −0 kitskam/JSON/SBJsonWriter.h
  21. +228 −0 kitskam/JSON/SBJsonWriter.m
  22. +212 −0 kitskam/MyController.h
  23. +1,139 −0 kitskam/MyController.m
  24. +35 −0 kitskam/MyShared/MyAmazonS3Utils.h
  25. +96 −0 kitskam/MyShared/MyAmazonS3Utils.m
  26. +40 −0 kitskam/MyShared/MyUtils.h
  27. +165 −0 kitskam/MyShared/MyUtils.m
  28. +13 −0 kitskam/MyUndocumented.h
  29. +9 −0 kitskam/MyUndocumented.m
  30. +140 −0 kitskam/PreferencesController.h
  31. +758 −0 kitskam/PreferencesController.m
  32. BIN kitskam/amazon_s3_controller_command_line
  33. +28 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIAuthenticationDialog.h
  34. +236 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIAuthenticationDialog.m
  35. +61 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIFormDataRequest.h
  36. +312 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIFormDataRequest.m
  37. +705 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIHTTPRequest.h
  38. +3,675 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIHTTPRequest.m
  39. +55 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIHTTPRequestConfig.h
  40. +26 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIInputStream.h
  41. +80 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIInputStream.m
  42. +16 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASINSStringAdditions.h
  43. +28 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASINSStringAdditions.m
  44. +121 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASINetworkQueue.h
  45. +366 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASINetworkQueue.m
  46. +52 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIS3BucketObject.h
  47. +73 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIS3BucketObject.m
  48. +42 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIS3ListRequest.h
  49. +148 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIS3ListRequest.m
  50. +107 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIS3Request.h
  51. +292 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ASI/ASIS3Request.m
  52. +44 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/MyController.h
  53. +148 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/MyController.m
  54. +70 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ParseCommandLine.h
  55. +400 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/ParseCommandLine.m
  56. +79 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/amazon_s3_controller_command_line.1
  57. +52 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/amazon_s3_controller_command_line.m
  58. BIN ...s/amazon_s3_controller_command_line/amazon_s3_controller_command_line.xcodeproj/TemplateIcon.icns
  59. +327 −0 ...cts/amazon_s3_controller_command_line/amazon_s3_controller_command_line.xcodeproj/project.pbxproj
  60. +1,444 −0 ...ojects/amazon_s3_controller_command_line/amazon_s3_controller_command_line.xcodeproj/user.mode1v3
  61. +821 −0 ...ojects/amazon_s3_controller_command_line/amazon_s3_controller_command_line.xcodeproj/user.pbxuser
  62. +30 −0 ...mand_line_projects/amazon_s3_controller_command_line/amazon_s3_controller_command_line_Prefix.pch
  63. +39 −0 kitskam/command_line_projects/amazon_s3_controller_command_line/usage.txt
  64. +114 −0 kitskam/command_line_projects/dslr_controller_comand_line/ICA/MyCameraInterface.h
  65. +289 −0 kitskam/command_line_projects/dslr_controller_comand_line/ICA/MyCameraInterface.m
  66. +67 −0 kitskam/command_line_projects/dslr_controller_comand_line/ICA/MyICAUtils.h
  67. +332 −0 kitskam/command_line_projects/dslr_controller_comand_line/ICA/MyICAUtils.m
  68. +62 −0 kitskam/command_line_projects/dslr_controller_comand_line/MyController.h
  69. +316 −0 kitskam/command_line_projects/dslr_controller_comand_line/MyController.m
  70. +78 −0 kitskam/command_line_projects/dslr_controller_comand_line/ParseCommandLine.h
  71. +541 −0 kitskam/command_line_projects/dslr_controller_comand_line/ParseCommandLine.m
  72. +79 −0 kitskam/command_line_projects/dslr_controller_comand_line/dslr_controller_comand_line.1
  73. +53 −0 kitskam/command_line_projects/dslr_controller_comand_line/dslr_controller_comand_line.m
  74. BIN ...line_projects/dslr_controller_comand_line/dslr_controller_comand_line.xcodeproj/TemplateIcon.icns
  75. +301 −0 ...d_line_projects/dslr_controller_comand_line/dslr_controller_comand_line.xcodeproj/project.pbxproj
  76. +1,495 −0 ...mand_line_projects/dslr_controller_comand_line/dslr_controller_comand_line.xcodeproj/user.mode1v3
  77. +1,156 −0 ...mand_line_projects/dslr_controller_comand_line/dslr_controller_comand_line.xcodeproj/user.pbxuser
  78. +30 −0 kitskam/command_line_projects/dslr_controller_comand_line/dslr_controller_comand_line_Prefix.pch
  79. +101 −0 kitskam/command_line_projects/dslr_controller_comand_line/usage.txt
  80. BIN kitskam/dslr_controller_comand_line
  81. BIN kitskam/kitskam.dmg
  82. BIN kitskam/kitskam.xcodeproj/TemplateIcon.icns
  83. +374 −0 kitskam/kitskam.xcodeproj/project.pbxproj
  84. +1,458 −0 kitskam/kitskam.xcodeproj/user.mode1v3
  85. +514 −0 kitskam/kitskam.xcodeproj/user.pbxuser
  86. +7 −0 kitskam/kitskam_Prefix.pch
  87. BIN kitskam/kitskam_dist_dmg/kitskam.dmg
  88. +32 −0 kitskam/main.m
  89. BIN kitskam/myapp.icns
  90. +69 −0 kitskam/preferences.nib/classes.nib
  91. +20 −0 kitskam/preferences.nib/info.nib
  92. BIN kitskam/preferences.nib/keyedobjects.nib
@@ -0,0 +1,86 @@
+{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww19920\viewh13940\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f0\fs24 \cf0 \
+\
+KitsKam project.\
+\
+SECTIONS IN THIS DOCUMENT:\
+1. LAYOUT OF THE DIRECTORIES AND FILES\
+2. BUILD PROCESS\
+3. NOTES ON THE COMMAND-LINE UTILITIES\
+\
+************************************\
+\
+1. LAYOUT OF THE DIRECTORIES AND FILES\
+\
+- amazon_s3_controller_command_line AN AMAZON S3 UPLOAD COMMAND LINE UTILITY\
+\
+- dslr_controller_comand_line A DSLR CONTROLLER COMMAND LINE UTILITY\
+\
+- kitskam.dmg THE RELEASE CANDIDATE FOR THE INSTALLED GUI --\
+ THE SAME ONE I'VE GIVEN YOU BEFORE\
+\
+- README.rtf THIS DOCUMENT\
+\
+- kitskam THE DIRECTORY OF THE XCODE PROJECT FOR THE GUI\
+\
+---- kitskam.dmg AN UNCOMPRESSED VERSION OF THE DISTRIBUTION DMG FOR THE GUI APP\
+ (THE SAME I'VE SENT YOU BEFORE)\
+\
+---- kitskam_dist_dmg DIRECTORY CONTAINING THE COMPRESSED VERSION OF THE DISTRIBUTION DMG\
+-------- kitskam.dmg THE COMPRESSED DISTRIBUTION DMG. THIS IS THE ONE THAT IS ACTUALLY \
+ GIVEN TO USERS\
+\
+---- command_line_projects DIRECTORY CONTAINING THE COMMAND-LINE PROJECTS\
+-------- dslr_controller_comand_line DIRECTORY OF THE DSLR CONTROLLER COMMAND LINE UTIL PROJECT\
+-------- amazon_s3_controller_command_line DIRECTORY OF THE AMAZON S3 UPLOAD COMMAND LINE UTILITY PROJECT\
+\
+**************************************\
+\
+2. THE BUILD PROCESS\
+\
+a. Open the dslr_controller_comand_line project in XCode and build it.\
+b. Open the amazon_s3_controller_command_line project in XCode and build it\
+c. Now you must copy "command_line_projects/dslr_controller_comand_line/build/Release/
+\f1 dslr_controller_comand_line" into\
+the "kitskam" directory of the kitskam XCode project. i.e. it goes into the same directory as the XCode project for the kitskam GUI app.\
+d. Copy "
+\f0 command_line_projects/
+\f1 amazon_s3_controller_command_line/build/Release/amazon_s3_controller_command_line" into the "kitskam" directory.\
+e. Clean and build the "kitskam" XCode project. You needed to do steps a-d first because those command line utilities are included as resources in the kitskam Gui app.\
+f. Open the uncompressed "kitskam.dmg". It will mount a new volume you can access in the Finder.\
+g. Replace the kitskam gui app in the DMG you opened in (f) with "kitskam/build/Release/kitskam.app".\
+h. Close the "DMG" from (f) by Ejecting it in the Finder.\
+i. Open the uncompressed "kitskam.dmg" with the Disk Utility, and you will see it listed on the left side.\
+Left click on it, and select "Convert". Save the result to the directory
+\f0 kitskam_dist_dmg/ so that it replaces the old compressed\
+kitskam.dmg that was in there.\
+\
+NOW YOU ARE DONE. THE "kitskam.dmg" in the kitskam_dist_dmg/ DIRECTORY IS THE DISTRIBUTION DMG.\
+\
+A useful tutorial on creating a distribution DMG file is at\
+http://mac101.net/content/how-to/how-to-create-dmg-art-for-fancy-application-installations/comment-page-1/\
+\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f1 \cf0 *************************************\
+\
+3. NOTES ON THE COMMAND-LINE UTILITIES\
+\
+If you want you can try these in the Terminal. \
+\
+If the command line utilities are in the current directory, you can try:\
+\
+./dslr_controller_comand_line --help\
+\
+This will display usage information, and gives more examples. Note the "./" at the start of the line.\
+\
+./amazon_s3_controller_command_line --help\
+\
+This will display usage information. Note the "./" at the start of the line.\
+\
+}
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,85 @@
+//
+// AmazonS3UploadCommandLineController.h
+/*
+ This file is part of kitskam DSLR controller for OS X 10.5 and above.
+
+ kitskam is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ kitskam is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Duncan Rawlinson, February 2010. All rights reserved.
+ Code written by:
+
+ http://www.elance.com/php/profile/main/eolproviderprofile.php?userid=2443714
+ http://www.RentACoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=6770066
+
+ */
+
+#import "CommandLineController.h"
+
+#import <Foundation/Foundation.h>
+
+@protocol AmazonS3UploadCommandLineControllerDelegate
+
+- (void) onAamazonS3CommandCompleteWithStdOutJSonObj:(NSObject*)objRet
+ withStrErr:(NSString*)strErr
+ retCode:(int)ret
+ timedOut:(Boolean)bTimedOut
+ userData:(void*)user;
+
+@end
+
+
+@interface AmazonS3UploadCommandLineController : NSObject
+< CommandLineControllerDelegate >
+{
+ NSString* mStrCmdLineAppPath;
+ CommandLineController* mCmdController;
+
+}
+
+- (AmazonS3UploadCommandLineController*) init;
+- (void) dealloc;
+
+
+- (Boolean) amazonS3UploadFile:(NSString*)strLocalPath
+ toBucket:(NSString*)strRemoteBucket
+ toObjectKey:(NSString*)strRemotePath
+ withAccess:(NSString*)strAccess
+ deleteAfterUpload:(Boolean)bDeleteAfterUpload
+ forSharedKey:(NSString*)strSharedKey
+ forSecretKey:(NSString*)strSecretKey
+ userData:(void*)user
+ withTimeOut:(NSTimeInterval)timeOut
+ deletegate:(NSObject<AmazonS3UploadCommandLineControllerDelegate>*)delegate;
+
+
+// **********
+// ********** CommandLineControllerDelegate
+// **********
+
+- (void) onCommandCompleteWithStdOut:(NSData*)dataStdOut
+ stdErr:(NSData*)dataStdErr
+ retCode:(int)ret
+ timedOut:(Boolean)bTimedOut
+ userData:(void*)user;
+
+// **********
+// ********** PRIVATE METHODS
+// **********
+
+- (Boolean) doCommandLineWithArgs:(NSArray*)arrArgs
+ withTimeOut:(NSTimeInterval)timeOut
+ withDelegate:(NSObject<AmazonS3UploadCommandLineControllerDelegate>*)delegate
+ userData:(void*) user;
+
+@end
@@ -0,0 +1,179 @@
+//
+// AmazonS3UploadCommandLineController.m
+/*
+ This file is part of kitskam DSLR controller for OS X 10.5 and above.
+
+ kitskam is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ kitskam is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Duncan Rawlinson, February 2010. All rights reserved.
+ Code written by:
+
+ http://www.elance.com/php/profile/main/eolproviderprofile.php?userid=2443714
+ http://www.RentACoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=6770066
+
+ */
+
+#import "AmazonS3UploadCommandLineController.h"
+
+#import "SBJsonParser.h"
+
+@interface AmazonS3CmdInfo : NSObject
+{
+ NSObject<AmazonS3UploadCommandLineControllerDelegate>* delegate;
+ void* user;
+}
+@property (retain) NSObject<AmazonS3UploadCommandLineControllerDelegate>* delegate;
+@property (assign) void* user;
+@end
+
+@implementation AmazonS3CmdInfo;
+@synthesize delegate;
+@synthesize user;
+
+- (AmazonS3CmdInfo*) init
+{
+ if (self = [super init]) {
+ delegate = NULL;
+ user = NULL;
+ }
+ return self;
+}
+- (void) dealloc
+{
+ [delegate release];
+ [super dealloc];
+}
+@end
+
+// ****************************************************************************
+// ****************************************************************************
+// ****************************************************************************
+
+@implementation AmazonS3UploadCommandLineController
+
+- (AmazonS3UploadCommandLineController*) init
+{
+ if (self = [super init]) {
+ NSBundle* nsb = [NSBundle mainBundle];
+ mStrCmdLineAppPath = [nsb pathForResource:@"amazon_s3_controller_command_line" ofType:@""];
+ [mStrCmdLineAppPath retain];
+
+ mCmdController = [ [ [CommandLineController alloc] init] autorelease];
+ [mCmdController retain];
+ }
+ return self;
+}
+
+- (void) dealloc
+{
+ [mCmdController release];
+ [super dealloc];
+}
+
+- (Boolean) amazonS3UploadFile:(NSString*)strLocalPath
+ toBucket:(NSString*)strRemoteBucket
+ toObjectKey:(NSString*)strRemotePath
+ withAccess:(NSString*)strAccess
+ deleteAfterUpload:(Boolean)bDeleteAfterUpload
+ forSharedKey:(NSString*)strSharedKey
+ forSecretKey:(NSString*)strSecretKey
+ userData:(void*)user
+ withTimeOut:(NSTimeInterval)timeOut
+ deletegate:(NSObject<AmazonS3UploadCommandLineControllerDelegate>*)delegate
+{
+ NSMutableArray* arrArgs = [NSMutableArray array];
+ [arrArgs addObject:@"--upload-file"];
+ [arrArgs addObject:@"--local-path"];
+ [arrArgs addObject:strLocalPath];
+ [arrArgs addObject:@"--remote-path"];
+ [arrArgs addObject:strRemotePath];
+ if (strAccess) {
+ [arrArgs addObject:@"--remote-access-control"];
+ [arrArgs addObject:strAccess];
+ }
+ [arrArgs addObject:@"--shared-key"];
+ [arrArgs addObject:strSharedKey];
+ [arrArgs addObject:@"--secret-key"];
+ [arrArgs addObject:strSecretKey];
+ [arrArgs addObject:@"--remote-bucket-name"];
+ [arrArgs addObject:strRemoteBucket];
+ if (bDeleteAfterUpload) {
+ [arrArgs addObject:@"--delete-after-upload"];
+ }
+
+ Boolean ret = [self doCommandLineWithArgs:arrArgs
+ withTimeOut:timeOut
+ withDelegate:delegate
+ userData:user];
+ return ret;
+}
+
+// **********
+// ********** CommandLineControllerDelegate
+// **********
+
+- (void) onCommandCompleteWithStdOut:(NSData*)dataStdOut
+ stdErr:(NSData*)dataStdErr
+ retCode:(int)retCode
+ timedOut:(Boolean)bTimedOut
+ userData:(void*)user
+{
+ AmazonS3CmdInfo* dci = (AmazonS3CmdInfo*) user;
+ NSObject<AmazonS3UploadCommandLineControllerDelegate>* delegate = dci.delegate;
+
+ NSObject* objRet = NULL;
+ if ( ! retCode && ! bTimedOut ) {
+ NSString* strStdOut = [ [NSString alloc]
+ initWithData:dataStdOut encoding:NSUTF8StringEncoding];
+ SBJsonParser* json = [ [ [SBJsonParser alloc] init] autorelease];
+ objRet = [json objectWithString:strStdOut];
+ }
+
+ NSString* strStdErr = [ [NSString alloc]
+ initWithData:dataStdErr encoding:NSUTF8StringEncoding];
+
+ [delegate onAamazonS3CommandCompleteWithStdOutJSonObj:objRet
+ withStrErr:strStdErr
+ retCode:retCode
+ timedOut:bTimedOut
+ userData:dci.user];
+
+ [dci release];
+}
+
+// **********
+// ********** PRIVATE METHODS
+// **********
+
+- (Boolean) doCommandLineWithArgs:(NSArray*)arrArgs
+ withTimeOut:(NSTimeInterval)timeOut
+ withDelegate:(NSObject<AmazonS3UploadCommandLineControllerDelegate>*)delegate
+ userData:(void*) user
+{
+ AmazonS3CmdInfo* aci = [ [ [AmazonS3CmdInfo alloc] init] autorelease];
+ [aci retain];
+ aci.delegate = delegate;
+ aci.user = user;
+
+ Boolean ret = [mCmdController doCommandLine:mStrCmdLineAppPath
+ withArgs:arrArgs
+ withTimeOut:timeOut
+ withDelegate:self
+ userData:(void*)aci];
+
+ return ret;
+}
+
+
+@end
Oops, something went wrong.

0 comments on commit 9e44410

Please sign in to comment.